MCPcopy Create free account
hub / github.com/SamNet-dev/snix / Add

Method Add

core/conntrack/connection.go:113–121  ·  view source on GitHub ↗

Add registers c. Returns false if an entry for the same tuple already exists.

(c *Connection)

Source from the content-addressed store, hash-verified

111
112// Add registers c. Returns false if an entry for the same tuple already exists.
113func (t *Table) Add(c *Connection) bool {
114 t.mu.Lock()
115 defer t.mu.Unlock()
116 if _, exists := t.m[c.Tuple]; exists {
117 return false
118 }
119 t.m[c.Tuple] = c
120 return true
121}
122
123// Get returns the connection for the given tuple, if any.
124func (t *Table) Get(k Tuple) (*Connection, bool) {

Callers 15

TestTableAddGetRemoveFunction · 0.95
startMethod · 0.80
handleOutboundMethod · 0.80
fnMethod · 0.80
TestRunEchoesFunction · 0.80
TestRunOnBytesNoDataRaceFunction · 0.80
RunFunction · 0.80
newScanSNICmdFunction · 0.80
newScanIPCmdFunction · 0.80
OpenMethod · 0.80
ProbeSNIsFunction · 0.80

Calls

no outgoing calls

Tested by 7

TestTableAddGetRemoveFunction · 0.76
fnMethod · 0.64
TestRunEchoesFunction · 0.64
TestRunOnBytesNoDataRaceFunction · 0.64
tlsTestServerFunction · 0.64
TestProbeSNIsConcurrentFunction · 0.64