sockdiag

package
v0.0.0-...-580d228 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InetDiagReqV2Len      = 56
	NlInetDiagReqV2MsgLen = 72 // includes netlink header
	NlInetDiagMsgLen      = 72
)
View Source
const SOCK_DIAG_BY_FAMILY = 20

Variables

View Source
var InetMsgLenError = errors.New("inet: invalid msg length")

Functions

func NewInetNetlinkMsg

func NewInetNetlinkMsg(nlHeader unix.NlMsghdr, inetHeader InetDiagReqV2) ([]byte, error)

func SerializeInetDiagReqV2

func SerializeInetDiagReqV2(req InetDiagReqV2) ([]byte, error)

Types

type InetDiagMsg

type InetDiagMsg struct {
	Family  uint8
	State   uint8
	Timer   uint8
	Retrans uint8
	ID      InetDiagSockID
	Expires uint32
	RQueue  uint32
	WQueue  uint32
	UID     uint32
	Inode   uint32
}

func DeserializeInetDiagMsg

func DeserializeInetDiagMsg(data []byte) (*InetDiagMsg, error)

type InetDiagReqV2

type InetDiagReqV2 struct {
	Family   uint8
	Protocol uint8
	Ext      uint8
	Pad      uint8
	States   uint32
	ID       InetDiagSockID
}

type InetDiagSockID

type InetDiagSockID struct {
	SPort  [2]byte  // source port          __be16  idiag_sport;
	DPort  [2]byte  // destination port     __be16  idiag_dport;
	Src    [16]byte // source address       __be32  idiag_src[4];
	Dst    [16]byte // destination address  __be32  idiag_dst[4];
	If     uint32
	Cookie [2]uint32
}

Jump to

Keyboard shortcuts

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