update go.mod

This commit is contained in:
兔子 2024-12-18 17:00:26 +08:00
parent 3acc278811
commit eb2f0f9c22
3 changed files with 9 additions and 1 deletions

2
go.mod
View File

@ -1,6 +1,6 @@
module b612.me/bcap
go 1.22.4
go 1.20
require (
github.com/florianl/go-nfqueue/v2 v2.0.0

View File

@ -17,6 +17,10 @@ type NetCatch struct {
stopFn context.CancelFunc
}
func (n *NetCatch) Recall() func(gopacket.Packet) {
return n.fn
}
func (n *NetCatch) SetRecall(fn func(p gopacket.Packet)) {
n.fn = fn
}

View File

@ -17,6 +17,10 @@ type NfQueue struct {
recallFn func(id uint32, q *nfqueue.Nfqueue, p Packet)
}
func (n *NfQueue) RecallFn() func(id uint32, q *nfqueue.Nfqueue, p Packet) {
return n.recallFn
}
type Packet struct {
Packet gopacket.Packet
Attr nfqueue.Attribute