From b95eb03aa5d7b8780efa7f9a71edd3b8a51bc807 Mon Sep 17 00:00:00 2001 From: Pat Whittingslow Date: Wed, 13 May 2026 15:44:30 -0300 Subject: [PATCH] fix CI and rework package structure (#111) --- {dhcpv4 => dhcp/dhcpv4}/client.go | 0 {dhcpv4 => dhcp/dhcpv4}/definitions.go | 0 {dhcpv4 => dhcp/dhcpv4}/dhcp_test.go | 0 {dhcpv4 => dhcp/dhcpv4}/frame.go | 0 {dhcpv4 => dhcp/dhcpv4}/server.go | 0 {dhcpv4 => dhcp/dhcpv4}/server_test.go | 0 {dhcpv4 => dhcp/dhcpv4}/stringers.go | 0 dns/dns.go | 6 +++--- {mdns => dns/mdns}/client.go | 0 {mdns => dns/mdns}/definitions.go | 0 {mdns => dns/mdns}/mdns_test.go | 0 examples/httptap/dhcp.go | 2 +- internet/pcap/capture.go | 4 ++-- internet/pcap/capture_test.go | 2 +- x/xnet/stack-async.go | 2 +- x/xnet/stack-blocking.go | 2 +- x/xnet/xnet_mdns_test.go | 2 +- 17 files changed, 10 insertions(+), 10 deletions(-) rename {dhcpv4 => dhcp/dhcpv4}/client.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/definitions.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/dhcp_test.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/frame.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/server.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/server_test.go (100%) rename {dhcpv4 => dhcp/dhcpv4}/stringers.go (100%) rename {mdns => dns/mdns}/client.go (100%) rename {mdns => dns/mdns}/definitions.go (100%) rename {mdns => dns/mdns}/mdns_test.go (100%) diff --git a/dhcpv4/client.go b/dhcp/dhcpv4/client.go similarity index 100% rename from dhcpv4/client.go rename to dhcp/dhcpv4/client.go diff --git a/dhcpv4/definitions.go b/dhcp/dhcpv4/definitions.go similarity index 100% rename from dhcpv4/definitions.go rename to dhcp/dhcpv4/definitions.go diff --git a/dhcpv4/dhcp_test.go b/dhcp/dhcpv4/dhcp_test.go similarity index 100% rename from dhcpv4/dhcp_test.go rename to dhcp/dhcpv4/dhcp_test.go diff --git a/dhcpv4/frame.go b/dhcp/dhcpv4/frame.go similarity index 100% rename from dhcpv4/frame.go rename to dhcp/dhcpv4/frame.go diff --git a/dhcpv4/server.go b/dhcp/dhcpv4/server.go similarity index 100% rename from dhcpv4/server.go rename to dhcp/dhcpv4/server.go diff --git a/dhcpv4/server_test.go b/dhcp/dhcpv4/server_test.go similarity index 100% rename from dhcpv4/server_test.go rename to dhcp/dhcpv4/server_test.go diff --git a/dhcpv4/stringers.go b/dhcp/dhcpv4/stringers.go similarity index 100% rename from dhcpv4/stringers.go rename to dhcp/dhcpv4/stringers.go diff --git a/dns/dns.go b/dns/dns.go index db4e3e6..ba791fa 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -78,11 +78,11 @@ func (n Name) EqualString(strname string) bool { } label := data[1 : 1+labelLen] var seg string - idx := strings.IndexByte(strname, '.') - if idx < 0 { + before, after, ok := strings.Cut(strname, ".") + if !ok { seg, strname = strname, "" } else { - seg, strname = strname[:idx], strname[idx+1:] + seg, strname = before, after } if len(seg) != len(label) || seg != string(label) { return false diff --git a/mdns/client.go b/dns/mdns/client.go similarity index 100% rename from mdns/client.go rename to dns/mdns/client.go diff --git a/mdns/definitions.go b/dns/mdns/definitions.go similarity index 100% rename from mdns/definitions.go rename to dns/mdns/definitions.go diff --git a/mdns/mdns_test.go b/dns/mdns/mdns_test.go similarity index 100% rename from mdns/mdns_test.go rename to dns/mdns/mdns_test.go diff --git a/examples/httptap/dhcp.go b/examples/httptap/dhcp.go index 94505c7..d3cd97f 100644 --- a/examples/httptap/dhcp.go +++ b/examples/httptap/dhcp.go @@ -11,7 +11,7 @@ import ( "github.com/soypat/lneto" "github.com/soypat/lneto/arp" - "github.com/soypat/lneto/dhcpv4" + "github.com/soypat/lneto/dhcp/dhcpv4" "github.com/soypat/lneto/ethernet" "github.com/soypat/lneto/internal" "github.com/soypat/lneto/internal/ltesto" diff --git a/internet/pcap/capture.go b/internet/pcap/capture.go index 98f7552..1c253e5 100644 --- a/internet/pcap/capture.go +++ b/internet/pcap/capture.go @@ -11,15 +11,15 @@ import ( "github.com/soypat/lneto" "github.com/soypat/lneto/arp" - "github.com/soypat/lneto/dhcpv4" + "github.com/soypat/lneto/dhcp/dhcpv4" "github.com/soypat/lneto/dns" + "github.com/soypat/lneto/dns/mdns" "github.com/soypat/lneto/ethernet" "github.com/soypat/lneto/http/httpraw" "github.com/soypat/lneto/internal" "github.com/soypat/lneto/ipv4" "github.com/soypat/lneto/ipv4/icmpv4" "github.com/soypat/lneto/ipv6" - "github.com/soypat/lneto/mdns" "github.com/soypat/lneto/ntp" "github.com/soypat/lneto/tcp" "github.com/soypat/lneto/udp" diff --git a/internet/pcap/capture_test.go b/internet/pcap/capture_test.go index fc877a3..4ee6bbd 100644 --- a/internet/pcap/capture_test.go +++ b/internet/pcap/capture_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/soypat/lneto" - "github.com/soypat/lneto/dhcpv4" + "github.com/soypat/lneto/dhcp/dhcpv4" "github.com/soypat/lneto/dns" "github.com/soypat/lneto/ethernet" "github.com/soypat/lneto/http/httpraw" diff --git a/x/xnet/stack-async.go b/x/xnet/stack-async.go index 3c41992..fbccda5 100644 --- a/x/xnet/stack-async.go +++ b/x/xnet/stack-async.go @@ -10,7 +10,7 @@ import ( "github.com/soypat/lneto" "github.com/soypat/lneto/arp" - "github.com/soypat/lneto/dhcpv4" + "github.com/soypat/lneto/dhcp/dhcpv4" "github.com/soypat/lneto/dns" "github.com/soypat/lneto/ethernet" "github.com/soypat/lneto/internal" diff --git a/x/xnet/stack-blocking.go b/x/xnet/stack-blocking.go index 990e211..f57d169 100644 --- a/x/xnet/stack-blocking.go +++ b/x/xnet/stack-blocking.go @@ -7,7 +7,7 @@ import ( "time" "github.com/soypat/lneto" - "github.com/soypat/lneto/dhcpv4" + "github.com/soypat/lneto/dhcp/dhcpv4" "github.com/soypat/lneto/internal" "github.com/soypat/lneto/tcp" ) diff --git a/x/xnet/xnet_mdns_test.go b/x/xnet/xnet_mdns_test.go index 912f153..0fc7283 100644 --- a/x/xnet/xnet_mdns_test.go +++ b/x/xnet/xnet_mdns_test.go @@ -7,9 +7,9 @@ import ( "github.com/soypat/lneto" "github.com/soypat/lneto/dns" + "github.com/soypat/lneto/dns/mdns" "github.com/soypat/lneto/ethernet" "github.com/soypat/lneto/ipv4" - "github.com/soypat/lneto/mdns" "github.com/soypat/lneto/udp" )