diff options
author | Tom Gundersen <teg@jklm.no> | 2013-11-30 01:24:29 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-12-04 14:15:13 +0100 |
commit | 8cec01b9e9b7264639fd1fc0fe373ef4d5baaf49 (patch) | |
tree | 6db638964058da2a30a7839fc7fe03de9b3c3732 /src/libsystemd-rtnl/rtnl-internal.h | |
parent | a02113d2ea96467dc9f1ec196d5f62a34dd99314 (diff) |
rtnl: add callback support
sd_rtnl_add_match allows you to add a callback function for when given types of
messages are received.
Diffstat (limited to 'src/libsystemd-rtnl/rtnl-internal.h')
-rw-r--r-- | src/libsystemd-rtnl/rtnl-internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsystemd-rtnl/rtnl-internal.h b/src/libsystemd-rtnl/rtnl-internal.h index a229ae77ad..dabf12d37f 100644 --- a/src/libsystemd-rtnl/rtnl-internal.h +++ b/src/libsystemd-rtnl/rtnl-internal.h @@ -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 types; + void *userdata; + + LIST_FIELDS(struct match_callback, match_callbacks); +}; + struct sd_rtnl { RefCount n_ref; @@ -59,6 +68,8 @@ 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; |