Documentation ¶
Index ¶
- func FilterByLocalListeningPorts(conns []*ConnectionStat) ([]string, error)
- func IsPrivateIP(ip net.IP) bool
- func LocalIPAddrs() ([]string, error)
- func LocalListeningPorts() ([]string, error)
- func NetlinkConnections() ([]*linux.InetDiagMsg, error)
- func NetlinkFilterByLocalListeningPorts(conns []*linux.InetDiagMsg) ([]*linux.InetDiagMsg, error)
- func NetlinkLocalListeningPorts() ([]string, error)
- func ResolveAddr(addr string) string
- type Addr
- type ConnectionStat
- type NetlinkError
- type UserEnt
- type UserEntByLport
- type UserEnts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterByLocalListeningPorts ¶ added in v0.4.0
func FilterByLocalListeningPorts(conns []*ConnectionStat) ([]string, error)
FilterByLocalListeningPorts filters ConnectionStat slice by the local listening ports.
func IsPrivateIP ¶ added in v0.6.0
IsPrivateIP returns whether 'ip' is in private network space.
func LocalIPAddrs ¶
LocalIPAddrs gets the string slice of localhost IPaddrs.
func LocalListeningPorts ¶
LocalListeningPorts returns the local listening ports.
func NetlinkConnections ¶ added in v0.4.0
func NetlinkConnections() ([]*linux.InetDiagMsg, error)
NetlinkConnections returns connection stats.
func NetlinkFilterByLocalListeningPorts ¶ added in v0.4.2
func NetlinkFilterByLocalListeningPorts(conns []*linux.InetDiagMsg) ([]*linux.InetDiagMsg, error)
NetlinkFilterByLocalListeningPorts filters ConnectionStat slice by the local listening ports.
func NetlinkLocalListeningPorts ¶ added in v0.4.2
NetlinkLocalListeningPorts returns the local listening ports.
func ResolveAddr ¶
ResolveAddr lookup first hostname from IP Address.
Types ¶
type ConnectionStat ¶ added in v0.4.3
ConnectionStat represents statistics for a connection.
func ProcfsConnections ¶ added in v0.4.3
func ProcfsConnections() ([]*ConnectionStat, error)
ProcfsConnections returns connection stats. ref. https://github.com/shirou/gopsutil/blob/c23bcca55e77b8389d84b09db8c5ac2b472070ef/net/net_linux.go#L656
type NetlinkError ¶ added in v0.5.0
type NetlinkError struct {
// contains filtered or unexported fields
}
NetlinkError represents netlink error.
func (*NetlinkError) Error ¶ added in v0.5.0
func (e *NetlinkError) Error() string
type UserEnt ¶ added in v0.5.0
type UserEnt struct {
// contains filtered or unexported fields
}
UserEnt represents a detail of network socket. see https://github.com/shemminger/iproute2/blob/afa588490b7e87c5adfb05d5163074e20b6ff14a/misc/ss.c#L509.
type UserEntByLport ¶ added in v0.5.0
UserEntByLport is a map that key is listening port, value is UserEnt structure.