MCPcopy
hub / github.com/bettercap/bettercap / setupMockSession

Function setupMockSession

modules/arp_spoof/arp_spoof_test.go:117–123  ·  view source on GitHub ↗

Override session methods to use our mocks

(mockSess *MockSession)

Source from the content-addressed store, hash-verified

115
116// Override session methods to use our mocks
117func setupMockSession(mockSess *MockSession) {
118 // Replace the Session's FindMAC method behavior by manipulating the LAN
119 // Since we can't override methods directly, we'll ensure the LAN has the data
120 for ip, mac := range mockSess.findMACResults {
121 mockSess.Lan.AddIfNew(ip, mac.String())
122 }
123}
124
125func (m *MockSession) FindMAC(ip net.IP, probe bool) (net.HardwareAddr, error) {
126 // First check our mock results

Callers

nothing calls this directly

Calls 2

AddIfNewMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected