better APIs for sending protocol messages

no longer tagging requiring the caller to construct them
This commit is contained in:
Matthias Radestock committed 2015-01-20 22:31:16 +00:00
1 parent 644697977b
commit 1181a0cb33
5 files changed
+40 -40

No files matched your search

+5 -10
View File
@@ -7,6 +7,11 @@ const (
type ProtocolMsg byte
type TaggedProtocolMsg struct {
tag ProtocolMsg
msg []byte
}
const (
ProtocolConnectionEstablished ProtocolMsg = iota
ProtocolFragmentationReceived
@@ -16,13 +21,3 @@ const (
ProtocolUpdate
ProtocolPMTUVerified
)
var (
ProtocolConnectionEstablishedByte = []byte{byte(ProtocolConnectionEstablished)}
ProtocolFragmentationReceivedByte = []byte{byte(ProtocolFragmentationReceived)}
ProtocolStartFragmentationTestByte = []byte{byte(ProtocolStartFragmentationTest)}
ProtocolNonceByte = []byte{byte(ProtocolNonce)}
ProtocolFetchAllByte = []byte{byte(ProtocolFetchAll)}
ProtocolUpdateByte = []byte{byte(ProtocolUpdate)}
ProtocolPMTUVerifiedByte = []byte{byte(ProtocolPMTUVerified)}
)