Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) ListTcp4Conns() ([]*Entry, error)
- func (c *Client) ListTcp4Listeners() ([]*Entry, error)
- func (c *Client) ListTcp6Conns() ([]*Entry, error)
- func (c *Client) ListTcp6Listeners() ([]*Entry, error)
- func (c *Client) ListUdp4Listeners() ([]*Entry, error)
- func (c *Client) ListUdp4Sockets() ([]*Entry, error)
- func (c *Client) ListUdp6Listeners() ([]*Entry, error)
- func (c *Client) ListUdp6Sockets() ([]*Entry, error)
- type Entry
- type Summary
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotImplemented = errors.New("ss: not implemented")
)
errors about ss
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client can manipulate ss netlink interface.
func NewWithConn ¶
NewWithConn creates a Client which can issue ss commands using an existing netlink connection.
func (*Client) ListTcp4Conns ¶
ListTcp4Conns retrieves all tcp connections from kernel.
func (*Client) ListTcp4Listeners ¶
ListTcp4Listeners retreives all IPv4 tcp listeners from kernel.
func (*Client) ListTcp6Conns ¶
ListTcp6Conns retrieves all tcp connections from kernel.
func (*Client) ListTcp6Listeners ¶
ListTcp6Listeners retreives all IPv6 tcp listeners from kernel.
func (*Client) ListUdp4Listeners ¶
ListUdp4Listeners retreives all IPv4 Udp listeners from kernel.
func (*Client) ListUdp4Sockets ¶
ListUdp4Conns retrieves all Udp sockets from kernel.
func (*Client) ListUdp6Listeners ¶
ListUdp6Listeners retreives all IPv6 Udp listeners from kernel.
func (*Client) ListUdp6Sockets ¶
ListUdp6Conns retrieves all Udp sockets from kernel.
type Entry ¶
type Entry struct { State iproute2.SockStateType RecvQ, SendQ uint32 LocalAddr, PeerAddr net.IP LocalPort, PeerPort int Ifindex int Inode int IsIPv4 bool }
Entry contains sockets' information, such as state, receive queue size, send queue size, local address, local port , peer address and peer port.
type Summary ¶
type Summary struct { Sockets int TcpMem int TcpTotal int TcpOrphans int TcpTws int Tcp4Hashed int Udp4 int Raw4 int Frag4 int Frag4Mem int Tcp6Hashed int Udp6 int Raw6 int Frag6 int Frag6Mem int TcpEstablished int }
Summary is the kernel sockets' statistics.
func (*Summary) GetSockStat ¶
GetSockStat reads IPv4 socket statistics data from */proc/net/sockstat*.
func (*Summary) GetSockStat6 ¶
GetSockStat6 reads IPv6 socket statistics data from */proc/net/sockstat6*.
func (*Summary) GetTcpEstablished ¶
GetTcpEstablished gets the number of established tcp connections from */proc/net/snmp*.