From 18e038c8ee1d315bcf6e5365414c1b1ddcc06c1c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 25 Oct 2024 10:00:44 +0200 Subject: [PATCH] unix: move NETLINK_* consts to own section This makes it easier to distinguish them from the IFLA_* and add new entries. Also refresh the IFLA_* consts while at it. Change-Id: I94aa56c9f99d0714668d8150cb6185d57e2d789c Reviewed-on: https://go-review.googlesource.com/c/sys/+/622515 Auto-Submit: Tobias Klauser Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Carlos Amedee --- unix/linux/types.go | 24 +++++++++++++++++------- unix/ztypes_linux.go | 20 ++++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/unix/linux/types.go b/unix/linux/types.go index 8a5a6a736..8109005cf 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -1583,7 +1583,7 @@ const ( ) // generated by: -// perl -nlE '/^\s*((IFLA|NETKIT)\w+)/ && say "$1 = C.$1"' /usr/include/linux/if_link.h +// perl -nlE '/^\s*(IFLA\w+)/ && say "$1 = C.$1"' /usr/include/linux/if_link.h const ( IFLA_UNSPEC = C.IFLA_UNSPEC IFLA_ADDRESS = C.IFLA_ADDRESS @@ -1814,12 +1814,6 @@ const ( IFLA_IPVLAN_UNSPEC = C.IFLA_IPVLAN_UNSPEC IFLA_IPVLAN_MODE = C.IFLA_IPVLAN_MODE IFLA_IPVLAN_FLAGS = C.IFLA_IPVLAN_FLAGS - NETKIT_NEXT = C.NETKIT_NEXT - NETKIT_PASS = C.NETKIT_PASS - NETKIT_DROP = C.NETKIT_DROP - NETKIT_REDIRECT = C.NETKIT_REDIRECT - NETKIT_L2 = C.NETKIT_L2 - NETKIT_L3 = C.NETKIT_L3 IFLA_NETKIT_UNSPEC = C.IFLA_NETKIT_UNSPEC IFLA_NETKIT_PEER_INFO = C.IFLA_NETKIT_PEER_INFO IFLA_NETKIT_PRIMARY = C.IFLA_NETKIT_PRIMARY @@ -1858,6 +1852,7 @@ const ( IFLA_VXLAN_DF = C.IFLA_VXLAN_DF IFLA_VXLAN_VNIFILTER = C.IFLA_VXLAN_VNIFILTER IFLA_VXLAN_LOCALBYPASS = C.IFLA_VXLAN_LOCALBYPASS + IFLA_VXLAN_LABEL_POLICY = C.IFLA_VXLAN_LABEL_POLICY IFLA_GENEVE_UNSPEC = C.IFLA_GENEVE_UNSPEC IFLA_GENEVE_ID = C.IFLA_GENEVE_ID IFLA_GENEVE_REMOTE = C.IFLA_GENEVE_REMOTE @@ -1887,6 +1882,8 @@ const ( IFLA_GTP_ROLE = C.IFLA_GTP_ROLE IFLA_GTP_CREATE_SOCKETS = C.IFLA_GTP_CREATE_SOCKETS IFLA_GTP_RESTART_COUNT = C.IFLA_GTP_RESTART_COUNT + IFLA_GTP_LOCAL = C.IFLA_GTP_LOCAL + IFLA_GTP_LOCAL6 = C.IFLA_GTP_LOCAL6 IFLA_BOND_UNSPEC = C.IFLA_BOND_UNSPEC IFLA_BOND_MODE = C.IFLA_BOND_MODE IFLA_BOND_ACTIVE_SLAVE = C.IFLA_BOND_ACTIVE_SLAVE @@ -1919,6 +1916,7 @@ const ( IFLA_BOND_AD_LACP_ACTIVE = C.IFLA_BOND_AD_LACP_ACTIVE IFLA_BOND_MISSED_MAX = C.IFLA_BOND_MISSED_MAX IFLA_BOND_NS_IP6_TARGET = C.IFLA_BOND_NS_IP6_TARGET + IFLA_BOND_COUPLED_CONTROL = C.IFLA_BOND_COUPLED_CONTROL IFLA_BOND_AD_INFO_UNSPEC = C.IFLA_BOND_AD_INFO_UNSPEC IFLA_BOND_AD_INFO_AGGREGATOR = C.IFLA_BOND_AD_INFO_AGGREGATOR IFLA_BOND_AD_INFO_NUM_PORTS = C.IFLA_BOND_AD_INFO_NUM_PORTS @@ -1987,6 +1985,7 @@ const ( IFLA_HSR_SEQ_NR = C.IFLA_HSR_SEQ_NR IFLA_HSR_VERSION = C.IFLA_HSR_VERSION IFLA_HSR_PROTOCOL = C.IFLA_HSR_PROTOCOL + IFLA_HSR_INTERLINK = C.IFLA_HSR_INTERLINK IFLA_STATS_UNSPEC = C.IFLA_STATS_UNSPEC IFLA_STATS_LINK_64 = C.IFLA_STATS_LINK_64 IFLA_STATS_LINK_XSTATS = C.IFLA_STATS_LINK_XSTATS @@ -2039,6 +2038,17 @@ const ( IFLA_DSA_MASTER = C.IFLA_DSA_MASTER ) +// netkit +// perl -nlE '/^\s*(NETKIT\w+)/ && say "$1 = C.$1"' /usr/include/linux/if_link.h +const ( + NETKIT_NEXT = C.NETKIT_NEXT + NETKIT_PASS = C.NETKIT_PASS + NETKIT_DROP = C.NETKIT_DROP + NETKIT_REDIRECT = C.NETKIT_REDIRECT + NETKIT_L2 = C.NETKIT_L2 + NETKIT_L3 = C.NETKIT_L3 +) + // netfilter // generated using: // perl -nlE '/^\s*(NF\w+)/ && say "$1 = C.$1"' /usr/include/linux/netfilter.h diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go index 384850ed3..8daaf3faf 100644 --- a/unix/ztypes_linux.go +++ b/unix/ztypes_linux.go @@ -1752,12 +1752,6 @@ const ( IFLA_IPVLAN_UNSPEC = 0x0 IFLA_IPVLAN_MODE = 0x1 IFLA_IPVLAN_FLAGS = 0x2 - NETKIT_NEXT = -0x1 - NETKIT_PASS = 0x0 - NETKIT_DROP = 0x2 - NETKIT_REDIRECT = 0x7 - NETKIT_L2 = 0x0 - NETKIT_L3 = 0x1 IFLA_NETKIT_UNSPEC = 0x0 IFLA_NETKIT_PEER_INFO = 0x1 IFLA_NETKIT_PRIMARY = 0x2 @@ -1796,6 +1790,7 @@ const ( IFLA_VXLAN_DF = 0x1d IFLA_VXLAN_VNIFILTER = 0x1e IFLA_VXLAN_LOCALBYPASS = 0x1f + IFLA_VXLAN_LABEL_POLICY = 0x20 IFLA_GENEVE_UNSPEC = 0x0 IFLA_GENEVE_ID = 0x1 IFLA_GENEVE_REMOTE = 0x2 @@ -1825,6 +1820,8 @@ const ( IFLA_GTP_ROLE = 0x4 IFLA_GTP_CREATE_SOCKETS = 0x5 IFLA_GTP_RESTART_COUNT = 0x6 + IFLA_GTP_LOCAL = 0x7 + IFLA_GTP_LOCAL6 = 0x8 IFLA_BOND_UNSPEC = 0x0 IFLA_BOND_MODE = 0x1 IFLA_BOND_ACTIVE_SLAVE = 0x2 @@ -1857,6 +1854,7 @@ const ( IFLA_BOND_AD_LACP_ACTIVE = 0x1d IFLA_BOND_MISSED_MAX = 0x1e IFLA_BOND_NS_IP6_TARGET = 0x1f + IFLA_BOND_COUPLED_CONTROL = 0x20 IFLA_BOND_AD_INFO_UNSPEC = 0x0 IFLA_BOND_AD_INFO_AGGREGATOR = 0x1 IFLA_BOND_AD_INFO_NUM_PORTS = 0x2 @@ -1925,6 +1923,7 @@ const ( IFLA_HSR_SEQ_NR = 0x5 IFLA_HSR_VERSION = 0x6 IFLA_HSR_PROTOCOL = 0x7 + IFLA_HSR_INTERLINK = 0x8 IFLA_STATS_UNSPEC = 0x0 IFLA_STATS_LINK_64 = 0x1 IFLA_STATS_LINK_XSTATS = 0x2 @@ -1977,6 +1976,15 @@ const ( IFLA_DSA_MASTER = 0x1 ) +const ( + NETKIT_NEXT = -0x1 + NETKIT_PASS = 0x0 + NETKIT_DROP = 0x2 + NETKIT_REDIRECT = 0x7 + NETKIT_L2 = 0x0 + NETKIT_L3 = 0x1 +) + const ( NF_INET_PRE_ROUTING = 0x0 NF_INET_LOCAL_IN = 0x1