summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-types.c
AgeCommit message (Collapse)Author
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-18sd-netlink: remove unused tableZbigniew Jędrzejewski-Szmek
2015-11-11sd-netlink: add support for RTA_PREFTom Gundersen
2015-11-11sd-netlink: types - let tables be sized implicitlyTom Gundersen
This way we do not rely on the size MAX* constants from the kernel headers, as these will be out-of-sync in case we have old headers and new defines in missing.h.
2015-10-27util-lib: move string table stuff into its own string-table.[ch]Lennart Poettering
2015-10-05sd-rtnl: sd-netlink: add support for bridge NL parametrsSusant Sahani
Rename rtnl_link_info_data_bridge_types to rtnl_link_bridge_management_types as they are of nested types of IFLA_AF_SPEC.
2015-07-29sd-netlink: add support for vxlan attributesSusant Sahani
2015-07-27sd-netlink: Add macvtap supportSusant Sahani
2015-07-24netlink-types: use consistent whitespace at EOLZbigniew Jędrzejewski-Szmek
Follow up for v222-124-g79e27dbcb1.
2015-07-23sd-netlink: add bridge NL paramsSusant Sahani
2015-07-22sd-netlink: add tunnel paramsSusant Sahani
2015-07-20sd-netlink: add tunnel NL parametersSusant Sahani
2015-06-24sd-netlink: don't export internal type-system detailsDavid Herrmann
The kernel bonding layer allows passing an array of ARP IP targets as bond-configuration. Due to the weird implementation of arrays in netlink (which we haven't figure out a generic way to support, yet), we usually hard-code the supported array-sizes. However, this should not be exported from sd-netlink. Instead, make sure the caller just uses it's current hack of enumerating the types, and the sd-netlink core will have it's own list of supported array-sizes (to be removed in future extensions, btw!). If either does not match, we will just return a normal error. Note that we provide 2 constants for ARP_IP_TARGETS_MAX now. However, both have very different reasons: - the constant in netdev-bond.c is used to warn the user that the given number of targets might not be supported by the kernel (even though the kernel might increase that number at _any_ time) - the constant in sd-netlink is solely used due to us missing a proper array implementation. Once that's supported in the type-system, it can be removed without notice Last but not least, this patch turns the log_error() into a log_warning(). Given that the previous condition was off-by-one, anyway, it never hit at the right time. Thus, it was probably of no real use.
2015-06-24sd-netlink: don't treat NULL as root type-systemDavid Herrmann
Explicitly export the root type-system to the type-system callers. This avoids treating NULL as root, which for one really looks backwards (NULL is usually a leaf, not root), and secondly prevents us from properly debugging calling into non-nested types. Also rename the root to "type_system_root". Once we support more than rtnl, well will have to revisit that, anyway.
2015-06-24sd-netlink: don't treat type_system->count==0 as invalidDavid Herrmann
Empty type-systems are just fine. Avoid the nasty hack in union-type-systems that treat empty type-systems as invalid. Instead check for the actual types-array and make sure it's non-NULL (which is even true for empty type-systems, due to "empty_types" array).
2015-06-24sd-netlink: drop NETLINK_TYPE_METADavid Herrmann
The NETLINK_TYPE_META pseudo-type is actually equivalent to an empty nested type. Drop it and define an empty type-system instead. This also has the nice side-effect that m->container_type_system[0] is never NULL (which has really nasty side-effects if you try to read attributes).
2015-06-24sd-netlink: turn 'max' into 'count' to support empty type-systemsDavid Herrmann
Right now we store the maximum type-ID of a type-system. This prevents us from creating empty type-systems. Store the "count" instead, which should be treated as max+1. Note that type_system_union_protocol_get_type_system() currently has a nasty hack to treat empty type-systems as invalid. This might need some modification later on as well.
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: rename from sd-rtnlTom Gundersen