diff options
author | Tom Gundersen <teg@jklm.no> | 2013-11-12 22:37:51 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2013-11-13 19:52:17 +0100 |
commit | 4555ec72d6530fce4c978fd894ac22f7e006b0ee (patch) | |
tree | 9e2f0e85634b9c929f4443fe377e70391f1101fb /src/libsystemd-rtnl/rtnl-internal.h | |
parent | fe4824e065765f4536c84916694bb050c4a5d0af (diff) |
rtnl: start adding support for asynchronous messaging
Similarly to sd-bus, add:
sd_rtnl_wait
sd_rtnl_process
sd_rtnl_send
and adapt sd_rtnl_call accordingly.
Diffstat (limited to 'src/libsystemd-rtnl/rtnl-internal.h')
-rw-r--r-- | src/libsystemd-rtnl/rtnl-internal.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libsystemd-rtnl/rtnl-internal.h b/src/libsystemd-rtnl/rtnl-internal.h index b05290fd89..03297bb8de 100644 --- a/src/libsystemd-rtnl/rtnl-internal.h +++ b/src/libsystemd-rtnl/rtnl-internal.h @@ -35,6 +35,14 @@ struct sd_rtnl { struct sockaddr_nl nl; } sockaddr; + sd_rtnl_message **rqueue; + unsigned rqueue_size; + + sd_rtnl_message **wqueue; + unsigned wqueue_size; + + bool processing:1; + uint32_t serial; pid_t original_pid; @@ -42,8 +50,11 @@ struct sd_rtnl { #define RTNL_DEFAULT_TIMEOUT ((usec_t) (10 * USEC_PER_SEC)) +#define RTNL_WQUEUE_MAX 1024 +#define RTNL_RQUEUE_MAX 64*1024 + int message_get_errno(sd_rtnl_message *m); -int message_get_serial(sd_rtnl_message *m); +uint32_t message_get_serial(sd_rtnl_message *m); int message_seal(sd_rtnl *nl, sd_rtnl_message *m); int socket_write_message(sd_rtnl *nl, sd_rtnl_message *m); int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret); |