]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/libsystemd/sd-netlink/netlink-types.h
Merge pull request #11827 from keszybz/pkgconfig-variables
[thirdparty/systemd.git] / src / libsystemd / sd-netlink / netlink-types.h
CommitLineData
53e1b683 1/* SPDX-License-Identifier: LGPL-2.1+ */
d8e538ec
TG
2#pragma once
3
ab5dfda7
TA
4#include "macro.h"
5
d8e538ec 6enum {
cafbc790 7 NETLINK_TYPE_UNSPEC,
cafbc790
DH
8 NETLINK_TYPE_U8, /* NLA_U8 */
9 NETLINK_TYPE_U16, /* NLA_U16 */
10 NETLINK_TYPE_U32, /* NLA_U32 */
11 NETLINK_TYPE_U64, /* NLA_U64 */
12 NETLINK_TYPE_STRING, /* NLA_STRING */
de566208 13 NETLINK_TYPE_FLAG, /* NLA_FLAG */
cafbc790
DH
14 NETLINK_TYPE_IN_ADDR,
15 NETLINK_TYPE_ETHER_ADDR,
16 NETLINK_TYPE_CACHE_INFO,
17 NETLINK_TYPE_NESTED, /* NLA_NESTED */
18 NETLINK_TYPE_UNION,
abd48ec8 19 NETLINK_TYPE_SOCKADDR,
d8e538ec
TG
20};
21
4af7b60d
TG
22typedef enum NLMatchType {
23 NL_MATCH_SIBLING,
24 NL_MATCH_PROTOCOL,
25} NLMatchType;
26
d8e538ec
TG
27typedef struct NLTypeSystemUnion NLTypeSystemUnion;
28typedef struct NLTypeSystem NLTypeSystem;
29typedef struct NLType NLType;
30
31struct NLTypeSystemUnion {
32 int num;
4af7b60d 33 NLMatchType match_type;
d8e538ec
TG
34 uint16_t match;
35 int (*lookup)(const char *);
36 const NLTypeSystem *type_systems;
37};
38
05d0c2e3
JT
39extern const NLTypeSystem rtnl_type_system_root;
40extern const NLTypeSystem genl_type_system_root;
41extern const NLTypeSystem genl_family_type_system_root;
846a6b3d 42
817d1cd8
DH
43uint16_t type_get_type(const NLType *type);
44size_t type_get_size(const NLType *type);
c658008f
DH
45void type_get_type_system(const NLType *type, const NLTypeSystem **ret);
46void type_get_type_system_union(const NLType *type, const NLTypeSystemUnion **ret);
435bbb02 47
05d0c2e3 48const NLTypeSystem* type_system_get_root(int protocol);
c1df8dee 49uint16_t type_system_get_count(const NLTypeSystem *type_system);
d8e538ec
TG
50int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, uint16_t type);
51int type_system_get_type_system(const NLTypeSystem *type_system, const NLTypeSystem **ret, uint16_t type);
52int type_system_get_type_system_union(const NLTypeSystem *type_system, const NLTypeSystemUnion **ret, uint16_t type);
53int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, const char *key);
4af7b60d 54int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, uint16_t protocol);
86bbe5bf
ZJS
55
56typedef enum NLUnionLinkInfoData {
57 NL_UNION_LINK_INFO_DATA_BOND,
58 NL_UNION_LINK_INFO_DATA_BRIDGE,
59 NL_UNION_LINK_INFO_DATA_VLAN,
60 NL_UNION_LINK_INFO_DATA_VETH,
61 NL_UNION_LINK_INFO_DATA_DUMMY,
62 NL_UNION_LINK_INFO_DATA_MACVLAN,
d1312575 63 NL_UNION_LINK_INFO_DATA_MACVTAP,
c4a5ddc9 64 NL_UNION_LINK_INFO_DATA_IPVLAN,
86bbe5bf
ZJS
65 NL_UNION_LINK_INFO_DATA_VXLAN,
66 NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL,
67 NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL,
2266864b 68 NL_UNION_LINK_INFO_DATA_ERSPAN,
1af2536a 69 NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL,
b16492f8
SS
70 NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL,
71 NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL,
86bbe5bf
ZJS
72 NL_UNION_LINK_INFO_DATA_SIT_TUNNEL,
73 NL_UNION_LINK_INFO_DATA_VTI_TUNNEL,
9011ce77 74 NL_UNION_LINK_INFO_DATA_VTI6_TUNNEL,
855ee1a1 75 NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL,
20897a0d 76 NL_UNION_LINK_INFO_DATA_VRF,
92c918b0 77 NL_UNION_LINK_INFO_DATA_VCAN,
ca5e8071 78 NL_UNION_LINK_INFO_DATA_GENEVE,
d6df583c 79 NL_UNION_LINK_INFO_DATA_VXCAN,
e5719363 80 NL_UNION_LINK_INFO_DATA_WIREGUARD,
56e7fb50 81 NL_UNION_LINK_INFO_DATA_NETDEVSIM,
06828bb6 82 NL_UNION_LINK_INFO_DATA_CAN,
86bbe5bf
ZJS
83 _NL_UNION_LINK_INFO_DATA_MAX,
84 _NL_UNION_LINK_INFO_DATA_INVALID = -1
85} NLUnionLinkInfoData;
86
87const char *nl_union_link_info_data_to_string(NLUnionLinkInfoData p) _const_;
88NLUnionLinkInfoData nl_union_link_info_data_from_string(const char *p) _pure_;