From 9714c020fc4cda1823c2a77e3fd08aefa7d78b25 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sun, 2 Dec 2018 16:27:02 +0100 Subject: [PATCH] missing: split network related entries Also adds comments which kernel version added the entries. Closes #10553. --- meson.build | 106 +++- src/basic/missing.h | 684 +--------------------- src/basic/missing_ethtool.h | 131 +++++ src/basic/missing_fib_rules.h | 36 ++ src/basic/missing_fou.h | 55 ++ src/basic/missing_if_bridge.h | 21 + src/basic/missing_if_link.h | 383 ++++++++++++ src/basic/missing_if_tunnel.h | 59 ++ src/basic/missing_network.h | 130 ++++ src/basic/missing_vxcan.h | 12 + src/libsystemd/sd-netlink/netlink-types.c | 2 +- src/network/netdev/vxcan.c | 6 +- src/network/netdev/vxcan.h | 4 - 13 files changed, 916 insertions(+), 713 deletions(-) create mode 100644 src/basic/missing_ethtool.h create mode 100644 src/basic/missing_fib_rules.h create mode 100644 src/basic/missing_fou.h create mode 100644 src/basic/missing_if_bridge.h create mode 100644 src/basic/missing_if_link.h create mode 100644 src/basic/missing_if_tunnel.h create mode 100644 src/basic/missing_network.h create mode 100644 src/basic/missing_vxcan.h diff --git a/meson.build b/meson.build index ec78e4c926..ac1cbd7df4 100644 --- a/meson.build +++ b/meson.build @@ -450,40 +450,87 @@ endforeach conf.set10('WANT_LINUX_STAT_H', want_linux_stat_h) -foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], - ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], - ['IFLA_VRF_TABLE', 'linux/if_link.h'], - ['IFLA_MACVLAN_FLAGS', 'linux/if_link.h'], - ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'], - ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], - ['IFLA_BOND_AD_ACTOR_SYSTEM', 'linux/if_link.h'], - ['IFLA_VLAN_PROTOCOL', 'linux/if_link.h'], - ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], - ['IFLA_VXLAN_GPE', 'linux/if_link.h'], - ['IFLA_GENEVE_LABEL', 'linux/if_link.h'], - # if_tunnel.h is buggy and cannot be included on its own - ['IFLA_VTI_REMOTE', 'linux/if_tunnel.h', '#include '], - ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], - ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], - ['IFLA_GRE_ERSPAN_HWID', 'linux/if_tunnel.h', '#include '], - ['IFLA_BRIDGE_VLAN_INFO', 'linux/if_bridge.h'], - ['IFLA_BRPORT_PROXYARP', 'linux/if_link.h'], - ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'], - ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'], - ['IPVLAN_F_PRIVATE', 'linux/if_link.h'], - ['NDA_IFINDEX', 'linux/neighbour.h'], - ['IFA_FLAGS', 'linux/if_addr.h'], - ['FRA_DPORT_RANGE', 'linux/fib_rules.h'], - ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], - ['VXCAN_INFO_PEER', 'linux/can/vxcan.h'], - ['FOU_ATTR_REMCSUM_NOPARTIAL', 'linux/fou.h'], - ['FOU_CMD_GET', 'linux/fou.h'], - ['ETHTOOL_LINK_MODE_10baseT_Half_BIT', 'linux/ethtool.h'], +foreach decl : [['ETHTOOL_LINK_MODE_10baseT_Half_BIT', 'linux/ethtool.h'], ['ETHTOOL_LINK_MODE_25000baseCR_Full_BIT', 'linux/ethtool.h'], ['ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT', 'linux/ethtool.h'], ['ETHTOOL_LINK_MODE_1000baseX_Full_BIT', 'linux/ethtool.h'], ['ETHTOOL_LINK_MODE_2500baseT_Full_BIT', 'linux/ethtool.h'], ['ETHTOOL_LINK_MODE_FEC_NONE_BIT', 'linux/ethtool.h'], + ['FRA_PAD', 'linux/fib_rules.h'], + ['FRA_L3MDEV', 'linux/fib_rules.h'], + ['FRA_UID_RANGE', 'linux/fib_rules.h'], + ['FRA_DPORT_RANGE', 'linux/fib_rules.h'], + ['FOU_ATTR_REMCSUM_NOPARTIAL', 'linux/fou.h'], + ['FOU_CMD_GET', 'linux/fou.h'], + ['IFA_FLAGS', 'linux/if_addr.h'], + ['IFLA_BRIDGE_VLAN_TUNNEL_INFO', 'linux/if_bridge.h'], + ['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'], + ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'], + ['IN6_ADDR_GEN_MODE_RANDOM', 'linux/if_link.h'], + ['IFLA_IPVLAN_MODE', 'linux/if_link.h'], + ['IPVLAN_MODE_L3S', 'linux/if_link.h'], + ['IFLA_IPVLAN_FLAGS', 'linux/if_link.h'], + ['IFLA_PHYS_PORT_ID', 'linux/if_link.h'], + ['IFLA_CARRIER_CHANGES', 'linux/if_link.h'], + ['IFLA_PHYS_SWITCH_ID', 'linux/if_link.h'], + ['IFLA_LINK_NETNSID', 'linux/if_link.h'], + ['IFLA_PHYS_PORT_NAME', 'linux/if_link.h'], + ['IFLA_PROTO_DOWN', 'linux/if_link.h'], + ['IFLA_GSO_MAX_SIZE', 'linux/if_link.h'], + ['IFLA_PAD', 'linux/if_link.h'], + ['IFLA_XDP', 'linux/if_link.h'], + ['IFLA_EVENT', 'linux/if_link.h'], + ['IFLA_IF_NETNSID', 'linux/if_link.h'], + ['IFLA_TARGET_NETNSID', 'linux/if_link.h'], + ['IFLA_NEW_IFINDEX', 'linux/if_link.h'], + ['IFLA_MAX_MTU', 'linux/if_link.h'], + ['IFLA_BOND_ACTIVE_SLAVE', 'linux/if_link.h'], + ['IFLA_BOND_AD_INFO', 'linux/if_link.h'], + ['IFLA_BOND_AD_ACTOR_SYSTEM', 'linux/if_link.h'], + ['IFLA_BOND_TLB_DYNAMIC_LB', 'linux/if_link.h'], + ['IFLA_VXLAN_UDP_ZERO_CSUM6_RX', 'linux/if_link.h'], + ['IFLA_VXLAN_REMCSUM_NOPARTIAL', 'linux/if_link.h'], + ['IFLA_VXLAN_COLLECT_METADATA', 'linux/if_link.h'], + ['IFLA_VXLAN_LABEL', 'linux/if_link.h'], + ['IFLA_VXLAN_GPE', 'linux/if_link.h'], + ['IFLA_VXLAN_TTL_INHERIT', 'linux/if_link.h'], + ['IFLA_GENEVE_TOS', 'linux/if_link.h'], + ['IFLA_GENEVE_COLLECT_METADATA', 'linux/if_link.h'], + ['IFLA_GENEVE_REMOTE6', 'linux/if_link.h'], + ['IFLA_GENEVE_UDP_ZERO_CSUM6_RX', 'linux/if_link.h'], + ['IFLA_GENEVE_LABEL', 'linux/if_link.h'], + ['IFLA_GENEVE_TTL_INHERIT', 'linux/if_link.h'], + ['IFLA_BR_MAX_AGE', 'linux/if_link.h'], + ['IFLA_BR_PRIORITY', 'linux/if_link.h'], + ['IFLA_BR_VLAN_PROTOCOL', 'linux/if_link.h'], + ['IFLA_BR_VLAN_DEFAULT_PVID', 'linux/if_link.h'], + ['IFLA_BR_VLAN_STATS_ENABLED', 'linux/if_link.h'], + ['IFLA_BR_MCAST_STATS_ENABLED', 'linux/if_link.h'], + ['IFLA_BR_MCAST_MLD_VERSION', 'linux/if_link.h'], + ['IFLA_BR_VLAN_STATS_PER_PORT', 'linux/if_link.h'], + ['IFLA_BRPORT_LEARNING_SYNC', 'linux/if_link.h'], + ['IFLA_BRPORT_PROXYARP_WIFI', 'linux/if_link.h'], + ['IFLA_BRPORT_MULTICAST_ROUTER', 'linux/if_link.h'], + ['IFLA_BRPORT_PAD', 'linux/if_link.h'], + ['IFLA_BRPORT_MCAST_FLOOD', 'linux/if_link.h'], + ['IFLA_BRPORT_VLAN_TUNNEL', 'linux/if_link.h'], + ['IFLA_BRPORT_BCAST_FLOOD', 'linux/if_link.h'], + ['IFLA_BRPORT_NEIGH_SUPPRESS', 'linux/if_link.h'], + ['IFLA_BRPORT_ISOLATED', 'linux/if_link.h'], + ['IFLA_BRPORT_BACKUP_PORT', 'linux/if_link.h'], + ['IFLA_VRF_TABLE', 'linux/if_link.h'], + # if_tunnel.h is buggy and cannot be included on its own + ['IFLA_VTI_FWMARK', 'linux/if_tunnel.h', '#include '], + ['IFLA_IPTUN_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], + ['IFLA_IPTUN_COLLECT_METADATA', 'linux/if_tunnel.h', '#include '], + ['IFLA_IPTUN_FWMARK', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_ENCAP_DPORT', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_COLLECT_METADATA', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_IGNORE_DF', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_FWMARK', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_ERSPAN_INDEX', 'linux/if_tunnel.h', '#include '], + ['IFLA_GRE_ERSPAN_HWID', 'linux/if_tunnel.h', '#include '], + ['LO_FLAGS_PARTSCAN', 'linux/loop.h'], ] prefix = decl.length() > 2 ? decl[2] : '' have = cc.has_header_symbol(decl[1], decl[0], prefix : prefix) @@ -618,6 +665,7 @@ foreach header : ['crypt.h', 'linux/fou.h', 'linux/memfd.h', 'linux/vm_sockets.h', + 'linux/can/vxcan.h', 'sys/auxv.h', 'valgrind/memcheck.h', 'valgrind/valgrind.h', diff --git a/src/basic/missing.h b/src/basic/missing.h index 99a463b7b6..0bdbab1ee4 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -9,13 +9,8 @@ #include #include #include -#include -#include #include -#include -#include #include -#include #include #include #include @@ -193,7 +188,7 @@ struct sockaddr_vm { #define BTRFS_QGROUP_LEVEL_SHIFT 48 #endif -#if ! HAVE_LINUX_BTRFS_H +#if !HAVE_LINUX_BTRFS_H #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \ struct btrfs_ioctl_qgroup_assign_args) #define BTRFS_IOC_QGROUP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 42, \ @@ -345,7 +340,7 @@ struct btrfs_ioctl_quota_ctl_args { __u64 cmd; __u64 status; }; -#endif +#endif /* !HAVE_LINUX_BTRFS_H */ #ifndef BTRFS_IOC_DEFRAG #define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ @@ -663,460 +658,8 @@ struct input_mask { #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY) #endif -#if !HAVE_LO_FLAGS_PARTSCAN -#define LO_FLAGS_PARTSCAN 8 -#endif - -#ifndef LOOP_CTL_REMOVE -#define LOOP_CTL_REMOVE 0x4C81 -#endif - -#ifndef LOOP_CTL_GET_FREE -#define LOOP_CTL_GET_FREE 0x4C82 -#endif - -#if !HAVE_IFLA_INET6_ADDR_GEN_MODE -#define IFLA_INET6_UNSPEC 0 -#define IFLA_INET6_FLAGS 1 -#define IFLA_INET6_CONF 2 -#define IFLA_INET6_STATS 3 -#define IFLA_INET6_MCAST 4 -#define IFLA_INET6_CACHEINFO 5 -#define IFLA_INET6_ICMP6STATS 6 -#define IFLA_INET6_TOKEN 7 -#define IFLA_INET6_ADDR_GEN_MODE 8 -#define __IFLA_INET6_MAX 9 - -#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) - -#define IN6_ADDR_GEN_MODE_EUI64 0 -#define IN6_ADDR_GEN_MODE_NONE 1 -#endif - -#if !HAVE_IN6_ADDR_GEN_MODE_STABLE_PRIVACY -#define IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2 -#endif - -#if !HAVE_IFLA_MACVLAN_FLAGS -#define IFLA_MACVLAN_UNSPEC 0 -#define IFLA_MACVLAN_MODE 1 -#define IFLA_MACVLAN_FLAGS 2 -#define __IFLA_MACVLAN_MAX 3 - -#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1) -#endif - -#if !HAVE_IFLA_IPVLAN_FLAGS -#define IFLA_IPVLAN_UNSPEC 0 -#define IFLA_IPVLAN_MODE 1 -#define IFLA_IPVLAN_FLAGS 2 -#define __IFLA_IPVLAN_MAX 3 - -#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1) - -#define IPVLAN_MODE_L2 0 -#define IPVLAN_MODE_L3 1 -#define IPVLAN_MODE_L3S 2 -#define IPVLAN_MAX 2 -#endif - -#if !HAVE_IPVLAN_F_PRIVATE -#define IPVLAN_F_PRIVATE 0x01 -#define IPVLAN_F_VEPA 0x02 -#define __IPVLAN_F_PRIVATE_MAX 3 - -#define HAVE_IPVLAN_F_PRIVATE_MAX (__HAVE_IPVLAN_F_PRIVATE_MAX - 1) -#endif - -#if !HAVE_IFLA_VTI_REMOTE -#define IFLA_VTI_UNSPEC 0 -#define IFLA_VTI_LINK 1 -#define IFLA_VTI_IKEY 2 -#define IFLA_VTI_OKEY 3 -#define IFLA_VTI_LOCAL 4 -#define IFLA_VTI_REMOTE 5 -#define __IFLA_VTI_MAX 6 - -#define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1) -#endif - -#if !HAVE_IFLA_PHYS_PORT_ID -#define IFLA_EXT_MASK 29 -#undef IFLA_PROMISCUITY -#define IFLA_PROMISCUITY 30 -#define IFLA_NUM_TX_QUEUES 31 -#define IFLA_NUM_RX_QUEUES 32 -#define IFLA_CARRIER 33 -#define IFLA_PHYS_PORT_ID 34 -#define __IFLA_MAX 35 - -#define IFLA_MAX (__IFLA_MAX - 1) -#endif - -#if !HAVE_IFLA_BOND_AD_ACTOR_SYSTEM -#define IFLA_BOND_UNSPEC 0 -#define IFLA_BOND_MODE 1 -#define IFLA_BOND_ACTIVE_SLAVE 2 -#define IFLA_BOND_MIIMON 3 -#define IFLA_BOND_UPDELAY 4 -#define IFLA_BOND_DOWNDELAY 5 -#define IFLA_BOND_USE_CARRIER 6 -#define IFLA_BOND_ARP_INTERVAL 7 -#define IFLA_BOND_ARP_IP_TARGET 8 -#define IFLA_BOND_ARP_VALIDATE 9 -#define IFLA_BOND_ARP_ALL_TARGETS 10 -#define IFLA_BOND_PRIMARY 11 -#define IFLA_BOND_PRIMARY_RESELECT 12 -#define IFLA_BOND_FAIL_OVER_MAC 13 -#define IFLA_BOND_XMIT_HASH_POLICY 14 -#define IFLA_BOND_RESEND_IGMP 15 -#define IFLA_BOND_NUM_PEER_NOTIF 16 -#define IFLA_BOND_ALL_SLAVES_ACTIVE 17 -#define IFLA_BOND_MIN_LINKS 18 -#define IFLA_BOND_LP_INTERVAL 19 -#define IFLA_BOND_PACKETS_PER_SLAVE 20 -#define IFLA_BOND_AD_LACP_RATE 21 -#define IFLA_BOND_AD_SELECT 22 -#define IFLA_BOND_AD_INFO 23 -#define IFLA_BOND_AD_ACTOR_SYS_PRIO 24 -#define IFLA_BOND_AD_USER_PORT_KEY 25 -#define IFLA_BOND_AD_ACTOR_SYSTEM 26 -#define __IFLA_BOND_MAX 27 - -#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) -#endif - -#if !HAVE_IFLA_VLAN_PROTOCOL -#define IFLA_VLAN_UNSPEC 0 -#define IFLA_VLAN_ID 1 -#define IFLA_VLAN_FLAGS 2 -#define IFLA_VLAN_EGRESS_QOS 3 -#define IFLA_VLAN_INGRESS_QOS 4 -#define IFLA_VLAN_PROTOCOL 5 -#define __IFLA_VLAN_MAX 6 - -#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1) -#endif - -#if !HAVE_IFLA_VXLAN_GPE -#define IFLA_VXLAN_UNSPEC 0 -#define IFLA_VXLAN_ID 1 -#define IFLA_VXLAN_GROUP 2 -#define IFLA_VXLAN_LINK 3 -#define IFLA_VXLAN_LOCAL 4 -#define IFLA_VXLAN_TTL 5 -#define IFLA_VXLAN_TOS 6 -#define IFLA_VXLAN_LEARNING 7 -#define IFLA_VXLAN_AGEING 8 -#define IFLA_VXLAN_LIMIT 9 -#define IFLA_VXLAN_PORT_RANGE 10 -#define IFLA_VXLAN_PROXY 11 -#define IFLA_VXLAN_RSC 12 -#define IFLA_VXLAN_L2MISS 13 -#define IFLA_VXLAN_L3MISS 14 -#define IFLA_VXLAN_PORT 15 -#define IFLA_VXLAN_GROUP6 16 -#define IFLA_VXLAN_LOCAL6 17 -#define IFLA_VXLAN_UDP_CSUM 18 -#define IFLA_VXLAN_UDP_ZERO_CSUM6_TX 19 -#define IFLA_VXLAN_UDP_ZERO_CSUM6_RX 20 -#define IFLA_VXLAN_REMCSUM_TX 21 -#define IFLA_VXLAN_REMCSUM_RX 22 -#define IFLA_VXLAN_GBP 23 -#define IFLA_VXLAN_REMCSUM_NOPARTIAL 24 -#define IFLA_VXLAN_COLLECT_METADATA 25 -#define IFLA_VXLAN_LABEL 26 -#define IFLA_VXLAN_GPE 27 - -#define __IFLA_VXLAN_MAX 28 - -#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) -#endif - -#if !HAVE_IFLA_GENEVE_LABEL -#define IFLA_GENEVE_UNSPEC 0 -#define IFLA_GENEVE_ID 1 -#define IFLA_GENEVE_REMOTE 2 -#define IFLA_GENEVE_TTL 3 -#define IFLA_GENEVE_TOS 4 -#define IFLA_GENEVE_PORT 5 -#define IFLA_GENEVE_COLLECT_METADATA 6 -#define IFLA_GENEVE_REMOTE6 7 -#define IFLA_GENEVE_UDP_CSUM 8 -#define IFLA_GENEVE_UDP_ZERO_CSUM6_TX 9 -#define IFLA_GENEVE_UDP_ZERO_CSUM6_RX 10 -#define IFLA_GENEVE_LABEL 11 - -#define __IFLA_GENEVE_MAX 12 - -#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1) -#endif - -#if !HAVE_IFLA_IPTUN_ENCAP_DPORT -#define IFLA_IPTUN_UNSPEC 0 -#define IFLA_IPTUN_LINK 1 -#define IFLA_IPTUN_LOCAL 2 -#define IFLA_IPTUN_REMOTE 3 -#define IFLA_IPTUN_TTL 4 -#define IFLA_IPTUN_TOS 5 -#define IFLA_IPTUN_ENCAP_LIMIT 6 -#define IFLA_IPTUN_FLOWINFO 7 -#define IFLA_IPTUN_FLAGS 8 -#define IFLA_IPTUN_PROTO 9 -#define IFLA_IPTUN_PMTUDISC 10 -#define IFLA_IPTUN_6RD_PREFIX 11 -#define IFLA_IPTUN_6RD_RELAY_PREFIX 12 -#define IFLA_IPTUN_6RD_PREFIXLEN 13 -#define IFLA_IPTUN_6RD_RELAY_PREFIXLEN 14 -#define IFLA_IPTUN_ENCAP_TYPE 15 -#define IFLA_IPTUN_ENCAP_FLAGS 16 -#define IFLA_IPTUN_ENCAP_SPORT 17 -#define IFLA_IPTUN_ENCAP_DPORT 18 - -#define __IFLA_IPTUN_MAX 19 - -#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) -#endif - -#if !HAVE_IFLA_GRE_ERSPAN_HWID -#define IFLA_GRE_UNSPEC 0 -#define IFLA_GRE_LINK 1 -#define IFLA_GRE_IFLAGS 2 -#define IFLA_GRE_OFLAGS 3 -#define IFLA_GRE_IKEY 4 -#define IFLA_GRE_OKEY 5 -#define IFLA_GRE_LOCAL 6 -#define IFLA_GRE_REMOTE 7 -#define IFLA_GRE_TTL 8 -#define IFLA_GRE_TOS 9 -#define IFLA_GRE_PMTUDISC 10 -#define IFLA_GRE_ENCAP_LIMIT 11 -#define IFLA_GRE_FLOWINFO 12 -#define IFLA_GRE_FLAGS 13 -#define IFLA_GRE_ENCAP_TYPE 14 -#define IFLA_GRE_ENCAP_FLAGS 15 -#define IFLA_GRE_ENCAP_SPORT 16 -#define IFLA_GRE_ENCAP_DPORT 17 -#define IFLA_GRE_COLLECT_METADATA 18 -#define IFLA_GRE_IGNORE_DF 19 -#define IFLA_GRE_FWMARK 20 -#define IFLA_GRE_ERSPAN_INDEX 21 -#define IFLA_GRE_ERSPAN_VER 22 -#define IFLA_GRE_ERSPAN_DIR 23 -#define IFLA_GRE_ERSPAN_HWID 24 -#define __IFLA_GRE_MAX 25 - -#define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) -#endif - -#if !HAVE_IFLA_BRIDGE_VLAN_INFO -#define IFLA_BRIDGE_FLAGS 0 -#define IFLA_BRIDGE_MODE 1 -#define IFLA_BRIDGE_VLAN_INFO 2 -#define __IFLA_BRIDGE_MAX 3 - -#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) -#endif - -#ifndef BRIDGE_VLAN_INFO_RANGE_BEGIN -#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */ -#endif - -#ifndef BRIDGE_VLAN_INFO_RANGE_END -#define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */ -#endif - -#if !HAVE_IFLA_BR_VLAN_DEFAULT_PVID -#define IFLA_BR_UNSPEC 0 -#define IFLA_BR_FORWARD_DELAY 1 -#define IFLA_BR_HELLO_TIME 2 -#define IFLA_BR_MAX_AGE 3 -#define IFLA_BR_AGEING_TIME 4 -#define IFLA_BR_STP_STATE 5 -#define IFLA_BR_PRIORITY 6 -#define IFLA_BR_VLAN_FILTERING 7 -#define IFLA_BR_VLAN_PROTOCOL 8 -#define IFLA_BR_GROUP_FWD_MASK 9 -#define IFLA_BR_ROOT_ID 10 -#define IFLA_BR_BRIDGE_ID 11 -#define IFLA_BR_ROOT_PORT 12 -#define IFLA_BR_ROOT_PATH_COST 13 -#define IFLA_BR_TOPOLOGY_CHANGE 14 -#define IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15 -#define IFLA_BR_HELLO_TIMER 16 -#define IFLA_BR_TCN_TIMER 17 -#define IFLA_BR_TOPOLOGY_CHANGE_TIMER 18 -#define IFLA_BR_GC_TIMER 19 -#define IFLA_BR_GROUP_ADDR 20 -#define IFLA_BR_FDB_FLUSH 21 -#define IFLA_BR_MCAST_ROUTER 22 -#define IFLA_BR_MCAST_SNOOPING 23 -#define IFLA_BR_MCAST_QUERY_USE_IFADDR 24 -#define IFLA_BR_MCAST_QUERIER 25 -#define IFLA_BR_MCAST_HASH_ELASTICITY 26 -#define IFLA_BR_MCAST_HASH_MAX 27 -#define IFLA_BR_MCAST_LAST_MEMBER_CNT 28 -#define IFLA_BR_MCAST_STARTUP_QUERY_CNT 29 -#define IFLA_BR_MCAST_LAST_MEMBER_INTVL 30 -#define IFLA_BR_MCAST_MEMBERSHIP_INTVL 31 -#define IFLA_BR_MCAST_QUERIER_INTVL 32 -#define IFLA_BR_MCAST_QUERY_INTVL 33 -#define IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34 -#define IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35 -#define IFLA_BR_NF_CALL_IPTABLES 36 -#define IFLA_BR_NF_CALL_IP6TABLES 37 -#define IFLA_BR_NF_CALL_ARPTABLES 38 -#define IFLA_BR_VLAN_DEFAULT_PVID 39 -#define __IFLA_BR_MAX 40 - -#define IFLA_BR_MAX (__IFLA_BR_MAX - 1) -#endif - -#if !HAVE_IFLA_BRPORT_LEARNING_SYNC -#define IFLA_BRPORT_UNSPEC 0 -#define IFLA_BRPORT_STATE 1 -#define IFLA_BRPORT_PRIORITY 2 -#define IFLA_BRPORT_COST 3 -#define IFLA_BRPORT_MODE 4 -#define IFLA_BRPORT_GUARD 5 -#define IFLA_BRPORT_PROTECT 6 -#define IFLA_BRPORT_FAST_LEAVE 7 -#define IFLA_BRPORT_LEARNING 8 -#define IFLA_BRPORT_UNICAST_FLOOD 9 -#define IFLA_BRPORT_LEARNING_SYNC 11 -#define __IFLA_BRPORT_MAX 12 - -#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) -#endif - -#if !HAVE_FRA_DPORT_RANGE -#define FRA_UNSPEC 0 -#define FRA_DST 1 -#define FRA_SRC 2 -#define FRA_IIFNAME 3 -#define FRA_GOTO 4 -#define FRA_UNUSED2 5 -#define FRA_PRIORITY 6 -#define FRA_UNUSED3 7 -#define FRA_UNUSED4 8 -#define FRA_UNUSED5 9 -#define FRA_FWMARK 10 -#define FRA_FLOW 11 -#define FRA_TUN_ID 12 -#define FRA_SUPPRESS_IFGROUP 13 -#define FRA_SUPPRESS_PREFIXLEN 14 -#define FRA_TABLE 15 -#define FRA_FWMASK 16 -#define FRA_OIFNAME 17 -#define FRA_PAD 18 -#define FRA_L3MDEV 19 -#define FRA_UID_RANGE 20 -#define FRA_PROTOCOL 21 -#define FRA_IP_PROTO 22 -#define FRA_SPORT_RANGE 23 -#define FRA_DPORT_RANGE 24 -#define __FRA_MAX 25 - -#define FRA_MAX (__FRA_MAX - 1) -#endif - -#if !HAVE_IFLA_BRPORT_PROXYARP -#define IFLA_BRPORT_PROXYARP 10 -#endif - -#if !HAVE_IFLA_VRF_TABLE -#define IFLA_VRF_TABLE 1 -#endif - -#if !HAVE_VXCAN_INFO_PEER -#define VXCAN_INFO_PEER 1 -#endif - -#if !HAVE_NDA_IFINDEX -#define NDA_UNSPEC 0 -#define NDA_DST 1 -#define NDA_LLADDR 2 -#define NDA_CACHEINFO 3 -#define NDA_PROBES 4 -#define NDA_VLAN 5 -#define NDA_PORT 6 -#define NDA_VNI 7 -#define NDA_IFINDEX 8 -#define __NDA_MAX 9 - -#define NDA_MAX (__NDA_MAX - 1) -#endif - -#ifndef RTA_PREF -#define RTA_PREF 20 -#endif - -#ifndef RTAX_QUICKACK -#define RTAX_QUICKACK 15 -#endif - -#ifndef RTA_EXPIRES -#define RTA_EXPIRES 23 -#endif - -#ifndef IPV6_UNICAST_IF -#define IPV6_UNICAST_IF 76 -#endif - -#ifndef IPV6_MIN_MTU -#define IPV6_MIN_MTU 1280 -#endif - -#ifndef IPV4_MIN_MTU -#define IPV4_MIN_MTU 68 -#endif - -#ifndef IFF_MULTI_QUEUE -#define IFF_MULTI_QUEUE 0x100 -#endif - -#ifndef IFF_LOWER_UP -#define IFF_LOWER_UP 0x10000 -#endif - -#ifndef IFF_DORMANT -#define IFF_DORMANT 0x20000 -#endif - -#ifndef BOND_XMIT_POLICY_ENCAP23 -#define BOND_XMIT_POLICY_ENCAP23 3 -#endif - -#ifndef BOND_XMIT_POLICY_ENCAP34 -#define BOND_XMIT_POLICY_ENCAP34 4 -#endif - -#ifndef NET_ADDR_RANDOM -# define NET_ADDR_RANDOM 1 -#endif - -#ifndef NET_NAME_UNKNOWN -# define NET_NAME_UNKNOWN 0 -#endif - -#ifndef NET_NAME_ENUM -# define NET_NAME_ENUM 1 -#endif - -#ifndef NET_NAME_PREDICTABLE -# define NET_NAME_PREDICTABLE 2 -#endif - -#ifndef NET_NAME_USER -# define NET_NAME_USER 3 -#endif - -#ifndef NET_NAME_RENAMED -# define NET_NAME_RENAMED 4 -#endif - #ifndef BPF_XOR -# define BPF_XOR 0xa0 +#define BPF_XOR 0xa0 #endif /* Note that LOOPBACK_IFINDEX is currently not exported by the @@ -1128,18 +671,6 @@ struct input_mask { #define LOOPBACK_IFINDEX 1 #endif -#if !HAVE_IFA_FLAGS -#define IFA_FLAGS 8 -#endif - -#ifndef IFA_F_MANAGETEMPADDR -#define IFA_F_MANAGETEMPADDR 0x100 -#endif - -#ifndef IFA_F_NOPREFIXROUTE -#define IFA_F_NOPREFIXROUTE 0x200 -#endif - #ifndef MAX_AUDIT_MESSAGE_LENGTH #define MAX_AUDIT_MESSAGE_LENGTH 8970 #endif @@ -1281,21 +812,11 @@ typedef int32_t key_serial_t; #define PR_CAP_AMBIENT_CLEAR_ALL 4 #endif -/* The following two defines are actually available in the kernel headers for longer, but we define them here anyway, - * since that makes it easier to use them in conjunction with the glibc net/if.h header which conflicts with - * linux/if.h. */ -#ifndef IF_OPER_UNKNOWN -#define IF_OPER_UNKNOWN 0 -#endif - -#ifndef IF_OPER_UP -#define IF_OPER_UP 6 - -#if ! HAVE_CHAR32_T +#if !HAVE_CHAR32_T #define char32_t uint32_t #endif -#if ! HAVE_CHAR16_T +#if !HAVE_CHAR16_T #define char16_t uint16_t #endif @@ -1303,30 +824,6 @@ typedef int32_t key_serial_t; #define ETHERTYPE_LLDP 0x88cc #endif -#ifndef IFA_F_MCAUTOJOIN -#define IFA_F_MCAUTOJOIN 0x400 -#endif - -#if ! HAVE_STRUCT_FIB_RULE_UID_RANGE - -struct fib_rule_uid_range { - __u32 start; - __u32 end; -}; - -#endif - -#if ! HAVE_STRUCT_FIB_RULE_PORT_RANGE - -struct fib_rule_port_range { - __u16 start; - __u16 end; -}; - -#endif - -#endif - #ifndef SOL_ALG #define SOL_ALG 279 #endif @@ -1405,174 +902,5 @@ struct statx { #define TASK_COMM_LEN 16 #endif -#ifndef FOU_GENL_NAME -#define FOU_GENL_NAME "fou" -#endif - -#ifndef FOU_GENL_VERSION -#define FOU_GENL_VERSION 0x1 -#endif - -#if !HAVE_LINUX_FOU_H -#define FOU_ATTR_UNSPEC 0 -#define FOU_ATTR_PORT 1 -#define FOU_ATTR_AF 2 -#define FOU_ATTR_IPPROTO 3 -#define FOU_ATTR_TYPE 4 -#endif -#if !HAVE_FOU_ATTR_REMCSUM_NOPARTIAL -#define FOU_ATTR_REMCSUM_NOPARTIAL 5 -#undef FOU_ATTR_MAX -#endif -#ifndef FOU_ATTR_MAX -#define FOU_ATTR_MAX 5 -#endif - -#if !HAVE_LINUX_FOU_H -#define FOU_CMD_UNSPEC 0 -#define FOU_CMD_ADD 1 -#define FOU_CMD_DEL 2 -#endif -#if !HAVE_FOU_CMD_GET -#define FOU_CMD_GET 3 -#undef FOU_CMD_MAX -#endif -#ifndef FOU_CMD_MAX -#define FOU_CMD_MAX 3 -#endif - -#if !HAVE_LINUX_FOU_H -#define FOU_ENCAP_UNSPEC 0 -#define FOU_ENCAP_DIRECT 1 -#define FOU_ENCAP_GUE 2 -#define __FOU_ENCAP_MAX 3 - -#define FOU_ENCAP_MAX (__FOU_ENCAP_MAX - 1) -#endif - -#if !HAVE_ETHTOOL_LINK_MODE_10baseT_Half_BIT /* linux@3f1ac7a700d039c61d8d8b99f28d605d489a60cf (4.6) */ - -#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */ -#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */ - -struct ethtool_link_settings { - __u32 cmd; - __u32 speed; - __u8 duplex; - __u8 port; - __u8 phy_address; - __u8 autoneg; - __u8 mdio_support; - __u8 eth_tp_mdix; - __u8 eth_tp_mdix_ctrl; - __s8 link_mode_masks_nwords; - __u8 transceiver; - __u8 reserved1[3]; - __u32 reserved[7]; - __u32 link_mode_masks[0]; - /* layout of link_mode_masks fields: - * __u32 map_supported[link_mode_masks_nwords]; - * __u32 map_advertising[link_mode_masks_nwords]; - * __u32 map_lp_advertising[link_mode_masks_nwords]; - */ -}; - -enum ethtool_link_mode_bit_indices { - ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0, - ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1, - ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2, - ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3, - ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4, - ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5, - ETHTOOL_LINK_MODE_Autoneg_BIT = 6, - ETHTOOL_LINK_MODE_TP_BIT = 7, - ETHTOOL_LINK_MODE_AUI_BIT = 8, - ETHTOOL_LINK_MODE_MII_BIT = 9, - ETHTOOL_LINK_MODE_FIBRE_BIT = 10, - ETHTOOL_LINK_MODE_BNC_BIT = 11, - ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12, - ETHTOOL_LINK_MODE_Pause_BIT = 13, - ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14, - ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15, - ETHTOOL_LINK_MODE_Backplane_BIT = 16, - ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17, - ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18, - ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19, - ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20, - ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21, - ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22, - ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23, - ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24, - ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25, - ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26, - ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27, - ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28, - ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, - ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, - ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, - ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, - ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, - ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, - ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35, - ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36, - ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37, - ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38, - ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39, - ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40, - ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41, - ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42, - ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43, - ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, - ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, - ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, - ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, - ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, - - ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, - ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, - ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, - - /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit - * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_* - * macro for bits > 31. The only way to use indices > 31 is to - * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. - */ - - __ETHTOOL_LINK_MODE_LAST - = ETHTOOL_LINK_MODE_FEC_BASER_BIT, -}; -#else -#if !HAVE_ETHTOOL_LINK_MODE_25000baseCR_Full_BIT /* linux@3851112e4737cd52aaeda0ce8d084be9ee128106 (4.7) */ -#define ETHTOOL_LINK_MODE_25000baseCR_Full_BIT 31 -#define ETHTOOL_LINK_MODE_25000baseKR_Full_BIT 32 -#define ETHTOOL_LINK_MODE_25000baseSR_Full_BIT 33 -#define ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT 34 -#define ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT 35 -#define ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT 36 -#define ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT 37 -#define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38 -#define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39 -#endif -#if !HAVE_ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT /* linux@89da45b8b5b2187734a11038b8593714f964ffd1 (4.8) */ -#define ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT 40 -#endif -#if !HAVE_ETHTOOL_LINK_MODE_1000baseX_Full_BIT /* linux@5711a98221443aec54c4c81ee98c6ae46acccb65 (4.9) */ -#define ETHTOOL_LINK_MODE_1000baseX_Full_BIT 41 -#define ETHTOOL_LINK_MODE_10000baseCR_Full_BIT 42 -#define ETHTOOL_LINK_MODE_10000baseSR_Full_BIT 43 -#define ETHTOOL_LINK_MODE_10000baseLR_Full_BIT 44 -#define ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT 45 -#define ETHTOOL_LINK_MODE_10000baseER_Full_BIT 46 -#endif -#if !HAVE_ETHTOOL_LINK_MODE_2500baseT_Full_BIT /* linux@94842b4fc4d6b1691cfc86c6f5251f299d27f4ba (4.10) */ -#define ETHTOOL_LINK_MODE_2500baseT_Full_BIT 47 -#define ETHTOOL_LINK_MODE_5000baseT_Full_BIT 48 -#endif -#if !HAVE_ETHTOOL_LINK_MODE_FEC_NONE_BIT /* linux@1a5f3da20bd966220931239fbd31e6ac6ff42251 (4.14) */ -#define ETHTOOL_LINK_MODE_FEC_NONE_BIT 49 -#define ETHTOOL_LINK_MODE_FEC_RS_BIT 50 -#define ETHTOOL_LINK_MODE_FEC_BASER_BIT 51 -#endif -#endif - +#include "missing_network.h" #include "missing_syscall.h" diff --git a/src/basic/missing_ethtool.h b/src/basic/missing_ethtool.h new file mode 100644 index 0000000000..9ba929c632 --- /dev/null +++ b/src/basic/missing_ethtool.h @@ -0,0 +1,131 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +/* Missing definitions in ethtool.h */ + +#if !HAVE_ETHTOOL_LINK_MODE_10baseT_Half_BIT /* linux@3f1ac7a700d039c61d8d8b99f28d605d489a60cf (4.6) */ + +#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */ +#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */ + +struct ethtool_link_settings { + __u32 cmd; + __u32 speed; + __u8 duplex; + __u8 port; + __u8 phy_address; + __u8 autoneg; + __u8 mdio_support; + __u8 eth_tp_mdix; + __u8 eth_tp_mdix_ctrl; + __s8 link_mode_masks_nwords; + __u8 transceiver; + __u8 reserved1[3]; + __u32 reserved[7]; + __u32 link_mode_masks[0]; + /* layout of link_mode_masks fields: + * __u32 map_supported[link_mode_masks_nwords]; + * __u32 map_advertising[link_mode_masks_nwords]; + * __u32 map_lp_advertising[link_mode_masks_nwords]; + */ +}; + +enum ethtool_link_mode_bit_indices { + ETHTOOL_LINK_MODE_10baseT_Half_BIT = 0, + ETHTOOL_LINK_MODE_10baseT_Full_BIT = 1, + ETHTOOL_LINK_MODE_100baseT_Half_BIT = 2, + ETHTOOL_LINK_MODE_100baseT_Full_BIT = 3, + ETHTOOL_LINK_MODE_1000baseT_Half_BIT = 4, + ETHTOOL_LINK_MODE_1000baseT_Full_BIT = 5, + ETHTOOL_LINK_MODE_Autoneg_BIT = 6, + ETHTOOL_LINK_MODE_TP_BIT = 7, + ETHTOOL_LINK_MODE_AUI_BIT = 8, + ETHTOOL_LINK_MODE_MII_BIT = 9, + ETHTOOL_LINK_MODE_FIBRE_BIT = 10, + ETHTOOL_LINK_MODE_BNC_BIT = 11, + ETHTOOL_LINK_MODE_10000baseT_Full_BIT = 12, + ETHTOOL_LINK_MODE_Pause_BIT = 13, + ETHTOOL_LINK_MODE_Asym_Pause_BIT = 14, + ETHTOOL_LINK_MODE_2500baseX_Full_BIT = 15, + ETHTOOL_LINK_MODE_Backplane_BIT = 16, + ETHTOOL_LINK_MODE_1000baseKX_Full_BIT = 17, + ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT = 18, + ETHTOOL_LINK_MODE_10000baseKR_Full_BIT = 19, + ETHTOOL_LINK_MODE_10000baseR_FEC_BIT = 20, + ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT = 21, + ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT = 22, + ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT = 23, + ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT = 24, + ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT = 25, + ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT = 26, + ETHTOOL_LINK_MODE_56000baseKR4_Full_BIT = 27, + ETHTOOL_LINK_MODE_56000baseCR4_Full_BIT = 28, + ETHTOOL_LINK_MODE_56000baseSR4_Full_BIT = 29, + ETHTOOL_LINK_MODE_56000baseLR4_Full_BIT = 30, + ETHTOOL_LINK_MODE_25000baseCR_Full_BIT = 31, + ETHTOOL_LINK_MODE_25000baseKR_Full_BIT = 32, + ETHTOOL_LINK_MODE_25000baseSR_Full_BIT = 33, + ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT = 34, + ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT = 35, + ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT = 36, + ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT = 37, + ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT = 38, + ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT = 39, + ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT = 40, + ETHTOOL_LINK_MODE_1000baseX_Full_BIT = 41, + ETHTOOL_LINK_MODE_10000baseCR_Full_BIT = 42, + ETHTOOL_LINK_MODE_10000baseSR_Full_BIT = 43, + ETHTOOL_LINK_MODE_10000baseLR_Full_BIT = 44, + ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT = 45, + ETHTOOL_LINK_MODE_10000baseER_Full_BIT = 46, + ETHTOOL_LINK_MODE_2500baseT_Full_BIT = 47, + ETHTOOL_LINK_MODE_5000baseT_Full_BIT = 48, + + ETHTOOL_LINK_MODE_FEC_NONE_BIT = 49, + ETHTOOL_LINK_MODE_FEC_RS_BIT = 50, + ETHTOOL_LINK_MODE_FEC_BASER_BIT = 51, + + /* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit + * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_* + * macro for bits > 31. The only way to use indices > 31 is to + * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API. + */ + + __ETHTOOL_LINK_MODE_LAST + = ETHTOOL_LINK_MODE_FEC_BASER_BIT, +}; +#else +#if !HAVE_ETHTOOL_LINK_MODE_25000baseCR_Full_BIT /* linux@3851112e4737cd52aaeda0ce8d084be9ee128106 (4.7) */ +#define ETHTOOL_LINK_MODE_25000baseCR_Full_BIT 31 +#define ETHTOOL_LINK_MODE_25000baseKR_Full_BIT 32 +#define ETHTOOL_LINK_MODE_25000baseSR_Full_BIT 33 +#define ETHTOOL_LINK_MODE_50000baseCR2_Full_BIT 34 +#define ETHTOOL_LINK_MODE_50000baseKR2_Full_BIT 35 +#define ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT 36 +#define ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT 37 +#define ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT 38 +#define ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT 39 +#endif +#if !HAVE_ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT /* linux@89da45b8b5b2187734a11038b8593714f964ffd1 (4.8) */ +#define ETHTOOL_LINK_MODE_50000baseSR2_Full_BIT 40 +#endif +#if !HAVE_ETHTOOL_LINK_MODE_1000baseX_Full_BIT /* linux@5711a98221443aec54c4c81ee98c6ae46acccb65 (4.9) */ +#define ETHTOOL_LINK_MODE_1000baseX_Full_BIT 41 +#define ETHTOOL_LINK_MODE_10000baseCR_Full_BIT 42 +#define ETHTOOL_LINK_MODE_10000baseSR_Full_BIT 43 +#define ETHTOOL_LINK_MODE_10000baseLR_Full_BIT 44 +#define ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT 45 +#define ETHTOOL_LINK_MODE_10000baseER_Full_BIT 46 +#endif +#if !HAVE_ETHTOOL_LINK_MODE_2500baseT_Full_BIT /* linux@94842b4fc4d6b1691cfc86c6f5251f299d27f4ba (4.10) */ +#define ETHTOOL_LINK_MODE_2500baseT_Full_BIT 47 +#define ETHTOOL_LINK_MODE_5000baseT_Full_BIT 48 +#endif +#if !HAVE_ETHTOOL_LINK_MODE_FEC_NONE_BIT /* linux@1a5f3da20bd966220931239fbd31e6ac6ff42251 (4.14) */ +#define ETHTOOL_LINK_MODE_FEC_NONE_BIT 49 +#define ETHTOOL_LINK_MODE_FEC_RS_BIT 50 +#define ETHTOOL_LINK_MODE_FEC_BASER_BIT 51 +#endif +#endif diff --git a/src/basic/missing_fib_rules.h b/src/basic/missing_fib_rules.h new file mode 100644 index 0000000000..a07c91b08a --- /dev/null +++ b/src/basic/missing_fib_rules.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include + +#if !HAVE_FRA_PAD /* linux@b46f6ded906ef0be52a4881ba50a084aeca64d7e (4.7) */ +#define FRA_PAD 18 +#endif + +#if !HAVE_FRA_L3MDEV /* linux@96c63fa7393d0a346acfe5a91e0c7d4c7782641b (4.8) */ +#define FRA_L3MDEV 19 +#endif + +#if !HAVE_FRA_UID_RANGE /* linux@622ec2c9d52405973c9f1ca5116eb1c393adfc7d (4.10) */ +#define FRA_UID_RANGE 20 + +struct fib_rule_uid_range { + __u32 start; + __u32 end; +}; +#endif + +#if !HAVE_FRA_DPORT_RANGE /* linux@1b71af6053af1bd2f849e9fda4f71c1e3f145dcf, bfff4862653bb96001ab57c1edd6d03f48e5f035 (4.17) */ +#define FRA_PROTOCOL 21 +#define FRA_IP_PROTO 22 +#define FRA_SPORT_RANGE 23 +#define FRA_DPORT_RANGE 24 + +#undef FRA_MAX +#define FRA_MAX 24 + +struct fib_rule_port_range { + __u16 start; + __u16 end; +}; +#endif diff --git a/src/basic/missing_fou.h b/src/basic/missing_fou.h new file mode 100644 index 0000000000..d8c743577c --- /dev/null +++ b/src/basic/missing_fou.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if !HAVE_LINUX_FOU_H /* linux@23461551c00628c3f3fe9cf837bf53cf8f212b63 (3.18) */ + +#define FOU_GENL_NAME "fou" +#define FOU_GENL_VERSION 0x1 + +enum { + FOU_ATTR_UNSPEC, + FOU_ATTR_PORT, /* u16 */ + FOU_ATTR_AF, /* u8 */ + FOU_ATTR_IPPROTO, /* u8 */ + FOU_ATTR_TYPE, /* u8 */ + FOU_ATTR_REMCSUM_NOPARTIAL, /* flag */ + + __FOU_ATTR_MAX, +}; + +#define FOU_ATTR_MAX (__FOU_ATTR_MAX - 1) + +enum { + FOU_CMD_UNSPEC, + FOU_CMD_ADD, + FOU_CMD_DEL, + FOU_CMD_GET, + + __FOU_CMD_MAX, +}; + +enum { + FOU_ENCAP_UNSPEC, + FOU_ENCAP_DIRECT, + FOU_ENCAP_GUE, +}; + +#define FOU_CMD_MAX (__FOU_CMD_MAX - 1) + +#else + +#if !HAVE_FOU_ATTR_REMCSUM_NOPARTIAL /* linux@fe881ef11cf0220f118816181930494d484c4883 (4.0) */ +#define FOU_ATTR_REMCSUM_NOPARTIAL 5 + +#undef FOU_ATTR_MAX +#define FOU_ATTR_MAX 5 +#endif + +#if !HAVE_FOU_CMD_GET /* linux@7a6c8c34e5b71ac50e39588e20b39494a9e1d8e5 (4.1) */ +#define FOU_CMD_GET 3 + +#undef FOU_CMD_MAX +#define FOU_CMD_MAX 3 +#endif + +#endif diff --git a/src/basic/missing_if_bridge.h b/src/basic/missing_if_bridge.h new file mode 100644 index 0000000000..9306062fc2 --- /dev/null +++ b/src/basic/missing_if_bridge.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if !HAVE_IFLA_BRIDGE_VLAN_TUNNEL_INFO /* linux@b3c7ef0adadc5768e0baa786213c6bd1ce521a77 (4.11) */ +#define IFLA_BRIDGE_VLAN_TUNNEL_INFO 3 + +#undef IFLA_BRIDGE_MAX +#define IFLA_BRIDGE_MAX 3 +#endif + +#ifndef BRIDGE_VLAN_INFO_RANGE_BEGIN +#define BRIDGE_VLAN_INFO_RANGE_BEGIN (1<<3) /* VLAN is start of vlan range */ +#endif + +#ifndef BRIDGE_VLAN_INFO_RANGE_END +#define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */ +#endif + +#ifndef BRIDGE_VLAN_INFO_BRENTRY +#define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */ +#endif diff --git a/src/basic/missing_if_link.h b/src/basic/missing_if_link.h new file mode 100644 index 0000000000..e6fc3b73c5 --- /dev/null +++ b/src/basic/missing_if_link.h @@ -0,0 +1,383 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if !HAVE_IFLA_INET6_ADDR_GEN_MODE /* linux@bc91b0f07ada5535427373a4e2050877bcc12218 (3.17) */ +#define IFLA_INET6_ADDR_GEN_MODE 8 + +#undef IFLA_INET6_MAX +#define IFLA_INET6_MAX 8 + +enum in6_addr_gen_mode { + IN6_ADDR_GEN_MODE_EUI64, + IN6_ADDR_GEN_MODE_NONE, + IN6_ADDR_GEN_MODE_STABLE_PRIVACY, + IN6_ADDR_GEN_MODE_RANDOM, +}; +#else +#if !HAVE_IN6_ADDR_GEN_MODE_STABLE_PRIVACY /* linux@622c81d57b392cc9be836670eb464a4dfaa9adfe (4.1) */ +#define IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2 +#endif +#if !HAVE_IN6_ADDR_GEN_MODE_RANDOM /* linux@cc9da6cc4f56e05cc9e591459fe0192727ff58b3 (4.5) */ +#define IN6_ADDR_GEN_MODE_RANDOM 3 +#endif +#endif + +#if !HAVE_IFLA_IPVLAN_MODE /* linux@2ad7bf3638411cb547f2823df08166c13ab04269 (3.19) */ +enum { + IFLA_IPVLAN_UNSPEC, + IFLA_IPVLAN_MODE, + IFLA_IPVLAN_FLAGS, + __IFLA_IPVLAN_MAX +}; +#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1) +enum ipvlan_mode { + IPVLAN_MODE_L2 = 0, + IPVLAN_MODE_L3, + IPVLAN_MODE_L3S, + IPVLAN_MODE_MAX +}; +#else +#if !HAVE_IPVLAN_MODE_L3S /* linux@4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5 (4.9) */ +#define IPVLAN_MODE_L3S 2 +#define IPVLAN_MODE_MAX 3 +#endif +#if !HAVE_IFLA_IPVLAN_FLAGS /* linux@a190d04db93710ae166749055b6985397c6d13f5, fe89aa6b250c1011ccf425fbb7998e96bd54263f (4.15) */ +#define IFLA_IPVLAN_FLAGS 2 + +#undef IFLA_IPVLAN_MAX +#define IFLA_IPVLAN_MAX 2 + +#define IPVLAN_F_PRIVATE 0x01 +#define IPVLAN_F_VEPA 0x02 +#endif +#endif + +#if !HAVE_IFLA_PHYS_PORT_ID /* linux@66cae9ed6bc46b8cc57a9693f99f69926f3cc7ef (3.12) */ +#define IFLA_PHYS_PORT_ID 34 +#endif +#if !HAVE_IFLA_CARRIER_CHANGES /* linux@2d3b479df41a10e2f41f9259fcba775bd34de6e4 (3.15) */ +#define IFLA_CARRIER_CHANGES 35 +#endif +#if !HAVE_IFLA_PHYS_SWITCH_ID /* linux@82f2841291cfaf4d225aa1766424280254d3e3b2 (3.19) */ +#define IFLA_PHYS_SWITCH_ID 36 +#endif +#if !HAVE_IFLA_LINK_NETNSID /* linux@d37512a277dfb2cef8a578e25a3246f61399a55a (4.0) */ +#define IFLA_LINK_NETNSID 37 +#endif +#if !HAVE_IFLA_PHYS_PORT_NAME /* linux@db24a9044ee191c397dcd1c6574f56d67d7c8df5 (4.1) */ +#define IFLA_PHYS_PORT_NAME 38 +#endif +#if !HAVE_IFLA_PROTO_DOWN /* linux@88d6378bd6c096cb8440face3ae3f33d55a2e6e4 (4.3) */ +#define IFLA_PROTO_DOWN 39 +#endif +#if !HAVE_IFLA_GSO_MAX_SIZE /* linux@c70ce028e834f8e51306217dbdbd441d851c64d3 (4.6) */ +#define IFLA_GSO_MAX_SEGS 40 +#define IFLA_GSO_MAX_SIZE 41 +#endif +#if !HAVE_IFLA_PAD /* linux@18402843bf88c2e9674e1a3a05c73b7d9b09ee05 (4.7) */ +#define IFLA_PAD 42 +#endif +#if !HAVE_IFLA_XDP /* linux@d1fdd9138682e0f272beee0cb08b6328c5478b26 (4.8) */ +#define IFLA_XDP 43 +#endif +#if !HAVE_IFLA_EVENT /* linux@3d3ea5af5c0b382bc9d9aed378fd814fb5d4a011 (4.13) */ +#define IFLA_EVENT 44 +#endif +#if !HAVE_IFLA_IF_NETNSID /* linux@6621dd29eb9b5e6774ec7a9a75161352fdea47fc, 79e1ad148c844f5c8b9d76b36b26e3886dca95ae (4.15) */ +#define IFLA_IF_NETNSID 45 +#define IFLA_NEW_NETNSID 46 +#endif +#if !HAVE_IFLA_TARGET_NETNSID /* linux@19d8f1ad12fd746e60707a58d954980013c7a35a (4.20) */ +#define IFLA_TARGET_NETNSID IFLA_IF_NETNSID +#endif +#if !HAVE_IFLA_NEW_IFINDEX /* linux@b2d3bcfa26a7a8de41f358a6cae8b848673b3c6e, 38e01b30563a5b5ade7b54e5d739d16a2b02fe82 (4.16) */ +#define IFLA_CARRIER_UP_COUNT 47 +#define IFLA_CARRIER_DOWN_COUNT 48 +#define IFLA_NEW_IFINDEX 49 +#endif +#if !HAVE_IFLA_MAX_MTU /* linux@3e7a50ceb11ea75c27e944f1a01e478fd62a2d8d (4.19) */ +#define IFLA_MIN_MTU 50 +#define IFLA_MAX_MTU 51 + +#undef IFLA_MAX +#define IFLA_MAX 51 +#endif + +#if !HAVE_IFLA_BOND_ACTIVE_SLAVE /* linux@ec76aa49855f6d6fea5e01de179fb57dd47c619d (3.13) */ +#define IFLA_BOND_ACTIVE_SLAVE 2 +#endif +#if !HAVE_IFLA_BOND_AD_INFO /* linux@4ee7ac7526d4a9413cafa733d824edfe49fdcc46 (3.14) */ +#define IFLA_BOND_MIIMON 3 +#define IFLA_BOND_UPDELAY 4 +#define IFLA_BOND_DOWNDELAY 5 +#define IFLA_BOND_USE_CARRIER 6 +#define IFLA_BOND_ARP_INTERVAL 7 +#define IFLA_BOND_ARP_IP_TARGET 8 +#define IFLA_BOND_ARP_VALIDATE 9 +#define IFLA_BOND_ARP_ALL_TARGETS 10 +#define IFLA_BOND_PRIMARY 11 +#define IFLA_BOND_PRIMARY_RESELECT 12 +#define IFLA_BOND_FAIL_OVER_MAC 13 +#define IFLA_BOND_XMIT_HASH_POLICY 14 +#define IFLA_BOND_RESEND_IGMP 15 +#define IFLA_BOND_NUM_PEER_NOTIF 16 +#define IFLA_BOND_ALL_SLAVES_ACTIVE 17 +#define IFLA_BOND_MIN_LINKS 18 +#define IFLA_BOND_LP_INTERVAL 19 +#define IFLA_BOND_PACKETS_PER_SLAVE 20 +#define IFLA_BOND_AD_LACP_RATE 21 +#define IFLA_BOND_AD_SELECT 22 +#define IFLA_BOND_AD_INFO 23 +#endif +#if !HAVE_IFLA_BOND_AD_ACTOR_SYSTEM /* linux@171a42c38c6e1a5a076d6276e94e55a0b5b7868c (4.2) */ +#define IFLA_BOND_AD_ACTOR_SYS_PRIO 24 +#define IFLA_BOND_AD_USER_PORT_KEY 25 +#define IFLA_BOND_AD_ACTOR_SYSTEM 26 +#endif +#if !HAVE_IFLA_BOND_TLB_DYNAMIC_LB /* linux@0f7bffd9e512b77279bbce704fad3cb1d6887958 (4.3) */ +#define IFLA_BOND_TLB_DYNAMIC_LB 27 + +#undef IFLA_BOND_MAX +#define IFLA_BOND_MAX 27 +#endif + +#if !HAVE_IFLA_VXLAN_UDP_ZERO_CSUM6_RX /* linux@359a0ea9875ef4f32c8425bbe1ae348e1fd2ed2a (3.16) */ +#define IFLA_VXLAN_UDP_CSUM 18 +#define IFLA_VXLAN_UDP_ZERO_CSUM6_TX 19 +#define IFLA_VXLAN_UDP_ZERO_CSUM6_RX 20 +#endif +#if !HAVE_IFLA_VXLAN_REMCSUM_NOPARTIAL /* linux@dfd8645ea1bd91277f841e74c33e1f4dbbede808..0ace2ca89cbd6bcdf2b9d2df1fa0fa24ea9d1653 (4.0) */ +#define IFLA_VXLAN_REMCSUM_TX 21 +#define IFLA_VXLAN_REMCSUM_RX 22 +#define IFLA_VXLAN_GBP 23 +#define IFLA_VXLAN_REMCSUM_NOPARTIAL 24 +#endif +#if !HAVE_IFLA_VXLAN_COLLECT_METADATA /* linux@f8a9b1bc1b238eed9987da747a0e52f5bb009980 (4.3) */ +#define IFLA_VXLAN_COLLECT_METADATA 25 +#endif +#if !HAVE_IFLA_VXLAN_LABEL /* linux@e7f70af111f086a20800ad2e17f544b2e3e0f375 (4.6) */ +#define IFLA_VXLAN_LABEL 26 +#endif +#if !HAVE_IFLA_VXLAN_GPE /* linux@e1e5314de08ba6003b358125eafc9ad9e75a950c (4.7) */ +#define IFLA_VXLAN_GPE 27 +#endif +#if !HAVE_IFLA_VXLAN_TTL_INHERIT /* linux@72f6d71e491e6ce269b564865b21fab0a4402dd3 (4.18) */ +#define IFLA_VXLAN_TTL_INHERIT 28 + +#undef IFLA_VXLAN_MAX +#define IFLA_VXLAN_MAX 28 +#endif + +#if !HAVE_IFLA_GENEVE_TOS /* linux@2d07dc79fe04a43d82a346ced6bbf07bdb523f1b..d89511251f6519599b109dc6cda87a6ab314ed8c (4.2) */ +enum { + IFLA_GENEVE_UNSPEC, + IFLA_GENEVE_ID, + IFLA_GENEVE_REMOTE, + IFLA_GENEVE_TTL, + IFLA_GENEVE_TOS, + IFLA_GENEVE_PORT, /* destination port */ + IFLA_GENEVE_COLLECT_METADATA, + IFLA_GENEVE_REMOTE6, + IFLA_GENEVE_UDP_CSUM, + IFLA_GENEVE_UDP_ZERO_CSUM6_TX, + IFLA_GENEVE_UDP_ZERO_CSUM6_RX, + IFLA_GENEVE_LABEL, + IFLA_GENEVE_TTL_INHERIT, + __IFLA_GENEVE_MAX +}; +#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1) +#else +#if !HAVE_IFLA_GENEVE_COLLECT_METADATA /* linux@e305ac6cf5a1e1386aedce7ef9cb773635d5845c (4.3) */ +#define IFLA_GENEVE_PORT 5 +#define IFLA_GENEVE_COLLECT_METADATA 6 +#endif +#if !HAVE_IFLA_GENEVE_REMOTE6 /* linux@8ed66f0e8235118a31720acdab3bbbe9debd0f6a (4.4) */ +#define IFLA_GENEVE_REMOTE6 7 +#endif +#if !HAVE_IFLA_GENEVE_UDP_ZERO_CSUM6_RX /* linux@abe492b4f50c3ae2ebcfaa2f5c16176aebaa1c68 (4.5) */ +#define IFLA_GENEVE_UDP_CSUM 8 +#define IFLA_GENEVE_UDP_ZERO_CSUM6_TX 9 +#define IFLA_GENEVE_UDP_ZERO_CSUM6_RX 10 +#endif +#if !HAVE_IFLA_GENEVE_LABEL /* linux@8eb3b99554b82da968d1fbc00df9f3156c5e2d63 (4.6) */ +#define IFLA_GENEVE_LABEL 11 +#endif +#if !HAVE_IFLA_GENEVE_TTL_INHERIT /* linux@52d0d404d39dd9eac71a181615d6ca15e23d8e38 (4.20) */ +#define IFLA_GENEVE_TTL_INHERIT 12 + +#undef IFLA_GENEVE_MAX +#define IFLA_GENEVE_MAX 12 +#endif +#endif + +#if !HAVE_IFLA_BR_MAX_AGE /* linux@e5c3ea5c668033b303e7ac835d7d91da32d97958 (3.18) */ +enum { + IFLA_BR_UNSPEC, + IFLA_BR_FORWARD_DELAY, + IFLA_BR_HELLO_TIME, + IFLA_BR_MAX_AGE, + IFLA_BR_AGEING_TIME, + IFLA_BR_STP_STATE, + IFLA_BR_PRIORITY, + IFLA_BR_VLAN_FILTERING, + IFLA_BR_VLAN_PROTOCOL, + IFLA_BR_GROUP_FWD_MASK, + IFLA_BR_ROOT_ID, + IFLA_BR_BRIDGE_ID, + IFLA_BR_ROOT_PORT, + IFLA_BR_ROOT_PATH_COST, + IFLA_BR_TOPOLOGY_CHANGE, + IFLA_BR_TOPOLOGY_CHANGE_DETECTED, + IFLA_BR_HELLO_TIMER, + IFLA_BR_TCN_TIMER, + IFLA_BR_TOPOLOGY_CHANGE_TIMER, + IFLA_BR_GC_TIMER, + IFLA_BR_GROUP_ADDR, + IFLA_BR_FDB_FLUSH, + IFLA_BR_MCAST_ROUTER, + IFLA_BR_MCAST_SNOOPING, + IFLA_BR_MCAST_QUERY_USE_IFADDR, + IFLA_BR_MCAST_QUERIER, + IFLA_BR_MCAST_HASH_ELASTICITY, + IFLA_BR_MCAST_HASH_MAX, + IFLA_BR_MCAST_LAST_MEMBER_CNT, + IFLA_BR_MCAST_STARTUP_QUERY_CNT, + IFLA_BR_MCAST_LAST_MEMBER_INTVL, + IFLA_BR_MCAST_MEMBERSHIP_INTVL, + IFLA_BR_MCAST_QUERIER_INTVL, + IFLA_BR_MCAST_QUERY_INTVL, + IFLA_BR_MCAST_QUERY_RESPONSE_INTVL, + IFLA_BR_MCAST_STARTUP_QUERY_INTVL, + IFLA_BR_NF_CALL_IPTABLES, + IFLA_BR_NF_CALL_IP6TABLES, + IFLA_BR_NF_CALL_ARPTABLES, + IFLA_BR_VLAN_DEFAULT_PVID, + IFLA_BR_PAD, + IFLA_BR_VLAN_STATS_ENABLED, + IFLA_BR_MCAST_STATS_ENABLED, + IFLA_BR_MCAST_IGMP_VERSION, + IFLA_BR_MCAST_MLD_VERSION, + IFLA_BR_VLAN_STATS_PER_PORT, + __IFLA_BR_MAX, +}; + +#define IFLA_BR_MAX (__IFLA_BR_MAX - 1) +#else +#if !HAVE_IFLA_BR_PRIORITY /* linux@af615762e972be0c66cf1d156ca4fac13b93c0b0 (4.1) */ +#define IFLA_BR_AGEING_TIME 4 +#define IFLA_BR_STP_STATE 5 +#define IFLA_BR_PRIORITY 6 +#endif +#if !HAVE_IFLA_BR_VLAN_PROTOCOL /* linux@a7854037da006a7472c48773e3190db55217ec9b, d2d427b3927bd7a0348fc7f323d0e291f79a2779 (4.3) */ +#define IFLA_BR_VLAN_FILTERING 7 +#define IFLA_BR_VLAN_PROTOCOL 8 +#endif +#if !HAVE_IFLA_BR_VLAN_DEFAULT_PVID /* linux@7910228b6bb35f3c8e0bc72a8d84c29616cb1b90..0f963b7592ef9e054974b6672b86ec1edd84b4bc (4.4) */ +#define IFLA_BR_GROUP_FWD_MASK 9 +#define IFLA_BR_ROOT_ID 10 +#define IFLA_BR_BRIDGE_ID 11 +#define IFLA_BR_ROOT_PORT 12 +#define IFLA_BR_ROOT_PATH_COST 13 +#define IFLA_BR_TOPOLOGY_CHANGE 14 +#define IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15 +#define IFLA_BR_HELLO_TIMER 16 +#define IFLA_BR_TCN_TIMER 17 +#define IFLA_BR_TOPOLOGY_CHANGE_TIMER 18 +#define IFLA_BR_GC_TIMER 19 +#define IFLA_BR_GROUP_ADDR 20 +#define IFLA_BR_FDB_FLUSH 21 +#define IFLA_BR_MCAST_ROUTER 22 +#define IFLA_BR_MCAST_SNOOPING 23 +#define IFLA_BR_MCAST_QUERY_USE_IFADDR 24 +#define IFLA_BR_MCAST_QUERIER 25 +#define IFLA_BR_MCAST_HASH_ELASTICITY 26 +#define IFLA_BR_MCAST_HASH_MAX 27 +#define IFLA_BR_MCAST_LAST_MEMBER_CNT 28 +#define IFLA_BR_MCAST_STARTUP_QUERY_CNT 29 +#define IFLA_BR_MCAST_LAST_MEMBER_INTVL 30 +#define IFLA_BR_MCAST_MEMBERSHIP_INTVL 31 +#define IFLA_BR_MCAST_QUERIER_INTVL 32 +#define IFLA_BR_MCAST_QUERY_INTVL 33 +#define IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34 +#define IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35 +#define IFLA_BR_NF_CALL_IPTABLES 36 +#define IFLA_BR_NF_CALL_IP6TABLES 37 +#define IFLA_BR_NF_CALL_ARPTABLES 38 +#define IFLA_BR_VLAN_DEFAULT_PVID 39 +#endif +#if !HAVE_IFLA_BR_VLAN_STATS_ENABLED /* linux@12a0faa3bd76157b9dc096758d6818ff535e4586, 6dada9b10a0818ba72c249526a742c8c41274a73 (4.7) */ +#define IFLA_BR_PAD 40 +#define IFLA_BR_VLAN_STATS_ENABLED 41 +#endif +#if !HAVE_IFLA_BR_MCAST_STATS_ENABLED /* linux@1080ab95e3c7bdd77870e209aff83c763fdcf439 (4.8) */ +#define IFLA_BR_MCAST_STATS_ENABLED 42 +#endif +#if !HAVE_IFLA_BR_MCAST_MLD_VERSION /* linux@5e9235853d652a295d5f56cb8652950b6b5bf56b, aa2ae3e71c74cc00ec22f133dc900b3817415785 (4.10) */ +#define IFLA_BR_MCAST_IGMP_VERSION 43 +#define IFLA_BR_MCAST_MLD_VERSION 44 +#endif +#if !HAVE_IFLA_BR_VLAN_STATS_PER_PORT /* linux@9163a0fc1f0c0980f117cc25f4fa6ba9b0750a36 (4.20) */ +#define IFLA_BR_VLAN_STATS_PER_PORT 45 + +#undef IFLA_BR_MAX +#define IFLA_BR_MAX 45 +#endif +#endif + +#if !HAVE_IFLA_BRPORT_LEARNING_SYNC /* linux@958501163ddd6ea22a98f94fa0e7ce6d4734e5c4, efacacdaf7cb5a0592ed772e3731636b2742e34a (3.19)*/ +#define IFLA_BRPORT_PROXYARP 10 +#define IFLA_BRPORT_LEARNING_SYNC 11 +#endif +#if !HAVE_IFLA_BRPORT_PROXYARP_WIFI /* linux@842a9ae08a25671db3d4f689eed68b4d64be15b5 (4.1) */ +#define IFLA_BRPORT_PROXYARP_WIFI 12 +#endif +#if !HAVE_IFLA_BRPORT_MULTICAST_ROUTER /* linux@4ebc7660ab4559cad10b6595e05f70562bb26dc5..5d6ae479ab7ddf77bb22bdf739268581453ff886 (4.4) */ +#define IFLA_BRPORT_ROOT_ID 13 +#define IFLA_BRPORT_BRIDGE_ID 14 +#define IFLA_BRPORT_DESIGNATED_PORT 15 +#define IFLA_BRPORT_DESIGNATED_COST 16 +#define IFLA_BRPORT_ID 17 +#define IFLA_BRPORT_NO 18 +#define IFLA_BRPORT_TOPOLOGY_CHANGE_ACK 19 +#define IFLA_BRPORT_CONFIG_PENDING 20 +#define IFLA_BRPORT_MESSAGE_AGE_TIMER 21 +#define IFLA_BRPORT_FORWARD_DELAY_TIMER 22 +#define IFLA_BRPORT_HOLD_TIMER 23 +#define IFLA_BRPORT_FLUSH 24 +#define IFLA_BRPORT_MULTICAST_ROUTER 25 +#endif +#if !HAVE_IFLA_BRPORT_PAD /* linux@12a0faa3bd76157b9dc096758d6818ff535e4586 (4.7) */ +#define IFLA_BRPORT_PAD 26 +#endif +#if !HAVE_IFLA_BRPORT_MCAST_FLOOD /* linux@b6cb5ac8331b6bcfe9ce38c7f7f58db6e1d6270a (4.9) */ +#define IFLA_BRPORT_MCAST_FLOOD 27 +#endif +#if !HAVE_IFLA_BRPORT_VLAN_TUNNEL /* linux@6db6f0eae6052b70885562e1733896647ec1d807, b3c7ef0adadc5768e0baa786213c6bd1ce521a77 (4.11) */ +#define IFLA_BRPORT_MCAST_TO_UCAST 28 +#define IFLA_BRPORT_VLAN_TUNNEL 29 +#endif +#if !HAVE_IFLA_BRPORT_BCAST_FLOOD /* linux@99f906e9ad7b6e79ffeda30f45906a8448b9d6a2 (4.12) */ +#define IFLA_BRPORT_BCAST_FLOOD 30 +#endif +#if !HAVE_IFLA_BRPORT_NEIGH_SUPPRESS /* linux@5af48b59f35cf712793badabe1a574a0d0ce3bd3, 821f1b21cabb46827ce39ddf82e2789680b5042a (4.15) */ +#define IFLA_BRPORT_GROUP_FWD_MASK 31 +#define IFLA_BRPORT_NEIGH_SUPPRESS 32 +#endif +#if !HAVE_IFLA_BRPORT_ISOLATED /* linux@7d850abd5f4edb1b1ca4b4141a4453305736f564 (4.18) */ +#define IFLA_BRPORT_ISOLATED 33 +#endif +#if !HAVE_IFLA_BRPORT_BACKUP_PORT /* linux@2756f68c314917d03eb348084edb08bb929139d9 (4.19) */ +#define IFLA_BRPORT_BACKUP_PORT 34 + +#undef IFLA_BRPORT_MAX +#define IFLA_BRPORT_MAX 34 +#endif + +#if !HAVE_IFLA_VRF_TABLE /* linux@4e3c89920cd3a6cfce22c6f537690747c26128dd (4.3) */ +enum { + IFLA_VRF_UNSPEC, + IFLA_VRF_TABLE, + __IFLA_VRF_MAX +}; +#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1) +#endif diff --git a/src/basic/missing_if_tunnel.h b/src/basic/missing_if_tunnel.h new file mode 100644 index 0000000000..f51fdd1ed7 --- /dev/null +++ b/src/basic/missing_if_tunnel.h @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if !HAVE_IFLA_VTI_FWMARK /* linux@0a473b82cb23e7a35c4be6e9765c8487a65e8f55 (4.12) */ +#define IFLA_VTI_FWMARK 6 + +#undef IFLA_VTI_MAX +#define IFLA_VTI_MAX 6 +#endif + +#if !HAVE_IFLA_IPTUN_ENCAP_DPORT /* linux@56328486539ddd07cbaafec7a542a2c8a3043623 (3.18)*/ +#define IFLA_IPTUN_ENCAP_TYPE 15 +#define IFLA_IPTUN_ENCAP_FLAGS 16 +#define IFLA_IPTUN_ENCAP_SPORT 17 +#define IFLA_IPTUN_ENCAP_DPORT 18 +#endif + +#if !HAVE_IFLA_IPTUN_COLLECT_METADATA /* linux@cfc7381b3002756b1dcada32979e942aa3126e31 (4.9) */ +#define IFLA_IPTUN_COLLECT_METADATA 19 +#endif + +#if !HAVE_IFLA_IPTUN_FWMARK /* linux@0a473b82cb23e7a35c4be6e9765c8487a65e8f55 (4.12) */ +#define IFLA_IPTUN_FWMARK 20 + +#undef IFLA_IPTUN_MAX +#define IFLA_IPTUN_MAX 20 +#endif + +#if !HAVE_IFLA_GRE_ENCAP_DPORT /* linux@4565e9919cda747815547e2e5d7b78f15efbffdf (3.18) */ +#define IFLA_GRE_ENCAP_TYPE 14 +#define IFLA_GRE_ENCAP_FLAGS 15 +#define IFLA_GRE_ENCAP_SPORT 16 +#define IFLA_GRE_ENCAP_DPORT 17 +#endif + +#if !HAVE_IFLA_GRE_COLLECT_METADATA /* linux@2e15ea390e6f4466655066d97e22ec66870a042c (4.3) */ +#define IFLA_GRE_COLLECT_METADATA 18 +#endif + +#if !HAVE_IFLA_GRE_IGNORE_DF /* linux@22a59be8b7693eb2d0897a9638f5991f2f8e4ddd (4.8) */ +#define IFLA_GRE_IGNORE_DF 19 +#endif + +#if !HAVE_IFLA_GRE_FWMARK /* linux@0a473b82cb23e7a35c4be6e9765c8487a65e8f55 (4.12) */ +#define IFLA_GRE_FWMARK 20 +#endif + +#if !HAVE_IFLA_GRE_ERSPAN_INDEX /* linux@84e54fe0a5eaed696dee4019c396f8396f5a908b (4.14) */ +#define IFLA_GRE_ERSPAN_INDEX 21 +#endif + +#if !HAVE_IFLA_GRE_ERSPAN_HWID /* linux@f551c91de262ba36b20c3ac19538afb4f4507441 (4.16) */ +#define IFLA_GRE_ERSPAN_VER 22 +#define IFLA_GRE_ERSPAN_DIR 23 +#define IFLA_GRE_ERSPAN_HWID 24 + +#undef IFLA_GRE_MAX +#define IFLA_GRE_MAX 24 +#endif diff --git a/src/basic/missing_network.h b/src/basic/missing_network.h new file mode 100644 index 0000000000..cba236b64d --- /dev/null +++ b/src/basic/missing_network.h @@ -0,0 +1,130 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#include +#include + +#include "missing_ethtool.h" +#include "missing_fib_rules.h" +#include "missing_fou.h" +#include "missing_if_bridge.h" +#include "missing_if_link.h" +#include "missing_if_tunnel.h" +#include "missing_vxcan.h" + +/* if.h */ +/* The following two defines are actually available in the kernel headers for longer, but we define them here anyway, + * since that makes it easier to use them in conjunction with the glibc net/if.h header which conflicts with + * linux/if.h. */ +#ifndef IF_OPER_UNKNOWN +#define IF_OPER_UNKNOWN 0 +#endif + +#ifndef IF_OPER_UP +#define IF_OPER_UP 6 +#endif + +#ifndef IFF_LOWER_UP +#define IFF_LOWER_UP 0x10000 +#endif + +#ifndef IFF_DORMANT +#define IFF_DORMANT 0x20000 +#endif + +/* if_addr.h */ +#if !HAVE_IFA_FLAGS +#define IFA_FLAGS 8 +#endif + +#ifndef IFA_F_MANAGETEMPADDR +#define IFA_F_MANAGETEMPADDR 0x100 +#endif + +#ifndef IFA_F_NOPREFIXROUTE +#define IFA_F_NOPREFIXROUTE 0x200 +#endif + +#ifndef IFA_F_MCAUTOJOIN +#define IFA_F_MCAUTOJOIN 0x400 +#endif + +/* if_bonding.h */ +#ifndef BOND_XMIT_POLICY_ENCAP23 +#define BOND_XMIT_POLICY_ENCAP23 3 +#endif + +#ifndef BOND_XMIT_POLICY_ENCAP34 +#define BOND_XMIT_POLICY_ENCAP34 4 +#endif + +/* if_tun.h */ +#ifndef IFF_MULTI_QUEUE +#define IFF_MULTI_QUEUE 0x100 +#endif + +/* in6.h */ +#ifndef IPV6_UNICAST_IF +#define IPV6_UNICAST_IF 76 +#endif + +/* ip.h */ +#ifndef IPV4_MIN_MTU +#define IPV4_MIN_MTU 68 +#endif + +/* ipv6.h */ +#ifndef IPV6_MIN_MTU +#define IPV6_MIN_MTU 1280 +#endif + +/* loop.h */ +#if !HAVE_LO_FLAGS_PARTSCAN +#define LO_FLAGS_PARTSCAN 8 +#endif + +#ifndef LOOP_CTL_REMOVE +#define LOOP_CTL_REMOVE 0x4C81 +#endif + +#ifndef LOOP_CTL_GET_FREE +#define LOOP_CTL_GET_FREE 0x4C82 +#endif + +/* netdevice.h */ +#ifndef NET_ADDR_RANDOM +#define NET_ADDR_RANDOM 1 +#endif + +#ifndef NET_NAME_UNKNOWN +#define NET_NAME_UNKNOWN 0 +#endif + +#ifndef NET_NAME_ENUM +#define NET_NAME_ENUM 1 +#endif + +#ifndef NET_NAME_PREDICTABLE +#define NET_NAME_PREDICTABLE 2 +#endif + +#ifndef NET_NAME_USER +#define NET_NAME_USER 3 +#endif + +#ifndef NET_NAME_RENAMED +#define NET_NAME_RENAMED 4 +#endif + +/* rtnetlink.h */ +#ifndef RTA_PREF +#define RTA_PREF 20 +#endif + +#ifndef RTAX_QUICKACK +#define RTAX_QUICKACK 15 +#endif + +#ifndef RTA_EXPIRES +#define RTA_EXPIRES 23 +#endif diff --git a/src/basic/missing_vxcan.h b/src/basic/missing_vxcan.h new file mode 100644 index 0000000000..be430f708d --- /dev/null +++ b/src/basic/missing_vxcan.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: LGPL-2.1+ */ +#pragma once + +#if !HAVE_LINUX_CAN_VXCAN_H /* linux@a8f820a380a2a06fc4fe1a54159067958f800929 (4.12) */ +enum { + VXCAN_INFO_UNSPEC, + VXCAN_INFO_PEER, + + __VXCAN_INFO_MAX +#define VXCAN_INFO_MAX (__VXCAN_INFO_MAX - 1) +}; +#endif diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c index 823e654d11..874babc9ef 100644 --- a/src/libsystemd/sd-netlink/netlink-types.c +++ b/src/libsystemd/sd-netlink/netlink-types.c @@ -21,7 +21,7 @@ #include #endif -#if HAVE_VXCAN_INFO_PEER +#if HAVE_LINUX_CAN_VXCAN_H #include #endif diff --git a/src/network/netdev/vxcan.c b/src/network/netdev/vxcan.c index f8139b52c3..e8ea70a1ed 100644 --- a/src/network/netdev/vxcan.c +++ b/src/network/netdev/vxcan.c @@ -1,7 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include "netdev/vxcan.h" +#if HAVE_LINUX_CAN_VXCAN_H +#include +#endif + #include "missing.h" +#include "netdev/vxcan.h" static int netdev_vxcan_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) { VxCan *v; diff --git a/src/network/netdev/vxcan.h b/src/network/netdev/vxcan.h index 417672c474..b5de19740f 100644 --- a/src/network/netdev/vxcan.h +++ b/src/network/netdev/vxcan.h @@ -3,10 +3,6 @@ typedef struct VxCan VxCan; -#if HAVE_VXCAN_INFO_PEER -#include -#endif - #include "netdev/netdev.h" struct VxCan {