diff options
author | Tom Gundersen <teg@jklm.no> | 2014-01-29 21:20:30 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-01-30 14:30:39 +0100 |
commit | 3815f36f05f8bc06904777b1eb7f1d22b78bcced (patch) | |
tree | 15f3d8e9d3ea908d8edd04016c47c5ca638cf3c1 /src/libsystemd/sd-rtnl/rtnl-internal.h | |
parent | 377a218f876507fb8be9c21ef4121fa2576ec317 (diff) |
sd-rtnl: beef up rtnl-util a bit
Diffstat (limited to 'src/libsystemd/sd-rtnl/rtnl-internal.h')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-internal.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-internal.h b/src/libsystemd/sd-rtnl/rtnl-internal.h index 5dc66ac9d6..4bfcb836d6 100644 --- a/src/libsystemd/sd-rtnl/rtnl-internal.h +++ b/src/libsystemd/sd-rtnl/rtnl-internal.h @@ -29,6 +29,13 @@ #include "sd-rtnl.h" +#define RTNL_DEFAULT_TIMEOUT ((usec_t) (10 * USEC_PER_SEC)) + +#define RTNL_WQUEUE_MAX 1024 +#define RTNL_RQUEUE_MAX 64*1024 + +#define RTNL_CONTAINER_DEPTH 32 + struct reply_callback { sd_rtnl_message_handler_t callback; void *userdata; @@ -78,20 +85,18 @@ struct sd_rtnl { sd_event *event; }; -#define RTNL_DEFAULT_TIMEOUT ((usec_t) (10 * USEC_PER_SEC)) - -#define RTNL_WQUEUE_MAX 1024 -#define RTNL_RQUEUE_MAX 64*1024 +struct sd_rtnl_message { + RefCount n_ref; -#define RTNL_CONTAINER_DEPTH 32 + struct nlmsghdr *hdr; + size_t container_offsets[RTNL_CONTAINER_DEPTH]; /* offset from hdr to each container's start */ + unsigned n_containers; /* number of containers */ + size_t next_rta_offset; /* offset from hdr to next rta */ -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 sealed:1; +}; -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 message_new(sd_rtnl_message **ret, size_t initial_size); int socket_write_message(sd_rtnl *nl, sd_rtnl_message *m); int socket_read_message(sd_rtnl *nl, sd_rtnl_message **ret); |