package net

Import Path
	github.com/gofiber/fiber/v2/internal/gopsutil/net (on go.dev)

Dependency Relation
	imports 14 packages, and imported by 2 packages

Involved Source Files net.go net_linux.go
Package-Level Type Names (total 9)
/* sort by: | */
Addr is implemented compatibility to psutil IP string Port uint32 ( Addr) String() string Addr : github.com/ChrisTrenkamp/goxpath/tree.Result Addr : fmt.Stringer
Family uint32 Fd uint32 Laddr Addr Pid int32 Raddr Addr Status string Type uint32 Uids []int32 ( ConnectionStat) String() string ConnectionStat : github.com/ChrisTrenkamp/goxpath/tree.Result ConnectionStat : fmt.Stringer func Connections(kind string) ([]ConnectionStat, error) func ConnectionsMax(kind string, max int) ([]ConnectionStat, error) func ConnectionsMaxWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) func ConnectionsMaxWithoutUidsWithContext(ctx context.Context, kind string, max int) ([]ConnectionStat, error) func ConnectionsPid(kind string, pid int32) ([]ConnectionStat, error) func ConnectionsPidMax(kind string, pid int32, max int) ([]ConnectionStat, error) func ConnectionsPidMaxWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) func ConnectionsPidMaxWithoutUids(kind string, pid int32, max int) ([]ConnectionStat, error) func ConnectionsPidMaxWithoutUidsWithContext(ctx context.Context, kind string, pid int32, max int) ([]ConnectionStat, error) func ConnectionsPidWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) func ConnectionsPidWithoutUids(kind string, pid int32) ([]ConnectionStat, error) func ConnectionsPidWithoutUidsWithContext(ctx context.Context, kind string, pid int32) ([]ConnectionStat, error) func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) func ConnectionsWithoutUids(kind string) ([]ConnectionStat, error) func ConnectionsWithoutUidsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).Connections() ([]ConnectionStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).ConnectionsMax(max int) ([]ConnectionStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).ConnectionsMaxWithContext(ctx context.Context, max int) ([]ConnectionStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).ConnectionsWithContext(ctx context.Context) ([]ConnectionStat, error)
ConntrackStat has conntrack summary info // Number of entries which were removed // Number of entries which were put to dying list // Number of packets dropped due to conntrack failure. // Dropped entries to make room for new ones, if maxsize reached // Number of entries in the conntrack table // Expectations added // Expectations deleted // Entries added after an expectation was already present // Number of searched entries which were successful // Subset of invalid. Packets that can't be tracked d/t error // Packets seen which are already connected to an entry // Number of entries inserted into the list // # insertion attempted but failed (same entry exists) // Number of packets seen which can not be tracked // Number of entries added which were not expected before // Conntrack table lookups restarted due to hashtable resizes // Number of conntrack table lookups performed ( ConntrackStat) String() string ConntrackStat : github.com/ChrisTrenkamp/goxpath/tree.Result ConntrackStat : fmt.Stringer func ConntrackStats(percpu bool) ([]ConntrackStat, error) func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) func NewConntrackStat(e, s, f, n, inv, ign, del, dlst, ins, insfail, drop, edrop, ie, en, ec, ed, sr uint32) *ConntrackStat func (*ConntrackStatList).Items() []ConntrackStat func (*ConntrackStatList).Summary() []ConntrackStat func (*ConntrackStatList).Append(c *ConntrackStat)
(*ConntrackStatList) Append(c *ConntrackStat) (*ConntrackStatList) Items() []ConntrackStat Summary returns a single-element list with totals from all list items. func NewConntrackStatList() *ConntrackStatList
ConnTrackCount int64 ConnTrackMax int64 func FilterCounters() ([]FilterStat, error) func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error)
NetInterfaceAddr is designed for represent interface addresses Addr string ( InterfaceAddr) String() string InterfaceAddr : github.com/ChrisTrenkamp/goxpath/tree.Result InterfaceAddr : fmt.Stringer
Addrs []InterfaceAddr // e.g., FlagUp, FlagLoopback, FlagMulticast // IEEE MAC-48, EUI-48 and EUI-64 form Index int // maximum transmission unit // e.g., "en0", "lo0", "eth0.100" ( InterfaceStat) String() string InterfaceStat : github.com/ChrisTrenkamp/goxpath/tree.Result InterfaceStat : fmt.Stringer func Interfaces() ([]InterfaceStat, error) func InterfacesWithContext(ctx context.Context) ([]InterfaceStat, error)
// number of bytes received // number of bytes sent // total number of incoming packets which were dropped // total number of outgoing packets which were dropped (always 0 on OSX and BSD) // total number of errors while receiving // total number of errors while sending // total number of FIFO buffers errors while receiving // total number of FIFO buffers errors while sending // interface name // number of packets received // number of packets sent ( IOCountersStat) String() string IOCountersStat : github.com/ChrisTrenkamp/goxpath/tree.Result IOCountersStat : fmt.Stringer func IOCounters(pernic bool) ([]IOCountersStat, error) func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) func IOCountersByFileWithContext(ctx context.Context, pernic bool, filename string) ([]IOCountersStat, error) func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).NetIOCounters(pernic bool) ([]IOCountersStat, error) func github.com/gofiber/fiber/v2/internal/gopsutil/process.(*Process).NetIOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error)
System wide stats about different network protocols Protocol string Stats map[string]int64 ( ProtoCountersStat) String() string ProtoCountersStat : github.com/ChrisTrenkamp/goxpath/tree.Result ProtoCountersStat : fmt.Stringer func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error)
Package-Level Functions (total 33)
Return a list of network connections opened.
Return a list of network connections opened returning at most `max` connections for each running process.
Return a list of network connections opened by a process.
Return up to `max` network connections opened by a process.
Return a list of network connections opened, omitting `Uids`. WithoutUids functions are reliant on implementation details. They may be altered to be an alias for Connections or be removed from the API in the future.
ConntrackStats returns more detailed info about the conntrack table
ConntrackStatsWithContext returns more detailed info about the conntrack table
NetFilterCounters returns iptables conntrack statistics the currently in use conntrack count and the max. If the file does not exist or is invalid it will return nil.
NetIOCounters returnes network I/O statistics for every network interface installed on the system. If pernic argument is false, return only sum of all information (which name is 'all'). If true, every network interface installed on the system is returned separately.
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error)
func NewConntrackStat(e, s, f, n, inv, ign, del, dlst, ins, insfail, drop, edrop, ie, en, ec, ed, sr uint32) *ConntrackStat
Pids retunres all pids. Note: this is a copy of process_linux.Pids() FIXME: Import process occures import cycle. move to common made other platform breaking. Need consider.
NetProtoCounters returns network statistics for the entire system If protocols is empty then all protocols are returned, otherwise just the protocols in the list are returned. Available protocols: ip,icmp,icmpmsg,tcp,udp,udplite
Reverse reverses array of bytes.
Package-Level Variables (only one)
http://students.mimuw.edu.pl/lxr/source/include/net/tcp_states.h
Package-Level Constants (total 17)
const CT_DELETE = 6
const CT_DELETE_LIST = 7
const CT_DROP = 10
const CT_EARLY_DROP = 11
const CT_ENTRIES = 0
const CT_EXPECT_CREATE = 14
const CT_EXPECT_DELETE = 15
const CT_EXPECT_NEW = 13
const CT_FOUND = 2
const CT_ICMP_ERROR = 12
const CT_IGNORE = 5
const CT_INSERT = 8
const CT_INSERT_FAILED = 9
const CT_INVALID = 4
const CT_NEW = 3
const CT_SEARCH_RESTART = 16
const CT_SEARCHED = 1