summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2018-02-02 11:02:55 +0000
committerAndrea Barberio <insomniac@slackware.it>2018-02-02 11:02:55 +0000
commita28d7b9f5dabbc4387ca744d54e2a57ef07a5bd6 (patch)
treec9f966b081469bf5e450cd6a793479f0b8ab4f94
parentd59035ff382096e0f1c7a90c25ddc42fb1907b43 (diff)
Added comments
-rw-r--r--dhcpv4/types.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/dhcpv4/types.go b/dhcpv4/types.go
index c0fcfe1..e8a71f5 100644
--- a/dhcpv4/types.go
+++ b/dhcpv4/types.go
@@ -3,14 +3,17 @@ package dhcpv4
// values from http://www.networksorcery.com/enp/protocol/dhcp.htm and
// http://www.networksorcery.com/enp/protocol/bootp/options.htm
+// OpcodeType represents a DHCPv4 opcode.
type OpcodeType uint8
+// constants that represent valid values for OpcodeType
const (
_ OpcodeType = iota // skip 0
OpcodeBootRequest
OpcodeBootReply
)
+// OpcodeToString maps an OpcodeType to its mnemonic name
var OpcodeToString = map[OpcodeType]string{
OpcodeBootRequest: "BootRequest",
OpcodeBootReply: "BootReply",
@@ -180,6 +183,7 @@ const (
OptionEnd = 255
)
+// OptionCodeToString maps an OptionCode to its mnemonic name
var OptionCodeToString = map[OptionCode]string{
OptionPad: "Pad",
OptionSubnetMask: "Subnet Mask",