chiark / gitweb /
sd-netlink: make NLType internal
[elogind.git] / src / libsystemd / sd-netlink / netlink-types.h
index de1544bf368a35b29e702f64c3decb27df5f8d9e..cb6a78fb3ebd38f28fff397dd219147361246a4c 100644 (file)
 ***/
 
 enum {
-        NLA_UNSPEC,
-        NLA_META,
-        NLA_U8,
-        NLA_U16,
-        NLA_U32,
-        NLA_U64,
-        NLA_STRING,
-        NLA_IN_ADDR,
-        NLA_ETHER_ADDR,
-        NLA_CACHE_INFO,
-        NLA_NESTED,
-        NLA_UNION,
+        NETLINK_TYPE_UNSPEC,
+        NETLINK_TYPE_META,
+        NETLINK_TYPE_U8,                        /* NLA_U8 */
+        NETLINK_TYPE_U16,                       /* NLA_U16 */
+        NETLINK_TYPE_U32,                       /* NLA_U32 */
+        NETLINK_TYPE_U64,                       /* NLA_U64 */
+        NETLINK_TYPE_STRING,                    /* NLA_STRING */
+        NETLINK_TYPE_IN_ADDR,
+        NETLINK_TYPE_ETHER_ADDR,
+        NETLINK_TYPE_CACHE_INFO,
+        NETLINK_TYPE_NESTED,                    /* NLA_NESTED */
+        NETLINK_TYPE_UNION,
 };
 
 typedef enum NLMatchType {
@@ -58,13 +58,10 @@ struct NLTypeSystem {
         const NLType *types;
 };
 
-struct NLType {
-        uint16_t type;
-        size_t size;
-        const NLTypeSystem *type_system;
-        const NLTypeSystemUnion *type_system_union;
-};
-
+uint16_t type_get_type(const NLType *type);
+size_t type_get_size(const NLType *type);
+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);