Documentation
¶
Index ¶
- Constants
- func AppendMessageTo(buf []byte, hdr *types.Header, msg proto.Message) ([]byte, error)
- func DecodeMessage(data []byte, interests map[string]dndm.Route) (*types.Header, proto.Message, error)
- func EncodeMessage(msg proto.Message, route dndm.Route) ([]byte, error)
- func PacketSize(hdr *types.Header, msg proto.Message) int
- func ReadMessage(r io.Reader) ([]byte, uint64, error)
- func RegisterType(t types.Type, msg proto.Message)
- func Release(b []byte)
Constants ¶
View Source
const MagicNumber = 0xFADABEDA
View Source
const MagicNumberHeaderless = 0xCEBAFE4A
View Source
const PreambleSize = 4 + 4 + 4 + 4
Size of the preamble: 4 bytes magic number, 4 bytes total message size, 4 bytes header size, 4 bytes message size
Variables ¶
This section is empty.
Functions ¶
func AppendMessageTo ¶
func DecodeMessage ¶
func DecodeMessage(data []byte, interests map[string]dndm.Route) (*types.Header, proto.Message, error)
DecodeMessage assumes the data array is already of correct size and preamble size field is removed
func EncodeMessage ¶
EncodeMessage encodes any proto message into stream bytes. It adds a header and packet part sizes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.