Skip to content

Commit 8100244

Browse files
committed
Minor refactors
1 parent f827f97 commit 8100244

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

main.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ import (
3939
"github.com/hako/durafmt"
4040
)
4141

42-
type kprobeHook struct {
43-
prog *ebpf.Program
44-
kprobe string
45-
}
46-
4742
func main() {
4843
parseFags()
4944

@@ -221,7 +216,7 @@ func startXDP(objs counterObjects, iface *net.Interface, links []link.Link) []li
221216

222217
log.Printf("Starting on interface %q using XDP (eXpress Data Path) eBPF mode, listening for %v",
223218
*ifname, durafmt.Parse(*timeout))
224-
log.Printf("Due to XDP mode, egress statistics are not available. Upon program exit, interface reset is possible.")
219+
log.Printf("Due to XDP mode, egress statistics are not available. Upon program exit, interface reset may happen on some cards.")
225220
return links
226221
}
227222

types.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package main
22

3-
import "net/netip"
3+
import (
4+
"net/netip"
5+
6+
"github.com/cilium/ebpf"
7+
)
48

59
type statEntry struct {
610
SrcIP netip.Addr `json:"srcIp"`
@@ -14,3 +18,8 @@ type statEntry struct {
1418
SrcPort uint16 `json:"srcPort"`
1519
DstPort uint16 `json:"dstPort"`
1620
}
21+
22+
type kprobeHook struct {
23+
prog *ebpf.Program
24+
kprobe string
25+
}

0 commit comments

Comments
 (0)