Eliminate CGO dependency #7

Closed
opened 2024-04-12 00:36:02 +00:00 by steven · 2 comments
Owner

The gopacket pcap library requires CGO, which won't run on busybox systems. Perhaps we can keep the existing pcap library support for the wide interfacing it supports, such as libpcap, and npcap (required for Windows). This could then be controlled with build directives.

This would require a go-native method to capture and read headers, should preferably re-use the existing gopacket library for layer decoding.

This is essential for dd-wrt support.

The gopacket pcap library requires CGO, which won't run on busybox systems. Perhaps we can keep the existing pcap library support for the wide interfacing it supports, such as libpcap, and npcap (required for Windows). This could then be controlled with build directives. This would require a go-native method to capture and read headers, should preferably re-use the existing gopacket library for layer decoding. This is essential for dd-wrt support.
steven self-assigned this 2024-04-12 00:36:02 +00:00
steven added this to the dd-wrt/openwrt support project 2024-04-12 00:36:02 +00:00
steven added the
enhancement
hypd / Server
labels 2024-04-12 00:36:11 +00:00
Author
Owner

Removing libpcap will also remove a lot of network types, so we will likely be contstrained to supporting just ethernet, IPv4/IPv6, and UDP.

This looks interesting: https://pkg.go.dev/golang.org/x/net/bpf

Removing libpcap will also remove a lot of network types, so we will likely be contstrained to supporting just ethernet, IPv4/IPv6, and UDP. This looks interesting: https://pkg.go.dev/golang.org/x/net/bpf
Author
Owner

Switched from libpcap to ebpf-go. Can now compile with CGO_ENABLED=0 and no dependency on libpcap.

0ad3e2b0d4

Switched from libpcap to ebpf-go. Can now compile with CGO_ENABLED=0 and no dependency on libpcap. 0ad3e2b0d4914bc0670f0acaad799839ae7726f3
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: steven/hyp#7
No description provided.