summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/types.go
diff options
context:
space:
mode:
authorAndrea Barberio <insomniac@slackware.it>2017-11-29 21:25:48 +0000
committerAndrea Barberio <insomniac@slackware.it>2017-12-05 23:32:27 +0000
commit1403bbe04ce275148b601c32e9551b2281110347 (patch)
tree6eacd224c2ea6b6e3865cb774970726809363d46 /dhcpv6/types.go
Initial commit
Diffstat (limited to 'dhcpv6/types.go')
-rw-r--r--dhcpv6/types.go46
1 files changed, 46 insertions, 0 deletions
diff --git a/dhcpv6/types.go b/dhcpv6/types.go
new file mode 100644
index 0000000..370243e
--- /dev/null
+++ b/dhcpv6/types.go
@@ -0,0 +1,46 @@
+package dhcpv6
+
+// from http://www.networksorcery.com/enp/protocol/dhcpv6.htm
+
+type MessageType uint8
+
+const (
+ _ MessageType = iota // skip 0
+ SOLICIT
+ ADVERTISE
+ REQUEST
+ CONFIRM
+ RENEW
+ REBIND
+ REPLY
+ RELEASE
+ DECLINE
+ RECONFIGURE
+ INFORMATION_REQUEST
+ RELAY_FORW
+ RELAY_REPL
+ LEASEQUERY
+ LEASEQUERY_REPLY
+ LEASEQUERY_DONE
+ LEASEQUERY_DATA
+)
+
+var MessageToString = map[MessageType]string{
+ SOLICIT: "SOLICIT",
+ ADVERTISE: "ADVERTISE",
+ REQUEST: "REQUEST",
+ CONFIRM: "CONFIRM",
+ RENEW: "RENEW",
+ REBIND: "REBIND",
+ REPLY: "REPLY",
+ RELEASE: "RELEASE",
+ DECLINE: "DECLINE",
+ RECONFIGURE: "RECONFIGURE",
+ INFORMATION_REQUEST: "INFORMATION-REQUEST",
+ RELAY_FORW: "RELAY-FORW",
+ RELAY_REPL: "RELAY-REPL",
+ LEASEQUERY: "LEASEQUERY",
+ LEASEQUERY_REPLY: "LEASEQUERY-REPLY",
+ LEASEQUERY_DONE: "LEASEQUERY-DONE",
+ LEASEQUERY_DATA: "LEASEQUERY-DATA",
+}