From 7e1214cf120c21fd8ab661f496c0d4248ddd1371 Mon Sep 17 00:00:00 2001 From: Leo Balduf Date: Mon, 26 Oct 2015 21:22:54 +0100 Subject: [PATCH] udp: make the options constant --- udp/protocol.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/udp/protocol.go b/udp/protocol.go index cdae147..b4b089a 100644 --- a/udp/protocol.go +++ b/udp/protocol.go @@ -22,6 +22,14 @@ const ( announceDualStackActionID ) +// Option-Types described in BEP41 and BEP45. +const ( + optionEndOfOptions byte = 0x0 + optionNOP = 0x1 + optionURLData = 0x2 + optionIPv6 = 0x3 +) + var ( // initialConnectionID is the magic initial connection ID specified by BEP 15. initialConnectionID = []byte{0, 0, 0x04, 0x17, 0x27, 0x10, 0x19, 0x80} @@ -30,12 +38,6 @@ var ( emptyIPv4 = []byte{0, 0, 0, 0} emptyIPv6 = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} - // Option-Types described in BEP41 and BEP45. - optionEndOfOptions = byte(0x0) - optionNOP = byte(0x1) - optionURLData = byte(0x2) - optionIPv6 = byte(0x3) - // eventIDs map IDs to event names. eventIDs = []string{ "",