]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
d8e538ec TG |
2 | #pragma once |
3 | ||
ab5dfda7 TA |
4 | #include "macro.h" |
5 | ||
d8e538ec | 6 | enum { |
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, | |
d8e538ec TG |
19 | }; |
20 | ||
4af7b60d TG |
21 | typedef enum NLMatchType { |
22 | NL_MATCH_SIBLING, | |
23 | NL_MATCH_PROTOCOL, | |
24 | } NLMatchType; | |
25 | ||
d8e538ec TG |
26 | typedef struct NLTypeSystemUnion NLTypeSystemUnion; |
27 | typedef struct NLTypeSystem NLTypeSystem; | |
28 | typedef struct NLType NLType; | |
29 | ||
30 | struct NLTypeSystemUnion { | |
31 | int num; | |
4af7b60d | 32 | NLMatchType match_type; |
d8e538ec TG |
33 | uint16_t match; |
34 | int (*lookup)(const char *); | |
35 | const NLTypeSystem *type_systems; | |
36 | }; | |
37 | ||
05d0c2e3 JT |
38 | extern const NLTypeSystem rtnl_type_system_root; |
39 | extern const NLTypeSystem genl_type_system_root; | |
40 | extern const NLTypeSystem genl_family_type_system_root; | |
846a6b3d | 41 | |
817d1cd8 DH |
42 | uint16_t type_get_type(const NLType *type); |
43 | size_t type_get_size(const NLType *type); | |
c658008f DH |
44 | void type_get_type_system(const NLType *type, const NLTypeSystem **ret); |
45 | void type_get_type_system_union(const NLType *type, const NLTypeSystemUnion **ret); | |
435bbb02 | 46 | |
05d0c2e3 | 47 | const NLTypeSystem* type_system_get_root(int protocol); |
c1df8dee | 48 | uint16_t type_system_get_count(const NLTypeSystem *type_system); |
d8e538ec TG |
49 | int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, uint16_t type); |
50 | int type_system_get_type_system(const NLTypeSystem *type_system, const NLTypeSystem **ret, uint16_t type); | |
51 | int type_system_get_type_system_union(const NLTypeSystem *type_system, const NLTypeSystemUnion **ret, uint16_t type); | |
52 | int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, const char *key); | |
4af7b60d | 53 | int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, uint16_t protocol); |
86bbe5bf ZJS |
54 | |
55 | typedef enum NLUnionLinkInfoData { | |
56 | NL_UNION_LINK_INFO_DATA_BOND, | |
57 | NL_UNION_LINK_INFO_DATA_BRIDGE, | |
58 | NL_UNION_LINK_INFO_DATA_VLAN, | |
59 | NL_UNION_LINK_INFO_DATA_VETH, | |
60 | NL_UNION_LINK_INFO_DATA_DUMMY, | |
61 | NL_UNION_LINK_INFO_DATA_MACVLAN, | |
d1312575 | 62 | NL_UNION_LINK_INFO_DATA_MACVTAP, |
c4a5ddc9 | 63 | NL_UNION_LINK_INFO_DATA_IPVLAN, |
86bbe5bf ZJS |
64 | NL_UNION_LINK_INFO_DATA_VXLAN, |
65 | NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL, | |
66 | NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL, | |
1af2536a | 67 | NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL, |
b16492f8 SS |
68 | NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL, |
69 | NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL, | |
86bbe5bf ZJS |
70 | NL_UNION_LINK_INFO_DATA_SIT_TUNNEL, |
71 | NL_UNION_LINK_INFO_DATA_VTI_TUNNEL, | |
9011ce77 | 72 | NL_UNION_LINK_INFO_DATA_VTI6_TUNNEL, |
855ee1a1 | 73 | NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL, |
20897a0d | 74 | NL_UNION_LINK_INFO_DATA_VRF, |
92c918b0 | 75 | NL_UNION_LINK_INFO_DATA_VCAN, |
ca5e8071 | 76 | NL_UNION_LINK_INFO_DATA_GENEVE, |
d6df583c | 77 | NL_UNION_LINK_INFO_DATA_VXCAN, |
e5719363 | 78 | NL_UNION_LINK_INFO_DATA_WIREGUARD, |
56e7fb50 | 79 | NL_UNION_LINK_INFO_DATA_NETDEVSIM, |
06828bb6 | 80 | NL_UNION_LINK_INFO_DATA_CAN, |
86bbe5bf ZJS |
81 | _NL_UNION_LINK_INFO_DATA_MAX, |
82 | _NL_UNION_LINK_INFO_DATA_INVALID = -1 | |
83 | } NLUnionLinkInfoData; | |
84 | ||
85 | const char *nl_union_link_info_data_to_string(NLUnionLinkInfoData p) _const_; | |
86 | NLUnionLinkInfoData nl_union_link_info_data_from_string(const char *p) _pure_; |