nl

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 15 Imported by: 915

Documentation

Overview

Package nl has low level primitives for making Netlink calls.

Index

Constants

View Source
const (
	BRIDGE_FLAGS_MASTER = iota + 1 /* Bridge command to/from master */
	BRIDGE_FLAGS_SELF              /* Bridge command to/from lowerdev */
)

Bridge Flags

View Source
const (
	IFLA_BRIDGE_FLAGS = iota
	IFLA_BRIDGE_MODE
	IFLA_BRIDGE_VLAN_INFO
)

Bridge management nested attributes * [IFLA_AF_SPEC] = { * IFLA_BRIDGE_FLAGS * IFLA_BRIDGE_MODE * IFLA_BRIDGE_VLAN_INFO * }

View Source
const (
	BRIDGE_VLAN_INFO_MASTER = 1 << iota
	BRIDGE_VLAN_INFO_PVID
	BRIDGE_VLAN_INFO_UNTAGGED
	BRIDGE_VLAN_INFO_RANGE_BEGIN
	BRIDGE_VLAN_INFO_RANGE_END
)
View Source
const (
	RTEXT_FILTER_VF = 1 << iota
	RTEXT_FILTER_BRVLAN
	RTEXT_FILTER_BRVLAN_COMPRESSED
)

New extended info filters for IFLA_EXT_MASK

View Source
const (
	SizeofNfgenmsg      = 4
	SizeofNfattr        = 4
	SizeofNfConntrack   = 376
	SizeofNfctTupleHead = 52
)

Track the message sizes for the correct serialization/deserialization

View Source
const (
	TCP_CONNTRACK_NONE        = 0
	TCP_CONNTRACK_SYN_SENT    = 1
	TCP_CONNTRACK_SYN_RECV    = 2
	TCP_CONNTRACK_ESTABLISHED = 3
	TCP_CONNTRACK_FIN_WAIT    = 4
	TCP_CONNTRACK_CLOSE_WAIT  = 5
	TCP_CONNTRACK_LAST_ACK    = 6
	TCP_CONNTRACK_TIME_WAIT   = 7
	TCP_CONNTRACK_CLOSE       = 8
	TCP_CONNTRACK_LISTEN      = 9
	TCP_CONNTRACK_SYN_SENT2   = 9
	TCP_CONNTRACK_MAX         = 10
	TCP_CONNTRACK_IGNORE      = 11
)

From https://git.netfilter.org/libnetfilter_conntrack/tree/include/libnetfilter_conntrack/libnetfilter_conntrack_tcp.h

 enum tcp_state {
	TCP_CONNTRACK_NONE,
	TCP_CONNTRACK_SYN_SENT,
	TCP_CONNTRACK_SYN_RECV,
	TCP_CONNTRACK_ESTABLISHED,
	TCP_CONNTRACK_FIN_WAIT,
	TCP_CONNTRACK_CLOSE_WAIT,
	TCP_CONNTRACK_LAST_ACK,
	TCP_CONNTRACK_TIME_WAIT,
	TCP_CONNTRACK_CLOSE,
	TCP_CONNTRACK_LISTEN,		/* obsolete */
#define TCP_CONNTRACK_SYN_SENT2		TCP_CONNTRACK_LISTEN
	TCP_CONNTRACK_MAX,
	TCP_CONNTRACK_IGNORE
 };
View Source
const (
	IPCTNL_MSG_CT_NEW    = 0
	IPCTNL_MSG_CT_GET    = 1
	IPCTNL_MSG_CT_DELETE = 2
)
enum cntl_msg_types {
	IPCTNL_MSG_CT_NEW,
	IPCTNL_MSG_CT_GET,
	IPCTNL_MSG_CT_DELETE,
	IPCTNL_MSG_CT_GET_CTRZERO,
	IPCTNL_MSG_CT_GET_STATS_CPU,
	IPCTNL_MSG_CT_GET_STATS,
	IPCTNL_MSG_CT_GET_DYING,
	IPCTNL_MSG_CT_GET_UNCONFIRMED,

	IPCTNL_MSG_MAX
};
View Source
const (
	NLA_F_NESTED        uint16 = (1 << 15) // #define NLA_F_NESTED (1 << 15)
	NLA_F_NET_BYTEORDER uint16 = (1 << 14) // #define NLA_F_NESTED (1 << 14)
	NLA_TYPE_MASK              = ^(NLA_F_NESTED | NLA_F_NET_BYTEORDER)
	NLA_ALIGNTO         uint16 = 4 // #define NLA_ALIGNTO 4
)
View Source
const (
	CTA_TUPLE_ORIG     = 1
	CTA_TUPLE_REPLY    = 2
	CTA_STATUS         = 3
	CTA_PROTOINFO      = 4
	CTA_TIMEOUT        = 7
	CTA_MARK           = 8
	CTA_COUNTERS_ORIG  = 9
	CTA_COUNTERS_REPLY = 10
	CTA_USE            = 11
	CTA_ID             = 12
	CTA_ZONE           = 18
	CTA_TIMESTAMP      = 20
	CTA_LABELS         = 22
	CTA_LABELS_MASK    = 23
)
enum ctattr_type {
	CTA_UNSPEC,
	CTA_TUPLE_ORIG,
	CTA_TUPLE_REPLY,
	CTA_STATUS,
	CTA_PROTOINFO,
	CTA_HELP,
	CTA_NAT_SRC,

#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */

	CTA_TIMEOUT,
	CTA_MARK,
	CTA_COUNTERS_ORIG,
	CTA_COUNTERS_REPLY,
	CTA_USE,
	CTA_ID,
	CTA_NAT_DST,
	CTA_TUPLE_MASTER,
	CTA_SEQ_ADJ_ORIG,
	CTA_NAT_SEQ_ADJ_ORIG	= CTA_SEQ_ADJ_ORIG,
	CTA_SEQ_ADJ_REPLY,
	CTA_NAT_SEQ_ADJ_REPLY	= CTA_SEQ_ADJ_REPLY,
	CTA_SECMARK,		/* obsolete */
	CTA_ZONE,
	CTA_SECCTX,
	CTA_TIMESTAMP,
	CTA_MARK_MASK,
	CTA_LABELS,
	CTA_LABELS_MASK,
	__CTA_MAX
};
View Source
const (
	CTA_TUPLE_IP    = 1
	CTA_TUPLE_PROTO = 2
)
enum ctattr_tuple {
	CTA_TUPLE_UNSPEC,
	CTA_TUPLE_IP,
	CTA_TUPLE_PROTO,
	CTA_TUPLE_ZONE,
	__CTA_TUPLE_MAX
};

#define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1)

View Source
const (
	CTA_IP_V4_SRC = 1
	CTA_IP_V4_DST = 2
	CTA_IP_V6_SRC = 3
	CTA_IP_V6_DST = 4
)
enum ctattr_ip {
	CTA_IP_UNSPEC,
	CTA_IP_V4_SRC,
	CTA_IP_V4_DST,
	CTA_IP_V6_SRC,
	CTA_IP_V6_DST,
	__CTA_IP_MAX
};

#define CTA_IP_MAX (__CTA_IP_MAX - 1)

View Source
const (
	CTA_PROTO_NUM      = 1
	CTA_PROTO_SRC_PORT = 2
	CTA_PROTO_DST_PORT = 3
)
enum ctattr_l4proto {
	CTA_PROTO_UNSPEC,
	CTA_PROTO_NUM,
	CTA_PROTO_SRC_PORT,
	CTA_PROTO_DST_PORT,
	CTA_PROTO_ICMP_ID,
	CTA_PROTO_ICMP_TYPE,
	CTA_PROTO_ICMP_CODE,
	CTA_PROTO_ICMPV6_ID,
	CTA_PROTO_ICMPV6_TYPE,
	CTA_PROTO_ICMPV6_CODE,
	__CTA_PROTO_MAX
};

#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1)

View Source
const (
	CTA_PROTOINFO_UNSPEC = 0
	CTA_PROTOINFO_TCP    = 1
	CTA_PROTOINFO_DCCP   = 2
	CTA_PROTOINFO_SCTP   = 3
)
enum ctattr_protoinfo {
	CTA_PROTOINFO_UNSPEC,
	CTA_PROTOINFO_TCP,
	CTA_PROTOINFO_DCCP,
	CTA_PROTOINFO_SCTP,
	__CTA_PROTOINFO_MAX
};

#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)

View Source
const (
	CTA_PROTOINFO_TCP_STATE           = 1
	CTA_PROTOINFO_TCP_WSCALE_ORIGINAL = 2
	CTA_PROTOINFO_TCP_WSCALE_REPLY    = 3
	CTA_PROTOINFO_TCP_FLAGS_ORIGINAL  = 4
	CTA_PROTOINFO_TCP_FLAGS_REPLY     = 5
)
enum ctattr_protoinfo_tcp {
	CTA_PROTOINFO_TCP_UNSPEC,
	CTA_PROTOINFO_TCP_STATE,
	CTA_PROTOINFO_TCP_WSCALE_ORIGINAL,
	CTA_PROTOINFO_TCP_WSCALE_REPLY,
	CTA_PROTOINFO_TCP_FLAGS_ORIGINAL,
	CTA_PROTOINFO_TCP_FLAGS_REPLY,
	__CTA_PROTOINFO_TCP_MAX
};

#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)

View Source
const (
	CTA_COUNTERS_PACKETS = 1
	CTA_COUNTERS_BYTES   = 2
)
enum ctattr_counters {
	CTA_COUNTERS_UNSPEC,
	CTA_COUNTERS_PACKETS,		/* 64bit counters */
	CTA_COUNTERS_BYTES,		/* 64bit counters */
	CTA_COUNTERS32_PACKETS,		/* old 32bit counters, unused */
	CTA_COUNTERS32_BYTES,		/* old 32bit counters, unused */
	CTA_COUNTERS_PAD,
	__CTA_COUNTERS_M
};

#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)

View Source
const (
	CTA_TIMESTAMP_START = 1
	CTA_TIMESTAMP_STOP  = 2
)

enum CTA TIMESTAMP TLVs CTA_TIMESTAMP_START /* 64bit value */ CTA_TIMESTAMP_STOP /* 64bit value */

View Source
const (
	GENL_DEVLINK_VERSION = 1
	GENL_DEVLINK_NAME    = "devlink"
)
View Source
const (
	DEVLINK_CMD_GET           = 1
	DEVLINK_CMD_PORT_GET      = 5
	DEVLINK_CMD_PORT_SET      = 6
	DEVLINK_CMD_PORT_NEW      = 7
	DEVLINK_CMD_PORT_DEL      = 8
	DEVLINK_CMD_ESWITCH_GET   = 29
	DEVLINK_CMD_ESWITCH_SET   = 30
	DEVLINK_CMD_RESOURCE_DUMP = 36
	DEVLINK_CMD_PARAM_GET     = 38
	DEVLINK_CMD_PARAM_SET     = 39
	DEVLINK_CMD_INFO_GET      = 51
)
View Source
const (
	DEVLINK_ATTR_BUS_NAME                   = 1
	DEVLINK_ATTR_DEV_NAME                   = 2
	DEVLINK_ATTR_PORT_INDEX                 = 3
	DEVLINK_ATTR_PORT_TYPE                  = 4
	DEVLINK_ATTR_PORT_NETDEV_IFINDEX        = 6
	DEVLINK_ATTR_PORT_NETDEV_NAME           = 7
	DEVLINK_ATTR_PORT_IBDEV_NAME            = 8
	DEVLINK_ATTR_ESWITCH_MODE               = 25
	DEVLINK_ATTR_ESWITCH_INLINE_MODE        = 26
	DEVLINK_ATTR_ESWITCH_ENCAP_MODE         = 62
	DEVLINK_ATTR_RESOURCE_LIST              = 63 /* nested */
	DEVLINK_ATTR_RESOURCE                   = 64 /* nested */
	DEVLINK_ATTR_RESOURCE_NAME              = 65 /* string */
	DEVLINK_ATTR_RESOURCE_ID                = 66 /* u64 */
	DEVLINK_ATTR_RESOURCE_SIZE              = 67 /* u64 */
	DEVLINK_ATTR_RESOURCE_SIZE_NEW          = 68 /* u64 */
	DEVLINK_ATTR_RESOURCE_SIZE_VALID        = 69 /* u8 */
	DEVLINK_ATTR_RESOURCE_SIZE_MIN          = 70 /* u64 */
	DEVLINK_ATTR_RESOURCE_SIZE_MAX          = 71 /* u64 */
	DEVLINK_ATTR_RESOURCE_SIZE_GRAN         = 72 /* u64 */
	DEVLINK_ATTR_RESOURCE_UNIT              = 73 /* u8 */
	DEVLINK_ATTR_RESOURCE_OCC               = 74 /* u64 */
	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_ID    = 75 /* u64 */
	DEVLINK_ATTR_DPIPE_TABLE_RESOURCE_UNITS = 76 /* u64 */
	DEVLINK_ATTR_PORT_FLAVOUR               = 77
	DEVLINK_ATTR_INFO_DRIVER_NAME           = 98
	DEVLINK_ATTR_INFO_SERIAL_NUMBER         = 99
	DEVLINK_ATTR_INFO_VERSION_FIXED         = 100
	DEVLINK_ATTR_INFO_VERSION_RUNNING       = 101
	DEVLINK_ATTR_INFO_VERSION_STORED        = 102
	DEVLINK_ATTR_INFO_VERSION_NAME          = 103
	DEVLINK_ATTR_INFO_VERSION_VALUE         = 104
	DEVLINK_ATTR_PORT_PCI_PF_NUMBER         = 127
	DEVLINK_ATTR_PORT_FUNCTION              = 145
	DEVLINK_ATTR_PORT_CONTROLLER_NUMBER     = 150
	DEVLINK_ATTR_PORT_PCI_SF_NUMBER         = 164
)
View Source
const (
	DEVLINK_ESWITCH_MODE_LEGACY    = 0
	DEVLINK_ESWITCH_MODE_SWITCHDEV = 1
)
View Source
const (
	DEVLINK_ESWITCH_INLINE_MODE_NONE      = 0
	DEVLINK_ESWITCH_INLINE_MODE_LINK      = 1
	DEVLINK_ESWITCH_INLINE_MODE_NETWORK   = 2
	DEVLINK_ESWITCH_INLINE_MODE_TRANSPORT = 3
)
View Source
const (
	DEVLINK_ESWITCH_ENCAP_MODE_NONE  = 0
	DEVLINK_ESWITCH_ENCAP_MODE_BASIC = 1
)
View Source
const (
	DEVLINK_PORT_FLAVOUR_PHYSICAL = 0
	DEVLINK_PORT_FLAVOUR_CPU      = 1
	DEVLINK_PORT_FLAVOUR_DSA      = 2
	DEVLINK_PORT_FLAVOUR_PCI_PF   = 3
	DEVLINK_PORT_FLAVOUR_PCI_VF   = 4
	DEVLINK_PORT_FLAVOUR_VIRTUAL  = 5
	DEVLINK_PORT_FLAVOUR_UNUSED   = 6
	DEVLINK_PORT_FLAVOUR_PCI_SF   = 7
)
View Source
const (
	DEVLINK_PORT_TYPE_NOTSET = 0
	DEVLINK_PORT_TYPE_AUTO   = 1
	DEVLINK_PORT_TYPE_ETH    = 2
	DEVLINK_PORT_TYPE_IB     = 3
)
View Source
const (
	DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR = 1
	DEVLINK_PORT_FN_ATTR_STATE         = 2
	DEVLINK_PORT_FN_ATTR_OPSTATE       = 3
)
View Source
const (
	DEVLINK_PORT_FN_STATE_INACTIVE = 0
	DEVLINK_PORT_FN_STATE_ACTIVE   = 1
)
View Source
const (
	DEVLINK_PORT_FN_OPSTATE_DETACHED = 0
	DEVLINK_PORT_FN_OPSTATE_ATTACHED = 1
)
View Source
const (
	DEVLINK_ATTR_PARAM             = iota + 80 /* nested */
	DEVLINK_ATTR_PARAM_NAME                    /* string */
	DEVLINK_ATTR_PARAM_GENERIC                 /* flag */
	DEVLINK_ATTR_PARAM_TYPE                    /* u8 */
	DEVLINK_ATTR_PARAM_VALUES_LIST             /* nested */
	DEVLINK_ATTR_PARAM_VALUE                   /* nested */
	DEVLINK_ATTR_PARAM_VALUE_DATA              /* dynamic */
	DEVLINK_ATTR_PARAM_VALUE_CMODE             /* u8 */
)
View Source
const (
	DEVLINK_PARAM_TYPE_U8     = 1
	DEVLINK_PARAM_TYPE_U16    = 2
	DEVLINK_PARAM_TYPE_U32    = 3
	DEVLINK_PARAM_TYPE_STRING = 5
	DEVLINK_PARAM_TYPE_BOOL   = 6
)
View Source
const (
	DEVLINK_PARAM_CMODE_RUNTIME = iota
	DEVLINK_PARAM_CMODE_DRIVERINIT
	DEVLINK_PARAM_CMODE_PERMANENT
)
View Source
const (
	GENL_ID_CTRL      = 0x10
	GENL_CTRL_VERSION = 2
	GENL_CTRL_NAME    = "nlctrl"
)
View Source
const (
	GENL_CTRL_ATTR_UNSPEC = iota
	GENL_CTRL_ATTR_FAMILY_ID
	GENL_CTRL_ATTR_FAMILY_NAME
	GENL_CTRL_ATTR_VERSION
	GENL_CTRL_ATTR_HDRSIZE
	GENL_CTRL_ATTR_MAXATTR
	GENL_CTRL_ATTR_OPS
	GENL_CTRL_ATTR_MCAST_GROUPS
)
View Source
const (
	GENL_CTRL_ATTR_OP_UNSPEC = iota
	GENL_CTRL_ATTR_OP_ID
	GENL_CTRL_ATTR_OP_FLAGS
)
View Source
const (
	GENL_ADMIN_PERM = 1 << iota
	GENL_CMD_CAP_DO
	GENL_CMD_CAP_DUMP
	GENL_CMD_CAP_HASPOL
)
View Source
const (
	GENL_CTRL_ATTR_MCAST_GRP_UNSPEC = iota
	GENL_CTRL_ATTR_MCAST_GRP_NAME
	GENL_CTRL_ATTR_MCAST_GRP_ID
)
View Source
const (
	GENL_GTP_VERSION = 0
	GENL_GTP_NAME    = "gtp"
)
View Source
const (
	GENL_GTP_CMD_NEWPDP = iota
	GENL_GTP_CMD_DELPDP
	GENL_GTP_CMD_GETPDP
)
View Source
const (
	GENL_GTP_ATTR_UNSPEC = iota
	GENL_GTP_ATTR_LINK
	GENL_GTP_ATTR_VERSION
	GENL_GTP_ATTR_TID
	GENL_GTP_ATTR_PEER_ADDRESS
	GENL_GTP_ATTR_MS_ADDRESS
	GENL_GTP_ATTR_FLOW
	GENL_GTP_ATTR_NET_NS_FD
	GENL_GTP_ATTR_I_TEI
	GENL_GTP_ATTR_O_TEI
	GENL_GTP_ATTR_PAD
)
View Source
const (
	LWTUNNEL_IP6_UNSPEC = iota
	LWTUNNEL_IP6_ID
	LWTUNNEL_IP6_DST
	LWTUNNEL_IP6_SRC
	LWTUNNEL_IP6_HOPLIMIT
	LWTUNNEL_IP6_TC
	LWTUNNEL_IP6_FLAGS
	LWTUNNEL_IP6_PAD  // not implemented
	LWTUNNEL_IP6_OPTS // not implemented

)
View Source
const (
	/* The protocol version */
	IPSET_PROTOCOL = 6

	/* The max length of strings including NUL: set and type identifiers */
	IPSET_MAXNAMELEN = 32

	/* The maximum permissible comment length we will accept over netlink */
	IPSET_MAX_COMMENT_SIZE = 255
)
View Source
const (
	IPSET_CMD_PROTOCOL /* 1: Return protocol version */
	IPSET_CMD_CREATE   /* 2: Create a new (empty) set */
	IPSET_CMD_DESTROY  /* 3: Destroy a (empty) set */
	IPSET_CMD_FLUSH    /* 4: Remove all elements from a set */
	IPSET_CMD_RENAME   /* 5: Rename a set */
	IPSET_CMD_SWAP     /* 6: Swap two sets */
	IPSET_CMD_LIST     /* 7: List sets */
	IPSET_CMD_SAVE     /* 8: Save sets */
	IPSET_CMD_ADD      /* 9: Add an element to a set */
	IPSET_CMD_DEL      /* 10: Delete an element from a set */
	IPSET_CMD_TEST     /* 11: Test an element in a set */
	IPSET_CMD_HEADER   /* 12: Get set header data only */
	IPSET_CMD_TYPE     /* 13: Get set type */
)
View Source
const (
	IPSET_ATTR_PROTOCOL     /* 1: Protocol version */
	IPSET_ATTR_SETNAME      /* 2: Name of the set */
	IPSET_ATTR_TYPENAME     /* 3: Typename */
	IPSET_ATTR_REVISION     /* 4: Settype revision */
	IPSET_ATTR_FAMILY       /* 5: Settype family */
	IPSET_ATTR_FLAGS        /* 6: Flags at command level */
	IPSET_ATTR_DATA         /* 7: Nested attributes */
	IPSET_ATTR_ADT          /* 8: Multiple data containers */
	IPSET_ATTR_LINENO       /* 9: Restore lineno */
	IPSET_ATTR_PROTOCOL_MIN /* 10: Minimal supported version number */

	IPSET_ATTR_SETNAME2     = IPSET_ATTR_TYPENAME     /* Setname at rename/swap */
	IPSET_ATTR_REVISION_MIN = IPSET_ATTR_PROTOCOL_MIN /* type rev min */
)

Attributes at command level

View Source
const (
	IPSET_ATTR_IP          = 1
	IPSET_ATTR_IP_FROM     = 1
	IPSET_ATTR_IP_TO       = 2
	IPSET_ATTR_CIDR        = 3
	IPSET_ATTR_PORT        = 4
	IPSET_ATTR_PORT_FROM   = 4
	IPSET_ATTR_PORT_TO     = 5
	IPSET_ATTR_TIMEOUT     = 6
	IPSET_ATTR_PROTO       = 7
	IPSET_ATTR_CADT_FLAGS  = 8
	IPSET_ATTR_CADT_LINENO = IPSET_ATTR_LINENO /* 9 */
	IPSET_ATTR_MARK        = 10
	IPSET_ATTR_MARKMASK    = 11

	/* Reserve empty slots */
	IPSET_ATTR_CADT_MAX = 16

	/* Create-only specific attributes */
	IPSET_ATTR_GC = 3 + iota
	IPSET_ATTR_HASHSIZE
	IPSET_ATTR_MAXELEM
	IPSET_ATTR_NETMASK
	IPSET_ATTR_PROBES
	IPSET_ATTR_RESIZE
	IPSET_ATTR_SIZE

	/* Kernel-only */
	IPSET_ATTR_ELEMENTS
	IPSET_ATTR_REFERENCES
	IPSET_ATTR_MEMSIZE

	SET_ATTR_CREATE_MAX
)

CADT specific attributes

View Source
const (
	IPSET_ATTR_IPADDR_IPV4 = 1
	IPSET_ATTR_IPADDR_IPV6 = 2
)
View Source
const (
	IPSET_ATTR_ETHER = IPSET_ATTR_CADT_MAX + iota + 1
	IPSET_ATTR_NAME
	IPSET_ATTR_NAMEREF
	IPSET_ATTR_IP2
	IPSET_ATTR_CIDR2
	IPSET_ATTR_IP2_TO
	IPSET_ATTR_IFACE
	IPSET_ATTR_BYTES
	IPSET_ATTR_PACKETS
	IPSET_ATTR_COMMENT
	IPSET_ATTR_SKBMARK
	IPSET_ATTR_SKBPRIO
	IPSET_ATTR_SKBQUEUE
)

ADT specific attributes

View Source
const (
	IPSET_FLAG_BIT_BEFORE        = 0
	IPSET_FLAG_BEFORE            = (1 << IPSET_FLAG_BIT_BEFORE)
	IPSET_FLAG_BIT_PHYSDEV       = 1
	IPSET_FLAG_PHYSDEV           = (1 << IPSET_FLAG_BIT_PHYSDEV)
	IPSET_FLAG_BIT_NOMATCH       = 2
	IPSET_FLAG_NOMATCH           = (1 << IPSET_FLAG_BIT_NOMATCH)
	IPSET_FLAG_BIT_WITH_COUNTERS = 3
	IPSET_FLAG_WITH_COUNTERS     = (1 << IPSET_FLAG_BIT_WITH_COUNTERS)
	IPSET_FLAG_BIT_WITH_COMMENT  = 4
	IPSET_FLAG_WITH_COMMENT      = (1 << IPSET_FLAG_BIT_WITH_COMMENT)
	IPSET_FLAG_BIT_WITH_FORCEADD = 5
	IPSET_FLAG_WITH_FORCEADD     = (1 << IPSET_FLAG_BIT_WITH_FORCEADD)
	IPSET_FLAG_BIT_WITH_SKBINFO  = 6
	IPSET_FLAG_WITH_SKBINFO      = (1 << IPSET_FLAG_BIT_WITH_SKBINFO)
	IPSET_FLAG_CADT_MAX          = 15
)

Flags at CADT attribute level, upper half of cmdattrs

View Source
const (
	IPSET_ERR_PRIVATE = 4096 + iota
	IPSET_ERR_PROTOCOL
	IPSET_ERR_FIND_TYPE
	IPSET_ERR_MAX_SETS
	IPSET_ERR_BUSY
	IPSET_ERR_EXIST_SETNAME2
	IPSET_ERR_TYPE_MISMATCH
	IPSET_ERR_EXIST
	IPSET_ERR_INVALID_CIDR
	IPSET_ERR_INVALID_NETMASK
	IPSET_ERR_INVALID_FAMILY
	IPSET_ERR_TIMEOUT
	IPSET_ERR_REFERENCED
	IPSET_ERR_IPADDR_IPV4
	IPSET_ERR_IPADDR_IPV6
	IPSET_ERR_COUNTER
	IPSET_ERR_COMMENT
	IPSET_ERR_INVALID_MARKMASK
	IPSET_ERR_SKBINFO

	/* Type specific error codes */
	IPSET_ERR_TYPE_SPECIFIC = 4352
)
View Source
const (
	IFLA_INFO_UNSPEC = iota
	IFLA_INFO_KIND
	IFLA_INFO_DATA
	IFLA_INFO_XSTATS
	IFLA_INFO_SLAVE_KIND
	IFLA_INFO_SLAVE_DATA
	IFLA_INFO_MAX = IFLA_INFO_SLAVE_DATA
)
View Source
const (
	IFLA_VLAN_UNSPEC = iota
	IFLA_VLAN_ID
	IFLA_VLAN_FLAGS
	IFLA_VLAN_EGRESS_QOS
	IFLA_VLAN_INGRESS_QOS
	IFLA_VLAN_PROTOCOL
	IFLA_VLAN_MAX = IFLA_VLAN_PROTOCOL
)
View Source
const (
	IFLA_NETKIT_UNSPEC = iota
	IFLA_NETKIT_PEER_INFO
	IFLA_NETKIT_PRIMARY
	IFLA_NETKIT_POLICY
	IFLA_NETKIT_PEER_POLICY
	IFLA_NETKIT_MODE
	IFLA_NETKIT_MAX = IFLA_NETKIT_MODE
)
View Source
const (
	VETH_INFO_UNSPEC = iota
	VETH_INFO_PEER
	VETH_INFO_MAX = VETH_INFO_PEER
)
View Source
const (
	IFLA_VXLAN_UNSPEC = iota
	IFLA_VXLAN_ID
	IFLA_VXLAN_GROUP
	IFLA_VXLAN_LINK
	IFLA_VXLAN_LOCAL
	IFLA_VXLAN_TTL
	IFLA_VXLAN_TOS
	IFLA_VXLAN_LEARNING
	IFLA_VXLAN_AGEING
	IFLA_VXLAN_LIMIT
	IFLA_VXLAN_PORT_RANGE
	IFLA_VXLAN_PROXY
	IFLA_VXLAN_RSC
	IFLA_VXLAN_L2MISS
	IFLA_VXLAN_L3MISS
	IFLA_VXLAN_PORT
	IFLA_VXLAN_GROUP6
	IFLA_VXLAN_LOCAL6
	IFLA_VXLAN_UDP_CSUM
	IFLA_VXLAN_UDP_ZERO_CSUM6_TX
	IFLA_VXLAN_UDP_ZERO_CSUM6_RX
	IFLA_VXLAN_REMCSUM_TX
	IFLA_VXLAN_REMCSUM_RX
	IFLA_VXLAN_GBP
	IFLA_VXLAN_REMCSUM_NOPARTIAL
	IFLA_VXLAN_FLOWBASED
	IFLA_VXLAN_MAX = IFLA_VXLAN_FLOWBASED
)
View Source
const (
	BRIDGE_MODE_UNSPEC = iota
	BRIDGE_MODE_HAIRPIN
)
View Source
const (
	IFLA_BRPORT_UNSPEC = iota
	IFLA_BRPORT_STATE
	IFLA_BRPORT_PRIORITY
	IFLA_BRPORT_COST
	IFLA_BRPORT_MODE
	IFLA_BRPORT_GUARD
	IFLA_BRPORT_PROTECT
	IFLA_BRPORT_FAST_LEAVE
	IFLA_BRPORT_LEARNING
	IFLA_BRPORT_UNICAST_FLOOD
	IFLA_BRPORT_PROXYARP
	IFLA_BRPORT_LEARNING_SYNC
	IFLA_BRPORT_PROXYARP_WIFI
	IFLA_BRPORT_ROOT_ID
	IFLA_BRPORT_BRIDGE_ID
	IFLA_BRPORT_DESIGNATED_PORT
	IFLA_BRPORT_DESIGNATED_COST
	IFLA_BRPORT_ID
	IFLA_BRPORT_NO
	IFLA_BRPORT_TOPOLOGY_CHANGE_ACK
	IFLA_BRPORT_CONFIG_PENDING
	IFLA_BRPORT_MESSAGE_AGE_TIMER
	IFLA_BRPORT_FORWARD_DELAY_TIMER
	IFLA_BRPORT_HOLD_TIMER
	IFLA_BRPORT_FLUSH
	IFLA_BRPORT_MULTICAST_ROUTER
	IFLA_BRPORT_PAD
	IFLA_BRPORT_MCAST_FLOOD
	IFLA_BRPORT_MCAST_TO_UCAST
	IFLA_BRPORT_VLAN_TUNNEL
	IFLA_BRPORT_BCAST_FLOOD
	IFLA_BRPORT_GROUP_FWD_MASK
	IFLA_BRPORT_NEIGH_SUPPRESS
	IFLA_BRPORT_ISOLATED
	IFLA_BRPORT_BACKUP_PORT
	IFLA_BRPORT_MRP_RING_OPEN
	IFLA_BRPORT_MRP_IN_OPEN
	IFLA_BRPORT_MCAST_EHT_HOSTS_LIMIT
	IFLA_BRPORT_MCAST_EHT_HOSTS_CNT
	IFLA_BRPORT_LOCKED
	IFLA_BRPORT_MAB
	IFLA_BRPORT_MCAST_N_GROUPS
	IFLA_BRPORT_MCAST_MAX_GROUPS
	IFLA_BRPORT_MAX = IFLA_BRPORT_MCAST_MAX_GROUPS
)
View Source
const (
	IFLA_IPVLAN_UNSPEC = iota
	IFLA_IPVLAN_MODE
	IFLA_IPVLAN_FLAG
	IFLA_IPVLAN_MAX = IFLA_IPVLAN_FLAG
)
View Source
const (
	IFLA_MACVLAN_UNSPEC = iota
	IFLA_MACVLAN_MODE
	IFLA_MACVLAN_FLAGS
	IFLA_MACVLAN_MACADDR_MODE
	IFLA_MACVLAN_MACADDR
	IFLA_MACVLAN_MACADDR_DATA
	IFLA_MACVLAN_MACADDR_COUNT
	IFLA_MACVLAN_BC_QUEUE_LEN
	IFLA_MACVLAN_BC_QUEUE_LEN_USED
	IFLA_MACVLAN_MAX = IFLA_MACVLAN_BC_QUEUE_LEN_USED
)
View Source
const (
	MACVLAN_MODE_PRIVATE  = 1
	MACVLAN_MODE_VEPA     = 2
	MACVLAN_MODE_BRIDGE   = 4
	MACVLAN_MODE_PASSTHRU = 8
	MACVLAN_MODE_SOURCE   = 16
)
View Source
const (
	MACVLAN_MACADDR_ADD = iota
	MACVLAN_MACADDR_DEL
	MACVLAN_MACADDR_FLUSH
	MACVLAN_MACADDR_SET
)
View Source
const (
	IFLA_BOND_UNSPEC = iota
	IFLA_BOND_MODE
	IFLA_BOND_ACTIVE_SLAVE
	IFLA_BOND_MIIMON
	IFLA_BOND_UPDELAY
	IFLA_BOND_DOWNDELAY
	IFLA_BOND_USE_CARRIER
	IFLA_BOND_ARP_INTERVAL
	IFLA_BOND_ARP_IP_TARGET
	IFLA_BOND_ARP_VALIDATE
	IFLA_BOND_ARP_ALL_TARGETS
	IFLA_BOND_PRIMARY
	IFLA_BOND_PRIMARY_RESELECT
	IFLA_BOND_FAIL_OVER_MAC
	IFLA_BOND_XMIT_HASH_POLICY
	IFLA_BOND_RESEND_IGMP
	IFLA_BOND_NUM_PEER_NOTIF
	IFLA_BOND_ALL_SLAVES_ACTIVE
	IFLA_BOND_MIN_LINKS
	IFLA_BOND_LP_INTERVAL
	IFLA_BOND_PACKETS_PER_SLAVE
	IFLA_BOND_AD_LACP_RATE
	IFLA_BOND_AD_SELECT
	IFLA_BOND_AD_INFO
	IFLA_BOND_AD_ACTOR_SYS_PRIO
	IFLA_BOND_AD_USER_PORT_KEY
	IFLA_BOND_AD_ACTOR_SYSTEM
	IFLA_BOND_TLB_DYNAMIC_LB
)
View Source
const (
	IFLA_BOND_AD_INFO_UNSPEC = iota
	IFLA_BOND_AD_INFO_AGGREGATOR
	IFLA_BOND_AD_INFO_NUM_PORTS
	IFLA_BOND_AD_INFO_ACTOR_KEY
	IFLA_BOND_AD_INFO_PARTNER_KEY
	IFLA_BOND_AD_INFO_PARTNER_MAC
)
View Source
const (
	IFLA_BOND_SLAVE_UNSPEC = iota
	IFLA_BOND_SLAVE_STATE
	IFLA_BOND_SLAVE_MII_STATUS
	IFLA_BOND_SLAVE_LINK_FAILURE_COUNT
	IFLA_BOND_SLAVE_PERM_HWADDR
	IFLA_BOND_SLAVE_QUEUE_ID
	IFLA_BOND_SLAVE_AD_AGGREGATOR_ID
	IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE
	IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE
)
View Source
const (
	IFLA_GENEVE_UNSPEC = iota
	IFLA_GENEVE_ID     // vni
	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_DF
	IFLA_GENEVE_INNER_PROTO_INHERIT
	IFLA_GENEVE_MAX = IFLA_GENEVE_INNER_PROTO_INHERIT
)
View Source
const (
	IFLA_GRE_UNSPEC = iota
	IFLA_GRE_LINK
	IFLA_GRE_IFLAGS
	IFLA_GRE_OFLAGS
	IFLA_GRE_IKEY
	IFLA_GRE_OKEY
	IFLA_GRE_LOCAL
	IFLA_GRE_REMOTE
	IFLA_GRE_TTL
	IFLA_GRE_TOS
	IFLA_GRE_PMTUDISC
	IFLA_GRE_ENCAP_LIMIT
	IFLA_GRE_FLOWINFO
	IFLA_GRE_FLAGS
	IFLA_GRE_ENCAP_TYPE
	IFLA_GRE_ENCAP_FLAGS
	IFLA_GRE_ENCAP_SPORT
	IFLA_GRE_ENCAP_DPORT
	IFLA_GRE_COLLECT_METADATA
	IFLA_GRE_MAX = IFLA_GRE_COLLECT_METADATA
)
View Source
const (
	GRE_CSUM    = 0x8000
	GRE_ROUTING = 0x4000
	GRE_KEY     = 0x2000
	GRE_SEQ     = 0x1000
	GRE_STRICT  = 0x0800
	GRE_REC     = 0x0700
	GRE_FLAGS   = 0x00F8
	GRE_VERSION = 0x0007
)
View Source
const (
	IFLA_VF_INFO_UNSPEC = iota
	IFLA_VF_INFO
	IFLA_VF_INFO_MAX = IFLA_VF_INFO
)
View Source
const (
	IFLA_VF_UNSPEC = iota
	IFLA_VF_MAC    /* Hardware queue specific attributes */
	IFLA_VF_VLAN
	IFLA_VF_TX_RATE      /* Max TX Bandwidth Allocation */
	IFLA_VF_SPOOFCHK     /* Spoof Checking on/off switch */
	IFLA_VF_LINK_STATE   /* link state enable/disable/auto switch */
	IFLA_VF_RATE         /* Min and Max TX Bandwidth Allocation */
	IFLA_VF_RSS_QUERY_EN /* RSS Redirection Table and Hash Key query
	 * on/off switch
	 */
	IFLA_VF_STATS        /* network device statistics */
	IFLA_VF_TRUST        /* Trust state of VF */
	IFLA_VF_IB_NODE_GUID /* VF Infiniband node GUID */
	IFLA_VF_IB_PORT_GUID /* VF Infiniband port GUID */
	IFLA_VF_VLAN_LIST    /* nested list of vlans, option for QinQ */

	IFLA_VF_MAX = IFLA_VF_IB_PORT_GUID
)
View Source
const (
	IFLA_VF_VLAN_INFO_UNSPEC = iota
	IFLA_VF_VLAN_INFO        /* VLAN ID, QoS and VLAN protocol */

)
View Source
const (
	IFLA_VF_LINK_STATE_AUTO    = iota /* link state of the uplink */
	IFLA_VF_LINK_STATE_ENABLE         /* link always up */
	IFLA_VF_LINK_STATE_DISABLE        /* link always down */
	IFLA_VF_LINK_STATE_MAX     = IFLA_VF_LINK_STATE_DISABLE
)
View Source
const (
	IFLA_VF_STATS_RX_PACKETS = iota
	IFLA_VF_STATS_TX_PACKETS
	IFLA_VF_STATS_RX_BYTES
	IFLA_VF_STATS_TX_BYTES
	IFLA_VF_STATS_BROADCAST
	IFLA_VF_STATS_MULTICAST
	IFLA_VF_STATS_RX_DROPPED
	IFLA_VF_STATS_TX_DROPPED
	IFLA_VF_STATS_MAX = IFLA_VF_STATS_TX_DROPPED
)
View Source
const (
	SizeofVfMac        = 0x24
	SizeofVfVlan       = 0x0c
	SizeofVfVlanInfo   = 0x10
	SizeofVfTxRate     = 0x08
	SizeofVfRate       = 0x0c
	SizeofVfSpoofchk   = 0x08
	SizeofVfLinkState  = 0x08
	SizeofVfRssQueryEn = 0x08
	SizeofVfTrust      = 0x08
	SizeofVfGUID       = 0x10
)
View Source
const (
	XDP_FLAGS_UPDATE_IF_NOEXIST = 1 << iota
	XDP_FLAGS_SKB_MODE
	XDP_FLAGS_DRV_MODE
	XDP_FLAGS_MASK = XDP_FLAGS_UPDATE_IF_NOEXIST | XDP_FLAGS_SKB_MODE | XDP_FLAGS_DRV_MODE
)
View Source
const (
	IFLA_XDP_UNSPEC   = iota
	IFLA_XDP_FD       /* fd of xdp program to attach, or -1 to remove */
	IFLA_XDP_ATTACHED /* read-only bool indicating if prog is attached */
	IFLA_XDP_FLAGS    /* xdp prog related flags */
	IFLA_XDP_PROG_ID  /* xdp prog id */
	IFLA_XDP_MAX      = IFLA_XDP_PROG_ID
)
View Source
const (
	XDP_ATTACHED_NONE = iota
	XDP_ATTACHED_DRV
	XDP_ATTACHED_SKB
	XDP_ATTACHED_HW
)

XDP program attach mode (used as dump value for IFLA_XDP_ATTACHED)

View Source
const (
	IFLA_IPTUN_UNSPEC = iota
	IFLA_IPTUN_LINK
	IFLA_IPTUN_LOCAL
	IFLA_IPTUN_REMOTE
	IFLA_IPTUN_TTL
	IFLA_IPTUN_TOS
	IFLA_IPTUN_ENCAP_LIMIT
	IFLA_IPTUN_FLOWINFO
	IFLA_IPTUN_FLAGS
	IFLA_IPTUN_PROTO
	IFLA_IPTUN_PMTUDISC
	IFLA_IPTUN_6RD_PREFIX
	IFLA_IPTUN_6RD_RELAY_PREFIX
	IFLA_IPTUN_6RD_PREFIXLEN
	IFLA_IPTUN_6RD_RELAY_PREFIXLEN
	IFLA_IPTUN_ENCAP_TYPE
	IFLA_IPTUN_ENCAP_FLAGS
	IFLA_IPTUN_ENCAP_SPORT
	IFLA_IPTUN_ENCAP_DPORT
	IFLA_IPTUN_COLLECT_METADATA
	IFLA_IPTUN_MAX = IFLA_IPTUN_COLLECT_METADATA
)
View Source
const (
	IFLA_VTI_UNSPEC = iota
	IFLA_VTI_LINK
	IFLA_VTI_IKEY
	IFLA_VTI_OKEY
	IFLA_VTI_LOCAL
	IFLA_VTI_REMOTE
	IFLA_VTI_MAX = IFLA_VTI_REMOTE
)
View Source
const (
	IFLA_VRF_UNSPEC = iota
	IFLA_VRF_TABLE
)
View Source
const (
	IFLA_BR_UNSPEC = iota
	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_MAX = IFLA_BR_MCAST_MLD_VERSION
)
View Source
const (
	IFLA_GTP_UNSPEC = iota
	IFLA_GTP_FD0
	IFLA_GTP_FD1
	IFLA_GTP_PDP_HASHSIZE
	IFLA_GTP_ROLE
)
View Source
const (
	GTP_ROLE_GGSN = iota
	GTP_ROLE_SGSN
)
View Source
const (
	IFLA_XFRM_UNSPEC = iota
	IFLA_XFRM_LINK
	IFLA_XFRM_IF_ID

	IFLA_XFRM_MAX = iota - 1
)
View Source
const (
	IFLA_TUN_UNSPEC = iota
	IFLA_TUN_OWNER
	IFLA_TUN_GROUP
	IFLA_TUN_TYPE
	IFLA_TUN_PI
	IFLA_TUN_VNET_HDR
	IFLA_TUN_PERSIST
	IFLA_TUN_MULTI_QUEUE
	IFLA_TUN_NUM_QUEUES
	IFLA_TUN_NUM_DISABLED_QUEUES
	IFLA_TUN_MAX = IFLA_TUN_NUM_DISABLED_QUEUES
)
View Source
const (
	IFLA_IPOIB_UNSPEC = iota
	IFLA_IPOIB_PKEY
	IFLA_IPOIB_MODE
	IFLA_IPOIB_UMCAST
	IFLA_IPOIB_MAX = IFLA_IPOIB_UMCAST
)
View Source
const (
	IFLA_CAN_UNSPEC = iota
	IFLA_CAN_BITTIMING
	IFLA_CAN_BITTIMING_CONST
	IFLA_CAN_CLOCK
	IFLA_CAN_STATE
	IFLA_CAN_CTRLMODE
	IFLA_CAN_RESTART_MS
	IFLA_CAN_RESTART
	IFLA_CAN_BERR_COUNTER
	IFLA_CAN_DATA_BITTIMING
	IFLA_CAN_DATA_BITTIMING_CONST
	IFLA_CAN_TERMINATION
	IFLA_CAN_TERMINATION_CONST
	IFLA_CAN_BITRATE_CONST
	IFLA_CAN_DATA_BITRATE_CONST
	IFLA_CAN_BITRATE_MAX
	IFLA_CAN_MAX = IFLA_CAN_BITRATE_MAX
)
View Source
const (
	IFLA_BAREUDP_UNSPEC = iota
	IFLA_BAREUDP_PORT
	IFLA_BAREUDP_ETHERTYPE
	IFLA_BAREUDP_SRCPORT_MIN
	IFLA_BAREUDP_MULTIPROTO_MODE
	IFLA_BAREUDP_MAX = IFLA_BAREUDP_MULTIPROTO_MODE
)
View Source
const (
	LWT_BPF_PROG_UNSPEC = iota
	LWT_BPF_PROG_FD
	LWT_BPF_PROG_NAME
)
View Source
const (
	LWT_BPF_UNSPEC = iota
	LWT_BPF_IN
	LWT_BPF_OUT
	LWT_BPF_XMIT
	LWT_BPF_XMIT_HEADROOM
)
View Source
const (
	MPLS_LS_LABEL_SHIFT = 12
	MPLS_LS_S_SHIFT     = 8
)
View Source
const (
	// Family type definitions
	FAMILY_ALL  = unix.AF_UNSPEC
	FAMILY_V4   = unix.AF_INET
	FAMILY_V6   = unix.AF_INET6
	FAMILY_MPLS = unix.AF_MPLS
	// Arbitrary set value (greater than default 4k) to allow receiving
	// from kernel more verbose messages e.g. for statistics,
	// tc rules or filters, or other more memory requiring data.
	RECEIVE_BUFFER_SIZE = 65536
	// Kernel netlink pid
	PidKernel     uint32 = 0
	SizeofCnMsgOp        = 0x18
)
View Source
const (
	NLMSGERR_ATTR_UNUSED = 0
	NLMSGERR_ATTR_MSG    = 1
	NLMSGERR_ATTR_OFFS   = 2
	NLMSGERR_ATTR_COOKIE = 3
	NLMSGERR_ATTR_POLICY = 4
)
View Source
const (
	PROC_CN_MCAST_LISTEN = 1
	PROC_CN_MCAST_IGNORE
)
View Source
const (
	RDMA_NLDEV_CMD_GET     = 1
	RDMA_NLDEV_CMD_SET     = 2
	RDMA_NLDEV_CMD_NEWLINK = 3
	RDMA_NLDEV_CMD_DELLINK = 4
	RDMA_NLDEV_CMD_SYS_GET = 6
	RDMA_NLDEV_CMD_SYS_SET = 7
)
View Source
const (
	RDMA_NLDEV_ATTR_DEV_INDEX       = 1
	RDMA_NLDEV_ATTR_DEV_NAME        = 2
	RDMA_NLDEV_ATTR_PORT_INDEX      = 3
	RDMA_NLDEV_ATTR_CAP_FLAGS       = 4
	RDMA_NLDEV_ATTR_FW_VERSION      = 5
	RDMA_NLDEV_ATTR_NODE_GUID       = 6
	RDMA_NLDEV_ATTR_SYS_IMAGE_GUID  = 7
	RDMA_NLDEV_ATTR_SUBNET_PREFIX   = 8
	RDMA_NLDEV_ATTR_LID             = 9
	RDMA_NLDEV_ATTR_SM_LID          = 10
	RDMA_NLDEV_ATTR_LMC             = 11
	RDMA_NLDEV_ATTR_PORT_STATE      = 12
	RDMA_NLDEV_ATTR_PORT_PHYS_STATE = 13
	RDMA_NLDEV_ATTR_DEV_NODE_TYPE   = 14
	RDMA_NLDEV_ATTR_NDEV_NAME       = 51
	RDMA_NLDEV_ATTR_LINK_TYPE       = 65
	RDMA_NLDEV_SYS_ATTR_NETNS_MODE  = 66
	RDMA_NLDEV_NET_NS_FD            = 68
)
View Source
const (
	SEG6_IPTUN_MODE_INLINE = iota
	SEG6_IPTUN_MODE_ENCAP
)

seg6 encap mode

View Source
const (
	SEG6_IPTUNNEL_UNSPEC = iota
	SEG6_IPTUNNEL_SRH
)

number of nested RTATTR from include/uapi/linux/seg6_iptunnel.h

View Source
const (
	SEG6_LOCAL_UNSPEC = iota
	SEG6_LOCAL_ACTION
	SEG6_LOCAL_SRH
	SEG6_LOCAL_TABLE
	SEG6_LOCAL_NH4
	SEG6_LOCAL_NH6
	SEG6_LOCAL_IIF
	SEG6_LOCAL_OIF
	SEG6_LOCAL_BPF
)

seg6local parameters

View Source
const (
	SEG6_LOCAL_ACTION_END           = iota + 1 // 1
	SEG6_LOCAL_ACTION_END_X                    // 2
	SEG6_LOCAL_ACTION_END_T                    // 3
	SEG6_LOCAL_ACTION_END_DX2                  // 4
	SEG6_LOCAL_ACTION_END_DX6                  // 5
	SEG6_LOCAL_ACTION_END_DX4                  // 6
	SEG6_LOCAL_ACTION_END_DT6                  // 7
	SEG6_LOCAL_ACTION_END_DT4                  // 8
	SEG6_LOCAL_ACTION_END_B6                   // 9
	SEG6_LOCAL_ACTION_END_B6_ENCAPS            // 10
	SEG6_LOCAL_ACTION_END_BM                   // 11
	SEG6_LOCAL_ACTION_END_S                    // 12
	SEG6_LOCAL_ACTION_END_AS                   // 13
	SEG6_LOCAL_ACTION_END_AM                   // 14
	SEG6_LOCAL_ACTION_END_BPF                  // 15

)

seg6local actions

View Source
const (
	FRA_UNSPEC  = iota
	FRA_DST     /* destination address */
	FRA_SRC     /* source address */
	FRA_IIFNAME /* interface name */
	FRA_GOTO    /* target to jump to (FR_ACT_GOTO) */
	FRA_UNUSED2
	FRA_PRIORITY /* priority/preference */
	FRA_UNUSED3
	FRA_UNUSED4
	FRA_UNUSED5
	FRA_FWMARK /* mark */
	FRA_FLOW   /* flow/class id */
	FRA_TUN_ID
	FRA_SUPPRESS_IFGROUP
	FRA_SUPPRESS_PREFIXLEN
	FRA_TABLE  /* Extended table id */
	FRA_FWMASK /* mask for netfilter mark */
	FRA_OIFNAME
	FRA_PAD
	FRA_L3MDEV      /* iif or oif is l3mdev goto its table */
	FRA_UID_RANGE   /* UID range */
	FRA_PROTOCOL    /* Originator of the rule */
	FRA_IP_PROTO    /* ip proto */
	FRA_SPORT_RANGE /* sport */
	FRA_DPORT_RANGE /* dport */
)

syscall package lack of rule attributes type. Thus there are defined below

View Source
const (
	FR_ACT_UNSPEC = iota
	FR_ACT_TO_TBL /* Pass to fixed table */
	FR_ACT_GOTO   /* Jump to another rule */
	FR_ACT_NOP    /* No operation */
	FR_ACT_RES3
	FR_ACT_RES4
	FR_ACT_BLACKHOLE   /* Drop without notification */
	FR_ACT_UNREACHABLE /* Drop with ENETUNREACH */
	FR_ACT_PROHIBIT    /* Drop with EACCES */
)

ip rule netlink request types

View Source
const (
	SOCK_DIAG_BY_FAMILY = 20 /* linux.sock_diag.h */
	SOCK_DESTROY        = 21
	TCPDIAG_NOCOOKIE    = 0xFFFFFFFF /* TCPDIAG_NOCOOKIE in net/ipv4/tcp_diag.h*/
)

socket diags related

View Source
const (
	MPLS_IPTUNNEL_UNSPEC = iota
	MPLS_IPTUNNEL_DST
)

RTA_ENCAP subtype

View Source
const (
	LWTUNNEL_ENCAP_NONE = iota
	LWTUNNEL_ENCAP_MPLS
	LWTUNNEL_ENCAP_IP
	LWTUNNEL_ENCAP_ILA
	LWTUNNEL_ENCAP_IP6
	LWTUNNEL_ENCAP_SEG6
	LWTUNNEL_ENCAP_BPF
	LWTUNNEL_ENCAP_SEG6_LOCAL
)

light weight tunnel encap types

View Source
const (
	IPV6_SRCRT_STRICT = 0x01 // Deprecated; will be removed
	IPV6_SRCRT_TYPE_0 = 0    // Deprecated; will be removed
	IPV6_SRCRT_TYPE_2 = 2    // IPv6 type 2 Routing Header
	IPV6_SRCRT_TYPE_4 = 4    // Segment Routing with IPv6
)

routing header types

View Source
const (
	LINKLAYER_UNSPEC = iota
	LINKLAYER_ETHERNET
	LINKLAYER_ATM
)

LinkLayer

View Source
const (
	ATM_CELL_PAYLOAD = 48
	ATM_CELL_SIZE    = 53
)

ATM

View Source
const (
	TCA_POLICE_UNSPEC = iota
	TCA_POLICE_TBF
	TCA_POLICE_RATE
	TCA_POLICE_PEAKRATE
	TCA_POLICE_AVRATE
	TCA_POLICE_RESULT
	TCA_POLICE_MAX = TCA_POLICE_RESULT
)

Police

View Source
const (
	TCA_UNSPEC = iota
	TCA_KIND
	TCA_OPTIONS
	TCA_STATS
	TCA_XSTATS
	TCA_RATE
	TCA_FCNT
	TCA_STATS2
	TCA_STAB
	TCA_PAD
	TCA_DUMP_INVISIBLE
	TCA_CHAIN
	TCA_HW_OFFLOAD
	TCA_INGRESS_BLOCK
	TCA_EGRESS_BLOCK
	TCA_DUMP_FLAGS
	TCA_MAX = TCA_DUMP_FLAGS
)

Message types

View Source
const (
	TCA_ACT_TAB = 1
	TCAA_MAX    = 1
)
View Source
const (
	TCA_ACT_UNSPEC = iota
	TCA_ACT_KIND
	TCA_ACT_OPTIONS
	TCA_ACT_INDEX
	TCA_ACT_STATS
	TCA_ACT_PAD
	TCA_ACT_COOKIE
	TCA_ACT_FLAGS
	TCA_ACT_HW_STATS
	TCA_ACT_USED_HW_STATS
	TCA_ACT_IN_HW_COUNT
	TCA_ACT_MAX
)
View Source
const (
	TCA_PRIO_UNSPEC = iota
	TCA_PRIO_MQ
	TCA_PRIO_MAX = TCA_PRIO_MQ
)
View Source
const (
	TCA_STATS_UNSPEC = iota
	TCA_STATS_BASIC
	TCA_STATS_RATE_EST
	TCA_STATS_QUEUE
	TCA_STATS_APP
	TCA_STATS_RATE_EST64
	TCA_STATS_PAD
	TCA_STATS_BASIC_HW
	TCA_STATS_PKT64
	TCA_STATS_MAX = TCA_STATS_PKT64
)
View Source
const (
	SizeofTcMsg          = 0x14
	SizeofTcActionMsg    = 0x04
	SizeofTcPrioMap      = 0x14
	SizeofTcRateSpec     = 0x0c
	SizeofTcNetemQopt    = 0x18
	SizeofTcNetemCorr    = 0x0c
	SizeofTcNetemReorder = 0x08
	SizeofTcNetemCorrupt = 0x08
	SizeOfTcNetemRate    = 0x10
	SizeofTcTbfQopt      = 2*SizeofTcRateSpec + 0x0c
	SizeofTcHtbCopt      = 2*SizeofTcRateSpec + 0x14
	SizeofTcHtbGlob      = 0x14
	SizeofTcU32Key       = 0x10
	SizeofTcU32Sel       = 0x10 // without keys
	SizeofTcGen          = 0x16
	SizeofTcConnmark     = SizeofTcGen + 0x04
	SizeofTcCsum         = SizeofTcGen + 0x04
	SizeofTcMirred       = SizeofTcGen + 0x08
	SizeofTcTunnelKey    = SizeofTcGen + 0x04
	SizeofTcSkbEdit      = SizeofTcGen
	SizeofTcPolice       = 2*SizeofTcRateSpec + 0x20
	SizeofTcSfqQopt      = 0x0b
	SizeofTcSfqRedStats  = 0x18
	SizeofTcSfqQoptV1    = SizeofTcSfqQopt + SizeofTcSfqRedStats + 0x1c
	SizeofUint32Bitfield = 0x8
)
View Source
const (
	TCA_TBF_UNSPEC = iota
	TCA_TBF_PARMS
	TCA_TBF_RTAB
	TCA_TBF_PTAB
	TCA_TBF_RATE64
	TCA_TBF_PRATE64
	TCA_TBF_BURST
	TCA_TBF_PBURST
	TCA_TBF_MAX = TCA_TBF_PBURST
)
View Source
const (
	TCA_NETEM_UNSPEC = iota
	TCA_NETEM_CORR
	TCA_NETEM_DELAY_DIST
	TCA_NETEM_REORDER
	TCA_NETEM_CORRUPT
	TCA_NETEM_LOSS
	TCA_NETEM_RATE
	TCA_NETEM_ECN
	TCA_NETEM_RATE64
	TCA_NETEM_MAX = TCA_NETEM_RATE64
)
View Source
const (
	TCA_HTB_UNSPEC = iota
	TCA_HTB_PARMS
	TCA_HTB_INIT
	TCA_HTB_CTAB
	TCA_HTB_RTAB
	TCA_HTB_DIRECT_QLEN
	TCA_HTB_RATE64
	TCA_HTB_CEIL64
	TCA_HTB_MAX = TCA_HTB_CEIL64
)
View Source
const (
	TCA_U32_UNSPEC = iota
	TCA_U32_CLASSID
	TCA_U32_HASH
	TCA_U32_LINK
	TCA_U32_DIVISOR
	TCA_U32_SEL
	TCA_U32_POLICE
	TCA_U32_ACT
	TCA_U32_INDEV
	TCA_U32_PCNT
	TCA_U32_MARK
	TCA_U32_MAX = TCA_U32_MARK
)
View Source
const (
	TC_U32_TERMINAL  = 1 << iota
	TC_U32_OFFSET    = 1 << iota
	TC_U32_VAROFFSET = 1 << iota
	TC_U32_EAT       = 1 << iota
)
View Source
const (
	TCA_GACT_UNSPEC = iota
	TCA_GACT_TM
	TCA_GACT_PARMS
	TCA_GACT_PROB
	TCA_GACT_MAX = TCA_GACT_PROB
)
View Source
const (
	TCA_ACT_BPF_UNSPEC = iota
	TCA_ACT_BPF_TM
	TCA_ACT_BPF_PARMS
	TCA_ACT_BPF_OPS_LEN
	TCA_ACT_BPF_OPS
	TCA_ACT_BPF_FD
	TCA_ACT_BPF_NAME
	TCA_ACT_BPF_MAX = TCA_ACT_BPF_NAME
)
View Source
const (
	TCA_BPF_UNSPEC = iota
	TCA_BPF_ACT
	TCA_BPF_POLICE
	TCA_BPF_CLASSID
	TCA_BPF_OPS_LEN
	TCA_BPF_OPS
	TCA_BPF_FD
	TCA_BPF_NAME
	TCA_BPF_FLAGS
	TCA_BPF_FLAGS_GEN
	TCA_BPF_TAG
	TCA_BPF_ID
	TCA_BPF_MAX = TCA_BPF_ID
)
View Source
const (
	TCA_CONNMARK_UNSPEC = iota
	TCA_CONNMARK_PARMS
	TCA_CONNMARK_TM
	TCA_CONNMARK_MAX = TCA_CONNMARK_TM
)
View Source
const (
	TCA_CSUM_UNSPEC = iota
	TCA_CSUM_PARMS
	TCA_CSUM_TM
	TCA_CSUM_PAD
	TCA_CSUM_MAX = TCA_CSUM_PAD
)
View Source
const (
	TCA_MIRRED_UNSPEC = iota
	TCA_MIRRED_TM
	TCA_MIRRED_PARMS
	TCA_MIRRED_MAX = TCA_MIRRED_PARMS
)
View Source
const (
	TCA_TUNNEL_KEY_UNSPEC = iota
	TCA_TUNNEL_KEY_TM
	TCA_TUNNEL_KEY_PARMS
	TCA_TUNNEL_KEY_ENC_IPV4_SRC
	TCA_TUNNEL_KEY_ENC_IPV4_DST
	TCA_TUNNEL_KEY_ENC_IPV6_SRC
	TCA_TUNNEL_KEY_ENC_IPV6_DST
	TCA_TUNNEL_KEY_ENC_KEY_ID
	TCA_TUNNEL_KEY_PAD
	TCA_TUNNEL_KEY_ENC_DST_PORT
	TCA_TUNNEL_KEY_NO_CSUM
	TCA_TUNNEL_KEY_ENC_OPTS
	TCA_TUNNEL_KEY_ENC_TOS
	TCA_TUNNEL_KEY_ENC_TTL
	TCA_TUNNEL_KEY_MAX
)
View Source
const (
	TCA_SKBEDIT_UNSPEC = iota
	TCA_SKBEDIT_TM
	TCA_SKBEDIT_PARMS
	TCA_SKBEDIT_PRIORITY
	TCA_SKBEDIT_QUEUE_MAPPING
	TCA_SKBEDIT_MARK
	TCA_SKBEDIT_PAD
	TCA_SKBEDIT_PTYPE
	TCA_SKBEDIT_MASK
	TCA_SKBEDIT_MAX
)
View Source
const (
	TCA_FW_UNSPEC = iota
	TCA_FW_CLASSID
	TCA_FW_POLICE
	TCA_FW_INDEV
	TCA_FW_ACT
	TCA_FW_MASK
	TCA_FW_MAX = TCA_FW_MASK
)
View Source
const (
	TCA_MATCHALL_UNSPEC = iota
	TCA_MATCHALL_CLASSID
	TCA_MATCHALL_ACT
	TCA_MATCHALL_FLAGS
)
View Source
const (
	TCA_FQ_UNSPEC             = iota
	TCA_FQ_PLIMIT             // limit of total number of packets in queue
	TCA_FQ_FLOW_PLIMIT        // limit of packets per flow
	TCA_FQ_QUANTUM            // RR quantum
	TCA_FQ_INITIAL_QUANTUM    // RR quantum for new flow
	TCA_FQ_RATE_ENABLE        // enable/disable rate limiting
	TCA_FQ_FLOW_DEFAULT_RATE  // obsolete do not use
	TCA_FQ_FLOW_MAX_RATE      // per flow max rate
	TCA_FQ_BUCKETS_LOG        // log2(number of buckets)
	TCA_FQ_FLOW_REFILL_DELAY  // flow credit refill delay in usec
	TCA_FQ_ORPHAN_MASK        // mask applied to orphaned skb hashes
	TCA_FQ_LOW_RATE_THRESHOLD // per packet delay under this rate
	TCA_FQ_CE_THRESHOLD       // DCTCP-like CE-marking threshold
	TCA_FQ_TIMER_SLACK        // timer slack
	TCA_FQ_HORIZON            // time horizon in us
	TCA_FQ_HORIZON_DROP       // drop packets beyond horizon, or cap their EDT
)
View Source
const (
	TCA_FQ_CODEL_UNSPEC = iota
	TCA_FQ_CODEL_TARGET
	TCA_FQ_CODEL_LIMIT
	TCA_FQ_CODEL_INTERVAL
	TCA_FQ_CODEL_ECN
	TCA_FQ_CODEL_FLOWS
	TCA_FQ_CODEL_QUANTUM
	TCA_FQ_CODEL_CE_THRESHOLD
	TCA_FQ_CODEL_DROP_BATCH_SIZE
	TCA_FQ_CODEL_MEMORY_LIMIT
)
View Source
const (
	TCA_HFSC_UNSPEC = iota
	TCA_HFSC_RSC
	TCA_HFSC_FSC
	TCA_HFSC_USC
)
View Source
const (
	TCA_FLOWER_UNSPEC = iota
	TCA_FLOWER_CLASSID
	TCA_FLOWER_INDEV
	TCA_FLOWER_ACT
	TCA_FLOWER_KEY_ETH_DST       /* ETH_ALEN */
	TCA_FLOWER_KEY_ETH_DST_MASK  /* ETH_ALEN */
	TCA_FLOWER_KEY_ETH_SRC       /* ETH_ALEN */
	TCA_FLOWER_KEY_ETH_SRC_MASK  /* ETH_ALEN */
	TCA_FLOWER_KEY_ETH_TYPE      /* be16 */
	TCA_FLOWER_KEY_IP_PROTO      /* u8 */
	TCA_FLOWER_KEY_IPV4_SRC      /* be32 */
	TCA_FLOWER_KEY_IPV4_SRC_MASK /* be32 */
	TCA_FLOWER_KEY_IPV4_DST      /* be32 */
	TCA_FLOWER_KEY_IPV4_DST_MASK /* be32 */
	TCA_FLOWER_KEY_IPV6_SRC      /* struct in6_addr */
	TCA_FLOWER_KEY_IPV6_SRC_MASK /* struct in6_addr */
	TCA_FLOWER_KEY_IPV6_DST      /* struct in6_addr */
	TCA_FLOWER_KEY_IPV6_DST_MASK /* struct in6_addr */
	TCA_FLOWER_KEY_TCP_SRC       /* be16 */
	TCA_FLOWER_KEY_TCP_DST       /* be16 */
	TCA_FLOWER_KEY_UDP_SRC       /* be16 */
	TCA_FLOWER_KEY_UDP_DST       /* be16 */

	TCA_FLOWER_FLAGS
	TCA_FLOWER_KEY_VLAN_ID       /* be16 */
	TCA_FLOWER_KEY_VLAN_PRIO     /* u8   */
	TCA_FLOWER_KEY_VLAN_ETH_TYPE /* be16 */

	TCA_FLOWER_KEY_ENC_KEY_ID        /* be32 */
	TCA_FLOWER_KEY_ENC_IPV4_SRC      /* be32 */
	TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK /* be32 */
	TCA_FLOWER_KEY_ENC_IPV4_DST      /* be32 */
	TCA_FLOWER_KEY_ENC_IPV4_DST_MASK /* be32 */
	TCA_FLOWER_KEY_ENC_IPV6_SRC      /* struct in6_addr */
	TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK /* struct in6_addr */
	TCA_FLOWER_KEY_ENC_IPV6_DST      /* struct in6_addr */
	TCA_FLOWER_KEY_ENC_IPV6_DST_MASK /* struct in6_addr */

	TCA_FLOWER_KEY_TCP_SRC_MASK  /* be16 */
	TCA_FLOWER_KEY_TCP_DST_MASK  /* be16 */
	TCA_FLOWER_KEY_UDP_SRC_MASK  /* be16 */
	TCA_FLOWER_KEY_UDP_DST_MASK  /* be16 */
	TCA_FLOWER_KEY_SCTP_SRC_MASK /* be16 */
	TCA_FLOWER_KEY_SCTP_DST_MASK /* be16 */

	TCA_FLOWER_KEY_SCTP_SRC /* be16 */
	TCA_FLOWER_KEY_SCTP_DST /* be16 */

	TCA_FLOWER_KEY_ENC_UDP_SRC_PORT      /* be16 */
	TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK /* be16 */
	TCA_FLOWER_KEY_ENC_UDP_DST_PORT      /* be16 */
	TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK /* be16 */

	TCA_FLOWER_KEY_FLAGS      /* be32 */
	TCA_FLOWER_KEY_FLAGS_MASK /* be32 */

	TCA_FLOWER_KEY_ICMPV4_CODE      /* u8 */
	TCA_FLOWER_KEY_ICMPV4_CODE_MASK /* u8 */
	TCA_FLOWER_KEY_ICMPV4_TYPE      /* u8 */
	TCA_FLOWER_KEY_ICMPV4_TYPE_MASK /* u8 */
	TCA_FLOWER_KEY_ICMPV6_CODE      /* u8 */
	TCA_FLOWER_KEY_ICMPV6_CODE_MASK /* u8 */
	TCA_FLOWER_KEY_ICMPV6_TYPE      /* u8 */
	TCA_FLOWER_KEY_ICMPV6_TYPE_MASK /* u8 */

	TCA_FLOWER_KEY_ARP_SIP      /* be32 */
	TCA_FLOWER_KEY_ARP_SIP_MASK /* be32 */
	TCA_FLOWER_KEY_ARP_TIP      /* be32 */
	TCA_FLOWER_KEY_ARP_TIP_MASK /* be32 */
	TCA_FLOWER_KEY_ARP_OP       /* u8 */
	TCA_FLOWER_KEY_ARP_OP_MASK  /* u8 */
	TCA_FLOWER_KEY_ARP_SHA      /* ETH_ALEN */
	TCA_FLOWER_KEY_ARP_SHA_MASK /* ETH_ALEN */
	TCA_FLOWER_KEY_ARP_THA      /* ETH_ALEN */
	TCA_FLOWER_KEY_ARP_THA_MASK /* ETH_ALEN */

	TCA_FLOWER_KEY_MPLS_TTL   /* u8 - 8 bits */
	TCA_FLOWER_KEY_MPLS_BOS   /* u8 - 1 bit */
	TCA_FLOWER_KEY_MPLS_TC    /* u8 - 3 bits */
	TCA_FLOWER_KEY_MPLS_LABEL /* be32 - 20 bits */

	TCA_FLOWER_KEY_TCP_FLAGS      /* be16 */
	TCA_FLOWER_KEY_TCP_FLAGS_MASK /* be16 */

	TCA_FLOWER_KEY_IP_TOS      /* u8 */
	TCA_FLOWER_KEY_IP_TOS_MASK /* u8 */
	TCA_FLOWER_KEY_IP_TTL      /* u8 */
	TCA_FLOWER_KEY_IP_TTL_MASK /* u8 */

	TCA_FLOWER_KEY_CVLAN_ID       /* be16 */
	TCA_FLOWER_KEY_CVLAN_PRIO     /* u8   */
	TCA_FLOWER_KEY_CVLAN_ETH_TYPE /* be16 */

	TCA_FLOWER_KEY_ENC_IP_TOS      /* u8 */
	TCA_FLOWER_KEY_ENC_IP_TOS_MASK /* u8 */
	TCA_FLOWER_KEY_ENC_IP_TTL      /* u8 */
	TCA_FLOWER_KEY_ENC_IP_TTL_MASK /* u8 */

	TCA_FLOWER_KEY_ENC_OPTS
	TCA_FLOWER_KEY_ENC_OPTS_MASK
)
View Source
const (
	MaxOffs        = 128
	SizeOfPeditSel = 24
	SizeOfPeditKey = 24

	TCA_PEDIT_KEY_EX_HTYPE = 1
	TCA_PEDIT_KEY_EX_CMD   = 2
)
View Source
const (
	TCA_PEDIT_UNSPEC = iota
	TCA_PEDIT_TM
	TCA_PEDIT_PARMS
	TCA_PEDIT_PAD
	TCA_PEDIT_PARMS_EX
	TCA_PEDIT_KEYS_EX
	TCA_PEDIT_KEY_EX
)
View Source
const (
	TCA_PEDIT_KEY_EX_HDR_TYPE_NETWORK = iota
	TCA_PEDIT_KEY_EX_HDR_TYPE_ETH
	TCA_PEDIT_KEY_EX_HDR_TYPE_IP4
	TCA_PEDIT_KEY_EX_HDR_TYPE_IP6
	TCA_PEDIT_KEY_EX_HDR_TYPE_TCP
	TCA_PEDIT_KEY_EX_HDR_TYPE_UDP
)
View Source
const (
	TCA_PEDIT_KEY_EX_CMD_SET = 0
	TCA_PEDIT_KEY_EX_CMD_ADD = 1
)
View Source
const (
	VDPA_GENL_NAME    = "vdpa"
	VDPA_GENL_VERSION = 0x1
)
View Source
const (
	VDPA_CMD_UNSPEC = iota
	VDPA_CMD_MGMTDEV_NEW
	VDPA_CMD_MGMTDEV_GET /* can dump */
	VDPA_CMD_DEV_NEW
	VDPA_CMD_DEV_DEL
	VDPA_CMD_DEV_GET        /* can dump */
	VDPA_CMD_DEV_CONFIG_GET /* can dump */
	VDPA_CMD_DEV_VSTATS_GET
)
View Source
const (
	VDPA_ATTR_UNSPEC = iota
	VDPA_ATTR_MGMTDEV_BUS_NAME
	VDPA_ATTR_MGMTDEV_DEV_NAME
	VDPA_ATTR_MGMTDEV_SUPPORTED_CLASSES
	VDPA_ATTR_DEV_NAME
	VDPA_ATTR_DEV_ID
	VDPA_ATTR_DEV_VENDOR_ID
	VDPA_ATTR_DEV_MAX_VQS
	VDPA_ATTR_DEV_MAX_VQ_SIZE
	VDPA_ATTR_DEV_MIN_VQ_SIZE
	VDPA_ATTR_DEV_NET_CFG_MACADDR
	VDPA_ATTR_DEV_NET_STATUS
	VDPA_ATTR_DEV_NET_CFG_MAX_VQP
	VDPA_ATTR_DEV_NET_CFG_MTU
	VDPA_ATTR_DEV_NEGOTIATED_FEATURES
	VDPA_ATTR_DEV_MGMTDEV_MAX_VQS
	VDPA_ATTR_DEV_SUPPORTED_FEATURES
	VDPA_ATTR_DEV_QUEUE_INDEX
	VDPA_ATTR_DEV_VENDOR_ATTR_NAME
	VDPA_ATTR_DEV_VENDOR_ATTR_VALUE
	VDPA_ATTR_DEV_FEATURES
)
View Source
const (
	XFRM_MSG_BASE        XfrmMsgType = 0x10
	XFRM_MSG_NEWSA                   = 0x10
	XFRM_MSG_DELSA                   = 0x11
	XFRM_MSG_GETSA                   = 0x12
	XFRM_MSG_NEWPOLICY               = 0x13
	XFRM_MSG_DELPOLICY               = 0x14
	XFRM_MSG_GETPOLICY               = 0x15
	XFRM_MSG_ALLOCSPI                = 0x16
	XFRM_MSG_ACQUIRE                 = 0x17
	XFRM_MSG_EXPIRE                  = 0x18
	XFRM_MSG_UPDPOLICY               = 0x19
	XFRM_MSG_UPDSA                   = 0x1a
	XFRM_MSG_POLEXPIRE               = 0x1b
	XFRM_MSG_FLUSHSA                 = 0x1c
	XFRM_MSG_FLUSHPOLICY             = 0x1d
	XFRM_MSG_NEWAE                   = 0x1e
	XFRM_MSG_GETAE                   = 0x1f
	XFRM_MSG_REPORT                  = 0x20
	XFRM_MSG_MIGRATE                 = 0x21
	XFRM_MSG_NEWSADINFO              = 0x22
	XFRM_MSG_GETSADINFO              = 0x23
	XFRM_MSG_NEWSPDINFO              = 0x24
	XFRM_MSG_GETSPDINFO              = 0x25
	XFRM_MSG_MAPPING                 = 0x26
	XFRM_MSG_MAX                     = 0x26
	XFRM_NR_MSGTYPES                 = 0x17
)

Message Types

View Source
const (
	/* Netlink message attributes.  */
	XFRMA_UNSPEC    = iota
	XFRMA_ALG_AUTH  /* struct xfrm_algo */
	XFRMA_ALG_CRYPT /* struct xfrm_algo */
	XFRMA_ALG_COMP  /* struct xfrm_algo */
	XFRMA_ENCAP     /* struct xfrm_algo + struct xfrm_encap_tmpl */
	XFRMA_TMPL      /* 1 or more struct xfrm_user_tmpl */
	XFRMA_SA        /* struct xfrm_usersa_info  */
	XFRMA_POLICY    /* struct xfrm_userpolicy_info */
	XFRMA_SEC_CTX   /* struct xfrm_sec_ctx */
	XFRMA_LTIME_VAL
	XFRMA_REPLAY_VAL
	XFRMA_REPLAY_THRESH
	XFRMA_ETIMER_THRESH
	XFRMA_SRCADDR     /* xfrm_address_t */
	XFRMA_COADDR      /* xfrm_address_t */
	XFRMA_LASTUSED    /* unsigned long  */
	XFRMA_POLICY_TYPE /* struct xfrm_userpolicy_type */
	XFRMA_MIGRATE
	XFRMA_ALG_AEAD       /* struct xfrm_algo_aead */
	XFRMA_KMADDRESS      /* struct xfrm_user_kmaddress */
	XFRMA_ALG_AUTH_TRUNC /* struct xfrm_algo_auth */
	XFRMA_MARK           /* struct xfrm_mark */
	XFRMA_TFCPAD         /* __u32 */
	XFRMA_REPLAY_ESN_VAL /* struct xfrm_replay_esn */
	XFRMA_SA_EXTRA_FLAGS /* __u32 */
	XFRMA_PROTO          /* __u8 */
	XFRMA_ADDRESS_FILTER /* struct xfrm_address_filter */
	XFRMA_PAD
	XFRMA_OFFLOAD_DEV   /* struct xfrm_state_offload */
	XFRMA_SET_MARK      /* __u32 */
	XFRMA_SET_MARK_MASK /* __u32 */
	XFRMA_IF_ID         /* __u32 */

	XFRMA_MAX = iota - 1
)

Attribute types

View Source
const (
	SizeofXfrmAddress     = 0x10
	SizeofXfrmSelector    = 0x38
	SizeofXfrmLifetimeCfg = 0x40
	SizeofXfrmLifetimeCur = 0x20
	SizeofXfrmId          = 0x18
	SizeofXfrmMark        = 0x08
)
View Source
const (
	XFRMNLGRP_NONE    = 0x0
	XFRMNLGRP_ACQUIRE = 0x1
	XFRMNLGRP_EXPIRE  = 0x2
	XFRMNLGRP_SA      = 0x3
	XFRMNLGRP_POLICY  = 0x4
	XFRMNLGRP_AEVENTS = 0x5
	XFRMNLGRP_REPORT  = 0x6
	XFRMNLGRP_MIGRATE = 0x7
	XFRMNLGRP_MAPPING = 0x8
)

Netlink groups

View Source
const (
	SizeofXfrmUserpolicyId   = 0x40
	SizeofXfrmUserpolicyInfo = 0xa8
	SizeofXfrmUserTmpl       = 0x40
)
View Source
const (
	SizeofXfrmUsersaId       = 0x18
	SizeofXfrmStats          = 0x0c
	SizeofXfrmUsersaInfo     = 0xe0
	SizeofXfrmUserSpiInfo    = 0xe8
	SizeofXfrmAlgo           = 0x44
	SizeofXfrmAlgoAuth       = 0x48
	SizeofXfrmAlgoAEAD       = 0x48
	SizeofXfrmEncapTmpl      = 0x18
	SizeofXfrmUsersaFlush    = 0x1
	SizeofXfrmReplayStateEsn = 0x18
	SizeofXfrmReplayState    = 0x0c
)
View Source
const (
	XFRM_STATE_NOECN      = 1
	XFRM_STATE_DECAP_DSCP = 2
	XFRM_STATE_NOPMTUDISC = 4
	XFRM_STATE_WILDRECV   = 8
	XFRM_STATE_ICMP       = 16
	XFRM_STATE_AF_UNSPEC  = 32
	XFRM_STATE_ALIGN4     = 64
	XFRM_STATE_ESN        = 128
)
View Source
const (
	XFRM_SA_XFLAG_DONT_ENCAP_DSCP = 1
	XFRM_SA_XFLAG_OSEQ_MAY_WRAP   = 2
)
View Source
const (
	DEFAULT_CHANGE = 0xFFFFFFFF
)
View Source
const (
	DEVLINK_RESOURCE_UNIT_ENTRY uint8 = 0
)
View Source
const (
	GENL_CTRL_CMD_GETFAMILY = 3
)
View Source
const (
	LWT_BPF_MAX = __LWT_BPF_MAX - 1
)
View Source
const (
	LWT_BPF_MAX_HEADROOM = 256
)
View Source
const (
	LWT_BPF_PROG_MAX = __LWT_BPF_PROG_MAX - 1
)
View Source
const (
	NFNETLINK_V0 = 0
)

#define NFNETLINK_V0 0

View Source
const (
	RDMA_NL_GET_CLIENT_SHIFT = 10
)
View Source
const (
	RDMA_NL_NLDEV = 5
)
View Source
const (
	SEG6_IPTUNNEL_MAX = __SEG6_IPTUNNEL_MAX - 1
)
View Source
const (
	SEG6_LOCAL_ACTION_MAX = __SEG6_LOCAL_ACTION_MAX - 1
)
View Source
const (
	SEG6_LOCAL_MAX = __SEG6_LOCAL_MAX
)
View Source
const (
	SizeofBridgeVlanInfo = 0x04
)
View Source
const SizeofGenlmsg = 4
View Source
const (
	SizeofXfrmUserExpire = 0xe8
)
View Source
const (
	TCA_ACT_BPF = 13
)
View Source
const (
	TCA_ACT_CONNMARK = 14
)
View Source
const (
	TCA_ACT_GACT = 5
)
View Source
const (
	TCA_ACT_MIRRED = 8
)
View Source
const (
	TCA_BPF_FLAG_ACT_DIRECT uint32 = 1 << iota
)
View Source
const TCA_CLS_FLAGS_SKIP_HW = 1 << 0 /* don't offload filter to HW */
View Source
const TCA_CLS_FLAGS_SKIP_SW = 1 << 1 /* don't use filter in SW */
View Source
const TC_LINKLAYER_MASK = 0x0F
View Source
const (
	TC_PRIO_MAX = 15
)
View Source
const XFRMA_OUTPUT_MARK = XFRMA_SET_MARK
View Source
const (
	XFRM_INF = ^uint64(0)
)

Infinity for packet and byte counts

Variables

View Source
var EnableErrorMessageReporting bool = false

ErrorMessageReporting is the default error message reporting configuration for the new netlink sockets

View Source
var L4ProtoMap = map[uint8]string{
	6:  "tcp",
	17: "udp",
}
View Source
var SocketTimeoutTv = unix.Timeval{Sec: 60, Usec: 0}

Default netlink socket timeout, 60s

SupportedNlFamilies contains the list of netlink families this netlink package supports

Functions

func BEUint16Attr added in v1.2.1

func BEUint16Attr(v uint16) []byte

func BEUint32Attr added in v1.2.1

func BEUint32Attr(v uint32) []byte

func BEUint64Attr added in v1.2.1

func BEUint64Attr(v uint64) []byte

func BytesToString

func BytesToString(b []byte) string

func DecodeMPLSStack

func DecodeMPLSStack(buf []byte) []int

func DecodeSEG6Encap

func DecodeSEG6Encap(buf []byte) (int, []net.IP, error)

func DecodeSEG6Srh added in v1.1.0

func DecodeSEG6Srh(buf []byte) ([]net.IP, error)

func DeserializeTcPedit added in v1.2.1

func DeserializeTcPedit(b []byte) (*TcPeditSel, []TcPeditKey)

func EncodeMPLSStack

func EncodeMPLSStack(labels ...int) []byte

func EncodeSEG6Encap

func EncodeSEG6Encap(mode int, segments []net.IP) ([]byte, error)

func EncodeSEG6Srh added in v1.1.0

func EncodeSEG6Srh(segments []net.IP) ([]byte, error)

func GetIPFamily

func GetIPFamily(ip net.IP) int

GetIPFamily returns the family type of a net.IP.

func GetIpsetFlags added in v1.2.1

func GetIpsetFlags(cmd int) int

func NativeEndian

func NativeEndian() binary.ByteOrder

NativeEndian gets native endianness for the system

func NonZeroTerminated

func NonZeroTerminated(s string) []byte

func ParseAttributes added in v1.2.1

func ParseAttributes(data []byte) <-chan Attribute

func ParseRouteAttr

func ParseRouteAttr(b []byte) ([]syscall.NetlinkRouteAttr, error)

func ParseRouteAttrAsMap added in v1.2.1

func ParseRouteAttrAsMap(b []byte) (map[uint16]syscall.NetlinkRouteAttr, error)

ParseRouteAttrAsMap parses provided buffer that contains raw RtAttrs and returns a map of parsed atttributes indexed by attribute type or error if occured.

func PrintAttributes added in v1.2.1

func PrintAttributes(data []byte)

func SEG6EncapModeString

func SEG6EncapModeString(mode int) string

Helper functions

func SEG6LocalActionString added in v1.1.0

func SEG6LocalActionString(action int) string

Helper functions

func SerializeHfscCurve added in v1.1.0

func SerializeHfscCurve(c *Curve) (b []byte)

func Swap16

func Swap16(i uint16) uint16

Byte swap a 16 bit value if we aren't big endian

func Swap32

func Swap32(i uint32) uint32

Byte swap a 32 bit value if aren't big endian

func Uint16Attr

func Uint16Attr(v uint16) []byte

func Uint32Attr

func Uint32Attr(v uint32) []byte

func Uint64Attr

func Uint64Attr(v uint64) []byte

func Uint8Attr

func Uint8Attr(v uint8) []byte

func ZeroTerminated

func ZeroTerminated(s string) []byte

Types

type Attribute added in v1.2.1

type Attribute struct {
	Type  uint16
	Value []byte
}

func (*Attribute) Uint32 added in v1.2.1

func (attr *Attribute) Uint32() uint32

Uint32 returns the uint32 value respecting the NET_BYTEORDER flag

func (*Attribute) Uint64 added in v1.2.1

func (attr *Attribute) Uint64() uint64

Uint64 returns the uint64 value respecting the NET_BYTEORDER flag

type BridgeVlanInfo

type BridgeVlanInfo struct {
	Flags uint16
	Vid   uint16
}

func DeserializeBridgeVlanInfo

func DeserializeBridgeVlanInfo(b []byte) *BridgeVlanInfo

func (*BridgeVlanInfo) EngressUntag

func (b *BridgeVlanInfo) EngressUntag() bool

func (*BridgeVlanInfo) PortVID

func (b *BridgeVlanInfo) PortVID() bool

func (*BridgeVlanInfo) Serialize

func (b *BridgeVlanInfo) Serialize() []byte

func (*BridgeVlanInfo) String

func (b *BridgeVlanInfo) String() string

type CbID added in v1.2.1

type CbID struct {
	Idx uint32
	Val uint32
}

type CnMsg added in v1.2.1

type CnMsg struct {
	ID     CbID
	Seq    uint32
	Ack    uint32
	Length uint16
	Flags  uint16
}

type CnMsgOp added in v1.2.1

type CnMsgOp struct {
	CnMsg
	// here we differ from the C header
	Op uint32
}

func DeserializeCnMsgOp added in v1.2.1

func DeserializeCnMsgOp(b []byte) *CnMsgOp

func NewCnMsg added in v1.2.1

func NewCnMsg(idx, val, op uint32) *CnMsgOp

func (*CnMsgOp) Len added in v1.2.1

func (msg *CnMsgOp) Len() int

func (*CnMsgOp) Serialize added in v1.2.1

func (msg *CnMsgOp) Serialize() []byte

type Curve added in v1.1.0

type Curve struct {
	// contains filtered or unexported fields
}

func DeserializeHfscCurve added in v1.1.0

func DeserializeHfscCurve(b []byte) *Curve

func (*Curve) Attrs added in v1.1.0

func (c *Curve) Attrs() (uint32, uint32, uint32)

func (*Curve) Set added in v1.1.0

func (c *Curve) Set(m1 uint32, d uint32, m2 uint32)

type Genlmsg

type Genlmsg struct {
	Command uint8
	Version uint8
}

func DeserializeGenlmsg

func DeserializeGenlmsg(b []byte) *Genlmsg

func (*Genlmsg) Len

func (msg *Genlmsg) Len() int

func (*Genlmsg) Serialize

func (msg *Genlmsg) Serialize() []byte

type HfscCopt added in v1.1.0

type HfscCopt struct {
	Rsc Curve
	Fsc Curve
	Usc Curve
}

type IPProto added in v1.2.1

type IPProto uint8

IPProto represents Flower ip_proto attribute

const (
	IPPROTO_TCP    IPProto = unix.IPPROTO_TCP
	IPPROTO_UDP    IPProto = unix.IPPROTO_UDP
	IPPROTO_SCTP   IPProto = unix.IPPROTO_SCTP
	IPPROTO_ICMP   IPProto = unix.IPPROTO_ICMP
	IPPROTO_ICMPV6 IPProto = unix.IPPROTO_ICMPV6
)

func (IPProto) Serialize added in v1.2.1

func (i IPProto) Serialize() []byte

func (IPProto) String added in v1.2.1

func (i IPProto) String() string

type IPSetError added in v1.2.1

type IPSetError uintptr

func (IPSetError) Error added in v1.2.1

func (e IPSetError) Error() string

type IPv6SrHdr

type IPv6SrHdr struct {
	Segments []net.IP
	// contains filtered or unexported fields
}

func (*IPv6SrHdr) Equal

func (s1 *IPv6SrHdr) Equal(s2 IPv6SrHdr) bool

type IfAddrmsg

type IfAddrmsg struct {
	unix.IfAddrmsg
}

func DeserializeIfAddrmsg

func DeserializeIfAddrmsg(b []byte) *IfAddrmsg

func NewIfAddrmsg

func NewIfAddrmsg(family int) *IfAddrmsg

func (*IfAddrmsg) Len

func (msg *IfAddrmsg) Len() int

func (*IfAddrmsg) Serialize

func (msg *IfAddrmsg) Serialize() []byte

type IfInfomsg

type IfInfomsg struct {
	unix.IfInfomsg
}

IfInfomsg is related to links, but it is used for list requests as well

func DeserializeIfInfomsg

func DeserializeIfInfomsg(b []byte) *IfInfomsg

func NewIfInfomsg

func NewIfInfomsg(family int) *IfInfomsg

Create an IfInfomsg with family specified

func NewIfInfomsgChild

func NewIfInfomsgChild(parent *RtAttr, family int) *IfInfomsg

func (*IfInfomsg) EncapType

func (msg *IfInfomsg) EncapType() string

func (*IfInfomsg) Len

func (msg *IfInfomsg) Len() int

func (*IfInfomsg) Serialize

func (msg *IfInfomsg) Serialize() []byte

type IfaCacheInfo

type IfaCacheInfo struct {
	unix.IfaCacheinfo
}

func DeserializeIfaCacheInfo

func DeserializeIfaCacheInfo(b []byte) *IfaCacheInfo

func (*IfaCacheInfo) Len

func (msg *IfaCacheInfo) Len() int

func (*IfaCacheInfo) Serialize

func (msg *IfaCacheInfo) Serialize() []byte

type NetlinkRequest

type NetlinkRequest struct {
	unix.NlMsghdr
	Data    []NetlinkRequestData
	RawData []byte
	Sockets map[int]*SocketHandle
}

func NewNetlinkRequest

func NewNetlinkRequest(proto, flags int) *NetlinkRequest

Create a new netlink request from proto and flags Note the Len value will be inaccurate once data is added until the message is serialized

func (*NetlinkRequest) AddData

func (req *NetlinkRequest) AddData(data NetlinkRequestData)

func (*NetlinkRequest) AddRawData

func (req *NetlinkRequest) AddRawData(data []byte)

AddRawData adds raw bytes to the end of the NetlinkRequest object during serialization

func (*NetlinkRequest) Execute

func (req *NetlinkRequest) Execute(sockType int, resType uint16) ([][]byte, error)

Execute the request against the given sockType. Returns a list of netlink messages in serialized format, optionally filtered by resType.

func (*NetlinkRequest) ExecuteIter added in v1.2.1

func (req *NetlinkRequest) ExecuteIter(sockType int, resType uint16, f func(msg []byte) bool) error

ExecuteIter executes the request against the given sockType. Calls the provided callback func once for each netlink message. If the callback returns false, it is not called again, but the remaining messages are consumed/discarded.

Thread safety: ExecuteIter holds a lock on the socket until it finishes iteration so the callback must not call back into the netlink API.

func (*NetlinkRequest) Serialize

func (req *NetlinkRequest) Serialize() []byte

Serialize the Netlink Request into a byte array

type NetlinkRequestData

type NetlinkRequestData interface {
	Len() int
	Serialize() []byte
}

type NetlinkSocket

type NetlinkSocket struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func GetNetlinkSocketAt

func GetNetlinkSocketAt(newNs, curNs netns.NsHandle, protocol int) (*NetlinkSocket, error)

GetNetlinkSocketAt opens a netlink socket in the network namespace newNs and positions the thread back into the network namespace specified by curNs, when done. If curNs is close, the function derives the current namespace and moves back into it when done. If newNs is close, the socket will be opened in the current network namespace.

func Subscribe

func Subscribe(protocol int, groups ...uint) (*NetlinkSocket, error)

Create a netlink socket with a given protocol (e.g. NETLINK_ROUTE) and subscribe it to multicast groups passed in variable argument list. Returns the netlink socket on which Receive() method can be called to retrieve the messages from the kernel.

func SubscribeAt

func SubscribeAt(newNs, curNs netns.NsHandle, protocol int, groups ...uint) (*NetlinkSocket, error)

SubscribeAt works like Subscribe plus let's the caller choose the network namespace in which the socket would be opened (newNs). Then control goes back to curNs if open, otherwise to the netns at the time this function was called.

func (*NetlinkSocket) Close

func (s *NetlinkSocket) Close()

func (*NetlinkSocket) GetFd

func (s *NetlinkSocket) GetFd() int

func (*NetlinkSocket) GetPid

func (s *NetlinkSocket) GetPid() (uint32, error)

func (*NetlinkSocket) Receive

func (*NetlinkSocket) Send

func (s *NetlinkSocket) Send(request *NetlinkRequest) error

func (*NetlinkSocket) SetExtAck added in v1.2.1

func (s *NetlinkSocket) SetExtAck(enable bool) error

SetExtAck requests error messages to be reported on the socket

func (*NetlinkSocket) SetReceiveBufferSize added in v1.2.1

func (s *NetlinkSocket) SetReceiveBufferSize(size int, force bool) error

SetReceiveBufferSize allows to set a receive buffer size on the socket

func (*NetlinkSocket) SetReceiveTimeout

func (s *NetlinkSocket) SetReceiveTimeout(timeout *unix.Timeval) error

SetReceiveTimeout allows to set a receive timeout on the socket

func (*NetlinkSocket) SetSendTimeout

func (s *NetlinkSocket) SetSendTimeout(timeout *unix.Timeval) error

SetSendTimeout allows to set a send timeout on the socket

type Nfgenmsg

type Nfgenmsg struct {
	NfgenFamily uint8
	Version     uint8
	ResId       uint16 // big endian
}

/* General form of address family dependent message.

*/
struct nfgenmsg {
	__u8  nfgen_family;		/* AF_xxx */
	__u8  version;		/* nfnetlink version */
	__be16    res_id;		/* resource id */
};

func DeserializeNfgenmsg

func DeserializeNfgenmsg(b []byte) *Nfgenmsg

func (*Nfgenmsg) Len

func (msg *Nfgenmsg) Len() int

func (*Nfgenmsg) Serialize

func (msg *Nfgenmsg) Serialize() []byte

type PeditCmd added in v1.2.1

type PeditCmd uint16

type PeditHeaderType added in v1.2.1

type PeditHeaderType uint16

/* TCA_PEDIT_KEY_EX_HDR_TYPE_NETWROK is a special case for legacy users. It

  • means no specific header type - offset is relative to the network layer */

type RtAttr

type RtAttr struct {
	unix.RtAttr
	Data []byte
	// contains filtered or unexported fields
}

Extend RtAttr to handle data and children

func NewRtAttr

func NewRtAttr(attrType int, data []byte) *RtAttr

Create a new Extended RtAttr object

func NewRtAttrChild deprecated

func NewRtAttrChild(parent *RtAttr, attrType int, data []byte) *RtAttr

NewRtAttrChild adds an RtAttr as a child to the parent and returns the new attribute

Deprecated: Use AddRtAttr() on the parent object

func (*RtAttr) AddChild

func (a *RtAttr) AddChild(attr NetlinkRequestData)

AddChild adds an existing NetlinkRequestData as a child.

func (*RtAttr) AddRtAttr added in v1.1.0

func (a *RtAttr) AddRtAttr(attrType int, data []byte) *RtAttr

AddRtAttr adds an RtAttr as a child and returns the new attribute

func (*RtAttr) Len

func (a *RtAttr) Len() int

func (*RtAttr) Serialize

func (a *RtAttr) Serialize() []byte

Serialize the RtAttr into a byte array This can't just unsafe.cast because it must iterate through children.

type RtGenMsg added in v1.1.0

type RtGenMsg struct {
	unix.RtGenmsg
}

func DeserializeRtGenMsg added in v1.1.0

func DeserializeRtGenMsg(b []byte) *RtGenMsg

func NewRtGenMsg added in v1.1.0

func NewRtGenMsg() *RtGenMsg

func (*RtGenMsg) Len added in v1.1.0

func (msg *RtGenMsg) Len() int

func (*RtGenMsg) Serialize added in v1.1.0

func (msg *RtGenMsg) Serialize() []byte

type RtMsg

type RtMsg struct {
	unix.RtMsg
}

func DeserializeRtMsg

func DeserializeRtMsg(b []byte) *RtMsg

func NewRtDelMsg

func NewRtDelMsg() *RtMsg

func NewRtMsg

func NewRtMsg() *RtMsg

func (*RtMsg) Len

func (msg *RtMsg) Len() int

func (*RtMsg) Serialize

func (msg *RtMsg) Serialize() []byte

type RtNexthop

type RtNexthop struct {
	unix.RtNexthop
	Children []NetlinkRequestData
}

func DeserializeRtNexthop

func DeserializeRtNexthop(b []byte) *RtNexthop

func (*RtNexthop) Len

func (msg *RtNexthop) Len() int

func (*RtNexthop) Serialize

func (msg *RtNexthop) Serialize() []byte

type SocketHandle

type SocketHandle struct {
	Seq    uint32
	Socket *NetlinkSocket
}

SocketHandle contains the netlink socket and the associated sequence counter for a specific netlink family

func (*SocketHandle) Close

func (sh *SocketHandle) Close()

Close closes the netlink socket

type TcActionMsg

type TcActionMsg struct {
	Family uint8
	Pad    [3]byte
}

func DeserializeTcActionMsg

func DeserializeTcActionMsg(b []byte) *TcActionMsg

func (*TcActionMsg) Len

func (msg *TcActionMsg) Len() int

func (*TcActionMsg) Serialize

func (x *TcActionMsg) Serialize() []byte

type TcBpf

type TcBpf TcGen

type TcConnmark added in v1.1.0

type TcConnmark struct {
	TcGen
	Zone uint16
}

func DeserializeTcConnmark added in v1.1.0

func DeserializeTcConnmark(b []byte) *TcConnmark

func (*TcConnmark) Len added in v1.1.0

func (msg *TcConnmark) Len() int

func (*TcConnmark) Serialize added in v1.1.0

func (x *TcConnmark) Serialize() []byte

type TcCsum added in v1.2.1

type TcCsum struct {
	TcGen
	UpdateFlags uint32
}

func DeserializeTcCsum added in v1.2.1

func DeserializeTcCsum(b []byte) *TcCsum

func (*TcCsum) Len added in v1.2.1

func (msg *TcCsum) Len() int

func (*TcCsum) Serialize added in v1.2.1

func (x *TcCsum) Serialize() []byte

type TcGact

type TcGact TcGen

type TcGen

type TcGen struct {
	Index   uint32
	Capab   uint32
	Action  int32
	Refcnt  int32
	Bindcnt int32
}

func DeserializeTcGen

func DeserializeTcGen(b []byte) *TcGen

func (*TcGen) Len

func (msg *TcGen) Len() int

func (*TcGen) Serialize

func (x *TcGen) Serialize() []byte

type TcHfscOpt added in v1.1.0

type TcHfscOpt struct {
	Defcls uint16
}

func (*TcHfscOpt) Serialize added in v1.1.0

func (x *TcHfscOpt) Serialize() []byte

type TcHtbCopt

type TcHtbCopt struct {
	Rate    TcRateSpec
	Ceil    TcRateSpec
	Buffer  uint32
	Cbuffer uint32
	Quantum uint32
	Level   uint32
	Prio    uint32
}

func DeserializeTcHtbCopt

func DeserializeTcHtbCopt(b []byte) *TcHtbCopt

func (*TcHtbCopt) Len

func (msg *TcHtbCopt) Len() int

func (*TcHtbCopt) Serialize

func (x *TcHtbCopt) Serialize() []byte

type TcHtbGlob

type TcHtbGlob struct {
	Version      uint32
	Rate2Quantum uint32
	Defcls       uint32
	Debug        uint32
	DirectPkts   uint32
}

func DeserializeTcHtbGlob

func DeserializeTcHtbGlob(b []byte) *TcHtbGlob

func (*TcHtbGlob) Len

func (msg *TcHtbGlob) Len() int

func (*TcHtbGlob) Serialize

func (x *TcHtbGlob) Serialize() []byte

type TcMirred

type TcMirred struct {
	TcGen
	Eaction int32
	Ifindex uint32
}

func DeserializeTcMirred

func DeserializeTcMirred(b []byte) *TcMirred

func (*TcMirred) Len

func (msg *TcMirred) Len() int

func (*TcMirred) Serialize

func (x *TcMirred) Serialize() []byte

type TcMsg

type TcMsg struct {
	Family  uint8
	Pad     [3]byte
	Ifindex int32
	Handle  uint32
	Parent  uint32
	Info    uint32
}

func DeserializeTcMsg

func DeserializeTcMsg(b []byte) *TcMsg

func (*TcMsg) Len

func (msg *TcMsg) Len() int

func (*TcMsg) Serialize

func (x *TcMsg) Serialize() []byte

type TcNetemCorr

type TcNetemCorr struct {
	DelayCorr uint32
	LossCorr  uint32
	DupCorr   uint32
}

func DeserializeTcNetemCorr

func DeserializeTcNetemCorr(b []byte) *TcNetemCorr

func (*TcNetemCorr) Len

func (msg *TcNetemCorr) Len() int

func (*TcNetemCorr) Serialize

func (x *TcNetemCorr) Serialize() []byte

type TcNetemCorrupt

type TcNetemCorrupt struct {
	Probability uint32
	Correlation uint32
}

func DeserializeTcNetemCorrupt

func DeserializeTcNetemCorrupt(b []byte) *TcNetemCorrupt

func (*TcNetemCorrupt) Len

func (msg *TcNetemCorrupt) Len() int

func (*TcNetemCorrupt) Serialize

func (x *TcNetemCorrupt) Serialize() []byte

type TcNetemQopt

type TcNetemQopt struct {
	Latency   uint32
	Limit     uint32
	Loss      uint32
	Gap       uint32
	Duplicate uint32
	Jitter    uint32
}

func DeserializeTcNetemQopt

func DeserializeTcNetemQopt(b []byte) *TcNetemQopt

func (*TcNetemQopt) Len

func (msg *TcNetemQopt) Len() int

func (*TcNetemQopt) Serialize

func (x *TcNetemQopt) Serialize() []byte

type TcNetemRate added in v1.2.1

type TcNetemRate struct {
	Rate           uint32
	PacketOverhead int32
	CellSize       uint32
	CellOverhead   int32
}

TcNetemRate is a struct that represents the rate of a netem qdisc

func DeserializeTcNetemRate added in v1.2.1

func DeserializeTcNetemRate(b []byte) *TcNetemRate

func (*TcNetemRate) Len added in v1.2.1

func (msg *TcNetemRate) Len() int

func (*TcNetemRate) Serialize added in v1.2.1

func (msg *TcNetemRate) Serialize() []byte

type TcNetemReorder

type TcNetemReorder struct {
	Probability uint32
	Correlation uint32
}

func DeserializeTcNetemReorder

func DeserializeTcNetemReorder(b []byte) *TcNetemReorder

func (*TcNetemReorder) Len

func (msg *TcNetemReorder) Len() int

func (*TcNetemReorder) Serialize

func (x *TcNetemReorder) Serialize() []byte

type TcPedit added in v1.2.1

type TcPedit struct {
	Sel    TcPeditSel
	Keys   []TcPeditKey
	KeysEx []TcPeditKeyEx
	Extend uint8
}

func (*TcPedit) Encode added in v1.2.1

func (p *TcPedit) Encode(parent *RtAttr)

func (*TcPedit) SetDstIP added in v1.2.1

func (p *TcPedit) SetDstIP(ip net.IP)

func (*TcPedit) SetDstPort added in v1.2.1

func (p *TcPedit) SetDstPort(dstPort uint16, protocol uint8)

SetDstPort only tcp and udp are supported to set port

func (*TcPedit) SetEthDst added in v1.2.1

func (p *TcPedit) SetEthDst(mac net.HardwareAddr)

func (*TcPedit) SetEthSrc added in v1.2.1

func (p *TcPedit) SetEthSrc(mac net.HardwareAddr)

func (*TcPedit) SetIPv4Dst added in v1.2.1

func (p *TcPedit) SetIPv4Dst(ip net.IP)

func (*TcPedit) SetIPv4Src added in v1.2.1

func (p *TcPedit) SetIPv4Src(ip net.IP)

func (*TcPedit) SetIPv6Dst added in v1.2.1

func (p *TcPedit) SetIPv6Dst(ip6 net.IP)

func (*TcPedit) SetIPv6Src added in v1.2.1

func (p *TcPedit) SetIPv6Src(ip6 net.IP)

func (*TcPedit) SetSrcIP added in v1.2.1

func (p *TcPedit) SetSrcIP(ip net.IP)

func (*TcPedit) SetSrcPort added in v1.2.1

func (p *TcPedit) SetSrcPort(srcPort uint16, protocol uint8)

SetSrcPort only tcp and udp are supported to set port

type TcPeditKey added in v1.2.1

type TcPeditKey struct {
	Mask    uint32
	Val     uint32
	Off     uint32
	At      uint32
	OffMask uint32
	Shift   uint32
}

func DeserializeTcPeditKey added in v1.2.1

func DeserializeTcPeditKey(b []byte) *TcPeditKey

type TcPeditKeyEx added in v1.2.1

type TcPeditKeyEx struct {
	HeaderType PeditHeaderType
	Cmd        PeditCmd
}

type TcPeditSel added in v1.2.1

type TcPeditSel struct {
	TcGen
	NKeys uint8
	Flags uint8
}

type TcPolice

type TcPolice struct {
	Index    uint32
	Action   int32
	Limit    uint32
	Burst    uint32
	Mtu      uint32
	Rate     TcRateSpec
	PeakRate TcRateSpec
	Refcnt   int32
	Bindcnt  int32
	Capab    uint32
}

func DeserializeTcPolice

func DeserializeTcPolice(b []byte) *TcPolice

func (*TcPolice) Len

func (msg *TcPolice) Len() int

func (*TcPolice) Serialize

func (x *TcPolice) Serialize() []byte

type TcPrioMap

type TcPrioMap struct {
	Bands   int32
	Priomap [TC_PRIO_MAX + 1]uint8
}

func DeserializeTcPrioMap

func DeserializeTcPrioMap(b []byte) *TcPrioMap

func (*TcPrioMap) Len

func (msg *TcPrioMap) Len() int

func (*TcPrioMap) Serialize

func (x *TcPrioMap) Serialize() []byte

type TcRateSpec

type TcRateSpec struct {
	CellLog   uint8
	Linklayer uint8
	Overhead  uint16
	CellAlign int16
	Mpu       uint16
	Rate      uint32
}

func DeserializeTcRateSpec

func DeserializeTcRateSpec(b []byte) *TcRateSpec

func (*TcRateSpec) Len

func (msg *TcRateSpec) Len() int

func (*TcRateSpec) Serialize

func (x *TcRateSpec) Serialize() []byte

type TcSfqQopt added in v1.2.1

type TcSfqQopt struct {
	Quantum uint8
	Perturb int32
	Limit   uint32
	Divisor uint8
	Flows   uint8
}

func DeserializeTcSfqQopt added in v1.2.1

func DeserializeTcSfqQopt(b []byte) *TcSfqQopt

func (*TcSfqQopt) Len added in v1.2.1

func (x *TcSfqQopt) Len() int

func (*TcSfqQopt) Serialize added in v1.2.1

func (x *TcSfqQopt) Serialize() []byte

type TcSfqQoptV1 added in v1.2.1

type TcSfqQoptV1 struct {
	TcSfqQopt
	Depth    uint32
	HeadDrop uint32
	Limit    uint32
	QthMin   uint32
	QthMax   uint32
	Wlog     byte
	Plog     byte
	ScellLog byte
	Flags    byte
	MaxP     uint32
	TcSfqRedStats
}
struct tc_sfq_qopt_v1 {
	struct tc_sfq_qopt v0;
	unsigned int	depth;		/* max number of packets per flow */
	unsigned int	headdrop;

/* SFQRED parameters */

__u32		limit;		/* HARD maximal flow queue length (bytes) */
__u32		qth_min;	/* Min average length threshold (bytes) */
__u32		qth_max;	/* Max average length threshold (bytes) */
unsigned char   Wlog;		/* log(W)		*/
unsigned char   Plog;		/* log(P_max/(qth_max-qth_min))	*/
unsigned char   Scell_log;	/* cell size for idle damping */
unsigned char	flags;
__u32		max_P;		/* probability, high resolution */

/* SFQRED stats */

	struct tc_sfqred_stats stats;
};

func DeserializeTcSfqQoptV1 added in v1.2.1

func DeserializeTcSfqQoptV1(b []byte) *TcSfqQoptV1

func (*TcSfqQoptV1) Len added in v1.2.1

func (x *TcSfqQoptV1) Len() int

func (*TcSfqQoptV1) Serialize added in v1.2.1

func (x *TcSfqQoptV1) Serialize() []byte

type TcSfqRedStats added in v1.2.1

type TcSfqRedStats struct {
	ProbDrop       uint32
	ForcedDrop     uint32
	ProbMark       uint32
	ForcedMark     uint32
	ProbMarkHead   uint32
	ForcedMarkHead uint32
}
struct tc_sfqred_stats {
	__u32           prob_drop;      /* Early drops, below max threshold */
	__u32           forced_drop;	/* Early drops, after max threshold */
	__u32           prob_mark;      /* Marked packets, below max threshold */
	__u32           forced_mark;    /* Marked packets, after max threshold */
	__u32           prob_mark_head; /* Marked packets, below max threshold */
	__u32           forced_mark_head;/* Marked packets, after max threshold */
};

func DeserializeTcSfqRedStats added in v1.2.1

func DeserializeTcSfqRedStats(b []byte) *TcSfqRedStats

func (*TcSfqRedStats) Len added in v1.2.1

func (x *TcSfqRedStats) Len() int

func (*TcSfqRedStats) Serialize added in v1.2.1

func (x *TcSfqRedStats) Serialize() []byte

type TcSkbEdit added in v1.1.0

type TcSkbEdit struct {
	TcGen
}

func DeserializeSkbEdit added in v1.1.0

func DeserializeSkbEdit(b []byte) *TcSkbEdit

func (*TcSkbEdit) Len added in v1.1.0

func (x *TcSkbEdit) Len() int

func (*TcSkbEdit) Serialize added in v1.1.0

func (x *TcSkbEdit) Serialize() []byte

type TcTbfQopt

type TcTbfQopt struct {
	Rate     TcRateSpec
	Peakrate TcRateSpec
	Limit    uint32
	Buffer   uint32
	Mtu      uint32
}

func DeserializeTcTbfQopt

func DeserializeTcTbfQopt(b []byte) *TcTbfQopt

func (*TcTbfQopt) Len

func (msg *TcTbfQopt) Len() int

func (*TcTbfQopt) Serialize

func (x *TcTbfQopt) Serialize() []byte

type TcTunnelKey added in v1.1.0

type TcTunnelKey struct {
	TcGen
	Action int32
}

func DeserializeTunnelKey added in v1.1.0

func DeserializeTunnelKey(b []byte) *TcTunnelKey

func (*TcTunnelKey) Len added in v1.1.0

func (x *TcTunnelKey) Len() int

func (*TcTunnelKey) Serialize added in v1.1.0

func (x *TcTunnelKey) Serialize() []byte

type TcU32Key

type TcU32Key struct {
	Mask    uint32 // big endian
	Val     uint32 // big endian
	Off     int32
	OffMask int32
}

func DeserializeTcU32Key

func DeserializeTcU32Key(b []byte) *TcU32Key

func (*TcU32Key) Len

func (msg *TcU32Key) Len() int

func (*TcU32Key) Serialize

func (x *TcU32Key) Serialize() []byte

type TcU32Sel

type TcU32Sel struct {
	Flags    uint8
	Offshift uint8
	Nkeys    uint8
	Pad      uint8
	Offmask  uint16 // big endian
	Off      uint16
	Offoff   int16
	Hoff     int16
	Hmask    uint32 // big endian
	Keys     []TcU32Key
}

func DeserializeTcU32Sel

func DeserializeTcU32Sel(b []byte) *TcU32Sel

func (*TcU32Sel) Len

func (msg *TcU32Sel) Len() int

func (*TcU32Sel) Serialize

func (x *TcU32Sel) Serialize() []byte

type Tcf added in v1.2.1

type Tcf struct {
	Install  uint64
	LastUse  uint64
	Expires  uint64
	FirstUse uint64
}

func DeserializeTcf added in v1.2.1

func DeserializeTcf(b []byte) *Tcf

type Uint32Attribute added in v1.2.1

type Uint32Attribute struct {
	Type  uint16
	Value uint32
}

func (*Uint32Attribute) Len added in v1.2.1

func (a *Uint32Attribute) Len() int

func (*Uint32Attribute) Serialize added in v1.2.1

func (a *Uint32Attribute) Serialize() []byte

type Uint32Bitfield added in v1.2.1

type Uint32Bitfield struct {
	Value    uint32
	Selector uint32
}

func DeserializeUint32Bitfield added in v1.2.1

func DeserializeUint32Bitfield(data []byte) *Uint32Bitfield

func (*Uint32Bitfield) Serialize added in v1.2.1

func (a *Uint32Bitfield) Serialize() []byte

type VfGUID added in v1.1.0

type VfGUID struct {
	Vf   uint32
	Rsvd uint32
	GUID uint64
}

func DeserializeVfGUID added in v1.1.0

func DeserializeVfGUID(b []byte) *VfGUID

func (*VfGUID) Len added in v1.1.0

func (msg *VfGUID) Len() int

func (*VfGUID) Serialize added in v1.1.0

func (msg *VfGUID) Serialize() []byte

type VfLinkState

type VfLinkState struct {
	Vf        uint32
	LinkState uint32
}

func DeserializeVfLinkState

func DeserializeVfLinkState(b []byte) *VfLinkState

func (*VfLinkState) Len

func (msg *VfLinkState) Len() int

func (*VfLinkState) Serialize

func (msg *VfLinkState) Serialize() []byte

type VfMac

type VfMac struct {
	Vf  uint32
	Mac [32]byte
}

func DeserializeVfMac

func DeserializeVfMac(b []byte) *VfMac

func (*VfMac) Len

func (msg *VfMac) Len() int

func (*VfMac) Serialize

func (msg *VfMac) Serialize() []byte

type VfRate

type VfRate struct {
	Vf        uint32
	MinTxRate uint32
	MaxTxRate uint32
}

func DeserializeVfRate

func DeserializeVfRate(b []byte) *VfRate

func (*VfRate) Len

func (msg *VfRate) Len() int

func (*VfRate) Serialize

func (msg *VfRate) Serialize() []byte

type VfRssQueryEn

type VfRssQueryEn struct {
	Vf      uint32
	Setting uint32
}

func DeserializeVfRssQueryEn

func DeserializeVfRssQueryEn(b []byte) *VfRssQueryEn

func (*VfRssQueryEn) Len

func (msg *VfRssQueryEn) Len() int

func (*VfRssQueryEn) Serialize

func (msg *VfRssQueryEn) Serialize() []byte

type VfSpoofchk

type VfSpoofchk struct {
	Vf      uint32
	Setting uint32
}

func DeserializeVfSpoofchk

func DeserializeVfSpoofchk(b []byte) *VfSpoofchk

func (*VfSpoofchk) Len

func (msg *VfSpoofchk) Len() int

func (*VfSpoofchk) Serialize

func (msg *VfSpoofchk) Serialize() []byte

type VfStats added in v1.2.1

type VfStats struct {
	RxPackets uint64
	TxPackets uint64
	RxBytes   uint64
	TxBytes   uint64
	Multicast uint64
	Broadcast uint64
	RxDropped uint64
	TxDropped uint64
}

func DeserializeVfStats added in v1.2.1

func DeserializeVfStats(b []byte) VfStats

type VfTrust

type VfTrust struct {
	Vf      uint32
	Setting uint32
}

func DeserializeVfTrust

func DeserializeVfTrust(b []byte) *VfTrust

func (*VfTrust) Len

func (msg *VfTrust) Len() int

func (*VfTrust) Serialize

func (msg *VfTrust) Serialize() []byte

type VfTxRate

type VfTxRate struct {
	Vf   uint32
	Rate uint32
}

func DeserializeVfTxRate

func DeserializeVfTxRate(b []byte) *VfTxRate

func (*VfTxRate) Len

func (msg *VfTxRate) Len() int

func (*VfTxRate) Serialize

func (msg *VfTxRate) Serialize() []byte

type VfVlan

type VfVlan struct {
	Vf   uint32
	Vlan uint32
	Qos  uint32
}

func DeserializeVfVlan

func DeserializeVfVlan(b []byte) *VfVlan

func (*VfVlan) Len

func (msg *VfVlan) Len() int

func (*VfVlan) Serialize

func (msg *VfVlan) Serialize() []byte

type VfVlanInfo added in v1.2.1

type VfVlanInfo struct {
	VfVlan
	VlanProto uint16
}

func DeserializeVfVlanInfo added in v1.2.1

func DeserializeVfVlanInfo(b []byte) *VfVlanInfo

func DeserializeVfVlanList added in v1.2.1

func DeserializeVfVlanList(b []byte) ([]*VfVlanInfo, error)

func (*VfVlanInfo) Serialize added in v1.2.1

func (msg *VfVlanInfo) Serialize() []byte

type XfrmAddress

type XfrmAddress [SizeofXfrmAddress]byte

func DeserializeXfrmAddress

func DeserializeXfrmAddress(b []byte) *XfrmAddress

func (*XfrmAddress) FromIP

func (x *XfrmAddress) FromIP(ip net.IP)

func (*XfrmAddress) Serialize

func (x *XfrmAddress) Serialize() []byte

func (*XfrmAddress) ToIP

func (x *XfrmAddress) ToIP() net.IP

func (*XfrmAddress) ToIPNet

func (x *XfrmAddress) ToIPNet(prefixlen uint8, family uint16) *net.IPNet

family is only used when x and prefixlen are both 0

type XfrmAlgo

type XfrmAlgo struct {
	AlgName   [64]byte
	AlgKeyLen uint32
	AlgKey    []byte
}

func DeserializeXfrmAlgo

func DeserializeXfrmAlgo(b []byte) *XfrmAlgo

func (*XfrmAlgo) Len

func (msg *XfrmAlgo) Len() int

func (*XfrmAlgo) Serialize

func (msg *XfrmAlgo) Serialize() []byte

type XfrmAlgoAEAD

type XfrmAlgoAEAD struct {
	AlgName   [64]byte
	AlgKeyLen uint32
	AlgICVLen uint32
	AlgKey    []byte
}

func DeserializeXfrmAlgoAEAD

func DeserializeXfrmAlgoAEAD(b []byte) *XfrmAlgoAEAD

func (*XfrmAlgoAEAD) Len

func (msg *XfrmAlgoAEAD) Len() int

func (*XfrmAlgoAEAD) Serialize

func (msg *XfrmAlgoAEAD) Serialize() []byte

type XfrmAlgoAuth

type XfrmAlgoAuth struct {
	AlgName     [64]byte
	AlgKeyLen   uint32
	AlgTruncLen uint32
	AlgKey      []byte
}

func DeserializeXfrmAlgoAuth

func DeserializeXfrmAlgoAuth(b []byte) *XfrmAlgoAuth

func (*XfrmAlgoAuth) Len

func (msg *XfrmAlgoAuth) Len() int

func (*XfrmAlgoAuth) Serialize

func (msg *XfrmAlgoAuth) Serialize() []byte

type XfrmEncapTmpl

type XfrmEncapTmpl struct {
	EncapType  uint16
	EncapSport uint16 // big endian
	EncapDport uint16 // big endian
	Pad        [2]byte
	EncapOa    XfrmAddress
}

func DeserializeXfrmEncapTmpl

func DeserializeXfrmEncapTmpl(b []byte) *XfrmEncapTmpl

func (*XfrmEncapTmpl) Len

func (msg *XfrmEncapTmpl) Len() int

func (*XfrmEncapTmpl) Serialize

func (msg *XfrmEncapTmpl) Serialize() []byte

type XfrmId

type XfrmId struct {
	Daddr XfrmAddress
	Spi   uint32 // big endian
	Proto uint8
	Pad   [3]byte
}

func DeserializeXfrmId

func DeserializeXfrmId(b []byte) *XfrmId

func (*XfrmId) Len

func (msg *XfrmId) Len() int

func (*XfrmId) Serialize

func (msg *XfrmId) Serialize() []byte

type XfrmLifetimeCfg

type XfrmLifetimeCfg struct {
	SoftByteLimit         uint64
	HardByteLimit         uint64
	SoftPacketLimit       uint64
	HardPacketLimit       uint64
	SoftAddExpiresSeconds uint64
	HardAddExpiresSeconds uint64
	SoftUseExpiresSeconds uint64
	HardUseExpiresSeconds uint64
}

func DeserializeXfrmLifetimeCfg

func DeserializeXfrmLifetimeCfg(b []byte) *XfrmLifetimeCfg

func (*XfrmLifetimeCfg) Len

func (msg *XfrmLifetimeCfg) Len() int

func (*XfrmLifetimeCfg) Serialize

func (msg *XfrmLifetimeCfg) Serialize() []byte

type XfrmLifetimeCur

type XfrmLifetimeCur struct {
	Bytes   uint64
	Packets uint64
	AddTime uint64
	UseTime uint64
}

func DeserializeXfrmLifetimeCur

func DeserializeXfrmLifetimeCur(b []byte) *XfrmLifetimeCur

func (*XfrmLifetimeCur) Len

func (msg *XfrmLifetimeCur) Len() int

func (*XfrmLifetimeCur) Serialize

func (msg *XfrmLifetimeCur) Serialize() []byte

type XfrmMark

type XfrmMark struct {
	Value uint32
	Mask  uint32
}

func DeserializeXfrmMark

func DeserializeXfrmMark(b []byte) *XfrmMark

func (*XfrmMark) Len

func (msg *XfrmMark) Len() int

func (*XfrmMark) Serialize

func (msg *XfrmMark) Serialize() []byte

type XfrmMsg

type XfrmMsg interface {
	Type() XfrmMsgType
}

type XfrmMsgType

type XfrmMsgType uint8

type XfrmReplayState added in v1.2.1

type XfrmReplayState struct {
	OSeq   uint32
	Seq    uint32
	BitMap uint32
}

func DeserializeXfrmReplayState added in v1.2.1

func DeserializeXfrmReplayState(b []byte) *XfrmReplayState

func (*XfrmReplayState) Serialize added in v1.2.1

func (msg *XfrmReplayState) Serialize() []byte

type XfrmReplayStateEsn

type XfrmReplayStateEsn struct {
	BmpLen       uint32
	OSeq         uint32
	Seq          uint32
	OSeqHi       uint32
	SeqHi        uint32
	ReplayWindow uint32
	Bmp          []uint32
}

func (*XfrmReplayStateEsn) Serialize

func (msg *XfrmReplayStateEsn) Serialize() []byte

type XfrmSelector

type XfrmSelector struct {
	Daddr      XfrmAddress
	Saddr      XfrmAddress
	Dport      uint16 // big endian
	DportMask  uint16 // big endian
	Sport      uint16 // big endian
	SportMask  uint16 // big endian
	Family     uint16
	PrefixlenD uint8
	PrefixlenS uint8
	Proto      uint8
	Pad        [3]byte
	Ifindex    int32
	User       uint32
}

func DeserializeXfrmSelector

func DeserializeXfrmSelector(b []byte) *XfrmSelector

func (*XfrmSelector) Len

func (msg *XfrmSelector) Len() int

func (*XfrmSelector) Serialize

func (msg *XfrmSelector) Serialize() []byte

type XfrmStats

type XfrmStats struct {
	ReplayWindow    uint32
	Replay          uint32
	IntegrityFailed uint32
}

func DeserializeXfrmStats

func DeserializeXfrmStats(b []byte) *XfrmStats

func (*XfrmStats) Len

func (msg *XfrmStats) Len() int

func (*XfrmStats) Serialize

func (msg *XfrmStats) Serialize() []byte

type XfrmUserExpire

type XfrmUserExpire struct {
	XfrmUsersaInfo XfrmUsersaInfo
	Hard           uint8
	Pad            [7]byte
}

func DeserializeXfrmUserExpire

func DeserializeXfrmUserExpire(b []byte) *XfrmUserExpire

func (*XfrmUserExpire) Len

func (msg *XfrmUserExpire) Len() int

func (*XfrmUserExpire) Serialize

func (msg *XfrmUserExpire) Serialize() []byte

type XfrmUserSpiInfo

type XfrmUserSpiInfo struct {
	XfrmUsersaInfo XfrmUsersaInfo
	Min            uint32
	Max            uint32
}

func DeserializeXfrmUserSpiInfo

func DeserializeXfrmUserSpiInfo(b []byte) *XfrmUserSpiInfo

func (*XfrmUserSpiInfo) Len

func (msg *XfrmUserSpiInfo) Len() int

func (*XfrmUserSpiInfo) Serialize

func (msg *XfrmUserSpiInfo) Serialize() []byte

type XfrmUserTmpl

type XfrmUserTmpl struct {
	XfrmId   XfrmId
	Family   uint16
	Pad1     [2]byte
	Saddr    XfrmAddress
	Reqid    uint32
	Mode     uint8
	Share    uint8
	Optional uint8
	Pad2     byte
	Aalgos   uint32
	Ealgos   uint32
	Calgos   uint32
}

func DeserializeXfrmUserTmpl

func DeserializeXfrmUserTmpl(b []byte) *XfrmUserTmpl

func (*XfrmUserTmpl) Len

func (msg *XfrmUserTmpl) Len() int

func (*XfrmUserTmpl) Serialize

func (msg *XfrmUserTmpl) Serialize() []byte

type XfrmUserpolicyId

type XfrmUserpolicyId struct {
	Sel   XfrmSelector
	Index uint32
	Dir   uint8
	Pad   [3]byte
}

func DeserializeXfrmUserpolicyId

func DeserializeXfrmUserpolicyId(b []byte) *XfrmUserpolicyId

func (*XfrmUserpolicyId) Len

func (msg *XfrmUserpolicyId) Len() int

func (*XfrmUserpolicyId) Serialize

func (msg *XfrmUserpolicyId) Serialize() []byte

type XfrmUserpolicyInfo

type XfrmUserpolicyInfo struct {
	Sel      XfrmSelector
	Lft      XfrmLifetimeCfg
	Curlft   XfrmLifetimeCur
	Priority uint32
	Index    uint32
	Dir      uint8
	Action   uint8
	Flags    uint8
	Share    uint8
	Pad      [4]byte
}

func DeserializeXfrmUserpolicyInfo

func DeserializeXfrmUserpolicyInfo(b []byte) *XfrmUserpolicyInfo

func (*XfrmUserpolicyInfo) Len

func (msg *XfrmUserpolicyInfo) Len() int

func (*XfrmUserpolicyInfo) Serialize

func (msg *XfrmUserpolicyInfo) Serialize() []byte

type XfrmUsersaFlush

type XfrmUsersaFlush struct {
	Proto uint8
}

func DeserializeXfrmUsersaFlush

func DeserializeXfrmUsersaFlush(b []byte) *XfrmUsersaFlush

func (*XfrmUsersaFlush) Len

func (msg *XfrmUsersaFlush) Len() int

func (*XfrmUsersaFlush) Serialize

func (msg *XfrmUsersaFlush) Serialize() []byte

type XfrmUsersaId

type XfrmUsersaId struct {
	Daddr  XfrmAddress
	Spi    uint32 // big endian
	Family uint16
	Proto  uint8
	Pad    byte
}

func DeserializeXfrmUsersaId

func DeserializeXfrmUsersaId(b []byte) *XfrmUsersaId

func (*XfrmUsersaId) Len

func (msg *XfrmUsersaId) Len() int

func (*XfrmUsersaId) Serialize

func (msg *XfrmUsersaId) Serialize() []byte

type XfrmUsersaInfo

type XfrmUsersaInfo struct {
	Sel          XfrmSelector
	Id           XfrmId
	Saddr        XfrmAddress
	Lft          XfrmLifetimeCfg
	Curlft       XfrmLifetimeCur
	Stats        XfrmStats
	Seq          uint32
	Reqid        uint32
	Family       uint16
	Mode         uint8
	ReplayWindow uint8
	Flags        uint8
	Pad          [7]byte
}

func DeserializeXfrmUsersaInfo

func DeserializeXfrmUsersaInfo(b []byte) *XfrmUsersaInfo

func (*XfrmUsersaInfo) Len

func (msg *XfrmUsersaInfo) Len() int

func (*XfrmUsersaInfo) Serialize

func (msg *XfrmUsersaInfo) Serialize() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL