Documentation ¶
Index ¶
Constants ¶
View Source
const ( Version uint8 = 1 Len = 16 )
Variables ¶
View Source
var ErrHeaderTooShort = errors.New("header is too short")
Functions ¶
func Encode ¶
func Encode(b []byte, v uint8, t MessageType, st MessageSubType, ri uint32, c uint64) []byte
Encode uses the provided byte array to encode the provided header values into. Byte array must be capped higher than HeaderLen or this will panic
func SubTypeName ¶
func SubTypeName(t MessageType, s MessageSubType) string
SubTypeName will transform a nebula message sub type into a human string
func TypeName ¶
func TypeName(t MessageType) string
TypeName will transform a nebula message type into a human string
Types ¶
type H ¶
type H struct { Version uint8 Type MessageType Subtype MessageSubType Reserved uint16 RemoteIndex uint32 MessageCounter uint64 }
func (*H) MarshalJSON ¶
MarshalJSON creates a json string representation of a header
func (*H) SubTypeName ¶
SubTypeName will transform the headers message sub type into a human string
type MessageSubType ¶
type MessageSubType uint8
const ( MessageNone MessageSubType = 0 MessageRelay MessageSubType = 1 )
const ( TestRequest MessageSubType = 0 TestReply MessageSubType = 1 )
const ( HandshakeIXPSK0 MessageSubType = 0 HandshakeXXPSK0 MessageSubType = 1 )
type MessageType ¶
type MessageType uint8
const ( Handshake MessageType = 0 Message MessageType = 1 RecvError MessageType = 2 LightHouse MessageType = 3 Test MessageType = 4 CloseTunnel MessageType = 5 Control MessageType = 6 )
Click to show internal directories.
Click to hide internal directories.