socket

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LISTEN              = 1024
	SOCK_DIAG_BY_FAMILY = 20
)

Variables

This section is empty.

Functions

func GetListeningPortsFor

func GetListeningPortsFor(pid int) ([]int, error)

func GetSocketInodesFor

func GetSocketInodesFor(pid int) ([]uint64, error)

Types

type Socket

type Socket struct {
	Family  uint8
	State   uint8
	Timer   uint8
	Retrans uint8
	ID      SocketID
	Expires uint32
	RQueue  uint32
	WQueue  uint32
	UID     uint32
	INode   uint32
}

Socket represents a netlink socket.

func SocketListen

func SocketListen() ([]*Socket, error)

SocketGet returns the Socket identified by its local and remote addresses.

type SocketID

type SocketID struct {
	SourcePort      uint16
	DestinationPort uint16
	Source          net.IP
	Destination     net.IP
	Interface       uint32
	Cookie          [2]uint32
}

Jump to

Keyboard shortcuts

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