refactor: extract pdu statics into separate file
This commit is contained in:
1 parent
9daf753d8a
commit
a1ef2def2b
2 files changed
+28
-21
No files matched your search
+2
-21
@@ -6,8 +6,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Protocol = "weave"
|
|
||||||
ProtocolVersion = 10
|
|
||||||
EthernetOverhead = 14
|
EthernetOverhead = 14
|
||||||
UDPOverhead = 28 // 20 bytes for IPv4, 8 bytes for UDP
|
UDPOverhead = 28 // 20 bytes for IPv4, 8 bytes for UDP
|
||||||
Port = 6783
|
Port = 6783
|
||||||
@@ -28,24 +26,7 @@ const (
|
|||||||
MaxDuration = time.Duration(math.MaxInt64)
|
MaxDuration = time.Duration(math.MaxInt64)
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
ProtocolConnectionEstablished = iota
|
|
||||||
ProtocolFragmentationReceived
|
|
||||||
ProtocolStartFragmentationTest
|
|
||||||
ProtocolNonce
|
|
||||||
ProtocolFetchAll
|
|
||||||
ProtocolUpdate
|
|
||||||
ProtocolPMTUVerified
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
FragTest = make([]byte, FragTestSize)
|
FragTest = make([]byte, FragTestSize)
|
||||||
PMTUDiscovery = make([]byte, PMTUDiscoverySize)
|
PMTUDiscovery = make([]byte, PMTUDiscoverySize)
|
||||||
ProtocolConnectionEstablishedByte = []byte{ProtocolConnectionEstablished}
|
|
||||||
ProtocolFragmentationReceivedByte = []byte{ProtocolFragmentationReceived}
|
|
||||||
ProtocolStartFragmentationTestByte = []byte{ProtocolStartFragmentationTest}
|
|
||||||
ProtocolNonceByte = []byte{ProtocolNonce}
|
|
||||||
ProtocolFetchAllByte = []byte{ProtocolFetchAll}
|
|
||||||
ProtocolUpdateByte = []byte{ProtocolUpdate}
|
|
||||||
ProtocolPMTUVerifiedByte = []byte{ProtocolPMTUVerified}
|
|
||||||
)
|
)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package router
|
||||||
|
|
||||||
|
const (
|
||||||
|
Protocol = "weave"
|
||||||
|
ProtocolVersion = 10
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ProtocolConnectionEstablished = iota
|
||||||
|
ProtocolFragmentationReceived
|
||||||
|
ProtocolStartFragmentationTest
|
||||||
|
ProtocolNonce
|
||||||
|
ProtocolFetchAll
|
||||||
|
ProtocolUpdate
|
||||||
|
ProtocolPMTUVerified
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ProtocolConnectionEstablishedByte = []byte{ProtocolConnectionEstablished}
|
||||||
|
ProtocolFragmentationReceivedByte = []byte{ProtocolFragmentationReceived}
|
||||||
|
ProtocolStartFragmentationTestByte = []byte{ProtocolStartFragmentationTest}
|
||||||
|
ProtocolNonceByte = []byte{ProtocolNonce}
|
||||||
|
ProtocolFetchAllByte = []byte{ProtocolFetchAll}
|
||||||
|
ProtocolUpdateByte = []byte{ProtocolUpdate}
|
||||||
|
ProtocolPMTUVerifiedByte = []byte{ProtocolPMTUVerified}
|
||||||
|
)
|
||||||
Reference in new issue
Block a user