summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-types.h
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-06-23 10:51:25 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-06-24 13:45:47 +0200
commitc658008f50fdbc617e6f7ad321c058f3a6f175f5 (patch)
treec2fb5229335daa4dadbbd0c8faf541e862418934 /src/libsystemd/sd-netlink/netlink-types.h
parentcafbc790d1affec2c9524c5ee1915485a1ac6879 (diff)
sd-netlink: don't access type->type_system[_union] directly
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.
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-types.h')
-rw-r--r--src/libsystemd/sd-netlink/netlink-types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-types.h b/src/libsystemd/sd-netlink/netlink-types.h
index 1bb1b21da9..74a59bb7c2 100644
--- a/src/libsystemd/sd-netlink/netlink-types.h
+++ b/src/libsystemd/sd-netlink/netlink-types.h
@@ -65,6 +65,8 @@ struct NLType {
const NLTypeSystemUnion *type_system_union;
};
+void type_get_type_system(const NLType *type, const NLTypeSystem **ret);
+void type_get_type_system_union(const NLType *type, const NLTypeSystemUnion **ret);
int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, uint16_t type);
int type_system_get_type_system(const NLTypeSystem *type_system, const NLTypeSystem **ret, uint16_t type);
int type_system_get_type_system_union(const NLTypeSystem *type_system, const NLTypeSystemUnion **ret, uint16_t type);