chiark / gitweb /
bus: fix typo in systemd-bus-proxyd
[elogind.git] / src / libsystemd-rtnl / rtnl-internal.h
index adad7850c596c533784caaacbfa0f032516127b1..2e0b7b8f373f836a6e97b155437eb610849f0cf4 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "refcnt.h"
 #include "prioq.h"
+#include "list.h"
 
 #include "sd-rtnl.h"
 
@@ -36,6 +37,14 @@ struct reply_callback {
         unsigned prioq_idx;
 };
 
+struct match_callback {
+        sd_rtnl_message_handler_t callback;
+        uint16_t type;
+        void *userdata;
+
+        LIST_FIELDS(struct match_callback, match_callbacks);
+};
+
 struct sd_rtnl {
         RefCount n_ref;
 
@@ -59,7 +68,14 @@ struct sd_rtnl {
         struct Prioq *reply_callbacks_prioq;
         Hashmap *reply_callbacks;
 
+        LIST_HEAD(struct match_callback, match_callbacks);
+
         pid_t original_pid;
+
+        sd_event_source *io_event_source;
+        sd_event_source *time_event_source;
+        sd_event_source *exit_event_source;
+        sd_event *event;
 };
 
 #define RTNL_DEFAULT_TIMEOUT ((usec_t) (10 * USEC_PER_SEC))
@@ -70,9 +86,14 @@ struct sd_rtnl {
 int message_new_synthetic_error(int error, uint32_t serial, sd_rtnl_message **ret);
 uint32_t message_get_serial(sd_rtnl_message *m);
 int message_seal(sd_rtnl *nl, sd_rtnl_message *m);
+
+bool message_type_is_link(uint16_t type);
+bool message_type_is_addr(uint16_t type);
+bool message_type_is_route(uint16_t type);
+
 int socket_write_message(sd_rtnl *nl, sd_rtnl_message *m);
 int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret);
 
 /* Make sure callbacks don't destroy the rtnl connection */
 #define RTNL_DONT_DESTROY(rtnl) \
-        _cleanup_sd_rtnl_unref_ sd_rtnl *_dont_destroy_##rtnl = sd_rtnl_ref(rtnl)
+        _cleanup_sd_rtnl_unref_ _unused_ sd_rtnl *_dont_destroy_##rtnl = sd_rtnl_ref(rtnl)