netlink: github.com/vishvananda/netlink/nl Index | Files

package nl

import "github.com/vishvananda/netlink/nl"

Package nl has low level primitives for making Netlink calls.

Index

Package Files

addr_linux.go bridge_linux.go conntrack_linux.go genetlink_linux.go link_linux.go mpls_linux.go nl_linux.go rdma_link_linux.go route_linux.go seg6_linux.go seg6local_linux.go syscall.go tc_linux.go xfrm_linux.go xfrm_monitor_linux.go xfrm_policy_linux.go xfrm_state_linux.go

Constants

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

Bridge Flags

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] * }

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
)
const (
    RTEXT_FILTER_VF = 1 << iota
    RTEXT_FILTER_BRVLAN
    RTEXT_FILTER_BRVLAN_COMPRESSED
)

New extended info filters for IFLA_EXT_MASK

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

Track the message sizes for the correct serialization/deserialization

const (
    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

};

const (
    CTA_TUPLE_ORIG     = 1
    CTA_TUPLE_REPLY    = 2
    CTA_STATUS         = 3
    CTA_TIMEOUT        = 7
    CTA_MARK           = 8
    CTA_COUNTERS_ORIG  = 9
    CTA_COUNTERS_REPLY = 10
    CTA_PROTOINFO      = 4
)

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

};

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)

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)

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)

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)

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)

const (
    GENL_ID_CTRL      = 0x10
    GENL_CTRL_VERSION = 2
    GENL_CTRL_NAME    = "nlctrl"
)
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
)
const (
    GENL_CTRL_ATTR_OP_UNSPEC = iota
    GENL_CTRL_ATTR_OP_ID
    GENL_CTRL_ATTR_OP_FLAGS
)
const (
    GENL_ADMIN_PERM = 1 << iota
    GENL_CMD_CAP_DO
    GENL_CMD_CAP_DUMP
    GENL_CMD_CAP_HASPOL
)
const (
    GENL_CTRL_ATTR_MCAST_GRP_UNSPEC = iota
    GENL_CTRL_ATTR_MCAST_GRP_NAME
    GENL_CTRL_ATTR_MCAST_GRP_ID
)
const (
    GENL_GTP_VERSION = 0
    GENL_GTP_NAME    = "gtp"
)
const (
    GENL_GTP_CMD_NEWPDP = iota
    GENL_GTP_CMD_DELPDP
    GENL_GTP_CMD_GETPDP
)
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
)
const (
    IFLA_INFO_UNSPEC = iota
    IFLA_INFO_KIND
    IFLA_INFO_DATA
    IFLA_INFO_XSTATS
    IFLA_INFO_MAX = IFLA_INFO_XSTATS
)
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
)
const (
    VETH_INFO_UNSPEC = iota
    VETH_INFO_PEER
    VETH_INFO_MAX = VETH_INFO_PEER
)
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
)
const (
    BRIDGE_MODE_UNSPEC = iota
    BRIDGE_MODE_HAIRPIN
)
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_MAX = IFLA_BRPORT_PROXYARP_WIFI
)
const (
    IFLA_IPVLAN_UNSPEC = iota
    IFLA_IPVLAN_MODE
    IFLA_IPVLAN_MAX = IFLA_IPVLAN_MODE
)
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_MAX = IFLA_MACVLAN_FLAGS
)
const (
    MACVLAN_MODE_PRIVATE  = 1
    MACVLAN_MODE_VEPA     = 2
    MACVLAN_MODE_BRIDGE   = 4
    MACVLAN_MODE_PASSTHRU = 8
    MACVLAN_MODE_SOURCE   = 16
)
const (
    MACVLAN_MACADDR_ADD = iota
    MACVLAN_MACADDR_DEL
    MACVLAN_MACADDR_FLUSH
    MACVLAN_MACADDR_SET
)
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
)
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
)
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
)
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
)
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
)
const (
    IFLA_VF_INFO_UNSPEC = iota
    IFLA_VF_INFO
    IFLA_VF_INFO_MAX = IFLA_VF_INFO
)
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_MAX          = IFLA_VF_IB_PORT_GUID
)
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
)
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_MAX = IFLA_VF_STATS_MULTICAST
)
const (
    SizeofVfMac        = 0x24
    SizeofVfVlan       = 0x0c
    SizeofVfTxRate     = 0x08
    SizeofVfRate       = 0x0c
    SizeofVfSpoofchk   = 0x08
    SizeofVfLinkState  = 0x08
    SizeofVfRssQueryEn = 0x08
    SizeofVfTrust      = 0x08
    SizeofVfGUID       = 0x10
)
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
)
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
)
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
)
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
)
const (
    IFLA_VRF_UNSPEC = iota
    IFLA_VRF_TABLE
)
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
)
const (
    IFLA_GTP_UNSPEC = iota
    IFLA_GTP_FD0
    IFLA_GTP_FD1
    IFLA_GTP_PDP_HASHSIZE
    IFLA_GTP_ROLE
)
const (
    GTP_ROLE_GGSN = iota
    GTP_ROLE_SGSN
)
const (
    MPLS_LS_LABEL_SHIFT = 12
    MPLS_LS_S_SHIFT     = 8
)
const (
    // Family type definitions
    FAMILY_ALL  = unix.AF_UNSPEC
    FAMILY_V4   = unix.AF_INET
    FAMILY_V6   = unix.AF_INET6
    FAMILY_MPLS = 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
)
const (
    RDMA_NLDEV_CMD_GET = 1
    RDMA_NLDEV_CMD_SET = 2
)
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
)
const (
    SEG6_IPTUN_MODE_INLINE = iota
    SEG6_IPTUN_MODE_ENCAP
)

seg6 encap mode

const (
    SEG6_IPTUNNEL_UNSPEC = iota
    SEG6_IPTUNNEL_SRH
)

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

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
)

seg6local parameters

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

)

seg6local actions

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
)

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

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

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

socket diags related

const (
    RTA_NEWDST     = 0x13
    RTA_ENCAP_TYPE = 0x15
    RTA_ENCAP      = 0x16
)
const (
    MPLS_IPTUNNEL_UNSPEC = iota
    MPLS_IPTUNNEL_DST
)

RTA_ENCAP subtype

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

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

const (
    LINKLAYER_UNSPEC = iota
    LINKLAYER_ETHERNET
    LINKLAYER_ATM
)

LinkLayer

const (
    ATM_CELL_PAYLOAD = 48
    ATM_CELL_SIZE    = 53
)

ATM

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

const (
    TCA_UNSPEC = iota
    TCA_KIND
    TCA_OPTIONS
    TCA_STATS
    TCA_XSTATS
    TCA_RATE
    TCA_FCNT
    TCA_STATS2
    TCA_STAB
    TCA_MAX = TCA_STAB
)

Message types

const (
    TCA_ACT_TAB = 1
    TCAA_MAX    = 1
)
const (
    TCA_ACT_UNSPEC = iota
    TCA_ACT_KIND
    TCA_ACT_OPTIONS
    TCA_ACT_INDEX
    TCA_ACT_STATS
    TCA_ACT_MAX
)
const (
    TCA_PRIO_UNSPEC = iota
    TCA_PRIO_MQ
    TCA_PRIO_MAX = TCA_PRIO_MQ
)
const (
    TCA_STATS_UNSPEC = iota
    TCA_STATS_BASIC
    TCA_STATS_RATE_EST
    TCA_STATS_QUEUE
    TCA_STATS_APP
    TCA_STATS_MAX = TCA_STATS_APP
)
const (
    SizeofTcMsg          = 0x14
    SizeofTcActionMsg    = 0x04
    SizeofTcPrioMap      = 0x14
    SizeofTcRateSpec     = 0x0c
    SizeofTcNetemQopt    = 0x18
    SizeofTcNetemCorr    = 0x0c
    SizeofTcNetemReorder = 0x08
    SizeofTcNetemCorrupt = 0x08
    SizeofTcTbfQopt      = 2*SizeofTcRateSpec + 0x0c
    SizeofTcHtbCopt      = 2*SizeofTcRateSpec + 0x14
    SizeofTcHtbGlob      = 0x14
    SizeofTcU32Key       = 0x10
    SizeofTcU32Sel       = 0x10 // without keys
    SizeofTcGen          = 0x14
    SizeofTcMirred       = SizeofTcGen + 0x08
    SizeofTcPolice       = 2*SizeofTcRateSpec + 0x20
)
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
)
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
)
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
)
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
)
const (
    TC_U32_TERMINAL  = 1 << iota
    TC_U32_OFFSET    = 1 << iota
    TC_U32_VAROFFSET = 1 << iota
    TC_U32_EAT       = 1 << iota
)
const (
    TCA_GACT_UNSPEC = iota
    TCA_GACT_TM
    TCA_GACT_PARMS
    TCA_GACT_PROB
    TCA_GACT_MAX = TCA_GACT_PROB
)
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
)
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_MAX = TCA_BPF_FLAGS
)
const (
    TCA_MIRRED_UNSPEC = iota
    TCA_MIRRED_TM
    TCA_MIRRED_PARMS
    TCA_MIRRED_MAX = TCA_MIRRED_PARMS
)
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
)
const (
    TCA_MATCHALL_UNSPEC = iota
    TCA_MATCHALL_CLASSID
    TCA_MATCHALL_ACT
    TCA_MATCHALL_FLAGS
)
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
)
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
)
const (
    TCA_HFSC_UNSPEC = iota
    TCA_HFSC_RSC
    TCA_HFSC_FSC
    TCA_HFSC_USC
)
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

const (
    /* Netlink message attributes.  */
    XFRMA_UNSPEC         = 0x00
    XFRMA_ALG_AUTH       = 0x01 /* struct xfrm_algo */
    XFRMA_ALG_CRYPT      = 0x02 /* struct xfrm_algo */
    XFRMA_ALG_COMP       = 0x03 /* struct xfrm_algo */
    XFRMA_ENCAP          = 0x04 /* struct xfrm_algo + struct xfrm_encap_tmpl */
    XFRMA_TMPL           = 0x05 /* 1 or more struct xfrm_user_tmpl */
    XFRMA_SA             = 0x06 /* struct xfrm_usersa_info  */
    XFRMA_POLICY         = 0x07 /* struct xfrm_userpolicy_info */
    XFRMA_SEC_CTX        = 0x08 /* struct xfrm_sec_ctx */
    XFRMA_LTIME_VAL      = 0x09
    XFRMA_REPLAY_VAL     = 0x0a
    XFRMA_REPLAY_THRESH  = 0x0b
    XFRMA_ETIMER_THRESH  = 0x0c
    XFRMA_SRCADDR        = 0x0d /* xfrm_address_t */
    XFRMA_COADDR         = 0x0e /* xfrm_address_t */
    XFRMA_LASTUSED       = 0x0f /* unsigned long  */
    XFRMA_POLICY_TYPE    = 0x10 /* struct xfrm_userpolicy_type */
    XFRMA_MIGRATE        = 0x11
    XFRMA_ALG_AEAD       = 0x12 /* struct xfrm_algo_aead */
    XFRMA_KMADDRESS      = 0x13 /* struct xfrm_user_kmaddress */
    XFRMA_ALG_AUTH_TRUNC = 0x14 /* struct xfrm_algo_auth */
    XFRMA_MARK           = 0x15 /* struct xfrm_mark */
    XFRMA_TFCPAD         = 0x16 /* __u32 */
    XFRMA_REPLAY_ESN_VAL = 0x17 /* struct xfrm_replay_esn */
    XFRMA_SA_EXTRA_FLAGS = 0x18 /* __u32 */
    XFRMA_MAX            = 0x18
)

Attribute types

const (
    SizeofXfrmAddress     = 0x10
    SizeofXfrmSelector    = 0x38
    SizeofXfrmLifetimeCfg = 0x40
    SizeofXfrmLifetimeCur = 0x20
    SizeofXfrmId          = 0x18
    SizeofXfrmMark        = 0x08
)
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

const (
    SizeofXfrmUserpolicyId   = 0x40
    SizeofXfrmUserpolicyInfo = 0xa8
    SizeofXfrmUserTmpl       = 0x40
)
const (
    SizeofXfrmUsersaId       = 0x18
    SizeofXfrmStats          = 0x0c
    SizeofXfrmUsersaInfo     = 0xe0
    SizeofXfrmUserSpiInfo    = 0xe8
    SizeofXfrmAlgo           = 0x44
    SizeofXfrmAlgoAuth       = 0x48
    SizeofXfrmAlgoAEAD       = 0x48
    SizeofXfrmEncapTmpl      = 0x18
    SizeofXfrmUsersaFlush    = 0x8
    SizeofXfrmReplayStateEsn = 0x18
)
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
)
const (
    AF_MPLS = 28
)
const (
    CTA_PROTOINFO_TCP = 1
)

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)

const (
    DEFAULT_CHANGE = 0xFFFFFFFF
)
const (
    GENL_CTRL_CMD_GETFAMILY = 3
)
const IFA_CACHEINFO = 6
const (
    NFNETLINK_V0 = 0
)

#define NFNETLINK_V0 0

const (
    NLA_F_NESTED = (1 << 15)
)

#define NLA_F_NESTED (1 << 15)

const (
    RDMA_NL_GET_CLIENT_SHIFT = 10
)
const (
    RDMA_NL_NLDEV = 5
)
const (
    SEG6_IPTUNNEL_MAX = __SEG6_IPTUNNEL_MAX - 1
)
const (
    SEG6_LOCAL_ACTION_MAX = __SEG6_LOCAL_ACTION_MAX - 1
)
const (
    SEG6_LOCAL_MAX = __SEG6_LOCAL_MAX
)
const (
    SizeofBridgeVlanInfo = 0x04
)
const SizeofGenlmsg = 4
const SizeofIfaCacheInfo = 0x10
const (
    SizeofXfrmUserExpire = 0xe8
)
const (
    TCA_ACT_BPF = 13
)
const (
    TCA_ACT_GACT = 5
)
const (
    TCA_ACT_MIRRED = 8
)
const (
    TCA_BPF_FLAG_ACT_DIRECT uint32 = 1 << iota
)
const TC_LINKLAYER_MASK = 0x0F
const (
    TC_PRIO_MAX = 15
)
const (
    XFRM_INF = ^uint64(0)
)

Infinity for packet and byte counts

Variables

var L4ProtoMap = map[uint8]string{
    6:  "tcp",
    17: "udp",
}
var SupportedNlFamilies = []int{unix.NETLINK_ROUTE, unix.NETLINK_XFRM, unix.NETLINK_NETFILTER}

SupportedNlFamilies contains the list of netlink families this netlink package supports

func BytesToString Uses

func BytesToString(b []byte) string

func DecodeMPLSStack Uses

func DecodeMPLSStack(buf []byte) []int

func DecodeSEG6Encap Uses

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

func DecodeSEG6Srh Uses

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

func EncodeMPLSStack Uses

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

func EncodeSEG6Encap Uses

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

func EncodeSEG6Srh Uses

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

func GetIPFamily Uses

func GetIPFamily(ip net.IP) int

GetIPFamily returns the family type of a net.IP.

func NativeEndian Uses

func NativeEndian() binary.ByteOrder

Get native endianness for the system

func NonZeroTerminated Uses

func NonZeroTerminated(s string) []byte

func ParseRouteAttr Uses

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

func SEG6EncapModeString Uses

func SEG6EncapModeString(mode int) string

Helper functions

func SEG6LocalActionString Uses

func SEG6LocalActionString(action int) string

Helper functions

func SerializeHfscCurve Uses

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

func Swap16 Uses

func Swap16(i uint16) uint16

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

func Swap32 Uses

func Swap32(i uint32) uint32

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

func Uint16Attr Uses

func Uint16Attr(v uint16) []byte

func Uint32Attr Uses

func Uint32Attr(v uint32) []byte

func Uint64Attr Uses

func Uint64Attr(v uint64) []byte

func Uint8Attr Uses

func Uint8Attr(v uint8) []byte

func ZeroTerminated Uses

func ZeroTerminated(s string) []byte

type BridgeVlanInfo Uses

type BridgeVlanInfo struct {
    Flags uint16
    Vid   uint16
}

func DeserializeBridgeVlanInfo Uses

func DeserializeBridgeVlanInfo(b []byte) *BridgeVlanInfo

func (*BridgeVlanInfo) EngressUntag Uses

func (b *BridgeVlanInfo) EngressUntag() bool

func (*BridgeVlanInfo) PortVID Uses

func (b *BridgeVlanInfo) PortVID() bool

func (*BridgeVlanInfo) Serialize Uses

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

func (*BridgeVlanInfo) String Uses

func (b *BridgeVlanInfo) String() string

type Curve Uses

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

func DeserializeHfscCurve Uses

func DeserializeHfscCurve(b []byte) *Curve

func (*Curve) Attrs Uses

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

func (*Curve) Set Uses

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

type Genlmsg Uses

type Genlmsg struct {
    Command uint8
    Version uint8
}

func DeserializeGenlmsg Uses

func DeserializeGenlmsg(b []byte) *Genlmsg

func (*Genlmsg) Len Uses

func (msg *Genlmsg) Len() int

func (*Genlmsg) Serialize Uses

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

type HfscCopt Uses

type HfscCopt struct {
    Rsc Curve
    Fsc Curve
    Usc Curve
}

type IPv6SrHdr Uses

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

func (*IPv6SrHdr) Equal Uses

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

type IfAddrmsg Uses

type IfAddrmsg struct {
    unix.IfAddrmsg
}

func DeserializeIfAddrmsg Uses

func DeserializeIfAddrmsg(b []byte) *IfAddrmsg

func NewIfAddrmsg Uses

func NewIfAddrmsg(family int) *IfAddrmsg

func (*IfAddrmsg) Len Uses

func (msg *IfAddrmsg) Len() int

func (*IfAddrmsg) Serialize Uses

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

type IfInfomsg Uses

type IfInfomsg struct {
    unix.IfInfomsg
}

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

func DeserializeIfInfomsg Uses

func DeserializeIfInfomsg(b []byte) *IfInfomsg

func NewIfInfomsg Uses

func NewIfInfomsg(family int) *IfInfomsg

Create an IfInfomsg with family specified

func NewIfInfomsgChild Uses

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

func (*IfInfomsg) EncapType Uses

func (msg *IfInfomsg) EncapType() string

func (*IfInfomsg) Len Uses

func (msg *IfInfomsg) Len() int

func (*IfInfomsg) Serialize Uses

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

type IfaCacheInfo Uses

type IfaCacheInfo struct {
    IfaPrefered uint32
    IfaValid    uint32
    Cstamp      uint32
    Tstamp      uint32
}

func DeserializeIfaCacheInfo Uses

func DeserializeIfaCacheInfo(b []byte) *IfaCacheInfo

func (*IfaCacheInfo) Len Uses

func (msg *IfaCacheInfo) Len() int

func (*IfaCacheInfo) Serialize Uses

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

type NetlinkRequest Uses

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

func NewNetlinkRequest Uses

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 Uses

func (req *NetlinkRequest) AddData(data NetlinkRequestData)

func (*NetlinkRequest) AddRawData Uses

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

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

func (*NetlinkRequest) Execute Uses

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

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

func (*NetlinkRequest) Serialize Uses

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

Serialize the Netlink Request into a byte array

type NetlinkRequestData Uses

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

type NetlinkSocket Uses

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

func GetNetlinkSocketAt Uses

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 Uses

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 Uses

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 Uses

func (s *NetlinkSocket) Close()

func (*NetlinkSocket) GetFd Uses

func (s *NetlinkSocket) GetFd() int

func (*NetlinkSocket) GetPid Uses

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

func (*NetlinkSocket) Receive Uses

func (s *NetlinkSocket) Receive() ([]syscall.NetlinkMessage, error)

func (*NetlinkSocket) Send Uses

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

func (*NetlinkSocket) SetReceiveTimeout Uses

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

SetReceiveTimeout allows to set a receive timeout on the socket

func (*NetlinkSocket) SetSendTimeout Uses

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

SetSendTimeout allows to set a send timeout on the socket

type Nfgenmsg Uses

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 Uses

func DeserializeNfgenmsg(b []byte) *Nfgenmsg

func (*Nfgenmsg) Len Uses

func (msg *Nfgenmsg) Len() int

func (*Nfgenmsg) Serialize Uses

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

type RtAttr Uses

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

Extend RtAttr to handle data and children

func NewRtAttr Uses

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

Create a new Extended RtAttr object

func NewRtAttrChild Uses

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 Uses

func (a *RtAttr) AddChild(attr NetlinkRequestData)

AddChild adds an existing NetlinkRequestData as a child.

func (*RtAttr) AddRtAttr Uses

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

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

func (*RtAttr) Len Uses

func (a *RtAttr) Len() int

func (*RtAttr) Serialize Uses

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 Uses

type RtGenMsg struct {
    unix.RtGenmsg
}

func DeserializeRtGenMsg Uses

func DeserializeRtGenMsg(b []byte) *RtGenMsg

func NewRtGenMsg Uses

func NewRtGenMsg() *RtGenMsg

func (*RtGenMsg) Len Uses

func (msg *RtGenMsg) Len() int

func (*RtGenMsg) Serialize Uses

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

type RtMsg Uses

type RtMsg struct {
    unix.RtMsg
}

func DeserializeRtMsg Uses

func DeserializeRtMsg(b []byte) *RtMsg

func NewRtDelMsg Uses

func NewRtDelMsg() *RtMsg

func NewRtMsg Uses

func NewRtMsg() *RtMsg

func (*RtMsg) Len Uses

func (msg *RtMsg) Len() int

func (*RtMsg) Serialize Uses

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

type RtNexthop Uses

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

func DeserializeRtNexthop Uses

func DeserializeRtNexthop(b []byte) *RtNexthop

func (*RtNexthop) Len Uses

func (msg *RtNexthop) Len() int

func (*RtNexthop) Serialize Uses

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

type SocketHandle Uses

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 Uses

func (sh *SocketHandle) Close()

Close closes the netlink socket

type TcActionMsg Uses

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

func DeserializeTcActionMsg Uses

func DeserializeTcActionMsg(b []byte) *TcActionMsg

func (*TcActionMsg) Len Uses

func (msg *TcActionMsg) Len() int

func (*TcActionMsg) Serialize Uses

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

type TcBpf Uses

type TcBpf TcGen

type TcGact Uses

type TcGact TcGen

type TcGen Uses

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

func DeserializeTcGen Uses

func DeserializeTcGen(b []byte) *TcGen

func (*TcGen) Len Uses

func (msg *TcGen) Len() int

func (*TcGen) Serialize Uses

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

type TcHfscOpt Uses

type TcHfscOpt struct {
    Defcls uint16
}

func (*TcHfscOpt) Serialize Uses

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

type TcHtbCopt Uses

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

func DeserializeTcHtbCopt Uses

func DeserializeTcHtbCopt(b []byte) *TcHtbCopt

func (*TcHtbCopt) Len Uses

func (msg *TcHtbCopt) Len() int

func (*TcHtbCopt) Serialize Uses

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

type TcHtbGlob Uses

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

func DeserializeTcHtbGlob Uses

func DeserializeTcHtbGlob(b []byte) *TcHtbGlob

func (*TcHtbGlob) Len Uses

func (msg *TcHtbGlob) Len() int

func (*TcHtbGlob) Serialize Uses

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

type TcMirred Uses

type TcMirred struct {
    TcGen
    Eaction int32
    Ifindex uint32
}

func DeserializeTcMirred Uses

func DeserializeTcMirred(b []byte) *TcMirred

func (*TcMirred) Len Uses

func (msg *TcMirred) Len() int

func (*TcMirred) Serialize Uses

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

type TcMsg Uses

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

func DeserializeTcMsg Uses

func DeserializeTcMsg(b []byte) *TcMsg

func (*TcMsg) Len Uses

func (msg *TcMsg) Len() int

func (*TcMsg) Serialize Uses

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

type TcNetemCorr Uses

type TcNetemCorr struct {
    DelayCorr uint32
    LossCorr  uint32
    DupCorr   uint32
}

func DeserializeTcNetemCorr Uses

func DeserializeTcNetemCorr(b []byte) *TcNetemCorr

func (*TcNetemCorr) Len Uses

func (msg *TcNetemCorr) Len() int

func (*TcNetemCorr) Serialize Uses

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

type TcNetemCorrupt Uses

type TcNetemCorrupt struct {
    Probability uint32
    Correlation uint32
}

func DeserializeTcNetemCorrupt Uses

func DeserializeTcNetemCorrupt(b []byte) *TcNetemCorrupt

func (*TcNetemCorrupt) Len Uses

func (msg *TcNetemCorrupt) Len() int

func (*TcNetemCorrupt) Serialize Uses

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

type TcNetemQopt Uses

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

func DeserializeTcNetemQopt Uses

func DeserializeTcNetemQopt(b []byte) *TcNetemQopt

func (*TcNetemQopt) Len Uses

func (msg *TcNetemQopt) Len() int

func (*TcNetemQopt) Serialize Uses

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

type TcNetemReorder Uses

type TcNetemReorder struct {
    Probability uint32
    Correlation uint32
}

func DeserializeTcNetemReorder Uses

func DeserializeTcNetemReorder(b []byte) *TcNetemReorder

func (*TcNetemReorder) Len Uses

func (msg *TcNetemReorder) Len() int

func (*TcNetemReorder) Serialize Uses

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

type TcPolice Uses

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 Uses

func DeserializeTcPolice(b []byte) *TcPolice

func (*TcPolice) Len Uses

func (msg *TcPolice) Len() int

func (*TcPolice) Serialize Uses

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

type TcPrioMap Uses

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

func DeserializeTcPrioMap Uses

func DeserializeTcPrioMap(b []byte) *TcPrioMap

func (*TcPrioMap) Len Uses

func (msg *TcPrioMap) Len() int

func (*TcPrioMap) Serialize Uses

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

type TcRateSpec Uses

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

func DeserializeTcRateSpec Uses

func DeserializeTcRateSpec(b []byte) *TcRateSpec

func (*TcRateSpec) Len Uses

func (msg *TcRateSpec) Len() int

func (*TcRateSpec) Serialize Uses

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

type TcTbfQopt Uses

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

func DeserializeTcTbfQopt Uses

func DeserializeTcTbfQopt(b []byte) *TcTbfQopt

func (*TcTbfQopt) Len Uses

func (msg *TcTbfQopt) Len() int

func (*TcTbfQopt) Serialize Uses

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

type TcU32Key Uses

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

func DeserializeTcU32Key Uses

func DeserializeTcU32Key(b []byte) *TcU32Key

func (*TcU32Key) Len Uses

func (msg *TcU32Key) Len() int

func (*TcU32Key) Serialize Uses

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

type TcU32Sel Uses

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 Uses

func DeserializeTcU32Sel(b []byte) *TcU32Sel

func (*TcU32Sel) Len Uses

func (msg *TcU32Sel) Len() int

func (*TcU32Sel) Serialize Uses

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

type VfGUID Uses

type VfGUID struct {
    Vf   uint32
    Rsvd uint32
    GUID uint64
}

func DeserializeVfGUID Uses

func DeserializeVfGUID(b []byte) *VfGUID

func (*VfGUID) Len Uses

func (msg *VfGUID) Len() int

func (*VfGUID) Serialize Uses

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

type VfLinkState Uses

type VfLinkState struct {
    Vf        uint32
    LinkState uint32
}

func DeserializeVfLinkState Uses

func DeserializeVfLinkState(b []byte) *VfLinkState

func (*VfLinkState) Len Uses

func (msg *VfLinkState) Len() int

func (*VfLinkState) Serialize Uses

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

type VfMac Uses

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

func DeserializeVfMac Uses

func DeserializeVfMac(b []byte) *VfMac

func (*VfMac) Len Uses

func (msg *VfMac) Len() int

func (*VfMac) Serialize Uses

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

type VfRate Uses

type VfRate struct {
    Vf        uint32
    MinTxRate uint32
    MaxTxRate uint32
}

func DeserializeVfRate Uses

func DeserializeVfRate(b []byte) *VfRate

func (*VfRate) Len Uses

func (msg *VfRate) Len() int

func (*VfRate) Serialize Uses

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

type VfRssQueryEn Uses

type VfRssQueryEn struct {
    Vf      uint32
    Setting uint32
}

func DeserializeVfRssQueryEn Uses

func DeserializeVfRssQueryEn(b []byte) *VfRssQueryEn

func (*VfRssQueryEn) Len Uses

func (msg *VfRssQueryEn) Len() int

func (*VfRssQueryEn) Serialize Uses

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

type VfSpoofchk Uses

type VfSpoofchk struct {
    Vf      uint32
    Setting uint32
}

func DeserializeVfSpoofchk Uses

func DeserializeVfSpoofchk(b []byte) *VfSpoofchk

func (*VfSpoofchk) Len Uses

func (msg *VfSpoofchk) Len() int

func (*VfSpoofchk) Serialize Uses

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

type VfTrust Uses

type VfTrust struct {
    Vf      uint32
    Setting uint32
}

func DeserializeVfTrust Uses

func DeserializeVfTrust(b []byte) *VfTrust

func (*VfTrust) Len Uses

func (msg *VfTrust) Len() int

func (*VfTrust) Serialize Uses

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

type VfTxRate Uses

type VfTxRate struct {
    Vf   uint32
    Rate uint32
}

func DeserializeVfTxRate Uses

func DeserializeVfTxRate(b []byte) *VfTxRate

func (*VfTxRate) Len Uses

func (msg *VfTxRate) Len() int

func (*VfTxRate) Serialize Uses

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

type VfVlan Uses

type VfVlan struct {
    Vf   uint32
    Vlan uint32
    Qos  uint32
}

func DeserializeVfVlan Uses

func DeserializeVfVlan(b []byte) *VfVlan

func (*VfVlan) Len Uses

func (msg *VfVlan) Len() int

func (*VfVlan) Serialize Uses

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

type XfrmAddress Uses

type XfrmAddress [SizeofXfrmAddress]byte

func DeserializeXfrmAddress Uses

func DeserializeXfrmAddress(b []byte) *XfrmAddress

func (*XfrmAddress) FromIP Uses

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

func (*XfrmAddress) Serialize Uses

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

func (*XfrmAddress) ToIP Uses

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

func (*XfrmAddress) ToIPNet Uses

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

type XfrmAlgo Uses

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

func DeserializeXfrmAlgo Uses

func DeserializeXfrmAlgo(b []byte) *XfrmAlgo

func (*XfrmAlgo) Len Uses

func (msg *XfrmAlgo) Len() int

func (*XfrmAlgo) Serialize Uses

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

type XfrmAlgoAEAD Uses

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

func DeserializeXfrmAlgoAEAD Uses

func DeserializeXfrmAlgoAEAD(b []byte) *XfrmAlgoAEAD

func (*XfrmAlgoAEAD) Len Uses

func (msg *XfrmAlgoAEAD) Len() int

func (*XfrmAlgoAEAD) Serialize Uses

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

type XfrmAlgoAuth Uses

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

func DeserializeXfrmAlgoAuth Uses

func DeserializeXfrmAlgoAuth(b []byte) *XfrmAlgoAuth

func (*XfrmAlgoAuth) Len Uses

func (msg *XfrmAlgoAuth) Len() int

func (*XfrmAlgoAuth) Serialize Uses

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

type XfrmEncapTmpl Uses

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

func DeserializeXfrmEncapTmpl Uses

func DeserializeXfrmEncapTmpl(b []byte) *XfrmEncapTmpl

func (*XfrmEncapTmpl) Len Uses

func (msg *XfrmEncapTmpl) Len() int

func (*XfrmEncapTmpl) Serialize Uses

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

type XfrmId Uses

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

func DeserializeXfrmId Uses

func DeserializeXfrmId(b []byte) *XfrmId

func (*XfrmId) Len Uses

func (msg *XfrmId) Len() int

func (*XfrmId) Serialize Uses

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

type XfrmLifetimeCfg Uses

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

func DeserializeXfrmLifetimeCfg Uses

func DeserializeXfrmLifetimeCfg(b []byte) *XfrmLifetimeCfg

func (*XfrmLifetimeCfg) Len Uses

func (msg *XfrmLifetimeCfg) Len() int

func (*XfrmLifetimeCfg) Serialize Uses

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

type XfrmLifetimeCur Uses

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

func DeserializeXfrmLifetimeCur Uses

func DeserializeXfrmLifetimeCur(b []byte) *XfrmLifetimeCur

func (*XfrmLifetimeCur) Len Uses

func (msg *XfrmLifetimeCur) Len() int

func (*XfrmLifetimeCur) Serialize Uses

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

type XfrmMark Uses

type XfrmMark struct {
    Value uint32
    Mask  uint32
}

func DeserializeXfrmMark Uses

func DeserializeXfrmMark(b []byte) *XfrmMark

func (*XfrmMark) Len Uses

func (msg *XfrmMark) Len() int

func (*XfrmMark) Serialize Uses

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

type XfrmMsg Uses

type XfrmMsg interface {
    Type() XfrmMsgType
}

type XfrmMsgType Uses

type XfrmMsgType uint8

type XfrmReplayStateEsn Uses

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

func (*XfrmReplayStateEsn) Serialize Uses

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

type XfrmSelector Uses

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 Uses

func DeserializeXfrmSelector(b []byte) *XfrmSelector

func (*XfrmSelector) Len Uses

func (msg *XfrmSelector) Len() int

func (*XfrmSelector) Serialize Uses

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

type XfrmStats Uses

type XfrmStats struct {
    ReplayWindow    uint32
    Replay          uint32
    IntegrityFailed uint32
}

func DeserializeXfrmStats Uses

func DeserializeXfrmStats(b []byte) *XfrmStats

func (*XfrmStats) Len Uses

func (msg *XfrmStats) Len() int

func (*XfrmStats) Serialize Uses

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

type XfrmUserExpire Uses

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

func DeserializeXfrmUserExpire Uses

func DeserializeXfrmUserExpire(b []byte) *XfrmUserExpire

func (*XfrmUserExpire) Len Uses

func (msg *XfrmUserExpire) Len() int

func (*XfrmUserExpire) Serialize Uses

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

type XfrmUserSpiInfo Uses

type XfrmUserSpiInfo struct {
    XfrmUsersaInfo XfrmUsersaInfo
    Min            uint32
    Max            uint32
}

func DeserializeXfrmUserSpiInfo Uses

func DeserializeXfrmUserSpiInfo(b []byte) *XfrmUserSpiInfo

func (*XfrmUserSpiInfo) Len Uses

func (msg *XfrmUserSpiInfo) Len() int

func (*XfrmUserSpiInfo) Serialize Uses

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

type XfrmUserTmpl Uses

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 Uses

func DeserializeXfrmUserTmpl(b []byte) *XfrmUserTmpl

func (*XfrmUserTmpl) Len Uses

func (msg *XfrmUserTmpl) Len() int

func (*XfrmUserTmpl) Serialize Uses

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

type XfrmUserpolicyId Uses

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

func DeserializeXfrmUserpolicyId Uses

func DeserializeXfrmUserpolicyId(b []byte) *XfrmUserpolicyId

func (*XfrmUserpolicyId) Len Uses

func (msg *XfrmUserpolicyId) Len() int

func (*XfrmUserpolicyId) Serialize Uses

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

type XfrmUserpolicyInfo Uses

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 Uses

func DeserializeXfrmUserpolicyInfo(b []byte) *XfrmUserpolicyInfo

func (*XfrmUserpolicyInfo) Len Uses

func (msg *XfrmUserpolicyInfo) Len() int

func (*XfrmUserpolicyInfo) Serialize Uses

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

type XfrmUsersaFlush Uses

type XfrmUsersaFlush struct {
    Proto uint8
}

func DeserializeXfrmUsersaFlush Uses

func DeserializeXfrmUsersaFlush(b []byte) *XfrmUsersaFlush

func (*XfrmUsersaFlush) Len Uses

func (msg *XfrmUsersaFlush) Len() int

func (*XfrmUsersaFlush) Serialize Uses

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

type XfrmUsersaId Uses

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

func DeserializeXfrmUsersaId Uses

func DeserializeXfrmUsersaId(b []byte) *XfrmUsersaId

func (*XfrmUsersaId) Len Uses

func (msg *XfrmUsersaId) Len() int

func (*XfrmUsersaId) Serialize Uses

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

type XfrmUsersaInfo Uses

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 Uses

func DeserializeXfrmUsersaInfo(b []byte) *XfrmUsersaInfo

func (*XfrmUsersaInfo) Len Uses

func (msg *XfrmUsersaInfo) Len() int

func (*XfrmUsersaInfo) Serialize Uses

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

Package nl imports 12 packages (graph) and is imported by 144 packages. Updated 2018-11-09. Refresh now. Tools for package owners.