Documentation
¶
Index ¶
- Constants
- Variables
- func PrintInterfaceTable(ifstr string, cont bool, out io.Writer) error
- func PrintMulticastGroups(ipv4, ipv6 bool, out io.Writer) error
- type AddressFamily
- type CFMode
- type FmtFlags
- type Groups
- type IPAddress
- type IPv4
- type IPv6
- type NetSockets
- type NetStat
- type NetState
- type Output
- func (o *Output) AddIPSocket(ipsock netSocket)
- func (o *Output) AddRoute4(r routev4)
- func (o *Output) AddRoute6(r routev6)
- func (o *Output) AddUnixSocket(uSock unixSocket)
- func (o *Output) ConstructTimer(tr uint8, tl, retr, to uint64) string
- func (o *Output) InitIPSocketTitels()
- func (o *Output) InitRoute4Titel()
- func (o *Output) InitRoute6Titel()
- func (o *Output) InitUnixSocketTitels()
- type ProcNode
- type Protocol
- type SNMP
- type SNMP6
- type SockState
- type SockType
- type Socket
- type UnixSockets
Constants ¶
View Source
const ( SSFREE = 0 + iota SSUNCONNECTED SSCONNECTING SSCONNECTED SSDISCONNECTING )
View Source
const ( RTFUP uint32 = 0x0001 RTFGATEWAY uint32 = 0x0002 RTFHOST uint32 = 0x0004 RTFREINSTATE uint32 = 0x0008 RTFDYNAMIC uint32 = 0x0010 RTFMODIFIED uint32 = 0x0020 RTFMTU uint32 = 0x0040 RTFMSS uint32 = RTFMTU RTFWINDOW uint32 = 0x0080 RTFIRTT uint32 = 0x0100 RTFREJECT uint32 = 0x0200 RTFNOTCACHED uint32 = 0x0400 RTFDEFAULT uint32 = 0x00010000 RTFALLONLINK uint32 = 0x00020000 RTFADDRCONF uint32 = 0x00040000 RTFNONEXTHOP uint32 = 0x00200000 RTFEXPIRES uint32 = 0x00400000 RTFCACHE uint32 = 0x01000000 RTFFLOW uint32 = 0x02000000 RTFPOLICY uint32 = 0x04000000 RTFLOCAL uint32 = 0x80000000 )
View Source
const ( SSACCEPTCON = (1 << 16) SSWAITDATA = (1 << 17) SSNOSPACE = (1 << 18) )
View Source
const SystemClkTck = 100
CLK_TCK is a constant on Linux for all architectures except alpha and ia64. See e.g. https://git.musl-libc.org/cgit/musl/tree/src/conf/sysconf.c#n30 https://github.com/containerd/cgroups/pull/12 https://lore.kernel.org/lkml/agtlq6$iht$1@penguin.transmeta.com/
Variables ¶
View Source
var ( ANYADDR = "0.0.0.0" ANYMASK = "00000000" )
View Source
var ( ProcNetigmpv4path = "/proc/net/igmp" ProcNetigmpv6path = "/proc/net/igmp6" )
View Source
var ErrRouteCacheIPv6only = errors.New("route cache printing for IPv6 only")
View Source
var ProcNetDevPath = "/proc/net/dev"
View Source
var ProcNetRoutePath4 = "/proc/net/route"
View Source
var ProcNetRoutePath6 = "/proc/net/ipv6_route"
View Source
var ProcnetPath = "/proc/net"
View Source
var (
SNMP4file = "/proc/net/snmp"
)
View Source
var (
SNMP6file = "/proc/net/snmp6"
)
Functions ¶
Types ¶
type AddressFamily ¶
type AddressFamily interface {
RoutesFormatString(bool) (string, error)
PrintStatistics(io.Writer) error
ClearOutput()
}
func NewAddressFamily ¶
func NewAddressFamily(ipv6Flag bool, output *Output) AddressFamily
type FmtFlags ¶
type FmtFlags struct {
Extend bool // Adds fields User and Inode for ip sockets
Wide bool // Unknown
NumHosts bool // dont resolve host ip to names - applies to ip socks
NumPorts bool // dont resolve port numbers to names - applies to ip socks
NumUsers bool // dont resolve user id to usernames - applies to ip and unix socks
ProgNames bool // Adds fields PID/Program name for sockets (for ip and unix sockets)
Timer bool // Adds field timer for sockets (not unix socket)
Symbolic bool // Rounting table/cache -> no ip to name conversion, same as -n
}
type NetSockets ¶
type NetSockets struct {
Protocol
Entries []netSocket
}
func (*NetSockets) SocketsString ¶
func (n *NetSockets) SocketsString(lst, all bool, outputfmt *Output) (string, error)
type Output ¶
func (*Output) AddIPSocket ¶
func (o *Output) AddIPSocket(ipsock netSocket)
func (*Output) AddUnixSocket ¶
func (o *Output) AddUnixSocket(uSock unixSocket)
func (*Output) ConstructTimer ¶
func (*Output) InitIPSocketTitels ¶
func (o *Output) InitIPSocketTitels()
func (*Output) InitRoute4Titel ¶
func (o *Output) InitRoute4Titel()
func (*Output) InitRoute6Titel ¶
func (o *Output) InitRoute6Titel()
func (*Output) InitUnixSocketTitels ¶
func (o *Output) InitUnixSocketTitels()
type Protocol ¶
type Protocol string
const ( PROT_IGMP Protocol = "igmp" PROT_IGMP6 Protocol = "igmp6" PROT_TCP Protocol = "tcp" PROT_TCP6 Protocol = "tcp6" PROT_UDP Protocol = "udp" PROT_UDP6 Protocol = "udp6" PROT_UDPL Protocol = "udplite" PROT_UDPL6 Protocol = "udplite6" PROT_RAW Protocol = "raw" PROT_RAW6 Protocol = "raw6" PROT_UNIX Protocol = "unix" )
type Socket ¶
type UnixSockets ¶
type UnixSockets struct {
Entries []unixSocket
}
func (*UnixSockets) SocketsString ¶
func (u *UnixSockets) SocketsString(lst, all bool, outputfmt *Output) (string, error)
Click to show internal directories.
Click to hide internal directories.