Documentation ¶
Index ¶
- Variables
- func ConvertToIPInt(ip string) uint32
- func ConvertToIPStr(ip uint32) string
- func GetDefaultIP() string
- func GrabSystemRandomIdlePort() (uint32, error)
- func GrabSystemRangeIdlePort(kind string, minPort uint32, maxPort uint32) (uint32, error)
- func IsIntranet(ipStr string) bool
- func Pids() ([]int32, error)
- func Reverse(s []byte) []byte
- type Addr
- type AddrInfo
- type ConnectionStat
- type InterfaceAddr
- type InterfaceStat
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoValidLocalAddr = errors.New("no valid local address.") ErrDeviceNameInvalid = errors.New("device name invalid.") )
View Source
var TCPStatuses = map[string]string{
"01": "ESTABLISHED",
"02": "SYN_SENT",
"03": "SYN_RECV",
"04": "FIN_WAIT1",
"05": "FIN_WAIT2",
"06": "TIME_WAIT",
"07": "CLOSE",
"08": "CLOSE_WAIT",
"09": "LAST_ACK",
"0A": "LISTEN",
"0B": "CLOSING",
}
http://students.mimuw.edu.pl/lxr/source/include/net/tcp_states.h
Functions ¶
func ConvertToIPInt ¶
func ConvertToIPStr ¶
func GetDefaultIP ¶
func GetDefaultIP() string
func GrabSystemRandomIdlePort ¶
GrabSystemRandomIdlePort is exported Get system random idle port, auto bind
func GrabSystemRangeIdlePort ¶
GrabSystemRangeIdlePort is exported
func IsIntranet ¶
Types ¶
type ConnectionStat ¶
type ConnectionStat struct { Fd uint32 `json:"fd"` Family uint32 `json:"family"` Type uint32 `json:"type"` Laddr Addr `json:"localaddr"` Raddr Addr `json:"remoteaddr"` Status string `json:"status"` Uids []int32 `json:"uids"` Pid int32 `json:"pid"` }
func ConnectionStats ¶
func ConnectionStats(kind string) ([]ConnectionStat, error)
Return a list of network connections opened.
func (ConnectionStat) String ¶
func (n ConnectionStat) String() string
type InterfaceAddr ¶
type InterfaceAddr struct {
Addr string `json:"addr"`
}
NetInterfaceAddr is designed for represent interface addresses
func (InterfaceAddr) String ¶
func (n InterfaceAddr) String() string
type InterfaceStat ¶
type InterfaceStat struct { MTU int `json:"mtu"` // maximum transmission unit Name string `json:"name"` // e.g., "en0", "lo0", "eth0.100" HardwareAddr string `json:"hardwareaddr"` // IEEE MAC-48, EUI-48 and EUI-64 form Flags []string `json:"flags"` // e.g., FlagUp, FlagLoopback, FlagMulticast Addrs []InterfaceAddr `json:"addrs"` }
func (InterfaceStat) String ¶
func (n InterfaceStat) String() string
Click to show internal directories.
Click to hide internal directories.