diff --git a/README.md b/README.md index 6265824..8bd971f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ Userspace networking primitives. ## Packages - `lneto`: Low-level Networking Operations, or "El Neto", the networking package. Zero copy network frame marshalling and unmarshalling. - - [`lneto/frames.go`](./frames.go): Ethernet, IPv4/IPv6, ARP, TCP, UDP packet marshalling/unmarshalling. + - [`lneto/validation.go`](./validation.go): Packet validation utilities +- [`lneto/internet`](./internet): Userspace IP/TCP networking stack. This is where the magic happens. Integrates many of the listed packages. + - [`lneto/internet/pcap`](./internal/pcap): Packet capture and field breakdown utilities. Wireshark in the making. - [`lneto/http/httpraw`](./http/httpraw/): Heapless HTTP header processing and validation. Does no implement header normalization. - [`lneto/tcp`](./ntp): TCP implementation and low level logic. - [`lneto/dhcpv4`](./dhcpv4): DHCP version 4 protocol implementation and low level logic. diff --git a/internal/pcap/capture.go b/internet/pcap/capture.go similarity index 99% rename from internal/pcap/capture.go rename to internet/pcap/capture.go index 617483f..9c9661f 100644 --- a/internal/pcap/capture.go +++ b/internet/pcap/capture.go @@ -52,8 +52,11 @@ func (pc *PacketBreakdown) CaptureEthernet(dst []Frame, pkt []byte, bitOffset in } switch etype { case ethernet.TypeARP: + dst, err = pc.CaptureARP(dst, pkt, end) case ethernet.TypeIPv4: dst, err = pc.CaptureIPv4(dst, pkt, end) + default: + dst = append(dst, remainingFrameInfo(nil, FieldClassPayload, end, octet*len(pkt))) } return dst, err } diff --git a/internal/pcap/capture_test.go b/internet/pcap/capture_test.go similarity index 100% rename from internal/pcap/capture_test.go rename to internet/pcap/capture_test.go