summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2018-12-29 11:29:25 -0800
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-14 23:19:04 +0000
commit833f274e1aca3b23320f6d31c246c73eefd38974 (patch)
treea25fab2a0597398262bc419a26ff2ffa058388a9
parent75d26a6410980df90d3a9d224956cfe5ed35a07f (diff)
iana: rename HwTypeType to HWType, add package comment.
-rw-r--r--dhcpv4/bsdp/bsdp_test.go2
-rw-r--r--dhcpv4/dhcpv4.go12
-rw-r--r--dhcpv4/dhcpv4_test.go6
-rw-r--r--dhcpv6/async/client_test.go2
-rw-r--r--dhcpv6/dhcpv6_test.go2
-rw-r--r--dhcpv6/dhcpv6message.go2
-rw-r--r--dhcpv6/duid.go8
-rw-r--r--dhcpv6/duid_test.go6
-rw-r--r--dhcpv6/iputils_test.go2
-rw-r--r--dhcpv6/modifiers_test.go4
-rw-r--r--dhcpv6/option_clientid_test.go6
-rw-r--r--dhcpv6/option_serverid_test.go6
-rw-r--r--iana/hwtypes.go155
-rw-r--r--iana/iana.go2
-rw-r--r--iana/statuscodes.go9
-rw-r--r--netboot/netconf_test.go2
16 files changed, 115 insertions, 111 deletions
diff --git a/dhcpv4/bsdp/bsdp_test.go b/dhcpv4/bsdp/bsdp_test.go
index 9f756a7..ce09324 100644
--- a/dhcpv4/bsdp/bsdp_test.go
+++ b/dhcpv4/bsdp/bsdp_test.go
@@ -106,7 +106,7 @@ func TestNewInformList_ReplyPort(t *testing.T) {
func newAck(hwAddr net.HardwareAddr, transactionID [4]byte) *dhcpv4.DHCPv4 {
ack, _ := dhcpv4.New()
ack.TransactionID = transactionID
- ack.HWType = iana.HwTypeEthernet
+ ack.HWType = iana.HWTypeEthernet
ack.ClientHWAddr = hwAddr
ack.AddOption(&dhcpv4.OptMessageType{MessageType: dhcpv4.MessageTypeAck})
ack.AddOption(&dhcpv4.OptionGeneric{OptionCode: dhcpv4.OptionEnd})
diff --git a/dhcpv4/dhcpv4.go b/dhcpv4/dhcpv4.go
index 0f2a5b4..f4e3596 100644
--- a/dhcpv4/dhcpv4.go
+++ b/dhcpv4/dhcpv4.go
@@ -33,7 +33,7 @@ var magicCookie = [4]byte{99, 130, 83, 99}
// to build DHCPv4 packets.
type DHCPv4 struct {
OpCode OpcodeType
- HWType iana.HwTypeType
+ HWType iana.HWType
HopCount uint8
TransactionID TransactionID
NumSeconds uint16
@@ -113,7 +113,7 @@ func New() (*DHCPv4, error) {
}
d := DHCPv4{
OpCode: OpcodeBootRequest,
- HWType: iana.HwTypeEthernet,
+ HWType: iana.HWTypeEthernet,
HopCount: 0,
TransactionID: xid,
NumSeconds: 0,
@@ -149,7 +149,7 @@ func NewDiscovery(hwaddr net.HardwareAddr) (*DHCPv4, error) {
}
// get hw addr
d.OpCode = OpcodeBootRequest
- d.HWType = iana.HwTypeEthernet
+ d.HWType = iana.HWTypeEthernet
d.ClientHWAddr = hwaddr
d.SetBroadcast()
d.AddOption(&OptMessageType{MessageType: MessageTypeDiscover})
@@ -202,7 +202,7 @@ func NewInform(hwaddr net.HardwareAddr, localIP net.IP) (*DHCPv4, error) {
}
d.OpCode = OpcodeBootRequest
- d.HWType = iana.HwTypeEthernet
+ d.HWType = iana.HWTypeEthernet
d.ClientHWAddr = hwaddr
d.ClientIPAddr = localIP
d.AddOption(&OptMessageType{MessageType: MessageTypeInform})
@@ -269,7 +269,7 @@ func FromBytes(q []byte) (*DHCPv4, error) {
buf := uio.NewBigEndianBuffer(q)
p.OpCode = OpcodeType(buf.Read8())
- p.HWType = iana.HwTypeType(buf.Read8())
+ p.HWType = iana.HWType(buf.Read8())
hwAddrLen := buf.Read8()
@@ -502,7 +502,7 @@ func (d *DHCPv4) ToBytes() []byte {
// HwAddrLen
hlen := uint8(len(d.ClientHWAddr))
- if hlen == 0 && d.HWType == iana.HwTypeEthernet {
+ if hlen == 0 && d.HWType == iana.HWTypeEthernet {
hlen = 6
}
buf.Write8(hlen)
diff --git a/dhcpv4/dhcpv4_test.go b/dhcpv4/dhcpv4_test.go
index 276b0fb..e5b8ad6 100644
--- a/dhcpv4/dhcpv4_test.go
+++ b/dhcpv4/dhcpv4_test.go
@@ -63,7 +63,7 @@ func TestFromBytes(t *testing.T) {
d, err := FromBytes(data)
require.NoError(t, err)
require.Equal(t, d.OpCode, OpcodeBootRequest)
- require.Equal(t, d.HWType, iana.HwTypeEthernet)
+ require.Equal(t, d.HWType, iana.HWTypeEthernet)
require.Equal(t, d.HopCount, byte(3))
require.Equal(t, d.TransactionID, TransactionID{0xaa, 0xbb, 0xcc, 0xdd})
require.Equal(t, d.NumSeconds, uint16(3))
@@ -302,7 +302,7 @@ func TestNewDiscovery(t *testing.T) {
// Validate fields of DISCOVER packet.
require.Equal(t, OpcodeBootRequest, m.OpCode)
- require.Equal(t, iana.HwTypeEthernet, m.HWType)
+ require.Equal(t, iana.HWTypeEthernet, m.HWType)
require.Equal(t, hwAddr, m.ClientHWAddr)
require.True(t, m.IsBroadcast())
require.True(t, m.Options.Has(OptionParameterRequestList))
@@ -316,7 +316,7 @@ func TestNewInform(t *testing.T) {
require.NoError(t, err)
require.Equal(t, OpcodeBootRequest, m.OpCode)
- require.Equal(t, iana.HwTypeEthernet, m.HWType)
+ require.Equal(t, iana.HWTypeEthernet, m.HWType)
require.Equal(t, hwAddr, m.ClientHWAddr)
require.Equal(t, MessageTypeInform, m.MessageType())
require.True(t, m.ClientIPAddr.Equal(localIP))
diff --git a/dhcpv6/async/client_test.go b/dhcpv6/async/client_test.go
index 0bc3a87..25a71a8 100644
--- a/dhcpv6/async/client_test.go
+++ b/dhcpv6/async/client_test.go
@@ -21,7 +21,7 @@ func solicit(input string) (dhcpv6.DHCPv6, error) {
}
duid := dhcpv6.Duid{
Type: dhcpv6.DUID_LLT,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
Time: dhcpv6.GetTime(),
LinkLayerAddr: mac,
}
diff --git a/dhcpv6/dhcpv6_test.go b/dhcpv6/dhcpv6_test.go
index b1da1d8..3a9e3f1 100644
--- a/dhcpv6/dhcpv6_test.go
+++ b/dhcpv6/dhcpv6_test.go
@@ -265,7 +265,7 @@ func TestNewMessageTypeSolicitWithCID(t *testing.T) {
duid := Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: hwAddr,
}
diff --git a/dhcpv6/dhcpv6message.go b/dhcpv6/dhcpv6message.go
index 545146c..a95d9ce 100644
--- a/dhcpv6/dhcpv6message.go
+++ b/dhcpv6/dhcpv6message.go
@@ -107,7 +107,7 @@ func NewSolicitForInterface(ifname string, modifiers ...Modifier) (DHCPv6, error
}
duid := Duid{
Type: DUID_LLT,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
Time: GetTime(),
LinkLayerAddr: iface.HardwareAddr,
}
diff --git a/dhcpv6/duid.go b/dhcpv6/duid.go
index 8530827..c9e38b2 100644
--- a/dhcpv6/duid.go
+++ b/dhcpv6/duid.go
@@ -34,7 +34,7 @@ func (d DuidType) String() string {
type Duid struct {
Type DuidType
- HwType iana.HwTypeType // for DUID-LLT and DUID-LL. Ignored otherwise. RFC 826
+ HwType iana.HWType // for DUID-LLT and DUID-LL. Ignored otherwise. RFC 826
Time uint32 // for DUID-LLT. Ignored otherwise
LinkLayerAddr net.HardwareAddr
EnterpriseNumber uint32 // for DUID-EN. Ignored otherwise
@@ -87,7 +87,7 @@ func (d *Duid) ToBytes() []byte {
func (d *Duid) String() string {
var hwaddr string
- if d.HwType == iana.HwTypeEthernet {
+ if d.HwType == iana.HWTypeEthernet {
for _, b := range d.LinkLayerAddr {
hwaddr += fmt.Sprintf("%02x:", b)
}
@@ -108,14 +108,14 @@ func DuidFromBytes(data []byte) (*Duid, error) {
if len(data) < 8 {
return nil, fmt.Errorf("Invalid DUID-LLT: shorter than 8 bytes")
}
- d.HwType = iana.HwTypeType(binary.BigEndian.Uint16(data[2:4]))
+ d.HwType = iana.HWType(binary.BigEndian.Uint16(data[2:4]))
d.Time = binary.BigEndian.Uint32(data[4:8])
d.LinkLayerAddr = data[8:]
} else if d.Type == DUID_LL {
if len(data) < 4 {
return nil, fmt.Errorf("Invalid DUID-LL: shorter than 4 bytes")
}
- d.HwType = iana.HwTypeType(binary.BigEndian.Uint16(data[2:4]))
+ d.HwType = iana.HWType(binary.BigEndian.Uint16(data[2:4]))
d.LinkLayerAddr = data[4:]
} else if d.Type == DUID_EN {
if len(data) < 6 {
diff --git a/dhcpv6/duid_test.go b/dhcpv6/duid_test.go
index abfe91d..840ab4a 100644
--- a/dhcpv6/duid_test.go
+++ b/dhcpv6/duid_test.go
@@ -43,7 +43,7 @@ func TestDuidLLTFromBytes(t *testing.T) {
require.Equal(t, 14, duid.Length())
require.Equal(t, DUID_LLT, duid.Type)
require.Equal(t, uint32(0x01020304), duid.Time)
- require.Equal(t, iana.HwTypeEthernet, duid.HwType)
+ require.Equal(t, iana.HWTypeEthernet, duid.HwType)
require.Equal(t, net.HardwareAddr{0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, duid.LinkLayerAddr)
}
@@ -57,7 +57,7 @@ func TestDuidLLFromBytes(t *testing.T) {
require.NoError(t, err)
require.Equal(t, 10, duid.Length())
require.Equal(t, DUID_LL, duid.Type)
- require.Equal(t, iana.HwTypeEthernet, duid.HwType)
+ require.Equal(t, iana.HWTypeEthernet, duid.HwType)
require.Equal(t, net.HardwareAddr{0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, duid.LinkLayerAddr)
}
@@ -83,7 +83,7 @@ func TestDuidLLTToBytes(t *testing.T) {
}
duid := Duid{
Type: DUID_LLT,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
Time: uint32(0x01020304),
LinkLayerAddr: []byte{0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff},
}
diff --git a/dhcpv6/iputils_test.go b/dhcpv6/iputils_test.go
index 76806ba..e033d57 100644
--- a/dhcpv6/iputils_test.go
+++ b/dhcpv6/iputils_test.go
@@ -134,7 +134,7 @@ func Test_ExtractMAC(t *testing.T) {
// MAC extracted from DUID
duid := Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: []byte{0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa},
}
solicit, err := NewMessage(WithClientID(duid))
diff --git a/dhcpv6/modifiers_test.go b/dhcpv6/modifiers_test.go
index 6fc6ae7..9bf2da4 100644
--- a/dhcpv6/modifiers_test.go
+++ b/dhcpv6/modifiers_test.go
@@ -12,7 +12,7 @@ import (
func TestWithClientID(t *testing.T) {
duid := Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{0xfa, 0xce, 0xb0, 0x00, 0x00, 0x0c}),
}
m, err := NewMessage(WithClientID(duid))
@@ -26,7 +26,7 @@ func TestWithClientID(t *testing.T) {
func TestWithServerID(t *testing.T) {
duid := Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{0xfa, 0xce, 0xb0, 0x00, 0x00, 0x0c}),
}
m, err := NewMessage(WithServerID(duid))
diff --git a/dhcpv6/option_clientid_test.go b/dhcpv6/option_clientid_test.go
index 872651e..5e95d1a 100644
--- a/dhcpv6/option_clientid_test.go
+++ b/dhcpv6/option_clientid_test.go
@@ -17,7 +17,7 @@ func TestParseOptClientId(t *testing.T) {
opt, err := ParseOptClientId(data)
require.NoError(t, err)
require.Equal(t, DUID_LL, opt.Cid.Type)
- require.Equal(t, iana.HwTypeEthernet, opt.Cid.HwType)
+ require.Equal(t, iana.HWTypeEthernet, opt.Cid.HwType)
require.Equal(t, net.HardwareAddr([]byte{0, 1, 2, 3, 4, 5}), opt.Cid.LinkLayerAddr)
}
@@ -25,7 +25,7 @@ func TestOptClientIdToBytes(t *testing.T) {
opt := OptClientId{
Cid: Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{5, 4, 3, 2, 1, 0}),
},
}
@@ -58,7 +58,7 @@ func TestOptionClientId(t *testing.T) {
opt := OptClientId{
Cid: Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{0xde, 0xad, 0, 0, 0xbe, 0xef}),
},
}
diff --git a/dhcpv6/option_serverid_test.go b/dhcpv6/option_serverid_test.go
index 44f6cf4..72b1e33 100644
--- a/dhcpv6/option_serverid_test.go
+++ b/dhcpv6/option_serverid_test.go
@@ -17,7 +17,7 @@ func TestParseOptServerId(t *testing.T) {
opt, err := ParseOptServerId(data)
require.NoError(t, err)
require.Equal(t, DUID_LL, opt.Sid.Type)
- require.Equal(t, iana.HwTypeEthernet, opt.Sid.HwType)
+ require.Equal(t, iana.HWTypeEthernet, opt.Sid.HwType)
require.Equal(t, net.HardwareAddr([]byte{0, 1, 2, 3, 4, 5}), opt.Sid.LinkLayerAddr)
}
@@ -25,7 +25,7 @@ func TestOptServerIdToBytes(t *testing.T) {
opt := OptServerId{
Sid: Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{5, 4, 3, 2, 1, 0}),
},
}
@@ -58,7 +58,7 @@ func TestOptionServerId(t *testing.T) {
opt := OptServerId{
Sid: Duid{
Type: DUID_LL,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
LinkLayerAddr: net.HardwareAddr([]byte{0xde, 0xad, 0, 0, 0xbe, 0xef}),
},
}
diff --git a/iana/hwtypes.go b/iana/hwtypes.go
index 075cded..bbb3188 100644
--- a/iana/hwtypes.go
+++ b/iana/hwtypes.go
@@ -1,88 +1,91 @@
package iana
-type HwTypeType uint8
+// HWType is a hardware type as per RFC 2132 and defined by the IANA.
+type HWType uint8
+// See IANA for values.
const (
- _ HwTypeType = iota // skip 0
- HwTypeEthernet
- HwTypeExperimentalEthernet
- HwTypeAmateurRadioAX25
- HwTypeProteonTokenRing
- HwTypeChaos
- HwTypeIEEE802
- HwTypeARCNET
- HwTypeHyperchannel
- HwTypeLanstar
- HwTypeAutonet
- HwTypeLocalTalk
- HwTypeLocalNet
- HwTypeUltraLink
- HwTypeSMDS
- HwTypeFrameRelay
- HwTypeATM
- HwTypeHDLC
- HwTypeFibreChannel
- HwTypeATM2
- HwTypeSerialLine
- HwTypeATM3
- HwTypeMILSTD188220
- HwTypeMetricom
- HwTypeIEEE1394
- HwTypeMAPOS
- HwTypeTwinaxial
- HwTypeEUI64
- HwTypeHIPARP
- HwTypeISO7816
- HwTypeARPSec
- HwTypeIPsec
- HwTypeInfiniband
- HwTypeCAI
- HwTypeWiegandInterface
- HwTypePureIP
+ _ HWType = iota // skip 0
+ HWTypeEthernet
+ HWTypeExperimentalEthernet
+ HWTypeAmateurRadioAX25
+ HWTypeProteonTokenRing
+ HWTypeChaos
+ HWTypeIEEE802
+ HWTypeARCNET
+ HWTypeHyperchannel
+ HWTypeLanstar
+ HWTypeAutonet
+ HWTypeLocalTalk
+ HWTypeLocalNet
+ HWTypeUltraLink
+ HWTypeSMDS
+ HWTypeFrameRelay
+ HWTypeATM
+ HWTypeHDLC
+ HWTypeFibreChannel
+ HWTypeATM2
+ HWTypeSerialLine
+ HWTypeATM3
+ HWTypeMILSTD188220
+ HWTypeMetricom
+ HWTypeIEEE1394
+ HWTypeMAPOS
+ HWTypeTwinaxial
+ HWTypeEUI64
+ HWTypeHIPARP
+ HWTypeISO7816
+ HWTypeARPSec
+ HWTypeIPsec
+ HWTypeInfiniband
+ HWTypeCAI
+ HWTypeWiegandInterface
+ HWTypePureIP
)
-var HwTypeToString = map[HwTypeType]string{
- HwTypeEthernet: "Ethernet",
- HwTypeExperimentalEthernet: "Experimental Ethernet",
- HwTypeAmateurRadioAX25: "Amateur Radio AX.25",
- HwTypeProteonTokenRing: "Proteon ProNET Token Ring",
- HwTypeChaos: "Chaos",
- HwTypeIEEE802: "IEEE 802",
- HwTypeARCNET: "ARCNET",
- HwTypeHyperchannel: "Hyperchannel",
- HwTypeLanstar: "Lanstar",
- HwTypeAutonet: "Autonet Short Address",
- HwTypeLocalTalk: "LocalTalk",
- HwTypeLocalNet: "LocalNet",
- HwTypeUltraLink: "Ultra link",
- HwTypeSMDS: "SMDS",
- HwTypeFrameRelay: "Frame Relay",
- HwTypeATM: "ATM",
- HwTypeHDLC: "HDLC",
- HwTypeFibreChannel: "Fibre Channel",
- HwTypeATM2: "ATM 2",
- HwTypeSerialLine: "Serial Line",
- HwTypeATM3: "ATM 3",
- HwTypeMILSTD188220: "MIL-STD-188-220",
- HwTypeMetricom: "Metricom",
- HwTypeIEEE1394: "IEEE 1394.1995",
- HwTypeMAPOS: "MAPOS",
- HwTypeTwinaxial: "Twinaxial",
- HwTypeEUI64: "EUI-64",
- HwTypeHIPARP: "HIPARP",
- HwTypeISO7816: "IP and ARP over ISO 7816-3",
- HwTypeARPSec: "ARPSec",
- HwTypeIPsec: "IPsec tunnel",
- HwTypeInfiniband: "Infiniband",
- HwTypeCAI: "CAI, TIA-102 Project 125 Common Air Interface",
- HwTypeWiegandInterface: "Wiegand Interface",
- HwTypePureIP: "Pure IP",
+var hwTypeToString = map[HWType]string{
+ HWTypeEthernet: "Ethernet",
+ HWTypeExperimentalEthernet: "Experimental Ethernet",
+ HWTypeAmateurRadioAX25: "Amateur Radio AX.25",
+ HWTypeProteonTokenRing: "Proteon ProNET Token Ring",
+ HWTypeChaos: "Chaos",
+ HWTypeIEEE802: "IEEE 802",
+ HWTypeARCNET: "ARCNET",
+ HWTypeHyperchannel: "Hyperchannel",
+ HWTypeLanstar: "Lanstar",
+ HWTypeAutonet: "Autonet Short Address",
+ HWTypeLocalTalk: "LocalTalk",
+ HWTypeLocalNet: "LocalNet",
+ HWTypeUltraLink: "Ultra link",
+ HWTypeSMDS: "SMDS",
+ HWTypeFrameRelay: "Frame Relay",
+ HWTypeATM: "ATM",
+ HWTypeHDLC: "HDLC",
+ HWTypeFibreChannel: "Fibre Channel",
+ HWTypeATM2: "ATM 2",
+ HWTypeSerialLine: "Serial Line",
+ HWTypeATM3: "ATM 3",
+ HWTypeMILSTD188220: "MIL-STD-188-220",
+ HWTypeMetricom: "Metricom",
+ HWTypeIEEE1394: "IEEE 1394.1995",
+ HWTypeMAPOS: "MAPOS",
+ HWTypeTwinaxial: "Twinaxial",
+ HWTypeEUI64: "EUI-64",
+ HWTypeHIPARP: "HIPARP",
+ HWTypeISO7816: "IP and ARP over ISO 7816-3",
+ HWTypeARPSec: "ARPSec",
+ HWTypeIPsec: "IPsec tunnel",
+ HWTypeInfiniband: "Infiniband",
+ HWTypeCAI: "CAI, TIA-102 Project 125 Common Air Interface",
+ HWTypeWiegandInterface: "Wiegand Interface",
+ HWTypePureIP: "Pure IP",
}
-func (h HwTypeType) String() string {
- hwtype := HwTypeToString[h]
+// String implements fmt.Stringer.
+func (h HWType) String() string {
+ hwtype := hwTypeToString[h]
if hwtype == "" {
- hwtype = "Invalid"
+ hwtype = "unknown"
}
return hwtype
}
diff --git a/iana/iana.go b/iana/iana.go
new file mode 100644
index 0000000..e0d5956
--- /dev/null
+++ b/iana/iana.go
@@ -0,0 +1,2 @@
+// Package iana contains constants defined by IANA.
+package iana
diff --git a/iana/statuscodes.go b/iana/statuscodes.go
index f61f99e..ee45820 100644
--- a/iana/statuscodes.go
+++ b/iana/statuscodes.go
@@ -1,9 +1,9 @@
package iana
+// StatusCode represents a IANA status code for DHCPv6
+//
// IANA Status Codes for DHCPv6
// https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#dhcpv6-parameters-5
-
-// StatusCode represents a IANA status code for DHCPv6
type StatusCode uint16
// IANA status codes
@@ -40,14 +40,13 @@ const (
// String returns a mnemonic name for a given status code
func (s StatusCode) String() string {
- if sc := StatusCodeToStringMap[s]; sc != "" {
+ if sc := statusCodeToStringMap[s]; sc != "" {
return sc
}
return "Unknown"
}
-// StatusCodeToStringMap maps status codes to their names
-var StatusCodeToStringMap = map[StatusCode]string{
+var statusCodeToStringMap = map[StatusCode]string{
StatusSuccess: "Success",
StatusUnspecFail: "UnspecFail",
StatusNoAddrsAvail: "NoAddrsAvail",
diff --git a/netboot/netconf_test.go b/netboot/netconf_test.go
index 0495806..91d4482 100644
--- a/netboot/netconf_test.go
+++ b/netboot/netconf_test.go
@@ -19,7 +19,7 @@ func getAdv(modifiers ...dhcpv6.Modifier) *dhcpv6.DHCPv6Message {
duid := dhcpv6.Duid{
Type: dhcpv6.DUID_LLT,
- HwType: iana.HwTypeEthernet,
+ HwType: iana.HWTypeEthernet,
Time: dhcpv6.GetTime(),
LinkLayerAddr: hwaddr,
}