Documentation ¶
Index ¶
- Constants
- Variables
- func Key(s string) string
- func StringOf(wt io.WriterTo) string
- func Uint32(attr Attr) uint32
- func Uint64(attr Attr) uint64
- func Uint8(attr Attr) uint8
- type AddressFamily
- type AddressFamilyAddress
- type AddressFamilyAttrType
- type Attr
- type AttrArray
- type AttrType
- type AttrVec
- func (p AttrVec) Len() uint
- func (p *AttrVec) ResetLen()
- func (p *AttrVec) Resize(n uint)
- func (a AttrVec) Set(v []byte) (vi int)
- func (a AttrVec) Size() (l int)
- func (p *AttrVec) Validate(i uint) *Attr
- func (p *AttrVec) ValidateInit(i uint, zero Attr) *Attr
- func (p *AttrVec) ValidateLen(l uint) (v *Attr)
- func (p *AttrVec) ValidateLenInit(l uint, zero Attr) (v *Attr)
- type Byter
- type DoneMessage
- type Empty
- type ErrorMessage
- type Errormsg
- type EthernetAddress
- func (a *EthernetAddress) Bytes() []byte
- func (a *EthernetAddress) Close() error
- func (a *EthernetAddress) Parse(b []byte)
- func (a *EthernetAddress) Set(v []byte)
- func (a *EthernetAddress) Size() int
- func (a *EthernetAddress) String() string
- func (a *EthernetAddress) WriteTo(w io.Writer) (int64, error)
- type GenMessage
- type Genmsg
- type Handler
- type Header
- type HeaderFlags
- type HexStringAttr
- type IfAddrAttrKind
- type IfAddrCacheInfo
- type IfAddrFlagAttr
- type IfAddrFlags
- type IfAddrMessage
- type IfAddrmsg
- type IfGRELinkInfoDataAttrKind
- type IfGRELinkInfoDataAttrType
- type IfInfoAttrKind
- type IfInfoFlags
- type IfInfoMessage
- func (m *IfInfoMessage) Close() error
- func (msg *IfInfoMessage) GetLinkInfoData() (as *AttrArray)
- func (m *IfInfoMessage) InterfaceKind() (k InterfaceKind)
- func (m *IfInfoMessage) Nsid() *int
- func (m *IfInfoMessage) Read(b []byte) (int, error)
- func (m *IfInfoMessage) String() string
- func (m *IfInfoMessage) Write(b []byte) (int, error)
- func (m *IfInfoMessage) WriteTo(w io.Writer) (int64, error)
- type IfInfomsg
- type IfIptunLinkInfoDataAttrKind
- type IfIptunLinkInfoDataAttrType
- type IfLinkInfoAttrKind
- type IfLinkInfoAttrType
- type IfOperState
- type IfVlanLinkInfoDataAttrKind
- type IfVlanLinkInfoDataAttrType
- type Int16Attr
- type Int32Attr
- type Int32er
- type Int64Attr
- type Int64er
- type Int8Attr
- type Int8er
- type InterfaceKind
- type Ip4Address
- type Ip4DevConf
- type Ip4DevConfKind
- type Ip4DevConfType
- type Ip4IfAttrKind
- type Ip4IfAttrType
- type Ip6Address
- type Ip6DevConf
- type Ip6DevConfKind
- type Ip6DevConfType
- type Ip6IfAttrKind
- type Ip6IfAttrType
- type Ip6IfFlagsAttr
- type L2IfType
- type LinkStatType
- type LinkStats
- type LinkStats64
- type ListenReq
- type LwtunnelEncapType
- type LwtunnelIp4AttrKind
- type LwtunnelIp4EncapAttrType
- type LwtunnelIp4EncapKindAttrType
- type LwtunnelIp6AttrKind
- type LwtunnelIp6EncapAttrType
- type LwtunnelIp6EncapKindAttrType
- type Message
- type MessageType
- type MsgType
- type MulticastGroup
- type NdaCacheInfo
- type Ndmsg
- type NeighborAttrKind
- type NeighborFlags
- type NeighborMessage
- func (m *NeighborMessage) AttrBytes(kind NeighborAttrKind) []byte
- func (m *NeighborMessage) Close() error
- func (m *NeighborMessage) Nsid() *int
- func (m *NeighborMessage) Read(b []byte) (int, error)
- func (m *NeighborMessage) String() string
- func (m *NeighborMessage) Write(b []byte) (int, error)
- func (m *NeighborMessage) WriteTo(w io.Writer) (int64, error)
- type NeighborState
- type NetnsAttrKind
- type NetnsMessage
- func (m *NetnsMessage) AttrBytes(kind NetnsAttrKind) []byte
- func (m *NetnsMessage) Close() error
- func (m *NetnsMessage) FD() uint32
- func (m *NetnsMessage) NSID() int32
- func (m *NetnsMessage) Nsid() *int
- func (m *NetnsMessage) PID() uint32
- func (m *NetnsMessage) Read(b []byte) (int, error)
- func (m *NetnsMessage) String() string
- func (m *NetnsMessage) Write(b []byte) (int, error)
- func (m *NetnsMessage) WriteTo(w io.Writer) (int64, error)
- type Netnsmsg
- type NlAttr
- type NoopMessage
- type RouteAttrKind
- type RouteFlags
- type RouteMessage
- type RouteProtocol
- type RouteTableKind
- type RouteType
- type RtNextHop
- type RtScope
- type RtaCacheInfo
- type RtaMultipath
- type Rtmsg
- type Runer
- type Socket
- type SocketConfig
- type StringAttr
- type Uint16Attr
- type Uint32Attr
- type Uint32er
- type Uint64Attr
- type Uint64er
- type Uint8Attr
- type Uint8er
- type VlanFlags
- type VlanProtocolAttr
Constants ¶
View Source
const ( RTNH_F_DEAD rtNextHopFlag = 1 << iota // Nexthop is dead (used by multipath) RTNH_F_PERVASIVE // Do recursive gateway lookup RTNH_F_ONLINK // Gateway is forced on link RTNH_F_OFFLOAD // offloaded route RTNH_F_LINKDOWN // carrier-down on nexthop RTNH_F_UNRESOLVED // The entry is unresolved (ipmr) )
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 )
View Source
const ( DefaultMessages = 64 DefaultNsid = -1 SizeofInt = (32 << (^uint(0) >> 63)) >> 3 )
View Source
const ( NLA_F_NESTED = 1 << 15 NLA_F_NET_BYTEORDER = 1 << 14 )
View Source
const ( INET6_IF_PREFIX_ONLINK = Ip6IfFlagsAttr(0x01) INET6_IF_PREFIX_AUTOCONF = Ip6IfFlagsAttr(0x02) INET6_IF_RA_OTHERCONF = Ip6IfFlagsAttr(0x80) INET6_IF_RA_MANAGED = Ip6IfFlagsAttr(0x40) INET6_IF_RA_RCVD = Ip6IfFlagsAttr(0x20) INET6_IF_RS_SENT = Ip6IfFlagsAttr(0x10) INET6_IF_READY = Ip6IfFlagsAttr(0x80000000) )
View Source
const ( NETLINK_ADD_MEMBERSHIP = iota + 1 NETLINK_DROP_MEMBERSHIP NETLINK_PKTINFO NETLINK_BROADCAST_ERROR NETLINK_NO_ENOBUFS NETLINK_RX_RING NETLINK_TX_RING NETLINK_LISTEN_ALL_NSID NETLINK_LIST_MEMBERSHIPS NETLINK_CAP_ACK )
View Source
const ( RTEXT_FILTER_VF uint32 = 1 << iota RTEXT_FILTER_BRVLAN RTEXT_FILTER_BRVLAN_COMPRESSED RTEXT_FILTER_SKIP_STATS )
Extended info filters for IFLA_EXT_MASK
View Source
const MaxUint32 = ^uint32(0)
View Source
const MaxUint64 = ^uint64(0)
View Source
const MaxUint8 = ^uint8(0)
View Source
const NETNSA_NSID_NOT_ASSIGNED = NetnsAttrKind(-1)
View Source
const NLMSG_ALIGNTO = 4
View Source
const NetnsPad = 3
View Source
const RTA_ALIGNTO = 4
View Source
const (
SOL_NETLINK = 270
)
Socket options
View Source
const SizeofAddressFamily = 1
View Source
const SizeofDoneMessage = SizeofHeader
View Source
const SizeofErrorMessage = SizeofHeader + SizeofErrormsg
View Source
const SizeofErrormsg = 4 + SizeofHeader
View Source
const SizeofGenMessage = SizeofHeader + SizeofGenmsg
View Source
const SizeofGenmsg = SizeofAddressFamily
View Source
const SizeofHeader = 4 + SizeofMsgType + SizeofHeaderFlags + 4 + 4
View Source
const SizeofHeaderFlags = 2
View Source
const SizeofIfAddrMessage = SizeofHeader + SizeofIfAddrmsg
View Source
const SizeofIfAddrmsg = 8
View Source
const SizeofIfInfoMessage = SizeofHeader + SizeofIfInfomsg
View Source
const SizeofIfInfomsg = 16
View Source
const SizeofMsgType = 2
View Source
const SizeofNdmsg = 12
View Source
const SizeofNeighborMessage = SizeofHeader + SizeofNdmsg
View Source
const SizeofNetnsMessage = SizeofHeader + SizeofNetnsmsg
View Source
const SizeofNetnsmsg = SizeofAddressFamily + NetnsPad
View Source
const SizeofNlAttr = 4
View Source
const SizeofNoopMessage = SizeofHeader
View Source
const SizeofRouteMessage = SizeofHeader + SizeofRtmsg
View Source
const SizeofRtmsg = 12
Variables ¶
View Source
var ( DefaultMulticastGroups = []MulticastGroup{ RTNLGRP_LINK, RTNLGRP_NEIGH, RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV4_ROUTE, RTNLGRP_IPV4_MROUTE, RTNLGRP_IPV6_IFADDR, RTNLGRP_IPV6_ROUTE, RTNLGRP_IPV6_MROUTE, RTNLGRP_NSID, } LinkMulticastGroups = []MulticastGroup{ RTNLGRP_LINK, } AddrMulticastGroups = []MulticastGroup{ RTNLGRP_IPV4_IFADDR, RTNLGRP_IPV6_IFADDR, } RouteMulticastGroups = []MulticastGroup{ RTNLGRP_IPV4_ROUTE, RTNLGRP_IPV6_ROUTE, RTNLGRP_IPV4_MROUTE, RTNLGRP_IPV6_MROUTE, } NeighborMulticastGroups = []MulticastGroup{ RTNLGRP_NEIGH, } NsidMulticastGroups = []MulticastGroup{ RTNLGRP_NSID, } DefaultListenReqs = []ListenReq{ {RTM_GETNSID, AF_UNSPEC}, {RTM_GETLINK, AF_PACKET}, {RTM_GETADDR, AF_INET}, {RTM_GETADDR, AF_INET6}, {RTM_GETNEIGH, AF_INET}, {RTM_GETNEIGH, AF_INET6}, {RTM_GETROUTE, AF_INET}, {RTM_GETROUTE, AF_INET6}, } LinkListenReqs = []ListenReq{ {RTM_GETLINK, AF_PACKET}, } AddrListenReqs = []ListenReq{ {RTM_GETADDR, AF_INET}, {RTM_GETADDR, AF_INET6}, } RouteListenReqs = []ListenReq{ {RTM_GETROUTE, AF_INET}, {RTM_GETROUTE, AF_INET6}, } NeighborListenReqs = []ListenReq{ {RTM_GETNEIGH, AF_INET}, {RTM_GETNEIGH, AF_INET6}, } NsidListenReqs = []ListenReq{ {RTM_GETNSID, AF_UNSPEC}, } NoopListenReq = ListenReq{NLMSG_NOOP, AF_UNSPEC} PageSize int )
View Source
var LwtunnelEncapNames = []string{ LWTUNNEL_ENCAP_NONE: "NONE", LWTUNNEL_ENCAP_MPLS: "MPLS", LWTUNNEL_ENCAP_IP: "IP", LWTUNNEL_ENCAP_ILA: "ILA", LWTUNNEL_ENCAP_IP6: "IP6", LWTUNNEL_ENCAP_SEG6: "SEG6", LWTUNNEL_ENCAP_BPF: "BPF", }
View Source
var LwtunnelIp4AttrKindNames = []string{ LWTUNNEL_IP_UNSPEC: "UNSPEC", LWTUNNEL_IP_ID: "ID", LWTUNNEL_IP_DST: "DST", LWTUNNEL_IP_SRC: "SRC", LWTUNNEL_IP_TTL: "TTL", LWTUNNEL_IP_TOS: "TOS", LWTUNNEL_IP_FLAGS: "FLAGS", }
View Source
var LwtunnelIp6AttrKindNames = []string{ LWTUNNEL_IP6_UNSPEC: "UNSPEC", LWTUNNEL_IP6_ID: "ID", LWTUNNEL_IP6_DST: "DST", LWTUNNEL_IP6_SRC: "SRC", LWTUNNEL_IP6_HOPLIMIT: "HOP LIMIT", LWTUNNEL_IP6_TC: "TC", LWTUNNEL_IP6_FLAGS: "FLAGS", }
Functions ¶
Types ¶
type AddressFamily ¶
type AddressFamily uint8
const ( AF_UNSPEC AddressFamily = iota AF_UNIX AF_INET AF_AX25 AF_IPX AF_APPLETALK AF_NETROM AF_BRIDGE AF_ATMPVC AF_X25 AF_INET6 AF_ROSE AF_DECnet AF_NETBEUI AF_SECURITY AF_KEY AF_NETLINK AF_PACKET AF_ASH AF_ECONET AF_ATMSVC AF_RDS AF_SNA AF_IRDA AF_PPPOX AF_WANPIPE AF_LLC AF_IB AF_MPLS AF_CAN AF_TIPC AF_BLUETOOTH AF_IUCV AF_RXRPC AF_ISDN AF_PHONET AF_IEEE802154 AF_CAIF AF_ALG AF_NFC AF_VSOCK )
func (AddressFamily) String ¶
func (af AddressFamily) String() string
func (AddressFamily) Uint ¶
func (af AddressFamily) Uint() uint8
type AddressFamilyAddress ¶
type AddressFamilyAttrType ¶
type AddressFamilyAttrType Empty
func NewAddressFamilyAttrType ¶
func NewAddressFamilyAttrType() *AddressFamilyAttrType
func (*AddressFamilyAttrType) Close ¶
func (t *AddressFamilyAttrType) Close() error
func (*AddressFamilyAttrType) IthString ¶
func (t *AddressFamilyAttrType) IthString(i int) string
type DoneMessage ¶
type DoneMessage struct { Header // contains filtered or unexported fields }
func NewDoneMessage ¶
func NewDoneMessage() *DoneMessage
func (*DoneMessage) Close ¶
func (m *DoneMessage) Close() error
func (*DoneMessage) Nsid ¶
func (m *DoneMessage) Nsid() *int
func (*DoneMessage) String ¶
func (m *DoneMessage) String() string
type ErrorMessage ¶
func NewErrorMessage ¶
func NewErrorMessage() *ErrorMessage
func (*ErrorMessage) Close ¶
func (m *ErrorMessage) Close() error
func (*ErrorMessage) Nsid ¶
func (m *ErrorMessage) Nsid() *int
func (*ErrorMessage) String ¶
func (m *ErrorMessage) String() string
type EthernetAddress ¶
type EthernetAddress [6]byte
func NewEthernetAddressBytes ¶
func NewEthernetAddressBytes(b []byte) *EthernetAddress
func (*EthernetAddress) Bytes ¶
func (a *EthernetAddress) Bytes() []byte
func (*EthernetAddress) Close ¶
func (a *EthernetAddress) Close() error
func (*EthernetAddress) Parse ¶
func (a *EthernetAddress) Parse(b []byte)
func (*EthernetAddress) Set ¶
func (a *EthernetAddress) Set(v []byte)
func (*EthernetAddress) Size ¶
func (a *EthernetAddress) Size() int
func (*EthernetAddress) String ¶
func (a *EthernetAddress) String() string
type GenMessage ¶
func NewGenMessage ¶
func NewGenMessage() *GenMessage
func (*GenMessage) Close ¶
func (m *GenMessage) Close() error
func (*GenMessage) Nsid ¶
func (m *GenMessage) Nsid() *int
func (*GenMessage) String ¶
func (m *GenMessage) String() string
type Genmsg ¶
type Genmsg struct {
AddressFamily
}
type Header ¶
type Header struct { Len uint32 Type MsgType Flags HeaderFlags Sequence uint32 Pid uint32 }
type HeaderFlags ¶
type HeaderFlags uint16
const ( NLM_F_REQUEST HeaderFlags = 1 /* It is request message. */ NLM_F_MULTI HeaderFlags = 2 /* Multipart message, terminated by NLMSG_DONE */ NLM_F_ACK HeaderFlags = 4 /* Reply with ack, with zero or error code */ NLM_F_ECHO HeaderFlags = 8 /* Echo this request */ NLM_F_DUMP_INTR HeaderFlags = 16 /* Dump was inconsistent due to sequence change */ /* Modifiers to GET request */ NLM_F_ROOT HeaderFlags = 0x100 NLM_F_MATCH HeaderFlags = 0x200 /* return all matching */ NLM_F_ATOMIC HeaderFlags = 0x400 /* atomic GET */ NLM_F_DUMP HeaderFlags = NLM_F_ROOT | NLM_F_MATCH /* Modifiers to NEW request */ NLM_F_REPLACE HeaderFlags = 0x100 /* Override existing */ NLM_F_EXCL HeaderFlags = 0x200 /* Do not touch, if it exists */ NLM_F_CREATE HeaderFlags = 0x400 /* Create, if it does not exist */ NLM_F_APPEND HeaderFlags = 0x800 /* Add to end of list */ )
func (HeaderFlags) String ¶
func (x HeaderFlags) String() string
type HexStringAttr ¶
func NewHexStringAttrBytes ¶
func NewHexStringAttrBytes(b []byte) *HexStringAttr
func (*HexStringAttr) Buffer ¶
func (a *HexStringAttr) Buffer() *bytes.Buffer
func (*HexStringAttr) Close ¶
func (a *HexStringAttr) Close() error
func (*HexStringAttr) Parse ¶
func (a *HexStringAttr) Parse(b []byte)
func (*HexStringAttr) Set ¶
func (a *HexStringAttr) Set(v []byte)
func (*HexStringAttr) Size ¶
func (a *HexStringAttr) Size() int
func (*HexStringAttr) String ¶
func (a *HexStringAttr) String() string
type IfAddrAttrKind ¶
type IfAddrAttrKind int
const ( IFA_UNSPEC IfAddrAttrKind = iota IFA_ADDRESS IFA_LOCAL IFA_LABEL IFA_BROADCAST IFA_ANYCAST IFA_CACHEINFO IFA_MULTICAST IFA_FLAGS IFA_MAX )
func (IfAddrAttrKind) String ¶
func (t IfAddrAttrKind) String() string
type IfAddrCacheInfo ¶
type IfAddrCacheInfo struct { Prefered uint32 Valid uint32 CreatedTimestamp uint32 /* created timestamp, hundredths of seconds */ UpdatedTimestamp uint32 /* updated timestamp, hundredths of seconds */ }
func NewIfAddrCacheInfoBytes ¶
func NewIfAddrCacheInfoBytes(b []byte) *IfAddrCacheInfo
func (*IfAddrCacheInfo) Close ¶
func (a *IfAddrCacheInfo) Close() error
func (*IfAddrCacheInfo) Parse ¶
func (a *IfAddrCacheInfo) Parse(b []byte)
func (*IfAddrCacheInfo) Set ¶
func (a *IfAddrCacheInfo) Set(v []byte)
func (*IfAddrCacheInfo) Size ¶
func (a *IfAddrCacheInfo) Size() int
func (*IfAddrCacheInfo) String ¶
func (a *IfAddrCacheInfo) String() string
type IfAddrFlagAttr ¶
type IfAddrFlagAttr uint32
func IfAddrFlagAttrBytes ¶
func IfAddrFlagAttrBytes(b []byte) IfAddrFlagAttr
func (IfAddrFlagAttr) Set ¶
func (a IfAddrFlagAttr) Set(v []byte)
func (IfAddrFlagAttr) Size ¶
func (a IfAddrFlagAttr) Size() int
func (IfAddrFlagAttr) String ¶
func (a IfAddrFlagAttr) String() string
type IfAddrFlags ¶
type IfAddrFlags uint32
const ( IFA_F_SECONDARY IfAddrFlags = 1 << iota IFA_F_NODAD IFA_F_OPTIMISTIC IFA_F_DADFAILED IFA_F_HOMEADDRESS IFA_F_DEPRECATED IFA_F_TENTATIVE IFA_F_PERMANENT IFA_F_MANAGETEMPADDR IFA_F_NOPREFIXROUTE IFA_F_MCAUTOJOIN IFA_F_STABLE_PRIVACY IFA_F_TEMPORARY = IFA_F_SECONDARY )
func (IfAddrFlags) String ¶
func (x IfAddrFlags) String() string
func (IfAddrFlags) Uint ¶
func (x IfAddrFlags) Uint() uint8
type IfAddrMessage ¶
type IfAddrMessage struct { Header IfAddrmsg Attrs [IFA_MAX]Attr // contains filtered or unexported fields }
func NewIfAddrMessage ¶
func NewIfAddrMessage() *IfAddrMessage
func (*IfAddrMessage) Close ¶
func (m *IfAddrMessage) Close() error
func (*IfAddrMessage) Nsid ¶
func (m *IfAddrMessage) Nsid() *int
func (*IfAddrMessage) String ¶
func (m *IfAddrMessage) String() string
type IfAddrmsg ¶
type IfAddrmsg struct { Family AddressFamily Prefixlen uint8 Flags uint8 Scope uint8 Index uint32 }
type IfGRELinkInfoDataAttrKind ¶
type IfGRELinkInfoDataAttrKind int
const ( IFLA_GRE_UNSPEC IfGRELinkInfoDataAttrKind = 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_IGNORE_DF IFLA_GRE_FWMARK IFLA_GRE_MAX )
func (IfGRELinkInfoDataAttrKind) String ¶
func (t IfGRELinkInfoDataAttrKind) String() string
type IfGRELinkInfoDataAttrType ¶
type IfGRELinkInfoDataAttrType Empty
func NewIfGRELinkInfoDataAttrType ¶
func NewIfGRELinkInfoDataAttrType() *IfGRELinkInfoDataAttrType
func (*IfGRELinkInfoDataAttrType) Close ¶
func (t *IfGRELinkInfoDataAttrType) Close() error
func (*IfGRELinkInfoDataAttrType) IthString ¶
func (t *IfGRELinkInfoDataAttrType) IthString(i int) string
type IfInfoAttrKind ¶
type IfInfoAttrKind int
const ( IFLA_UNSPEC IfInfoAttrKind = iota IFLA_ADDRESS IFLA_BROADCAST IFLA_IFNAME IFLA_MTU IFLA_LINK IFLA_QDISC IFLA_STATS IFLA_COST IFLA_PRIORITY IFLA_MASTER IFLA_WIRELESS /* Wireless Extension event - see wireless.h */ IFLA_PROTINFO /* Protocol specific information for a link */ IFLA_TXQLEN IFLA_MAP IFLA_WEIGHT IFLA_OPERSTATE IFLA_LINKMODE IFLA_LINKINFO IFLA_NET_NS_PID IFLA_IFALIAS IFLA_NUM_VF /* Number of VFs if device is SR-IOV PF */ IFLA_VFINFO_LIST IFLA_STATS64 IFLA_VF_PORTS IFLA_PORT_SELF IFLA_AF_SPEC IFLA_GROUP /* Group the device belongs to */ IFLA_NET_NS_FD IFLA_EXT_MASK /* Extended info mask VFs etc */ IFLA_PROMISCUITY /* Promiscuity count: > 0 means acts PROMISC */ IFLA_NUM_TX_QUEUES IFLA_NUM_RX_QUEUES IFLA_CARRIER IFLA_PHYS_PORT_ID IFLA_CARRIER_CHANGES IFLA_PHYS_SWITCH_ID IFLA_LINK_NETNSID IFLA_PHYS_PORT_NAME IFLA_PROTO_DOWN IFLA_GSO_MAX_SEGS IFLA_GSO_MAX_SIZE IFLA_PAD IFLA_XDP IFLA_EVENT IFLA_MAX )
func (IfInfoAttrKind) String ¶
func (t IfInfoAttrKind) String() string
type IfInfoFlags ¶
type IfInfoFlags uint32
const ( IFF_UP IfInfoFlags = 1 << iota IFF_BROADCAST IFF_DEBUG IFF_LOOPBACK IFF_POINTOPOINT IFF_NOTRAILERS IFF_RUNNING IFF_NOARP IFF_PROMISC IFF_ALLMULTI IFF_MASTER IFF_SLAVE IFF_MULTICAST IFF_PORTSEL IFF_AUTOMEDIA IFF_DYNAMIC IFF_LOWER_UP IFF_DORMANT IFF_ECHO )
func (IfInfoFlags) String ¶
func (x IfInfoFlags) String() string
type IfInfoMessage ¶
type IfInfoMessage struct { Header IfInfomsg Attrs [IFLA_MAX]Attr // contains filtered or unexported fields }
func NewIfInfoMessage ¶
func NewIfInfoMessage() *IfInfoMessage
func (*IfInfoMessage) Close ¶
func (m *IfInfoMessage) Close() error
func (*IfInfoMessage) GetLinkInfoData ¶
func (msg *IfInfoMessage) GetLinkInfoData() (as *AttrArray)
func (*IfInfoMessage) InterfaceKind ¶
func (m *IfInfoMessage) InterfaceKind() (k InterfaceKind)
func (*IfInfoMessage) Nsid ¶
func (m *IfInfoMessage) Nsid() *int
func (*IfInfoMessage) String ¶
func (m *IfInfoMessage) String() string
type IfInfomsg ¶
type IfInfomsg struct { Family uint8 L2IfType uint16 Index uint32 Flags IfInfoFlags Change IfInfoFlags // contains filtered or unexported fields }
type IfIptunLinkInfoDataAttrKind ¶
type IfIptunLinkInfoDataAttrKind int
const ( IFLA_IPTUN_UNSPEC IfIptunLinkInfoDataAttrKind = 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_FWMARK IFLA_IPTUN_MAX )
func (IfIptunLinkInfoDataAttrKind) String ¶
func (t IfIptunLinkInfoDataAttrKind) String() string
type IfIptunLinkInfoDataAttrType ¶
type IfIptunLinkInfoDataAttrType Empty
func NewIfIptunLinkInfoDataAttrType ¶
func NewIfIptunLinkInfoDataAttrType() *IfIptunLinkInfoDataAttrType
func (*IfIptunLinkInfoDataAttrType) Close ¶
func (t *IfIptunLinkInfoDataAttrType) Close() error
func (*IfIptunLinkInfoDataAttrType) IthString ¶
func (t *IfIptunLinkInfoDataAttrType) IthString(i int) string
type IfLinkInfoAttrKind ¶
type IfLinkInfoAttrKind int
const ( IFLA_INFO_UNSPEC IfLinkInfoAttrKind = iota IFLA_INFO_KIND IFLA_INFO_DATA IFLA_INFO_XSTATS IFLA_INFO_SLAVE_KIND IFLA_INFO_SLAVE_DATA IFLA_INFO_MAX )
func (IfLinkInfoAttrKind) String ¶
func (t IfLinkInfoAttrKind) String() string
type IfLinkInfoAttrType ¶
type IfLinkInfoAttrType Empty
func NewIfLinkInfoAttrType ¶
func NewIfLinkInfoAttrType() *IfLinkInfoAttrType
func (*IfLinkInfoAttrType) Close ¶
func (t *IfLinkInfoAttrType) Close() error
func (*IfLinkInfoAttrType) IthString ¶
func (t *IfLinkInfoAttrType) IthString(i int) string
type IfOperState ¶
type IfOperState uint8
const ( IF_OPER_UNKNOWN IfOperState = iota IF_OPER_NOTPRESENT IF_OPER_DOWN IF_OPER_LOWERLAYERDOWN IF_OPER_TESTING IF_OPER_DORMANT IF_OPER_UP )
func (IfOperState) Set ¶
func (a IfOperState) Set(v []byte)
func (IfOperState) Size ¶
func (a IfOperState) Size() int
func (IfOperState) String ¶
func (a IfOperState) String() string
type IfVlanLinkInfoDataAttrKind ¶
type IfVlanLinkInfoDataAttrKind int
const ( IFLA_VLAN_UNSPEC IfVlanLinkInfoDataAttrKind = iota IFLA_VLAN_ID IFLA_VLAN_FLAGS IFLA_VLAN_EGRESS_QOS IFLA_VLAN_INGRESS_QOS IFLA_VLAN_PROTOCOL IFLA_VLAN_MAX )
func (IfVlanLinkInfoDataAttrKind) String ¶
func (t IfVlanLinkInfoDataAttrKind) String() string
type IfVlanLinkInfoDataAttrType ¶
type IfVlanLinkInfoDataAttrType Empty
func NewIfVlanLinkInfoDataAttrType ¶
func NewIfVlanLinkInfoDataAttrType() *IfVlanLinkInfoDataAttrType
func (*IfVlanLinkInfoDataAttrType) Close ¶
func (t *IfVlanLinkInfoDataAttrType) Close() error
func (*IfVlanLinkInfoDataAttrType) IthString ¶
func (t *IfVlanLinkInfoDataAttrType) IthString(i int) string
type InterfaceKind ¶
type InterfaceKind int
const ( InterfaceKindUnknown InterfaceKind = iota InterfaceKindBridge InterfaceKindDummy InterfaceKindIp4GRE InterfaceKindIp4GRETap InterfaceKindIp6GRE InterfaceKindIp6GRETap InterfaceKindIp6Tunnel InterfaceKindIpip InterfaceKindSit InterfaceKindTun InterfaceKindVeth InterfaceKindVlan )
func (InterfaceKind) String ¶
func (k InterfaceKind) String() string
type Ip4Address ¶
type Ip4Address [4]byte
func NewIp4AddressBytes ¶
func NewIp4AddressBytes(b []byte) *Ip4Address
func (*Ip4Address) Bytes ¶
func (a *Ip4Address) Bytes() []byte
func (*Ip4Address) Close ¶
func (a *Ip4Address) Close() error
func (*Ip4Address) Parse ¶
func (a *Ip4Address) Parse(b []byte)
func (*Ip4Address) Set ¶
func (a *Ip4Address) Set(v []byte)
func (*Ip4Address) Size ¶
func (a *Ip4Address) Size() int
func (*Ip4Address) String ¶
func (a *Ip4Address) String() string
type Ip4DevConf ¶
type Ip4DevConf [IPV4_DEVCONF_MAX]uint32
func NewIp4DevConfBytes ¶
func NewIp4DevConfBytes(b []byte) *Ip4DevConf
func (*Ip4DevConf) Close ¶
func (a *Ip4DevConf) Close() error
func (*Ip4DevConf) Parse ¶
func (a *Ip4DevConf) Parse(b []byte)
func (*Ip4DevConf) Set ¶
func (a *Ip4DevConf) Set(v []byte)
func (*Ip4DevConf) Size ¶
func (a *Ip4DevConf) Size() int
func (*Ip4DevConf) String ¶
func (a *Ip4DevConf) String() string
type Ip4DevConfKind ¶
type Ip4DevConfKind int
const ( IPV4_DEVCONF_FORWARDING Ip4DevConfKind = iota + 1 IPV4_DEVCONF_MC_FORWARDING IPV4_DEVCONF_PROXY_ARP IPV4_DEVCONF_ACCEPT_REDIRECTS IPV4_DEVCONF_SECURE_REDIRECTS IPV4_DEVCONF_SEND_REDIRECTS IPV4_DEVCONF_SHARED_MEDIA IPV4_DEVCONF_RP_FILTER IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE IPV4_DEVCONF_BOOTP_RELAY IPV4_DEVCONF_LOG_MARTIANS IPV4_DEVCONF_TAG IPV4_DEVCONF_ARPFILTER IPV4_DEVCONF_MEDIUM_ID IPV4_DEVCONF_NOXFRM IPV4_DEVCONF_NOPOLICY IPV4_DEVCONF_FORCE_IGMP_VERSION IPV4_DEVCONF_ARP_ANNOUNCE IPV4_DEVCONF_ARP_IGNORE IPV4_DEVCONF_PROMOTE_SECONDARIES IPV4_DEVCONF_ARP_ACCEPT IPV4_DEVCONF_ARP_NOTIFY IPV4_DEVCONF_ACCEPT_LOCAL IPV4_DEVCONF_SRC_VMARK IPV4_DEVCONF_PROXY_ARP_PVLAN IPV4_DEVCONF_ROUTE_LOCALNET IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN IPV4_DEVCONF_MAX )
func (Ip4DevConfKind) String ¶
func (t Ip4DevConfKind) String() string
type Ip4DevConfType ¶
type Ip4DevConfType Empty
func (*Ip4DevConfType) IthString ¶
func (t *Ip4DevConfType) IthString(i int) string
type Ip4IfAttrKind ¶
type Ip4IfAttrKind int
const ( IFLA_INET_UNSPEC Ip4IfAttrKind = iota IFLA_INET_CONF )
func (Ip4IfAttrKind) String ¶
func (t Ip4IfAttrKind) String() string
type Ip4IfAttrType ¶
type Ip4IfAttrType Empty
func NewIp4IfAttrType ¶
func NewIp4IfAttrType() *Ip4IfAttrType
func (*Ip4IfAttrType) Close ¶
func (t *Ip4IfAttrType) Close() error
func (*Ip4IfAttrType) IthString ¶
func (t *Ip4IfAttrType) IthString(i int) string
type Ip6Address ¶
type Ip6Address [16]byte
func NewIp6AddressBytes ¶
func NewIp6AddressBytes(b []byte) *Ip6Address
func (*Ip6Address) Bytes ¶
func (a *Ip6Address) Bytes() []byte
func (*Ip6Address) Close ¶
func (a *Ip6Address) Close() error
func (*Ip6Address) Parse ¶
func (a *Ip6Address) Parse(b []byte)
func (*Ip6Address) Set ¶
func (a *Ip6Address) Set(v []byte)
func (*Ip6Address) Size ¶
func (a *Ip6Address) Size() int
func (*Ip6Address) String ¶
func (a *Ip6Address) String() string
type Ip6DevConf ¶
type Ip6DevConf [IPV6_DEVCONF_MAX]uint32
func NewIp6DevConfBytes ¶
func NewIp6DevConfBytes(b []byte) *Ip6DevConf
func (*Ip6DevConf) Close ¶
func (a *Ip6DevConf) Close() error
func (*Ip6DevConf) Parse ¶
func (a *Ip6DevConf) Parse(b []byte)
func (*Ip6DevConf) Set ¶
func (a *Ip6DevConf) Set(v []byte)
func (*Ip6DevConf) Size ¶
func (a *Ip6DevConf) Size() int
func (*Ip6DevConf) String ¶
func (a *Ip6DevConf) String() string
type Ip6DevConfKind ¶
type Ip6DevConfKind int
const ( IPV6_DEVCONF_FORWARDING Ip6DevConfKind = iota IPV6_DEVCONF_HOPLIMIT IPV6_DEVCONF_MTU6 IPV6_DEVCONF_ACCEPT_RA IPV6_DEVCONF_ACCEPT_REDIRECTS IPV6_DEVCONF_AUTOCONF IPV6_DEVCONF_DAD_TRANSMITS IPV6_DEVCONF_RTR_SOLICITS IPV6_DEVCONF_RTR_SOLICIT_INTERVAL IPV6_DEVCONF_RTR_SOLICIT_DELAY IPV6_DEVCONF_USE_TEMPADDR IPV6_DEVCONF_TEMP_VALID_LFT IPV6_DEVCONF_TEMP_PREFERED_LFT IPV6_DEVCONF_REGEN_MAX_RETRY IPV6_DEVCONF_MAX_DESYNC_FACTOR IPV6_DEVCONF_MAX_ADDRESSES IPV6_DEVCONF_FORCE_MLD_VERSION IPV6_DEVCONF_ACCEPT_RA_DEFRTR IPV6_DEVCONF_ACCEPT_RA_PINFO IPV6_DEVCONF_ACCEPT_RA_RTR_PREF IPV6_DEVCONF_RTR_PROBE_INTERVAL IPV6_DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN IPV6_DEVCONF_PROXY_NDP IPV6_DEVCONF_OPTIMISTIC_DAD IPV6_DEVCONF_ACCEPT_SOURCE_ROUTE IPV6_DEVCONF_MC_FORWARDING IPV6_DEVCONF_DISABLE_IPV6 IPV6_DEVCONF_ACCEPT_DAD IPV6_DEVCONF_FORCE_TLLAO IPV6_DEVCONF_NDISC_NOTIFY IPV6_DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL IPV6_DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL IPV6_DEVCONF_SUPPRESS_FRAG_NDISC IPV6_DEVCONF_ACCEPT_RA_FROM_LOCAL IPV6_DEVCONF_USE_OPTIMISTIC IPV6_DEVCONF_ACCEPT_RA_MTU IPV6_DEVCONF_STABLE_SECRET IPV6_DEVCONF_USE_OIF_ADDRS_ONLY IPV6_DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT IPV6_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN IPV6_DEVCONF_MAX )
func (Ip6DevConfKind) String ¶
func (t Ip6DevConfKind) String() string
type Ip6DevConfType ¶
type Ip6DevConfType Empty
func (*Ip6DevConfType) IthString ¶
func (t *Ip6DevConfType) IthString(i int) string
type Ip6IfAttrKind ¶
type Ip6IfAttrKind int
const ( IFLA_INET6_UNSPEC Ip6IfAttrKind = iota IFLA_INET6_FLAGS /* link flags */ IFLA_INET6_CONF /* sysctl parameters */ IFLA_INET6_STATS /* statistics */ IFLA_INET6_MCAST /* MC things. What of them? */ IFLA_INET6_CACHEINFO /* time values and max reasm size */ IFLA_INET6_ICMP6STATS /* statistics (icmpv6) */ IFLA_INET6_TOKEN /* device token */ IFLA_INET6_ADDR_GEN_MODE /* implicit address generator mode */ )
func (Ip6IfAttrKind) String ¶
func (t Ip6IfAttrKind) String() string
type Ip6IfAttrType ¶
type Ip6IfAttrType Empty
func NewIp6IfAttrType ¶
func NewIp6IfAttrType() *Ip6IfAttrType
func (*Ip6IfAttrType) Close ¶
func (t *Ip6IfAttrType) Close() error
func (*Ip6IfAttrType) IthString ¶
func (t *Ip6IfAttrType) IthString(i int) string
type Ip6IfFlagsAttr ¶
type Ip6IfFlagsAttr uint32
func Ip6IfFlagsAttrBytes ¶
func Ip6IfFlagsAttrBytes(b []byte) Ip6IfFlagsAttr
func (Ip6IfFlagsAttr) Set ¶
func (a Ip6IfFlagsAttr) Set(v []byte)
func (Ip6IfFlagsAttr) Size ¶
func (a Ip6IfFlagsAttr) Size() int
func (Ip6IfFlagsAttr) String ¶
func (a Ip6IfFlagsAttr) String() string
func (Ip6IfFlagsAttr) Uint ¶
func (a Ip6IfFlagsAttr) Uint() uint32
type L2IfType ¶
type L2IfType int
const ( /* ARP protocol HARDWARE identifiers. */ ARPHRD_NETROM L2IfType = 0 /* From KA9Q: NET/ROM pseudo. */ ARPHRD_ETHER L2IfType = 1 /* Ethernet 10/100Mbps. */ ARPHRD_EETHER L2IfType = 2 /* Experimental Ethernet. */ ARPHRD_AX25 L2IfType = 3 /* AX.25 Level 2. */ ARPHRD_PRONET L2IfType = 4 /* PROnet token ring. */ ARPHRD_CHAOS L2IfType = 5 /* Chaosnet. */ ARPHRD_IEEE802 L2IfType = 6 /* IEEE 802.2 Ethernet/TR/TB. */ ARPHRD_ARCNET L2IfType = 7 /* ARCnet. */ ARPHRD_APPLETLK L2IfType = 8 /* APPLEtalk. */ ARPHRD_DLCI L2IfType = 15 /* Frame Relay DLCI. */ ARPHRD_ATM L2IfType = 19 /* ATM. */ ARPHRD_METRICOM L2IfType = 23 /* Metricom STRIP (new IANA id). */ ARPHRD_IEEE1394 L2IfType = 24 /* IEEE 1394 IPv4 - RFC 2734. */ ARPHRD_EUI64 L2IfType = 27 /* EUI-64. */ ARPHRD_INFINIBAND L2IfType = 32 /* InfiniBand. */ /* Dummy types for non ARP hardware */ ARPHRD_SLIP L2IfType = 256 ARPHRD_CSLIP L2IfType = 257 ARPHRD_SLIP6 L2IfType = 258 ARPHRD_CSLIP6 L2IfType = 259 ARPHRD_RSRVD L2IfType = 260 /* Notional KISS type. */ ARPHRD_ADAPT L2IfType = 264 ARPHRD_ROSE L2IfType = 270 ARPHRD_X25 L2IfType = 271 /* CCITT X.25. */ ARPHRD_HWX25 L2IfType = 272 /* Boards with X.25 in firmware. */ ARPHRD_PPP L2IfType = 512 ARPHRD_CISCO L2IfType = 513 /* Cisco HDLC. */ ARPHRD_HDLC L2IfType = ARPHRD_CISCO ARPHRD_LAPB L2IfType = 516 /* LAPB. */ ARPHRD_DDCMP L2IfType = 517 /* Digital's DDCMP. */ ARPHRD_RAWHDLC L2IfType = 518 /* Raw HDLC. */ ARPHRD_TUNNEL L2IfType = 768 /* IPIP tunnel. */ ARPHRD_TUNNEL6 L2IfType = 769 /* IPIP6 tunnel. */ ARPHRD_FRAD L2IfType = 770 /* Frame Relay Access Device. */ ARPHRD_SKIP L2IfType = 771 /* SKIP vif. */ ARPHRD_LOOPBACK L2IfType = 772 /* Loopback device. */ ARPHRD_LOCALTLK L2IfType = 773 /* Localtalk device. */ ARPHRD_FDDI L2IfType = 774 /* Fiber Distributed Data Interface. */ ARPHRD_BIF L2IfType = 775 /* AP1000 BIF. */ ARPHRD_SIT L2IfType = 776 /* sit0 device - IPv6-in-IPv4. */ ARPHRD_IPDDP L2IfType = 777 /* IP-in-DDP tunnel. */ ARPHRD_IPGRE L2IfType = 778 /* GRE over IP. */ ARPHRD_PIMREG L2IfType = 779 /* PIMSM register interface. */ ARPHRD_HIPPI L2IfType = 780 /* High Performance Parallel I'face. */ ARPHRD_ASH L2IfType = 781 /* (Nexus Electronics) Ash. */ ARPHRD_ECONET L2IfType = 782 /* Acorn Econet. */ ARPHRD_IRDA L2IfType = 783 /* Linux-IrDA. */ ARPHRD_FCPP L2IfType = 784 /* Point to point fibrechanel. */ ARPHRD_FCAL L2IfType = 785 /* Fibrechanel arbitrated loop. */ ARPHRD_FCPL L2IfType = 786 /* Fibrechanel public loop. */ ARPHRD_FCFABRIC L2IfType = 787 /* Fibrechanel fabric. */ ARPHRD_IEEE802_TR L2IfType = 800 /* Magic type ident for TR. */ ARPHRD_IEEE80211 L2IfType = 801 /* IEEE 802.11. */ ARPHRD_IEEE80211_PRISM L2IfType = 802 /* IEEE 802.11 + Prism2 header. */ ARPHRD_IEEE80211_RADIOTAP L2IfType = 803 /* IEEE 802.11 + radiotap header. */ ARPHRD_IEEE802154 L2IfType = 804 /* IEEE 802.15.4 header. */ ARPHRD_IEEE802154_PHY L2IfType = 805 /* IEEE 802.15.4 PHY header. */ )
type LinkStatType ¶
type LinkStatType int
const ( Rx_packets LinkStatType = iota Tx_packets /* total packets transmitted */ Rx_bytes /* total bytes received */ Tx_bytes /* total bytes transmitted */ Rx_errors /* bad packets received */ Tx_errors /* packet transmit problems */ Rx_dropped /* no space in linux buffers */ Tx_dropped /* no space available in linux */ Multicast /* multicast packets received */ Collisions Rx_length_errors Rx_over_errors /* receiver ring buff overflow */ Rx_crc_errors /* recved pkt with crc error */ Rx_frame_errors /* recv'd frame alignment error */ Rx_fifo_errors /* recv'r fifo overrun */ Rx_missed_errors /* receiver missed packet */ Tx_aborted_errors Tx_carrier_errors Tx_fifo_errors Tx_heartbeat_errors Tx_window_errors Rx_compressed Tx_compressed N_link_stat )
func (LinkStatType) String ¶
func (t LinkStatType) String() string
type LinkStats64 ¶
type LinkStats64 [N_link_stat]uint64
func NewLinkStats64Bytes ¶
func NewLinkStats64Bytes(b []byte) *LinkStats64
func (*LinkStats64) Close ¶
func (a *LinkStats64) Close() error
func (*LinkStats64) Parse ¶
func (a *LinkStats64) Parse(b []byte)
func (*LinkStats64) Set ¶
func (a *LinkStats64) Set(v []byte)
func (*LinkStats64) Size ¶
func (a *LinkStats64) Size() int
func (*LinkStats64) String ¶
func (a *LinkStats64) String() string
type ListenReq ¶
type ListenReq struct { MsgType AddressFamily }
type LwtunnelEncapType ¶
type LwtunnelEncapType uint8
func (LwtunnelEncapType) Set ¶
func (x LwtunnelEncapType) Set(v []byte)
func (LwtunnelEncapType) Size ¶
func (x LwtunnelEncapType) Size() int
func (LwtunnelEncapType) String ¶
func (x LwtunnelEncapType) String() string
func (LwtunnelEncapType) Uint ¶
func (x LwtunnelEncapType) Uint() uint8
type LwtunnelIp4AttrKind ¶
type LwtunnelIp4AttrKind uint8
const ( LWTUNNEL_IP_UNSPEC LwtunnelIp4AttrKind = iota LWTUNNEL_IP_ID LWTUNNEL_IP_DST LWTUNNEL_IP_SRC LWTUNNEL_IP_TTL LWTUNNEL_IP_TOS LWTUNNEL_IP_FLAGS )
func (LwtunnelIp4AttrKind) String ¶
func (x LwtunnelIp4AttrKind) String() string
type LwtunnelIp4EncapAttrType ¶
type LwtunnelIp4EncapAttrType Empty
func NewLwtunnelIp4EncapAttrType ¶
func NewLwtunnelIp4EncapAttrType() *LwtunnelIp4EncapAttrType
func (*LwtunnelIp4EncapAttrType) Close ¶
func (t *LwtunnelIp4EncapAttrType) Close() error
func (*LwtunnelIp4EncapAttrType) IthString ¶
func (t *LwtunnelIp4EncapAttrType) IthString(i int) string
type LwtunnelIp4EncapKindAttrType ¶
type LwtunnelIp4EncapKindAttrType Empty
func NewLwtunnelIp4EncapKindAttrType ¶
func NewLwtunnelIp4EncapKindAttrType() *LwtunnelIp4EncapKindAttrType
func (*LwtunnelIp4EncapKindAttrType) Close ¶
func (t *LwtunnelIp4EncapKindAttrType) Close() error
func (*LwtunnelIp4EncapKindAttrType) IthString ¶
func (t *LwtunnelIp4EncapKindAttrType) IthString(i int) string
type LwtunnelIp6AttrKind ¶
type LwtunnelIp6AttrKind uint8
const ( LWTUNNEL_IP6_UNSPEC LwtunnelIp6AttrKind = iota LWTUNNEL_IP6_ID LWTUNNEL_IP6_DST LWTUNNEL_IP6_SRC LWTUNNEL_IP6_HOPLIMIT LWTUNNEL_IP6_TC LWTUNNEL_IP6_FLAGS )
func (LwtunnelIp6AttrKind) String ¶
func (x LwtunnelIp6AttrKind) String() string
type LwtunnelIp6EncapAttrType ¶
type LwtunnelIp6EncapAttrType Empty
func NewLwtunnelIp6EncapAttrType ¶
func NewLwtunnelIp6EncapAttrType() *LwtunnelIp6EncapAttrType
func (*LwtunnelIp6EncapAttrType) Close ¶
func (t *LwtunnelIp6EncapAttrType) Close() error
func (*LwtunnelIp6EncapAttrType) IthString ¶
func (t *LwtunnelIp6EncapAttrType) IthString(i int) string
type LwtunnelIp6EncapKindAttrType ¶
type LwtunnelIp6EncapKindAttrType Empty
func NewLwtunnelIp6EncapKindAttrType ¶
func NewLwtunnelIp6EncapKindAttrType() *LwtunnelIp6EncapKindAttrType
func (*LwtunnelIp6EncapKindAttrType) Close ¶
func (t *LwtunnelIp6EncapKindAttrType) Close() error
func (*LwtunnelIp6EncapKindAttrType) IthString ¶
func (t *LwtunnelIp6EncapKindAttrType) IthString(i int) string
type Message ¶
type Message interface { // The Message Closer returns itself to its respective pool. io.Closer MsgHeader() *Header MsgLen() int MsgType() MsgType Nsid() *int // The Message Reader stores itself in a given byte buffer. io.Reader // The Message Stringer returns itself as a formatted string. fmt.Stringer // The Message Writer loads itself from a given byte buffer. io.Writer // The Message WriterTo string formats itself into the given writer. io.WriterTo }
type MessageType ¶
type MessageType int
func (MessageType) String ¶
func (t MessageType) String() string
type MsgType ¶
type MsgType uint16
const ( NLMSG_NOOP MsgType = 0x1 /* Nothing */ NLMSG_ERROR MsgType = 0x2 /* Error */ NLMSG_DONE MsgType = 0x3 /* End of a dump */ NLMSG_OVERRUN MsgType = 0x4 /* Data lost */ RTM_NEWLINK MsgType = 16 RTM_DELLINK MsgType = 17 RTM_GETLINK MsgType = 18 RTM_SETLINK MsgType = 19 RTM_NEWADDR MsgType = 20 RTM_DELADDR MsgType = 21 RTM_GETADDR MsgType = 22 RTM_NEWROUTE MsgType = 24 RTM_DELROUTE MsgType = 25 RTM_GETROUTE MsgType = 26 RTM_NEWNEIGH MsgType = 28 RTM_DELNEIGH MsgType = 29 RTM_GETNEIGH MsgType = 30 RTM_NEWRULE MsgType = 32 RTM_DELRULE MsgType = 33 RTM_GETRULE MsgType = 34 RTM_NEWQDISC MsgType = 36 RTM_DELQDISC MsgType = 37 RTM_GETQDISC MsgType = 38 RTM_NEWTCLASS MsgType = 40 RTM_DELTCLASS MsgType = 41 RTM_GETTCLASS MsgType = 42 RTM_NEWTFILTER MsgType = 44 RTM_DELTFILTER MsgType = 45 RTM_GETTFILTER MsgType = 46 RTM_NEWACTION MsgType = 48 RTM_DELACTION MsgType = 49 RTM_GETACTION MsgType = 50 RTM_NEWPREFIX MsgType = 52 RTM_GETMULTICAST MsgType = 58 RTM_GETANYCAST MsgType = 62 RTM_NEWNEIGHTBL MsgType = 64 RTM_GETNEIGHTBL MsgType = 66 RTM_SETNEIGHTBL MsgType = 67 RTM_NEWNDUSEROPT MsgType = 68 RTM_NEWADDRLABEL MsgType = 72 RTM_DELADDRLABEL MsgType = 73 RTM_GETADDRLABEL MsgType = 74 RTM_GETDCB MsgType = 78 RTM_SETDCB MsgType = 79 RTM_NEWNETCONF MsgType = 80 RTM_GETNETCONF MsgType = 82 RTM_NEWMDB MsgType = 84 RTM_DELMDB MsgType = 85 RTM_GETMDB MsgType = 86 RTM_NEWNSID MsgType = 88 RTM_DELNSID MsgType = 89 RTM_GETNSID MsgType = 90 )
Header type field values
type MulticastGroup ¶
type MulticastGroup uint32
const ( RTNLGRP_LINK MulticastGroup = iota RTNLGRP_NOTIFY RTNLGRP_NEIGH RTNLGRP_TC RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_RULE RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_IFINFO RTNLGRP_DECnet_IFADDR RTNLGRP_NOP2 RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_RULE RTNLGRP_NOP4 RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_RULE RTNLGRP_ND_USEROPT RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_ROUTE RTNLGRP_DCB RTNLGRP_IPV4_NETCONF RTNLGRP_IPV6_NETCONF RTNLGRP_MDB RTNLGRP_MPLS_ROUTE RTNLGRP_NSID NOOP_RTNLGRP )
Multicast groups
type NdaCacheInfo ¶
func NewNdaCacheInfoBytes ¶
func NewNdaCacheInfoBytes(b []byte) *NdaCacheInfo
func (*NdaCacheInfo) Close ¶
func (a *NdaCacheInfo) Close() error
func (*NdaCacheInfo) Parse ¶
func (a *NdaCacheInfo) Parse(b []byte)
func (*NdaCacheInfo) Set ¶
func (a *NdaCacheInfo) Set(v []byte)
func (*NdaCacheInfo) Size ¶
func (a *NdaCacheInfo) Size() int
func (*NdaCacheInfo) String ¶
func (a *NdaCacheInfo) String() string
type Ndmsg ¶
type Ndmsg struct { Family AddressFamily Index uint32 State NeighborState Flags uint8 Type RouteType // contains filtered or unexported fields }
type NeighborAttrKind ¶
type NeighborAttrKind int
const ( NDA_UNSPEC NeighborAttrKind = iota NDA_DST NDA_LLADDR NDA_CACHEINFO NDA_PROBES NDA_VLAN NDA_PORT NDA_VNI NDA_IFINDEX NDA_MASTER NDA_LINK_NETNSID NDA_MAX )
func (NeighborAttrKind) String ¶
func (x NeighborAttrKind) String() string
type NeighborFlags ¶
type NeighborFlags int
const ( NTF_USE NeighborFlags = 0 NTF_SELF NeighborFlags = 1 NTF_MASTER NeighborFlags = 2 NTF_PROXY NeighborFlags = 3 NTF_EXT_LEARNED NeighborFlags = 4 NTF_ROUTER NeighborFlags = 7 )
func (NeighborFlags) String ¶
func (x NeighborFlags) String() string
type NeighborMessage ¶
type NeighborMessage struct { Header Ndmsg Attrs [NDA_MAX]Attr // contains filtered or unexported fields }
func NewNeighborMessage ¶
func NewNeighborMessage() *NeighborMessage
func (*NeighborMessage) AttrBytes ¶
func (m *NeighborMessage) AttrBytes(kind NeighborAttrKind) []byte
func (*NeighborMessage) Close ¶
func (m *NeighborMessage) Close() error
func (*NeighborMessage) Nsid ¶
func (m *NeighborMessage) Nsid() *int
func (*NeighborMessage) String ¶
func (m *NeighborMessage) String() string
type NeighborState ¶
type NeighborState uint16
const (
NUD_INCOMPLETE_BIT, NUD_INCOMPLETE NeighborState = iota, 1 << iota
NUD_REACHABLE_BIT, NUD_REACHABLE
NUD_STALE_BIT, NUD_STALE
NUD_DELAY_BIT, NUD_DELAY
NUD_PROBE_BIT, NUD_PROBE
NUD_FAILED_BIT, NUD_FAILED
NUD_NOARP_BIT, NUD_NOARP
NUD_PERMANENT_BIT, NUD_PERMANENT
NUD_NONE NeighborState = 0
)
func (NeighborState) String ¶
func (x NeighborState) String() string
type NetnsAttrKind ¶
type NetnsAttrKind int
const ( NETNSA_NONE NetnsAttrKind = iota NETNSA_NSID NETNSA_PID NETNSA_FD NETNSA_MAX )
func (NetnsAttrKind) String ¶
func (x NetnsAttrKind) String() string
type NetnsMessage ¶
type NetnsMessage struct { Header Netnsmsg Attrs [NETNSA_MAX]Attr // contains filtered or unexported fields }
func NewNetnsMessage ¶
func NewNetnsMessage() *NetnsMessage
func (*NetnsMessage) AttrBytes ¶
func (m *NetnsMessage) AttrBytes(kind NetnsAttrKind) []byte
func (*NetnsMessage) Close ¶
func (m *NetnsMessage) Close() error
func (*NetnsMessage) FD ¶
func (m *NetnsMessage) FD() uint32
func (*NetnsMessage) NSID ¶
func (m *NetnsMessage) NSID() int32
func (*NetnsMessage) Nsid ¶
func (m *NetnsMessage) Nsid() *int
func (*NetnsMessage) PID ¶
func (m *NetnsMessage) PID() uint32
func (*NetnsMessage) String ¶
func (m *NetnsMessage) String() string
type Netnsmsg ¶
type Netnsmsg struct { AddressFamily // contains filtered or unexported fields }
type NoopMessage ¶
type NoopMessage struct { Header // contains filtered or unexported fields }
func NewNoopMessage ¶
func NewNoopMessage() *NoopMessage
func (*NoopMessage) Close ¶
func (m *NoopMessage) Close() error
func (*NoopMessage) Nsid ¶
func (m *NoopMessage) Nsid() *int
func (*NoopMessage) String ¶
func (m *NoopMessage) String() string
type RouteAttrKind ¶
type RouteAttrKind int
const ( RTA_UNSPEC RouteAttrKind = iota RTA_DST RTA_SRC RTA_IIF RTA_OIF RTA_GATEWAY RTA_PRIORITY RTA_PREFSRC RTA_METRICS RTA_MULTIPATH RTA_PROTOINFO RTA_FLOW RTA_CACHEINFO RTA_SESSION RTA_MP_ALGO RTA_TABLE RTA_MARK RTA_MFC_STATS RTA_VIA RTA_NEWDST RTA_PREF RTA_ENCAP_TYPE RTA_ENCAP RTA_MAX )
func (RouteAttrKind) String ¶
func (x RouteAttrKind) String() string
type RouteFlags ¶
type RouteFlags uint32
const ( RTM_F_NOTIFY RouteFlags = 0x100 /* Notify user of route change */ RTM_F_CLONED RouteFlags = 0x200 /* This route is cloned */ RTM_F_EQUALIZE RouteFlags = 0x400 /* Multipath equalizer: NI */ RTM_F_PREFIX RouteFlags = 0x800 /* Prefix addresses */ )
func (RouteFlags) String ¶
func (x RouteFlags) String() string
type RouteMessage ¶
type RouteMessage struct { Header Rtmsg Attrs [RTA_MAX]Attr // contains filtered or unexported fields }
func NewRouteMessage ¶
func NewRouteMessage() *RouteMessage
func (*RouteMessage) Close ¶
func (m *RouteMessage) Close() error
func (*RouteMessage) Nsid ¶
func (m *RouteMessage) Nsid() *int
func (*RouteMessage) String ¶
func (m *RouteMessage) String() string
type RouteProtocol ¶
type RouteProtocol uint8
const ( RTPROT_UNSPEC RouteProtocol = 0 RTPROT_REDIRECT RouteProtocol = 1 /* Route installed by ICMP redirects; not used by current IPv4 */ RTPROT_KERNEL RouteProtocol = 2 /* Route installed by kernel */ RTPROT_BOOT RouteProtocol = 3 /* Route installed during boot */ RTPROT_STATIC RouteProtocol = 4 /* Route installed by administrator */ RTPROT_GATED RouteProtocol = 8 /* Apparently, GateD */ RTPROT_RA RouteProtocol = 9 /* RDISC/ND router advertisements */ RTPROT_MRT RouteProtocol = 10 /* Merit MRT */ RTPROT_ZEBRA RouteProtocol = 11 /* Zebra */ RTPROT_BIRD RouteProtocol = 12 /* BIRD */ RTPROT_DNROUTED RouteProtocol = 13 /* DECnet routing daemon */ RTPROT_XORP RouteProtocol = 14 /* XORP */ RTPROT_NTK RouteProtocol = 15 /* Netsukuku */ RTPROT_DHCP RouteProtocol = 16 /* DHCP client */ RTPROT_MROUTED RouteProtocol = 17 /* Multicast daemon */ RTPROT_BABEL RouteProtocol = 42 /* Babel daemon */ )
func (RouteProtocol) String ¶
func (x RouteProtocol) String() string
type RouteTableKind ¶
type RouteTableKind uint8
const ( RT_TABLE_UNSPEC RouteTableKind = 0 RT_TABLE_COMPAT RouteTableKind = 252 RT_TABLE_DEFAULT RouteTableKind = 253 RT_TABLE_MAIN RouteTableKind = 254 RT_TABLE_LOCAL RouteTableKind = 255 )
func (RouteTableKind) String ¶
func (x RouteTableKind) String() string
type RtaCacheInfo ¶
func NewRtaCacheInfoBytes ¶
func NewRtaCacheInfoBytes(b []byte) *RtaCacheInfo
func (*RtaCacheInfo) Close ¶
func (a *RtaCacheInfo) Close() error
func (*RtaCacheInfo) Parse ¶
func (a *RtaCacheInfo) Parse(b []byte)
func (*RtaCacheInfo) Set ¶
func (a *RtaCacheInfo) Set(v []byte)
func (*RtaCacheInfo) Size ¶
func (a *RtaCacheInfo) Size() int
func (*RtaCacheInfo) String ¶
func (a *RtaCacheInfo) String() string
type RtaMultipath ¶
type RtaMultipath struct {
NextHops []RtNextHop
}
func NewRtaMultipathBytes ¶
func NewRtaMultipathBytes(af AddressFamily, b []byte) *RtaMultipath
func (*RtaMultipath) Close ¶
func (a *RtaMultipath) Close() error
func (*RtaMultipath) Parse ¶
func (a *RtaMultipath) Parse(af AddressFamily, b []byte)
func (*RtaMultipath) Set ¶
func (a *RtaMultipath) Set(v []byte)
func (*RtaMultipath) Size ¶
func (a *RtaMultipath) Size() int
func (*RtaMultipath) String ¶
func (a *RtaMultipath) String() string
type Rtmsg ¶
type Rtmsg struct { Family AddressFamily DstLen uint8 SrcLen uint8 Tos uint8 Table RouteTableKind Protocol RouteProtocol Scope RtScope RouteType RouteType RouteFlags RouteFlags }
type Socket ¶
type Socket struct { Rx <-chan Message Tx chan<- Message SocketConfig // contains filtered or unexported fields }
func New ¶
func New(groups ...MulticastGroup) (*Socket, error)
func NewWithConfig ¶
func NewWithConfig(cf SocketConfig) (s *Socket, err error)
func NewWithConfigAndFile ¶
func NewWithConfigAndFile(cf SocketConfig, fd int) (s *Socket, err error)
func (*Socket) GetlinkReq ¶
func (s *Socket) GetlinkReq()
func (*Socket) Listen ¶
The Listen handler is for messages that we receive while waiting for the DONE or ERROR acknowledgement to each dump request.
func (*Socket) RxUntilDone ¶
type SocketConfig ¶
type SocketConfig struct { RxBytes int TxBytes int RxMessages int TxMessages int DontListenAllNsid bool Groups []MulticastGroup }
Zero means use default value.
type StringAttr ¶
type StringAttr string
func StringAttrBytes ¶
func StringAttrBytes(b []byte) StringAttr
func (StringAttr) Set ¶
func (a StringAttr) Set(v []byte)
func (StringAttr) Size ¶
func (a StringAttr) Size() int
func (StringAttr) String ¶
func (a StringAttr) String() string
type Uint16Attr ¶
type Uint16Attr uint16
func Uint16AttrBytes ¶
func Uint16AttrBytes(b []byte) Uint16Attr
func (Uint16Attr) Set ¶
func (a Uint16Attr) Set(v []byte)
func (Uint16Attr) Size ¶
func (a Uint16Attr) Size() int
func (Uint16Attr) String ¶
func (a Uint16Attr) String() string
func (Uint16Attr) Uint ¶
func (a Uint16Attr) Uint() uint16
type Uint32Attr ¶
type Uint32Attr uint32
func Uint32AttrBytes ¶
func Uint32AttrBytes(b []byte) Uint32Attr
func (Uint32Attr) Set ¶
func (a Uint32Attr) Set(v []byte)
func (Uint32Attr) Size ¶
func (a Uint32Attr) Size() int
func (Uint32Attr) String ¶
func (a Uint32Attr) String() string
func (Uint32Attr) Uint ¶
func (a Uint32Attr) Uint() uint32
type Uint64Attr ¶
type Uint64Attr uint64
func Uint64AttrBytes ¶
func Uint64AttrBytes(b []byte) Uint64Attr
func (Uint64Attr) Set ¶
func (a Uint64Attr) Set(v []byte)
func (Uint64Attr) Size ¶
func (a Uint64Attr) Size() int
func (Uint64Attr) String ¶
func (a Uint64Attr) String() string
func (Uint64Attr) Uint ¶
func (a Uint64Attr) Uint() uint64
type VlanFlags ¶
func NewVlanFlagsBytes ¶
type VlanProtocolAttr ¶
type VlanProtocolAttr uint16
func VlanProtocolAttrBytes ¶
func VlanProtocolAttrBytes(b []byte) VlanProtocolAttr
func (VlanProtocolAttr) Set ¶
func (a VlanProtocolAttr) Set(v []byte)
func (VlanProtocolAttr) Size ¶
func (a VlanProtocolAttr) Size() int
func (VlanProtocolAttr) String ¶
func (a VlanProtocolAttr) String() string
func (VlanProtocolAttr) Uint ¶
func (a VlanProtocolAttr) Uint() uint16
Click to show internal directories.
Click to hide internal directories.