Skip to content

Commit

Permalink
Break circular dependency on u-root
Browse files Browse the repository at this point in the history
u-root -> dhcp -> u-root is the circular dependency. Which is fine,
except we messed up modules in u-root big time. We need to break the
circular dep for now.

Signed-off-by: Chris Koch <chrisko@google.com>
  • Loading branch information
hugelgupf committed May 28, 2021
1 parent 95b2ff6 commit fb4eaaa
Show file tree
Hide file tree
Showing 49 changed files with 55 additions and 66 deletions.
2 changes: 1 addition & 1 deletion dhcpv4/bsdp/boot_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/insomniacslk/dhcp/dhcpv4"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// BootImageType represents the different BSDP boot image types.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/bsdp/boot_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

func TestBootImageIDToBytes(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/bsdp/bsdp_option_boot_image_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/insomniacslk/dhcp/dhcpv4"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// BootImageList contains a list of boot images presented by a netboot server.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/bsdp/bsdp_option_message_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/insomniacslk/dhcp/dhcpv4"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// MessageType represents the different BSDP message types.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/bsdp/bsdp_option_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"

"github.com/insomniacslk/dhcp/dhcpv4"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptReplyPort returns a new BSDP reply port option.
Expand Down
4 changes: 2 additions & 2 deletions dhcpv4/dhcpv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

"github.com/insomniacslk/dhcp/iana"
"github.com/insomniacslk/dhcp/rfc1035label"
"github.com/u-root/u-root/pkg/rand"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/rand"
"github.com/u-root/uio/uio"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/dhcpv4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/insomniacslk/dhcp/iana"
"github.com/stretchr/testify/require"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

func TestGetExternalIPv4Addrs(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/nclient4/conn_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/mdlayher/ethernet"
"github.com/mdlayher/raw"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/nclient4/ipv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"encoding/binary"
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv4
import (
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// IP implements DHCPv4 IP option marshaling and unmarshaling as described by
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_ip_address_lease_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// MaxLeaseTime is the maximum lease time that can be encoded.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_ips.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// IPs are IPv4 addresses from a DHCP packet as used and specified by options
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_maximum_dhcp_message_size.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv4
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// Uint16 implements encoding and decoding functions for a uint16 as used in
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_parameter_request_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sort"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptionCodeList is a list of DHCP option codes.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// Route is a classless static route as per RFC 3442.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// Strings represents an option encapsulating a list of strings in IPv4 DHCP as
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_subnet_mask.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv4
import (
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// IPMask represents an option encapsulating the subnet mask.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/option_vivc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// VIVCIdentifier implements the vendor-identifying vendor class option
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/insomniacslk/dhcp/iana"
"github.com/insomniacslk/dhcp/rfc1035label"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

"github.com/stretchr/testify/require"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

func TestParseOption(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dhcpv4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv4
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// values from http://www.networksorcery.com/enp/protocol/dhcp.htm and
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/dhcpv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/insomniacslk/dhcp/iana"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

type DHCPv6 interface {
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/dhcpv6_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/insomniacslk/dhcp/iana"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/u-root/u-root/pkg/rand"
"github.com/u-root/uio/rand"
)

func randomReadMock(value []byte, n int, err error) func([]byte) (int, error) {
Expand Down
4 changes: 2 additions & 2 deletions dhcpv6/dhcpv6message.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/insomniacslk/dhcp/iana"
"github.com/insomniacslk/dhcp/rfc1035label"
"github.com/u-root/u-root/pkg/rand"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/rand"
"github.com/u-root/uio/uio"
)

const MessageHeaderSize = 4
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/dhcpv6relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net"

"github.com/insomniacslk/dhcp/iana"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

const RelayHeaderSize = 34
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_4rd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// Opt4RD represents a 4RD option. It is only a container for 4RD_*_RULE options
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_bootfileparam.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv6
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptBootFileParam returns a BootfileParam option as defined in RFC 5970
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_clientlinklayeraddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"

"github.com/insomniacslk/dhcp/iana"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptClientLinkLayerAddress implements OptionClientLinkLayerAddr option.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_dhcpv4_o_dhcpv6_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptDHCP4oDHCP6Server represents a OptionDHCP4oDHCP6Server option
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"net"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptDNS returns a DNS Recursive Name Server option as defined by RFC 3646.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_elapsedtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptElapsedTime returns an Elapsed Time option as defined by RFC 3315 Section
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_fqdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/insomniacslk/dhcp/rfc1035label"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptFQDN implements OptionFQDN option.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_iaaddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// AddressOptions are options valid for the IAAddress option field.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_iapd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// PDOptions are options used with the IAPD (prefix delegation) option.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_iaprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// PrefixOptions are the options valid for use with IAPrefix option field.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_informationrefreshtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptInformationRefreshTime implements OptionInformationRefreshTime option.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_nii.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv6
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// NetworkInterfaceType is the NIC type as defined by RFC 4578 Section 2.2
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_nontemporaryaddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// Duration is a duration as embedded in IA messages (IAPD, IANA, IATA).
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_remoteid.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv6
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptRemoteID implemens the Remote ID option as defined by RFC 4649.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_requestedoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptionCodes are a collection of option codes.
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_statuscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/insomniacslk/dhcp/iana"
"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptStatusCode represents a DHCPv6 Status Code option
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_temporaryaddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv6
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptIATA implements the identity association for non-temporary addresses
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_userclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptUserClass represent a DHCPv6 User Class option
Expand Down
2 changes: 1 addition & 1 deletion dhcpv6/option_vendor_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dhcpv6
import (
"fmt"

"github.com/u-root/u-root/pkg/uio"
"github.com/u-root/uio/uio"
)

// OptVendorOpts represents a DHCPv6 Status Code option
Expand Down
Loading

0 comments on commit fb4eaaa

Please sign in to comment.