lpv2

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Fragment           = 0x50
	Sequence           = 0x51
	FragIndex          = 0x52
	FragCount          = 0x53
	PitToken           = 0x62
	LpPacket           = 0x64
	Nack               = 0x0320
	IncomingFaceID     = 0x032C
	NextHopFaceID      = 0x0330
	CachePolicy        = 0x0334
	CachePolicyType    = 0x0335
	CongestionMark     = 0x0340
	Ack                = 0x0344
	TxSequence         = 0x0348
	NonDiscovery       = 0x034c
	PrefixAnnouncement = 0x0350
)

TLV types for NDNLPv2.

Variables

This section is empty.

Functions

func IsCritical

func IsCritical(tlvType uint32) bool

IsCritical returns whether the NDNLPv2 TLV type is critical.

Types

type Packet

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

Packet represents an NDNLPv2 frame.

func DecodePacket

func DecodePacket(wire *tlv.Block) (*Packet, error)

DecodePacket returns an NDNLPv2 frame decoded from the wire.

func DecodePacketNoCopy added in v1.3.0

func DecodePacketNoCopy(wire *tlv.Block) (*Packet, error)

func NewIDLEPacket

func NewIDLEPacket() *Packet

NewIDLEPacket returns an NDNLPv2 IDLE frame.

func NewPacket

func NewPacket(fragment []byte) *Packet

NewPacket returns an NDNLPv2 frame containing a copy of the provided network-layer packet.

func NewPacketNoCopy added in v1.3.0

func NewPacketNoCopy(fragment []byte) *Packet

func (*Packet) Acks

func (p *Packet) Acks() []uint64

Acks returns the Ack field(s) set in the LpPacket (if any).

func (*Packet) AppendAck

func (p *Packet) AppendAck(ack uint64)

AppendAck appends an Ack to the LpPacket.

func (*Packet) CachePolicyType

func (p *Packet) CachePolicyType() *uint64

CachePolicyType returns the CachePolicyType of the LpPacket or nil if it is unset.

func (*Packet) ClearAcks

func (p *Packet) ClearAcks()

ClearAcks removes all Acks from the LpPacket.

func (*Packet) CongestionMark

func (p *Packet) CongestionMark() *uint64

CongestionMark returns the CongestionMark of the LpPacket or nil if it is unset.

func (*Packet) Encode

func (p *Packet) Encode() (*tlv.Block, error)

Encode encodes the LpPacket into a block.

func (*Packet) FragCount

func (p *Packet) FragCount() *uint64

FragCount returns the FragCount of the LpPacket or nil if it is unset.

func (*Packet) FragIndex

func (p *Packet) FragIndex() *uint64

FragIndex returns the FragIndex of the LpPacket or nil if it is unset.

func (*Packet) Fragment

func (p *Packet) Fragment() []byte

Fragment returns the Fragment field of the LpPacket or nil if it is unset.

func (*Packet) FragmentNoCopy added in v1.3.0

func (p *Packet) FragmentNoCopy() []byte

func (*Packet) IncomingFaceID

func (p *Packet) IncomingFaceID() *uint64

IncomingFaceID returns the IncomingFaceId of the LpPacket or nil if it is unset.

func (*Packet) IsBare

func (p *Packet) IsBare() bool

IsBare returns whether the LpPacket only contains a fragment and has no headers fields.

func (*Packet) IsIdle

func (p *Packet) IsIdle() bool

IsIdle returns whether the LpPacket is an "IDLE" frame and does not contain a fragment.

func (*Packet) NextHopFaceID

func (p *Packet) NextHopFaceID() *uint64

NextHopFaceID returns the NextHopFaceId of the LpPacket or nil if it is unset.

func (*Packet) NonDiscovery

func (p *Packet) NonDiscovery() bool

NonDiscovery returns whether the NonDiscovery flag is set in the LpPacket

func (*Packet) PitToken

func (p *Packet) PitToken() []byte

PitToken returns the PitToken set in the LpPacket or an empty slice if it is unset.

func (*Packet) PrefixAnnouncement

func (p *Packet) PrefixAnnouncement() *ndn.Data

PrefixAnnouncement returns the PrefixAnnouncement field of the LpPacket or nil if none is present.

func (*Packet) Sequence

func (p *Packet) Sequence() *uint64

Sequence returns the Sequence of the LpPacket or nil if it is unset.

func (*Packet) SetCachePolicytype

func (p *Packet) SetCachePolicytype(cachePolicyType uint64)

SetCachePolicytype sets the CachePolicyType of the LpPacket.

func (*Packet) SetCongestionMark

func (p *Packet) SetCongestionMark(congestionMark uint64)

SetCongestionMark sets the CongestionMark of the LpPacket.

func (*Packet) SetFragCount

func (p *Packet) SetFragCount(fragCount uint64)

SetFragCount sets the FragCount of the LpPacket.

func (*Packet) SetFragIndex

func (p *Packet) SetFragIndex(fragIndex uint64)

SetFragIndex sets the FragIndex of the LpPacket.

func (*Packet) SetFragment

func (p *Packet) SetFragment(fragment []byte)

SetFragment sets the Fragment field of the LpPacket.

func (*Packet) SetIncomingFaceID

func (p *Packet) SetIncomingFaceID(incomingFaceID uint64)

SetIncomingFaceID sets the IncomingFaceId of the LpPacket.

func (*Packet) SetNextHopFaceID

func (p *Packet) SetNextHopFaceID(nextHopFaceID uint64)

SetNextHopFaceID sets the NextHopFaceId of the LpPacket.

func (*Packet) SetNonDiscovery

func (p *Packet) SetNonDiscovery(nonDiscovery bool)

SetNonDiscovery sets the NonDiscovery flag of the LpPacket.

func (*Packet) SetPitToken

func (p *Packet) SetPitToken(pitToken []byte)

SetPitToken sets the PitToken of the LpPacket.

func (*Packet) SetPrefixAnnouncement

func (p *Packet) SetPrefixAnnouncement(prefixAnnouncement *ndn.Data)

SetPrefixAnnouncement sets the PrefixAnnouncement field of the LpPacket.

func (*Packet) SetSequence

func (p *Packet) SetSequence(sequence uint64)

SetSequence sets the Sequence of the LpPacket.

func (*Packet) SetTxSequence

func (p *Packet) SetTxSequence(txSequence uint64)

SetTxSequence sets the TxSequence of the LpPacket.

func (*Packet) TxSequence

func (p *Packet) TxSequence() *uint64

TxSequence returns the TxSequence of the LpPacket or nil if it is unset.

Jump to

Keyboard shortcuts

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