messages

package
v0.0.0-...-ee7ae68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
	// Messages can encode themselves
	Encode() []byte

	// Messages have names, identifiers, and optionally, a payload
	Name() *name.Name
	Payload() *payload.Payload
	PayloadType() uint16

	// Generic slots for containers
	AddContainer(container codec.TLV)
	GetContainer(containerType uint16) (codec.TLV, error)

	// Type APIs
	GetPacketType() uint16
}

type MessageWrapper

type MessageWrapper struct {
	// contains filtered or unexported fields
}

func CreateFromTLV

func CreateFromTLV(tlv []codec.TLV) (*MessageWrapper, error)

func Package

func Package(m Message) *MessageWrapper

We just need a single package function here

func (*MessageWrapper) ComputeMessageHash

func (m *MessageWrapper) ComputeMessageHash(hasher hash.Hash) []byte

func (*MessageWrapper) Encode

func (m *MessageWrapper) Encode() []byte

func (*MessageWrapper) GetPacketType

func (m *MessageWrapper) GetPacketType() uint16

func (*MessageWrapper) GetValidationAlgorithm

func (m *MessageWrapper) GetValidationAlgorithm() validation.ValidationAlgorithm

func (*MessageWrapper) GetValidationPayload

func (m *MessageWrapper) GetValidationPayload() validation.ValidationPayload

func (*MessageWrapper) HashProtectedRegion

func (m *MessageWrapper) HashProtectedRegion(hasher hash.Hash) []byte

Messages can compute the hashes of their protected regions and their complete packet formats.

func (*MessageWrapper) Identifier

func (m *MessageWrapper) Identifier() string

func (*MessageWrapper) InnerMessage

func (m *MessageWrapper) InnerMessage() Message

func (*MessageWrapper) Name

func (m *MessageWrapper) Name() *name.Name

func (*MessageWrapper) NamelessIdentifier

func (m *MessageWrapper) NamelessIdentifier() string

func (*MessageWrapper) Payload

func (m *MessageWrapper) Payload() *payload.Payload

func (*MessageWrapper) PayloadType

func (m *MessageWrapper) PayloadType() uint16

func (*MessageWrapper) SetValidationAlgorithm

func (m *MessageWrapper) SetValidationAlgorithm(va validation.ValidationAlgorithm)

func (*MessageWrapper) SetValidationPayload

func (m *MessageWrapper) SetValidationPayload(vp validation.ValidationPayload)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL