2017-11-18 17:09:20 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1+ */
|
2014-03-26 19:25:01 +01:00
|
|
|
#pragma once
|
|
|
|
|
2015-11-16 20:13:09 +01:00
|
|
|
#include "macro.h"
|
|
|
|
|
2014-03-26 19:25:01 +01:00
|
|
|
enum {
|
2015-06-23 09:56:59 +02:00
|
|
|
NETLINK_TYPE_UNSPEC,
|
|
|
|
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 */
|
2015-07-29 07:47:08 +02:00
|
|
|
NETLINK_TYPE_FLAG, /* NLA_FLAG */
|
2015-06-23 09:56:59 +02:00
|
|
|
NETLINK_TYPE_IN_ADDR,
|
|
|
|
NETLINK_TYPE_ETHER_ADDR,
|
|
|
|
NETLINK_TYPE_CACHE_INFO,
|
|
|
|
NETLINK_TYPE_NESTED, /* NLA_NESTED */
|
|
|
|
NETLINK_TYPE_UNION,
|
2019-01-28 12:19:29 +01:00
|
|
|
NETLINK_TYPE_SOCKADDR,
|
2014-03-26 19:25:01 +01:00
|
|
|
};
|
|
|
|
|
2015-02-08 12:37:05 +01:00
|
|
|
typedef enum NLMatchType {
|
|
|
|
NL_MATCH_SIBLING,
|
|
|
|
NL_MATCH_PROTOCOL,
|
|
|
|
} NLMatchType;
|
|
|
|
|
2014-03-26 19:25:01 +01:00
|
|
|
typedef struct NLTypeSystemUnion NLTypeSystemUnion;
|
|
|
|
typedef struct NLTypeSystem NLTypeSystem;
|
|
|
|
typedef struct NLType NLType;
|
|
|
|
|
|
|
|
struct NLTypeSystemUnion {
|
|
|
|
int num;
|
2015-02-08 12:37:05 +01:00
|
|
|
NLMatchType match_type;
|
2014-03-26 19:25:01 +01:00
|
|
|
uint16_t match;
|
|
|
|
int (*lookup)(const char *);
|
|
|
|
const NLTypeSystem *type_systems;
|
|
|
|
};
|
|
|
|
|
2017-12-18 15:17:06 +01:00
|
|
|
extern const NLTypeSystem genl_family_type_system_root;
|
2015-06-23 12:10:38 +02:00
|
|
|
|
2015-06-23 11:03:10 +02:00
|
|
|
uint16_t type_get_type(const NLType *type);
|
|
|
|
size_t type_get_size(const NLType *type);
|
2015-06-23 10:51:25 +02:00
|
|
|
void type_get_type_system(const NLType *type, const NLTypeSystem **ret);
|
|
|
|
void type_get_type_system_union(const NLType *type, const NLTypeSystemUnion **ret);
|
2015-06-23 11:07:59 +02:00
|
|
|
|
2017-12-18 15:17:06 +01:00
|
|
|
const NLTypeSystem* type_system_get_root(int protocol);
|
2015-06-23 11:46:48 +02:00
|
|
|
uint16_t type_system_get_count(const NLTypeSystem *type_system);
|
2019-07-23 08:54:06 +02:00
|
|
|
int type_system_root_get_type(sd_netlink *nl, const NLType **ret, uint16_t type);
|
2014-03-26 19:25:01 +01:00
|
|
|
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);
|
|
|
|
int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, const char *key);
|
2015-02-08 12:37:05 +01:00
|
|
|
int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_system_union, const NLTypeSystem **ret, uint16_t protocol);
|
2014-07-10 04:29:24 +02:00
|
|
|
|
|
|
|
typedef enum NLUnionLinkInfoData {
|
|
|
|
NL_UNION_LINK_INFO_DATA_BOND,
|
|
|
|
NL_UNION_LINK_INFO_DATA_BRIDGE,
|
|
|
|
NL_UNION_LINK_INFO_DATA_VLAN,
|
|
|
|
NL_UNION_LINK_INFO_DATA_VETH,
|
|
|
|
NL_UNION_LINK_INFO_DATA_DUMMY,
|
|
|
|
NL_UNION_LINK_INFO_DATA_MACVLAN,
|
2015-07-27 07:48:07 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_MACVTAP,
|
2015-01-19 22:24:32 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_IPVLAN,
|
2019-05-15 12:12:30 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_IPVTAP,
|
2014-07-10 04:29:24 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_VXLAN,
|
|
|
|
NL_UNION_LINK_INFO_DATA_IPIP_TUNNEL,
|
|
|
|
NL_UNION_LINK_INFO_DATA_IPGRE_TUNNEL,
|
2018-11-26 12:50:09 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_ERSPAN,
|
2014-12-20 09:05:06 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_IPGRETAP_TUNNEL,
|
2015-01-18 18:54:24 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_IP6GRE_TUNNEL,
|
|
|
|
NL_UNION_LINK_INFO_DATA_IP6GRETAP_TUNNEL,
|
2014-07-10 04:29:24 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_SIT_TUNNEL,
|
|
|
|
NL_UNION_LINK_INFO_DATA_VTI_TUNNEL,
|
2015-04-22 10:44:55 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_VTI6_TUNNEL,
|
2015-01-16 20:09:10 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_IP6TNL_TUNNEL,
|
2016-06-10 01:57:51 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_VRF,
|
2016-09-14 18:15:16 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_VCAN,
|
2017-04-25 06:14:28 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_GENEVE,
|
2017-11-22 08:23:22 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_VXCAN,
|
2017-12-18 15:20:34 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_WIREGUARD,
|
2018-06-02 15:06:33 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_NETDEVSIM,
|
2018-04-10 17:26:20 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_CAN,
|
2019-04-03 13:27:36 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_MACSEC,
|
2019-05-23 04:36:25 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_NLMON,
|
2019-07-08 17:09:46 +02:00
|
|
|
NL_UNION_LINK_INFO_DATA_XFRM,
|
2019-12-07 14:35:23 +01:00
|
|
|
NL_UNION_LINK_INFO_DATA_IFB,
|
2014-07-10 04:29:24 +02:00
|
|
|
_NL_UNION_LINK_INFO_DATA_MAX,
|
|
|
|
_NL_UNION_LINK_INFO_DATA_INVALID = -1
|
|
|
|
} NLUnionLinkInfoData;
|
|
|
|
|
|
|
|
const char *nl_union_link_info_data_to_string(NLUnionLinkInfoData p) _const_;
|
|
|
|
NLUnionLinkInfoData nl_union_link_info_data_from_string(const char *p) _pure_;
|
2019-12-11 08:30:39 +01:00
|
|
|
|
|
|
|
typedef enum NLUnionTCAOptionData {
|
2019-12-21 20:18:09 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_CODEL,
|
2019-12-12 08:21:49 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_FQ,
|
2019-12-11 08:30:39 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_FQ_CODEL,
|
2020-02-10 13:24:02 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_GRED,
|
2020-02-10 11:41:12 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_HTB,
|
2019-12-12 08:21:49 +01:00
|
|
|
NL_UNION_TCA_OPTION_DATA_TBF,
|
2019-12-11 08:30:39 +01:00
|
|
|
_NL_UNION_TCA_OPTION_DATA_MAX,
|
|
|
|
_NL_UNION_TCA_OPTION_DATA_INVALID = -1,
|
|
|
|
} NLUnionTCAOptionData;
|
|
|
|
|
|
|
|
const char *nl_union_tca_option_data_to_string(NLUnionTCAOptionData p) _const_;
|
|
|
|
NLUnionTCAOptionData nl_union_tca_option_data_from_string(const char *p) _pure_;
|