MCPcopy
hub / github.com/bettercap/bettercap / dummyCallback

Function dummyCallback

modules/packet_proxy/packet_proxy_linux.go:199–210  ·  view source on GitHub ↗

we need this because for some reason we can't directly pass the symbol loaded from the plugin as a direct CGO callback ... ¯\_(ツ)_/¯

(attribute nfqueue.Attribute)

Source from the content-addressed store, hash-verified

197// pass the symbol loaded from the plugin as a direct
198// CGO callback ... ¯\_(ツ)_/¯
199func dummyCallback(attribute nfqueue.Attribute) int {
200 if mod.queueCb != nil {
201 return mod.queueCb(mod.queue, attribute)
202 } else {
203 id := *attribute.PacketID
204
205 mod.Info("[%d] %v", id, *attribute.Payload)
206
207 mod.queue.SetVerdict(id, nfqueue.NfAccept)
208 return 0
209 }
210}
211
212func (mod *PacketProxy) Start() error {
213 if mod.Running() {

Callers

nothing calls this directly

Calls 1

InfoMethod · 0.45

Tested by

no test coverage detected