Documentation ¶
Index ¶
Constants ¶
const ( SizeofInetDiagReq = int(unsafe.Sizeof(InetDiagReq{})) SizeofInetDiagMsg = int(unsafe.Sizeof(InetDiagMsg{})) SizeofIfInfoMsg = unix.SizeofIfInfomsg SizeofIfAddrMsg = unix.SizeofIfAddrmsg SizeofIfaCacheinfo = unix.SizeofIfaCacheinfo SizeofNdMsg = unix.SizeofNdMsg SizeofRtMsg = unix.SizeofRtMsg )
size of some structures.
const ( AF_BRIDGE = 0x7 PF_BRIDGE = AF_BRIDGE )
copied from syscall
const ( NETLINK_ROUTE = 0x0 RTM_NEWNEIGH = 0x1c RTM_DELNEIGH = 0x1d RTM_GETNEIGH = 0x1e RTNLGRP_NEIGH = 0x3 )
copied from golang.org/x/sys/unix
const (
FamilySocketMonitoring = 0x0004
)
families for netlink socket
const (
IFLA_EXT_MASK = 0x1d
)
copied from src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux.go TODO(Asphaltt): use ztypes_linux.go instead
const (
MsgTypeSockDiagByFamily = 0x0014
)
message types for netlink message
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IfAddrMsg ¶
IfAddrMsg is an interface address message, that's an alias of golang.org/x/sys/unix.IfAddrmsg
func (*IfAddrMsg) MarshalBinary ¶
MarshalBinary marshals an interface address message to byte slice.
func (*IfAddrMsg) UnmarshalBinary ¶
UnmarshalBinary unmarshals an interface address message from byte slice.
type IfInfoMsg ¶
IfInfoMsg is an interface information message, that's an alias of golang.org/x/sys/unix.IfInfomsg
func (*IfInfoMsg) MarshalBinary ¶
MarshalBinary marshals an interface information message to byte slice.
func (*IfInfoMsg) UnmarshalBinary ¶
UnmarshalBinary unmarshals an interface information message from byte slice.
type IfaCacheinfo ¶
type IfaCacheinfo unix.IfaCacheinfo
IfaCacheinfo is an interface address information, that's an alias of golang.org/x/sys/unix.IfaCacheinfo
func (*IfaCacheinfo) MarshalBinary ¶
func (m *IfaCacheinfo) MarshalBinary() ([]byte, error)
MarshalBinary marshals an interface address information to byte slice.
func (*IfaCacheinfo) UnmarshalBinary ¶
func (m *IfaCacheinfo) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshals an interface address information from byte slice.
type InetDiagMsg ¶
type InetDiagMsg struct { Family uint8 State uint8 Timer uint8 Retrans uint8 InetDiagSockID Expires uint32 RQueue uint32 WQueue uint32 UID uint32 Inode uint32 }
An InetDiagMsg is a response message for sock diag netlink.
func (*InetDiagMsg) UnmarshalBinary ¶
func (msg *InetDiagMsg) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshals an inet diag response message from byte slice.
type InetDiagReq ¶
type InetDiagReq struct { Family uint8 Protocol uint8 Ext uint8 Pad uint8 States uint32 InetDiagSockID }
An InetDiagReq is a request message for sock diag netlink.
func (*InetDiagReq) MarshalBinary ¶
func (req *InetDiagReq) MarshalBinary() (data []byte, err error)
MarshalBinary marshals an inet diag request message to byte slice.
type InetDiagSockID ¶
type InetDiagSockID struct { Sport uint16 // big endian Dport uint16 // big endian Saddr [16]byte Daddr [16]byte Ifindex uint32 Cookie [2]uint32 }
An InetDiagSockID contains some info about a socket.
type NdAttrCacheInfo ¶
A NdAttrCacheInfo is the cache info in the neighbour/fdb message.
func (*NdAttrCacheInfo) UnmarshalBinary ¶
func (c *NdAttrCacheInfo) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshals a neighbour attribute's cache info from byte slice.
type NdAttrType ¶
type NdAttrType uint16
const ( NdaUnspec NdAttrType = iota NdaDst NdaLladdr NdaCacheInfo NdaProbes NdaVlan NdaPort NdaVNI NdaIfindex NdaMaster NdaLinkNetNSID NdaSrcVNI NdaProtocol NdaNhID NdaFdbExtAttrs )
types for error message attribute
type NdMsg ¶
NdMsg is a neighbour message, that's an alias of golang.org/x/sys/unix.NdMsg
func (*NdMsg) MarshalBinary ¶
MarshalBinary marshals a neighbour message to byte slice.
type RtMsg ¶
RtMsg is a route message, that's an alias of golang.org/x/sys/unix.RtMsg
func (*RtMsg) MarshalBinary ¶
MarshalBinary marshals a route message to byte slice.
func (*RtMsg) UnmarshalBinary ¶
UnmarshalBinary unmarshals a route message from byte slice.
type RtTextFilterType ¶
type RtTextFilterType int
New extended info filters for IFLA_EXT_MASK
const ( RTEXT_FILTER_VF RtTextFilterType = 1 << iota RTEXT_FILTER_BRVLAN RTEXT_FILTER_BRVLAN_COMPRESSED RTEXT_FILTER_SKIP_STATS RTEXT_FILTER_MRP RTEXT_FILTER_CFM_CONFIG RTEXT_FILTER_CFM_STATUS )
type SockDiagAttrType ¶
type SockDiagAttrType int
SockDiagAttrType is the type for sock diag's attribute.
const ( InetDiagNone SockDiagAttrType = iota InetDiagMemInfo InetDiagInfo InetDiagVegaInfo InetDiagCong InetDiagTOS InetDiagTclass InetDiagSkMemInfo InetDiagShutdown InetDiagDctcpInfo /* request as INET_DIAG_VEGASINFO */ InetDiagProtocol /* response attribute only */ InetDiagSkV6Only InetDiagLocals InetDiagPeers InetDiagPad InetDiagMark /* only with CAP_NET_ADMIN */ InetDiagBbrInfo /* request as INET_DIAG_VEGASINFO */ InetDiagClassID /* request as INET_DIAG_TCLASS */ InetDiagMD5Sig InetDiagUlpInfo InetDiagSkBpfStorages InetDiagCgroupID InetDiagSockOpt )
attribute types for sock diag message
type SockStateType ¶
type SockStateType int
SockStateType is the type for socket's state.
const ( Unknown SockStateType = iota Established SynSent SynRecv FinWait1 FinWait2 TimeWait Close CloseWait LastAck Listen Closing All SockStateType = 1<<(_Max) - 1 Conn SockStateType = All & ^((1 << Listen) | (1 << Close) | (1 << TimeWait) | (1 << SynRecv)) )
states for socket
func (SockStateType) String ¶
func (s SockStateType) String() string
String gets the description string of the state.