diff options
author | Tom Gundersen <teg@jklm.no> | 2015-06-26 00:02:55 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-06-28 19:16:04 +0200 |
commit | f663aeb80be485817c9d9071b49c64122fb11f19 (patch) | |
tree | 3f7dbd6c75278f726b23f7fdf6fde225e45f1a8f /src/libsystemd/sd-netlink/netlink-internal.h | |
parent | 4203fc8b818e68113aed2f3dc0e47a00f4059a30 (diff) |
netlink: rework containers
Instead of representing containers as several arrays, make a new
netlink_container struct and keep one array of these structs. We
also introduce netlink_attribute structs that in the future will
hold meta-information about each atribute.
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-internal.h')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-internal.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-internal.h b/src/libsystemd/sd-netlink/netlink-internal.h index 31bc1d3fbd..5773f61165 100644 --- a/src/libsystemd/sd-netlink/netlink-internal.h +++ b/src/libsystemd/sd-netlink/netlink-internal.h @@ -92,18 +92,26 @@ struct sd_netlink { sd_event *event; }; +struct netlink_attribute { + size_t offset; /* offset from hdr to attirubte */ +}; + +struct netlink_container { + const struct NLTypeSystem *type_system; /* the type system of the container */ + size_t offset; /* offset from hdr to the start of the container */ + struct netlink_attribute *attributes; + unsigned short n_attributes; /* number of attributes in container */ +}; + struct sd_netlink_message { RefCount n_ref; sd_netlink *rtnl; struct nlmsghdr *hdr; - const struct NLTypeSystem *(container_type_system[RTNL_CONTAINER_DEPTH]); /* the type of the container and all its parents */ - size_t container_offsets[RTNL_CONTAINER_DEPTH]; /* offset from hdr to each container's start */ + struct netlink_container containers[RTNL_CONTAINER_DEPTH]; unsigned n_containers; /* number of containers */ size_t next_rta_offset; /* offset from hdr to next rta */ - size_t *rta_offset_tb[RTNL_CONTAINER_DEPTH]; - unsigned short rta_tb_size[RTNL_CONTAINER_DEPTH]; bool sealed:1; bool broadcast:1; |