Documentation ¶
Index ¶
- Constants
- func HashTuple(protocol flow.FlowProtocol, srcAddr net.IP, srcPort int64, dstAddr net.IP, ...) string
- func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error)
- type ConnectionCache
- func (c *ConnectionCache) Get(protocol flow.FlowProtocol, srcIP net.IP, srcPort int, dstIP net.IP, ...) (interface{}, string)
- func (c *ConnectionCache) Map(protocol flow.FlowProtocol, srcIP net.IP, srcPort int, dstIP net.IP, ...) (a *ProcessInfo, b *ProcessInfo)
- func (c *ConnectionCache) MapTCP(srcAddr, dstAddr *net.TCPAddr) (a *ProcessInfo, b *ProcessInfo)
- func (c *ConnectionCache) MapUDP(srcAddr, dstAddr *net.UDPAddr) (a *ProcessInfo, b *ProcessInfo)
- func (c *ConnectionCache) Remove(protocol flow.FlowProtocol, srcAddr, dstAddr *net.TCPAddr)
- func (c *ConnectionCache) Set(hash string, obj interface{})
- type ConnectionInfo
- func (c *ConnectionInfo) Decode(obj interface{}) error
- func (obj *ConnectionInfo) GetField(key string) (interface{}, error)
- func (obj *ConnectionInfo) GetFieldBool(key string) (bool, error)
- func (obj *ConnectionInfo) GetFieldInt64(key string) (int64, error)
- func (obj *ConnectionInfo) GetFieldKeys() []string
- func (obj *ConnectionInfo) GetFieldString(key string) (string, error)
- func (c *ConnectionInfo) Hash() string
- func (v ConnectionInfo) MarshalEasyJSON(w *jwriter.Writer)
- func (v ConnectionInfo) MarshalJSON() ([]byte, error)
- func (obj *ConnectionInfo) MatchBool(key string, predicate getter.BoolPredicate) bool
- func (obj *ConnectionInfo) MatchInt64(key string, predicate getter.Int64Predicate) bool
- func (obj *ConnectionInfo) MatchString(key string, predicate getter.StringPredicate) bool
- func (v *ConnectionInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ConnectionInfo) UnmarshalJSON(data []byte) error
- type ConnectionState
- type ProbeHandler
- type ProcProbe
- type ProcessInfo
Constants ¶
const ( StateUnknown = "UNKNOWN" StateEstablished = "ESTABLISHED" StateSynSent = "SYN_SENT" StateSynRecv = "SYN_RECV" StateFinWait1 = "FIN_WAIT1" StateFinWait2 = "FIN_WAIT2" StateTimeWait = "TIME_WAIT" StateClose = "CLOSE" StateCloseWait = "CLOSE_WAIT" StateLastAck = "LAST_ACK" StateListen = "LISTEN" StateClosing = "CLOSING" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectionCache ¶
type ConnectionCache struct {
*cache.Cache
}
ConnectionCache describes a cache of TCP connections
func NewConnectionCache ¶
func NewConnectionCache() *ConnectionCache
NewConnectionCache returns a new connection cache
func (*ConnectionCache) Get ¶
func (c *ConnectionCache) Get(protocol flow.FlowProtocol, srcIP net.IP, srcPort int, dstIP net.IP, dstPort int) (interface{}, string)
Get returns the connection for a pair of TCP addresses
func (*ConnectionCache) Map ¶
func (c *ConnectionCache) Map(protocol flow.FlowProtocol, srcIP net.IP, srcPort int, dstIP net.IP, dstPort int) (a *ProcessInfo, b *ProcessInfo)
Map a flow to a process
func (*ConnectionCache) MapTCP ¶
func (c *ConnectionCache) MapTCP(srcAddr, dstAddr *net.TCPAddr) (a *ProcessInfo, b *ProcessInfo)
MapTCP returns the sending and receiving processes for a pair of TCP addresses
func (*ConnectionCache) MapUDP ¶
func (c *ConnectionCache) MapUDP(srcAddr, dstAddr *net.UDPAddr) (a *ProcessInfo, b *ProcessInfo)
MapUDP returns the sending and receiving processes for a pair of UDP addresses
func (*ConnectionCache) Remove ¶
func (c *ConnectionCache) Remove(protocol flow.FlowProtocol, srcAddr, dstAddr *net.TCPAddr)
Remove the entry for a pair of TCP addresses
func (*ConnectionCache) Set ¶
func (c *ConnectionCache) Set(hash string, obj interface{})
Set maps a hash to a connection
type ConnectionInfo ¶
type ConnectionInfo struct { ProcessInfo `mapstructure:",squash"` LocalAddress string LocalPort int64 RemoteAddress string RemotePort int64 Protocol flow.FlowProtocol State ConnectionState }
ConnectionInfo describes a connection and its corresponding process easyjson:json gendecoder
func (*ConnectionInfo) Decode ¶
func (c *ConnectionInfo) Decode(obj interface{}) error
Decode an JSON object to connection info
func (*ConnectionInfo) GetField ¶
func (obj *ConnectionInfo) GetField(key string) (interface{}, error)
func (*ConnectionInfo) GetFieldBool ¶ added in v0.26.0
func (obj *ConnectionInfo) GetFieldBool(key string) (bool, error)
func (*ConnectionInfo) GetFieldInt64 ¶
func (obj *ConnectionInfo) GetFieldInt64(key string) (int64, error)
func (*ConnectionInfo) GetFieldKeys ¶ added in v0.21.0
func (obj *ConnectionInfo) GetFieldKeys() []string
func (*ConnectionInfo) GetFieldString ¶
func (obj *ConnectionInfo) GetFieldString(key string) (string, error)
func (*ConnectionInfo) Hash ¶
func (c *ConnectionInfo) Hash() string
Hash computes the hash of a connection
func (ConnectionInfo) MarshalEasyJSON ¶ added in v0.26.0
func (v ConnectionInfo) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ConnectionInfo) MarshalJSON ¶ added in v0.26.0
func (v ConnectionInfo) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ConnectionInfo) MatchBool ¶ added in v0.26.0
func (obj *ConnectionInfo) MatchBool(key string, predicate getter.BoolPredicate) bool
func (*ConnectionInfo) MatchInt64 ¶ added in v0.26.0
func (obj *ConnectionInfo) MatchInt64(key string, predicate getter.Int64Predicate) bool
func (*ConnectionInfo) MatchString ¶ added in v0.26.0
func (obj *ConnectionInfo) MatchString(key string, predicate getter.StringPredicate) bool
func (*ConnectionInfo) UnmarshalEasyJSON ¶ added in v0.26.0
func (v *ConnectionInfo) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ConnectionInfo) UnmarshalJSON ¶ added in v0.26.0
func (v *ConnectionInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ConnectionState ¶
type ConnectionState string
ConnectionState describes the state of a connection
type ProbeHandler ¶ added in v0.25.0
ProbeHandler describes a probe that collects active connections
type ProcProbe ¶ added in v0.25.0
ProcProbe describes a probe that collects active connections
func NewProcProbe ¶ added in v0.25.0
NewProcProbe create a new socket info probe
func (*ProcProbe) MapTCP ¶ added in v0.25.0
func (s *ProcProbe) MapTCP(srcAddr, dstAddr *net.TCPAddr) (src *ProcessInfo, dst *ProcessInfo)
MapTCP returns the sending and receiving processes for a pair of TCP addresses When using /proc, if the connection was not found at the first try, we scan /proc again
type ProcessInfo ¶
ProcessInfo describes the information of a running process