Documentation ¶
Overview ¶
Package connection provides a struct to encode a single TCP connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { RemoteIP string RemotePort int LocalIP string LocalPort int Cookie string }
Connection models a single connection. This type is checked for equality elsewhere in traceroute-caller, so be very careful adding more fields as you might accidentally change program semantics elsewhere.
func (*Connection) UUID ¶
func (c *Connection) UUID() (string, error)
UUID returns uuid from cookie parsed from "ss -e" output.
type Creator ¶ added in v0.2.1
type Creator interface {
FromSockID(sockid inetdiag.SockID) (Connection, error)
}
Creator allows you to create a connection object from a SockID. It properly assigns SrcIP and DestIP to RemoteIP and LocalIP.
func NewCreator ¶ added in v0.2.1
NewCreator makes an object that can convert src and dst into local and remote IPs.
func NewFakeCreator ¶ added in v0.2.1
NewFakeCreator makes a fake creator with hardcoded local IPs to enable testing in diverse network environments.