Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // IPConntrackPath are ip_conntrack path. IPConntrackPath = "/proc/net/ip_conntrack" // old kernel // NFConntrackPath are nf_conntrack path. NFConntrackPath = "/proc/net/nf_conntrack" // new kernel )
Functions ¶
func FindConntrackPath ¶
func FindConntrackPath() string
FindConntrackPath returns the conntrack proc path if exists.
func LocalIPAddrs ¶
LocalIPAddrs gets the string slice of localhost IPaddrs.
func LocalListeningPorts ¶
LocalListeningPorts returns the local listening ports. eg. [199, 111, 46131, 53, 8953, 25, 2812, 80, 8081, 22] ----------------------------------------------------------------------------------- [y_uuki@host ~]$ netstat -tln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:199 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:46131 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:8953 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2812 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::8081 :::* LISTEN tcp 0 0 :::22 :::* LISTEN
func ResolveAddr ¶
ResolveAddr lookup first hostname from IP Address.
Types ¶
This section is empty.