summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/types.go
diff options
context:
space:
mode:
Diffstat (limited to 'dhcpv4/types.go')
-rw-r--r--dhcpv4/types.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/dhcpv4/types.go b/dhcpv4/types.go
index 90ea5da..7c22bff 100644
--- a/dhcpv4/types.go
+++ b/dhcpv4/types.go
@@ -18,6 +18,18 @@ const (
MessageTypeInform MessageType = 8
)
+// MessageTypeToString maps DHCP message types to human-readable strings.
+var MessageTypeToString = map[MessageType]string{
+ MessageTypeDiscover: "DISCOVER",
+ MessageTypeOffer: "OFFER",
+ MessageTypeRequest: "REQUEST",
+ MessageTypeDecline: "DECLINE",
+ MessageTypeAck: "ACK",
+ MessageTypeNak: "NAK",
+ MessageTypeRelease: "RELEASE",
+ MessageTypeInform: "INFORM",
+}
+
// OpcodeType represents a DHCPv4 opcode.
type OpcodeType uint8