MCPcopy
hub / github.com/evilsocket/opensnitch / OnConnectionEvent

Method OnConnectionEvent

daemon/statistics/stats.go:122–136  ·  view source on GitHub ↗

OnConnectionEvent sends the details of a new connection throughout a channel, in order to add the connection to the stats.

(con *conman.Connection, match *rule.Rule, wasMissed bool)

Source from the content-addressed store, hash-verified

120// OnConnectionEvent sends the details of a new connection throughout a channel,
121// in order to add the connection to the stats.
122func (s *Statistics) OnConnectionEvent(con *conman.Connection, match *rule.Rule, wasMissed bool) {
123 s.jobs <- conEvent{
124 con: con,
125 match: match,
126 wasMissed: wasMissed,
127 }
128 action := "<nil>"
129 rname := "<nil>"
130 if match != nil {
131 action = string(match.Action)
132 rname = string(match.Name)
133 }
134
135 s.logger.Log(con.Serialize(), action, rname)
136}
137
138// OnDNSResponse increases the counter of dns and accepted connections.
139func (s *Statistics) OnDNSResponse() {

Callers 1

onPacketFunction · 0.80

Calls 2

LogMethod · 0.65
SerializeMethod · 0.65

Tested by

no test coverage detected