Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPID(socketInfo socket.Info, connInbound bool) (pid int, inbound bool, err error)
- func CleanUDPStates(_ context.Context)
- func EnableTCPDualStack()
- func EnableUDPDualStack()
- func Exists(pktInfo *packet.Info, now time.Time) (exists bool)
- func Lookup(pktInfo *packet.Info, fast bool) (pid int, inbound bool, err error)
- type Info
Constants ¶
View Source
const ( // UDPConnStateTTL is the maximum time a udp connection state is held. UDPConnStateTTL = 72 * time.Hour // UDPConnStateShortenedTTL is a shortened maximum time a udp connection state is held, if there more entries than defined by AggressiveCleaningThreshold. UDPConnStateShortenedTTL = 3 * time.Hour // AggressiveCleaningThreshold defines the soft limit of udp connection state held per udp socket. AggressiveCleaningThreshold = 256 )
View Source
const ( // UDPConnectionTTL defines the duration after which unseen UDP connections are regarded as ended. UDPConnectionTTL = 10 * time.Minute )
Variables ¶
View Source
var ( ErrConnectionNotFound = errors.New("could not find connection in system state tables") ErrPIDNotFound = errors.New("could not find pid for socket inode") )
Errors.
Functions ¶
func CheckPID ¶
CheckPID checks the if socket info already has a PID and if not, tries to find it. Depending on the OS, this might be a no-op.
func CleanUDPStates ¶
CleanUDPStates cleans the udp connection states which save connection directions.
func EnableTCPDualStack ¶
func EnableTCPDualStack()
EnableTCPDualStack adds the TCP6 table to the TCP4 table as a dual-stack. Must be called before any lookup operation.
func EnableUDPDualStack ¶
func EnableUDPDualStack()
EnableUDPDualStack adds the UDP6 table to the UDP4 table as a dual-stack. Must be called before any lookup operation.
Types ¶
type Info ¶
type Info struct { record.Base sync.Mutex TCP4Connections []*socket.ConnectionInfo TCP4Listeners []*socket.BindInfo TCP6Connections []*socket.ConnectionInfo TCP6Listeners []*socket.BindInfo UDP4Binds []*socket.BindInfo UDP6Binds []*socket.BindInfo }
Info holds network state information as provided by the system.
Click to show internal directories.
Click to hide internal directories.