codec

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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const T_CACHE_TIME uint16 = 0x0002
View Source
const T_CRC32C uint16 = 0x0002

Validation fields - crypto suites

View Source
const T_DATA_POINTER uint16 = 0x0002
View Source
const T_EXPIRY uint16 = 0x0006
View Source
const T_HASH uint16 = 0x0001

TODO

View Source
const T_HASHGROUP uint16 = 0x0007
View Source
const T_HASH_REST uint16 = 0x0003
View Source
const T_HASH_SHA256 uint16 = 0x0001
View Source
const T_HMAC_SHA256 uint16 = 0x0003
View Source
const T_INTEREST uint16 = 0x0001

top-level TLVs

View Source
const T_INT_LIFE uint16 = 0x0001

hop-by-hop headers

View Source
const T_KEX uint16 = 0x0009
View Source
const T_KEX_ACCEPT uint16 = 0x0004
View Source
const T_KEX_BAREHELLO uint16 = 0x0001

KEX message types

View Source
const T_KEX_HELLO uint16 = 0x0003
View Source
const T_KEX_KEYSHARE uint16 = 0x0009
View Source
const T_KEX_MESSAGE_TYPE uint16 = 0x0000

KEX extension types

View Source
const T_KEX_MOVE_CHALLENGE uint16 = 0x0004
View Source
const T_KEX_MOVE_PROOF uint16 = 0x0006
View Source
const T_KEX_MOVE_TOKEN uint16 = 0x0005
View Source
const T_KEX_REJECT uint16 = 0x0002
View Source
const T_KEX_SESSION_ID uint16 = 0x0007
View Source
const T_KEX_SOURCE_CHALLENGE uint16 = 0x0001
View Source
const T_KEX_SOURCE_PROOF uint16 = 0x0003
View Source
const T_KEX_SOURCE_TOKEN uint16 = 0x0002
View Source
const T_KEX_TIMESTAMP uint16 = 0x0008
View Source
const T_KEYID uint16 = 0x0009

Validation fields - validation dependent data

View Source
const T_KEYID_REST uint16 = 0x0002
View Source
const T_MANIFEST uint16 = 0x0006
View Source
const T_MANIFEST_POINTER uint16 = 0x0003
View Source
const T_MSG_HASH uint16 = 0x0003
View Source
const T_NAME uint16 = 0x0000

Message body containers

View Source
const T_NAMESEG_CHUNK uint16 = 0x0010
View Source
const T_NAMESEG_IPID uint16 = 0x0002
View Source
const T_NAMESEG_NAME uint16 = 0x0001

name sements

View Source
const T_NAMESEG_VERSION uint16 = 0x0013
View Source
const T_OBJECT uint16 = 0x0002
View Source
const T_PAYLDTYPE uint16 = 0x0005
View Source
const T_PAYLOAD uint16 = 0x0001
View Source
const T_PAYLOADTYPE_DATA uint16 = 0x0000

Payload type

View Source
const T_PAYLOADTYPE_ENCAP uint16 = 0x0004
View Source
const T_PAYLOADTYPE_KEY uint16 = 0x0001
View Source
const T_PAYLOADTYPE_LINK uint16 = 0x0002
View Source
const T_PAYLOADTYPE_MANIFEST uint16 = 0x0003
View Source
const T_POINTER_SIZE uint16 = 0x0001

HashGroup containers

View Source
const T_PUBLICKEY uint16 = 0x000B
View Source
const T_RSA_SHA256 uint16 = 0x0006
View Source
const T_SIGTIME uint16 = 0x000F
View Source
const T_VALALG uint16 = 0x0003
View Source
const T_VALPAYLOAD uint16 = 0x0004

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
}

func (Decoder) Decode

func (d Decoder) Decode(bytes []byte) []TLV

type Encoder

type Encoder struct {
}

func (Encoder) Encode

func (e Encoder) Encode(tlvList []TLV) []byte

func (Encoder) EncodeContainer

func (e Encoder) EncodeContainer(tlvType, tlvLength uint16) []byte

func (Encoder) EncodeTLV

func (e Encoder) EncodeTLV(tlv TLV) []byte

type LeafTLV

type LeafTLV struct {
	Payload []byte `json:"payload"`
	// contains filtered or unexported fields
}

func NewLeafTLV

func NewLeafTLV(tlvType uint16, payload []byte) LeafTLV

func (LeafTLV) Children

func (tlv LeafTLV) Children() []TLV

func (LeafTLV) Length

func (tlv LeafTLV) Length() uint16

func (LeafTLV) String

func (tlv LeafTLV) String() string

func (LeafTLV) Type

func (tlv LeafTLV) Type() uint16

func (LeafTLV) Value

func (tlv LeafTLV) Value() []byte

type NestedTLV

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

func NewNestedTLV

func NewNestedTLV(tlvType uint16, children []TLV) NestedTLV

func (NestedTLV) Children

func (tlv NestedTLV) Children() []TLV

func (NestedTLV) Length

func (tlv NestedTLV) Length() uint16

func (NestedTLV) String

func (tlv NestedTLV) String() string

func (NestedTLV) Type

func (tlv NestedTLV) Type() uint16

func (NestedTLV) Value

func (tlv NestedTLV) Value() []byte

type TLV

type TLV interface {
	Type() uint16
	Length() uint16
	Value() []byte

	Children() []TLV
	String() string
}

Jump to

Keyboard shortcuts

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