summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink
AgeCommit message (Collapse)Author
2015-06-24sd-netlink: avoid casting size_t into intDavid Herrmann
size_t is usually 64bit and int 32bit on a 64bit machine. This probably does not matter for netlink message sizes, but nevertheless, avoid hard-coding it anywhere.
2015-06-24sd-netlink: make NLTypeSystem internalDavid Herrmann
Same as NLType, move NLTypeSystem into netlink-types.c and hide it from the outside. Provide an accessor function for the 'max' field that is used to allocate suitable array sizes. Note that this will probably be removed later on, anyway. Once we support bigger type-systems, it just seems impractical to allocate such big arrays for each container entry. An RBTree would probably do just fine.
2015-06-24sd-netlink: make NLType internalDavid Herrmann
If we extend NLType to support arrays and further extended types, we really want to avoid hard-coding the type-layout outside of netlink-types.c. We already avoid accessing nl_type->type_system outside of netlink-types.c, extend this to also avoid accessing any other fields. Provide accessor functions for nl_type->type and nl_type->size and then move NLType away from the type-system header. With this in place, follow-up patches can safely turn "type_system" and "type_system_union" into a real "union { }", and then add another type for arrays.
2015-06-24sd-netlink: don't access type->type_system[_union] directlyDavid Herrmann
Make sure we never access type->type_system or type->type_system_union directly. This is an implementation detail of the type-system and we should always use the accessors. Right now, they only exist for 2-level accesses (type-system to type-system). This patch introduces the 1-level accessors (type to type-system) and makes use of it. This patch makes sure the proper assertions are in place, so we never accidentally access sub-type-systems for non-nested/union types. Note that this places hard-asserts on the accessors. This should be fine, as we expect callers to only access sub type-systems if they *know* they're dealing with nested types.
2015-06-24sd-netlink: rename NLA_ to NETLINK_TYPE_David Herrmann
The NLA_ names are used to name real datatypes we extract out of netlink messages. The kernel has an internal enum with the same names (NLA_foobar), which is *NOT* binary compatible to our types. Furthermore, we support a different set of types than the kernel (as we try to treat some kernel peculiarities as our own types to simplify the API). Rename NLA_ to NETLINK_TYPE_ to make clear that this is our own set of types.
2015-06-13sd-netlink: socket - move some functions from main source fileTom Gundersen
2015-06-13sd-netlink: message - split up source fileTom Gundersen
Split netlink-socket.c and rtnl-message.c from netlink-message.c.
2015-06-13sd-netlink: drop the write-queueTom Gundersen
AF_NETLINK is not write-buffered, so this was actually never used.
2015-06-13sd-netlink: rename from sd-rtnlTom Gundersen