spec_2022

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 11 Imported by: 11

Documentation

Overview

Code generated by ndn tlv codegen DO NOT EDIT.

Index

Constants

View Source
const (
	NackReasonNone       = uint64(0)
	NackReasonCongestion = uint64(50)
	NackReasonDuplicate  = uint64(100)
	NackReasonNoRoute    = uint64(150)
)
View Source
const TimeFmt = "20060102T150405" // ISO 8601 time format

Variables

This section is empty.

Functions

func ReadPacket

func ReadPacket(reader enc.WireView) (ret *Packet, context PacketParsingContext, err error)

ReadPacket parses a packet from the reader.

Precondition: reader contains only one TLV.
Postcondition: exactly one of Interest, Data, or LpPacket is returned.

If precondition is not met, then postcondition is not required to hold. But the call won't crash.

Types

type CachePolicy

type CachePolicy struct {
	//+field:natural
	CachePolicyType uint64 `tlv:"0x0335"`
}

func ParseCachePolicy

func ParseCachePolicy(reader enc.WireView, ignoreCritical bool) (*CachePolicy, error)

func (*CachePolicy) Bytes

func (value *CachePolicy) Bytes() []byte

func (*CachePolicy) Encode

func (value *CachePolicy) Encode() enc.Wire

type CachePolicyEncoder

type CachePolicyEncoder struct {
	Length uint
}

func (*CachePolicyEncoder) Encode

func (encoder *CachePolicyEncoder) Encode(value *CachePolicy) enc.Wire

func (*CachePolicyEncoder) EncodeInto

func (encoder *CachePolicyEncoder) EncodeInto(value *CachePolicy, buf []byte)

func (*CachePolicyEncoder) Init

func (encoder *CachePolicyEncoder) Init(value *CachePolicy)

type CachePolicyParsingContext

type CachePolicyParsingContext struct {
}

func (*CachePolicyParsingContext) Init

func (context *CachePolicyParsingContext) Init()

func (*CachePolicyParsingContext) Parse

func (context *CachePolicyParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*CachePolicy, error)

type CertAdditionalDescription

type CertAdditionalDescription struct {
	//+field:sequence:*CertDescriptionEntry:struct:CertDescriptionEntry
	DescriptionEntries []*CertDescriptionEntry `tlv:"0x0200"`
}

func ParseCertAdditionalDescription

func ParseCertAdditionalDescription(reader enc.WireView, ignoreCritical bool) (*CertAdditionalDescription, error)

func (*CertAdditionalDescription) Bytes

func (value *CertAdditionalDescription) Bytes() []byte

func (*CertAdditionalDescription) Encode

func (value *CertAdditionalDescription) Encode() enc.Wire

type CertAdditionalDescriptionEncoder

type CertAdditionalDescriptionEncoder struct {
	Length uint

	DescriptionEntries_subencoder []struct {
		DescriptionEntries_encoder CertDescriptionEntryEncoder
	}
}

func (*CertAdditionalDescriptionEncoder) Encode

func (*CertAdditionalDescriptionEncoder) EncodeInto

func (encoder *CertAdditionalDescriptionEncoder) EncodeInto(value *CertAdditionalDescription, buf []byte)

func (*CertAdditionalDescriptionEncoder) Init

type CertAdditionalDescriptionParsingContext

type CertAdditionalDescriptionParsingContext struct {
	DescriptionEntries_context CertDescriptionEntryParsingContext
}

func (*CertAdditionalDescriptionParsingContext) Init

func (*CertAdditionalDescriptionParsingContext) Parse

func (context *CertAdditionalDescriptionParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*CertAdditionalDescription, error)

type CertDescriptionEntry

type CertDescriptionEntry struct {
	//+field:string
	DescriptionKey string `tlv:"0x0201"`
	//+field:string
	DescriptionValue string `tlv:"0x0202"`
}

func ParseCertDescriptionEntry

func ParseCertDescriptionEntry(reader enc.WireView, ignoreCritical bool) (*CertDescriptionEntry, error)

func (*CertDescriptionEntry) Bytes

func (value *CertDescriptionEntry) Bytes() []byte

func (*CertDescriptionEntry) Encode

func (value *CertDescriptionEntry) Encode() enc.Wire

type CertDescriptionEntryEncoder

type CertDescriptionEntryEncoder struct {
	Length uint
}

func (*CertDescriptionEntryEncoder) Encode

func (encoder *CertDescriptionEntryEncoder) Encode(value *CertDescriptionEntry) enc.Wire

func (*CertDescriptionEntryEncoder) EncodeInto

func (encoder *CertDescriptionEntryEncoder) EncodeInto(value *CertDescriptionEntry, buf []byte)

func (*CertDescriptionEntryEncoder) Init

func (encoder *CertDescriptionEntryEncoder) Init(value *CertDescriptionEntry)

type CertDescriptionEntryParsingContext

type CertDescriptionEntryParsingContext struct {
}

func (*CertDescriptionEntryParsingContext) Init

func (context *CertDescriptionEntryParsingContext) Init()

func (*CertDescriptionEntryParsingContext) Parse

func (context *CertDescriptionEntryParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*CertDescriptionEntry, error)

type Data

type Data struct {

	//+field:name
	NameV enc.Name `tlv:"0x07"`
	//+field:struct:MetaInfo
	MetaInfo *MetaInfo `tlv:"0x14"`
	//+field:wire
	ContentV enc.Wire `tlv:"0x15"`
	//+field:struct:SignatureInfo
	SignatureInfo *SignatureInfo `tlv:"0x16"`
	//+field:signature:sigCoverStart:sigCovered
	SignatureValue enc.Wire `tlv:"0x17"`

	//+field:wire
	CrossSchemaV enc.Wire `tlv:"0x258"`
	// contains filtered or unexported fields
}

+tlv-model:nocopy,private,ordered

func (*Data) Content

func (d *Data) Content() enc.Wire

(AI GENERATED DESCRIPTION): Returns the Data packet’s content payload as a wire‑encoded value.

func (*Data) ContentType

func (d *Data) ContentType() (val optional.Optional[ndn.ContentType])

(AI GENERATED DESCRIPTION): Returns the Data packet's `ContentType` from its `MetaInfo`, if present, wrapped as an `optional.Optional[ndn.ContentType]`.

func (*Data) CrossSchema added in v1.5.2

func (d *Data) CrossSchema() enc.Wire

(AI GENERATED DESCRIPTION): Returns the wire representation of the Data packet in the cross‑schema format.

func (*Data) FinalBlockID

func (d *Data) FinalBlockID() (val optional.Optional[enc.Component])

(AI GENERATED DESCRIPTION): Returns the MetaInfo’s FinalBlockID component as an optional, yielding a parsed `enc.Component` if present and valid, otherwise an empty optional.

func (*Data) Freshness

func (d *Data) Freshness() (val optional.Optional[time.Duration])

(AI GENERATED DESCRIPTION): Returns the Data packet’s freshness period from MetaInfo if present; otherwise returns an empty optional.

func (*Data) KeyName

func (d *Data) KeyName() enc.Name

(AI GENERATED DESCRIPTION): Retrieves the name of the key used to sign the data packet, returning the key‑locator’s name or nil when the signature info or key locator is absent.

func (*Data) Name

func (d *Data) Name() enc.Name

(AI GENERATED DESCRIPTION): Returns the name (enc.Name) of the Data packet.

func (*Data) SetSigTime

func (d *Data) SetSigTime(t *time.Time) error

(AI GENERATED DESCRIPTION): Sets the Data packet’s SignatureInfo.SignatureTime to the given time (converted to a millisecond duration) or clears the field if the argument is nil.

func (*Data) SigNonce

func (d *Data) SigNonce() []byte

(AI GENERATED DESCRIPTION): Retrieves the signature nonce attached to the Data packet, returning nil if no nonce is present.

func (*Data) SigSeqNum

func (d *Data) SigSeqNum() *uint64

(AI GENERATED DESCRIPTION): Retrieves the sequence number associated with the packet’s signature (returning nil if the field is not set).

func (*Data) SigTime

func (d *Data) SigTime() *time.Time

(AI GENERATED DESCRIPTION): Returns the signature timestamp of the Data packet (currently unimplemented and returns nil).

func (*Data) SigType

func (d *Data) SigType() ndn.SigType

(AI GENERATED DESCRIPTION): Returns the signature type of the Data packet, defaulting to ndn.SignatureNone when SignatureInfo is nil.

func (*Data) SigValue

func (d *Data) SigValue() []byte

(AI GENERATED DESCRIPTION): Returns the Data packet’s signature value as a byte slice, or nil if no signature is present.

func (*Data) Signature

func (d *Data) Signature() ndn.Signature

(AI GENERATED DESCRIPTION): Returns the Data packet itself as its own signature, allowing the Data struct to satisfy the ndn.Signature interface.

func (*Data) Validity

func (d *Data) Validity() (notBefore, notAfter optional.Optional[time.Time])

(AI GENERATED DESCRIPTION): Retrieves the optional “NotBefore” and “NotAfter” timestamps from a Data packet’s SignatureInfo validity period, returning them as `optional.Optional[time.Time]` values when present.

type DataEncoder

type DataEncoder struct {
	Length uint

	NameV_length           uint
	MetaInfo_encoder       MetaInfoEncoder
	ContentV_length        uint
	SignatureInfo_encoder  SignatureInfoEncoder
	SignatureValue_wireIdx int
	SignatureValue_estLen  uint
	CrossSchemaV_length    uint
	// contains filtered or unexported fields
}

func (*DataEncoder) Encode

func (encoder *DataEncoder) Encode(value *Data) enc.Wire

func (*DataEncoder) EncodeInto

func (encoder *DataEncoder) EncodeInto(value *Data, wire enc.Wire)

func (*DataEncoder) Init

func (encoder *DataEncoder) Init(value *Data)

type DataParsingContext

type DataParsingContext struct {
	MetaInfo_context MetaInfoParsingContext

	SignatureInfo_context SignatureInfoParsingContext
	// contains filtered or unexported fields
}

func (*DataParsingContext) Init

func (context *DataParsingContext) Init()

func (*DataParsingContext) Parse

func (context *DataParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*Data, error)

func (DataParsingContext) SigCovered

func (c DataParsingContext) SigCovered() enc.Wire

(AI GENERATED DESCRIPTION): Returns the wire representation of the portion of the Data packet that is covered by the signature.

type Interest

type Interest struct {

	//+field:interestName:sigCovered
	NameV enc.Name `tlv:"0x07"`
	//+field:bool
	CanBePrefixV bool `tlv:"0x21"`
	//+field:bool
	MustBeFreshV bool `tlv:"0x12"`
	//+field:struct:Links
	ForwardingHintV *Links `tlv:"0x1e"`
	//+field:fixedUint:uint32:optional
	NonceV optional.Optional[uint32] `tlv:"0x0a"`
	//+field:time:optional
	InterestLifetimeV optional.Optional[time.Duration] `tlv:"0x0c"`
	//+field:byte
	HopLimitV *byte `tlv:"0x22"`

	//+field:wire
	ApplicationParameters enc.Wire `tlv:"0x24"`
	//+field:struct:SignatureInfo
	SignatureInfo *SignatureInfo `tlv:"0x2c"`
	//+field:signature:sigCoverStart:sigCovered
	SignatureValue enc.Wire `tlv:"0x2e"`
	// contains filtered or unexported fields
}

+tlv-model:nocopy,private,ordered

func (*Interest) AppParam

func (t *Interest) AppParam() enc.Wire

(AI GENERATED DESCRIPTION): Returns the ApplicationParameters field of the Interest packet.

func (*Interest) CanBePrefix

func (t *Interest) CanBePrefix() bool

(AI GENERATED DESCRIPTION): Returns whether the CanBePrefix flag is set on this Interest packet, indicating that it may be satisfied by Data packets whose name is a prefix of the Interest.

func (*Interest) ForwardingHint

func (t *Interest) ForwardingHint() []enc.Name

(AI GENERATED DESCRIPTION): Retrieves the slice of forwarding‑hint names from the Interest packet, returning nil if no forwarding hint is set.

func (*Interest) HopLimit

func (t *Interest) HopLimit() *uint

(AI GENERATED DESCRIPTION): Retrieves the hop limit of an Interest, returning it as a `*uint` or `nil` if the hop limit is not set.

func (*Interest) KeyName

func (t *Interest) KeyName() enc.Name

(AI GENERATED DESCRIPTION): Retrieves the key name stored in the Interest’s SignatureInfo.KeyLocator, returning nil if the SignatureInfo or KeyLocator is absent.

func (*Interest) Lifetime

func (t *Interest) Lifetime() optional.Optional[time.Duration]

(AI GENERATED DESCRIPTION): Returns the optional lifetime duration of this Interest packet.

func (*Interest) MustBeFresh

func (t *Interest) MustBeFresh() bool

(AI GENERATED DESCRIPTION): Returns whether the MustBeFresh flag is set for this Interest packet.

func (*Interest) Name

func (t *Interest) Name() enc.Name

(AI GENERATED DESCRIPTION): Returns the Interest packet’s name as an enc.Name value.

func (*Interest) Nonce

func (t *Interest) Nonce() optional.Optional[uint32]

(AI GENERATED DESCRIPTION): Retrieves the optional Nonce value from the Interest packet.

func (*Interest) SigNonce

func (t *Interest) SigNonce() []byte

(AI GENERATED DESCRIPTION): Retrieves the signature nonce stored in the Interest’s SignatureInfo, returning `nil` if no nonce is present.

func (*Interest) SigSeqNum

func (t *Interest) SigSeqNum() *uint64

(AI GENERATED DESCRIPTION): Retrieves the signature sequence number from an Interest's SignatureInfo when set, returning a pointer to it; otherwise returns nil.

func (*Interest) SigTime

func (t *Interest) SigTime() *time.Time

(AI GENERATED DESCRIPTION): Retrieves the signature timestamp of an Interest, returning it as a `*time.Time` when set, or `nil` if no signature time is present.

func (*Interest) SigType

func (t *Interest) SigType() ndn.SigType

(AI GENERATED DESCRIPTION): Returns the signature type of the Interest packet, defaulting to `SignatureNone` when no signature information is present.

func (*Interest) SigValue

func (t *Interest) SigValue() []byte

(AI GENERATED DESCRIPTION): Returns the concatenated raw signature value of the Interest packet as a byte slice.

func (*Interest) Signature

func (t *Interest) Signature() ndn.Signature

(AI GENERATED DESCRIPTION): Returns the Interest packet itself as its signature (the Interest implements the ndn.Signature interface).

func (*Interest) Validity

func (t *Interest) Validity() (notBefore, notAfter optional.Optional[time.Time])

(AI GENERATED DESCRIPTION): Retrieves the optional notBefore and notAfter timestamps of the Interest packet, returning unset optional values if no validity period is set.

type InterestEncoder

type InterestEncoder struct {
	Length uint

	NameV_length     uint
	NameV_needDigest bool
	NameV_wireIdx    int
	NameV_pos        uint

	ForwardingHintV_encoder LinksEncoder

	ApplicationParameters_length uint
	SignatureInfo_encoder        SignatureInfoEncoder
	SignatureValue_wireIdx       int
	SignatureValue_estLen        uint
	// contains filtered or unexported fields
}

func (*InterestEncoder) Encode

func (encoder *InterestEncoder) Encode(value *Interest) enc.Wire

func (*InterestEncoder) EncodeInto

func (encoder *InterestEncoder) EncodeInto(value *Interest, wire enc.Wire)

func (*InterestEncoder) Init

func (encoder *InterestEncoder) Init(value *Interest)

type InterestParsingContext

type InterestParsingContext struct {
	NameV_wireIdx int
	NameV_pos     uint

	ForwardingHintV_context LinksParsingContext

	SignatureInfo_context SignatureInfoParsingContext
	// contains filtered or unexported fields
}

func (*InterestParsingContext) Init

func (context *InterestParsingContext) Init()

func (*InterestParsingContext) Parse

func (context *InterestParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*Interest, error)

func (InterestParsingContext) SigCovered

func (c InterestParsingContext) SigCovered() enc.Wire

(AI GENERATED DESCRIPTION): Returns the wire representation of the signature‑covered portion of an Interest packet.

type KeyLocator

type KeyLocator struct {
	//+field:name
	Name enc.Name `tlv:"0x07"`
	//+field:binary
	KeyDigest []byte `tlv:"0x1d"`
}

func ParseKeyLocator

func ParseKeyLocator(reader enc.WireView, ignoreCritical bool) (*KeyLocator, error)

func (*KeyLocator) Bytes

func (value *KeyLocator) Bytes() []byte

func (*KeyLocator) Encode

func (value *KeyLocator) Encode() enc.Wire

type KeyLocatorEncoder

type KeyLocatorEncoder struct {
	Length uint

	Name_length uint
}

func (*KeyLocatorEncoder) Encode

func (encoder *KeyLocatorEncoder) Encode(value *KeyLocator) enc.Wire

func (*KeyLocatorEncoder) EncodeInto

func (encoder *KeyLocatorEncoder) EncodeInto(value *KeyLocator, buf []byte)

func (*KeyLocatorEncoder) Init

func (encoder *KeyLocatorEncoder) Init(value *KeyLocator)

type KeyLocatorParsingContext

type KeyLocatorParsingContext struct {
}

func (*KeyLocatorParsingContext) Init

func (context *KeyLocatorParsingContext) Init()

func (*KeyLocatorParsingContext) Parse

func (context *KeyLocatorParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*KeyLocator, error)
type Links struct {
	//+field:sequence:enc.Name:name
	Names []enc.Name `tlv:"0x07"`
}
func ParseLinks(reader enc.WireView, ignoreCritical bool) (*Links, error)

func (*Links) Bytes

func (value *Links) Bytes() []byte

func (*Links) Encode

func (value *Links) Encode() enc.Wire

type LinksEncoder

type LinksEncoder struct {
	Length uint

	Names_subencoder []struct {
		Names_length uint
	}
}

func (*LinksEncoder) Encode

func (encoder *LinksEncoder) Encode(value *Links) enc.Wire

func (*LinksEncoder) EncodeInto

func (encoder *LinksEncoder) EncodeInto(value *Links, buf []byte)

func (*LinksEncoder) Init

func (encoder *LinksEncoder) Init(value *Links)

type LinksParsingContext

type LinksParsingContext struct {
}

func (*LinksParsingContext) Init

func (context *LinksParsingContext) Init()

func (*LinksParsingContext) Parse

func (context *LinksParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*Links, error)

type LpPacket

type LpPacket struct {
	//+field:fixedUint:uint64:optional
	Sequence optional.Optional[uint64] `tlv:"0x51"`
	//+field:natural:optional
	FragIndex optional.Optional[uint64] `tlv:"0x52"`
	//+field:natural:optional
	FragCount optional.Optional[uint64] `tlv:"0x53"`
	//+field:binary
	PitToken []byte `tlv:"0x62"`
	//+field:struct:NetworkNack
	Nack *NetworkNack `tlv:"0x0320"`
	//+field:natural:optional
	IncomingFaceId optional.Optional[uint64] `tlv:"0x032C"`
	//+field:natural:optional
	NextHopFaceId optional.Optional[uint64] `tlv:"0x0330"`
	//+field:struct:CachePolicy
	CachePolicy *CachePolicy `tlv:"0x0334"`
	//+field:natural:optional
	CongestionMark optional.Optional[uint64] `tlv:"0x0340"`
	//+field:fixedUint:uint64:optional
	Ack optional.Optional[uint64] `tlv:"0x0344"`
	//+field:fixedUint:uint64:optional
	TxSequence optional.Optional[uint64] `tlv:"0x0348"`
	//+field:bool
	NonDiscovery bool `tlv:"0x034C"`
	//+field:wire
	PrefixAnnouncement enc.Wire `tlv:"0x0350"`

	//+field:wire
	Fragment enc.Wire `tlv:"0x50"`
}

+tlv-model:nocopy,private

type LpPacketEncoder

type LpPacketEncoder struct {
	Length uint

	Nack_encoder NetworkNackEncoder

	CachePolicy_encoder CachePolicyEncoder

	PrefixAnnouncement_length uint
	Fragment_length           uint
	// contains filtered or unexported fields
}

func (*LpPacketEncoder) Encode

func (encoder *LpPacketEncoder) Encode(value *LpPacket) enc.Wire

func (*LpPacketEncoder) EncodeInto

func (encoder *LpPacketEncoder) EncodeInto(value *LpPacket, wire enc.Wire)

func (*LpPacketEncoder) Init

func (encoder *LpPacketEncoder) Init(value *LpPacket)

type LpPacketParsingContext

type LpPacketParsingContext struct {
	Nack_context NetworkNackParsingContext

	CachePolicy_context CachePolicyParsingContext
}

func (*LpPacketParsingContext) Init

func (context *LpPacketParsingContext) Init()

func (*LpPacketParsingContext) Parse

func (context *LpPacketParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*LpPacket, error)

type MetaInfo

type MetaInfo struct {
	//+field:natural:optional
	ContentType optional.Optional[uint64] `tlv:"0x18"`
	//+field:time:optional
	FreshnessPeriod optional.Optional[time.Duration] `tlv:"0x19"`
	//+field:binary
	FinalBlockID []byte `tlv:"0x1a"`
}

func ParseMetaInfo

func ParseMetaInfo(reader enc.WireView, ignoreCritical bool) (*MetaInfo, error)

func (*MetaInfo) Bytes

func (value *MetaInfo) Bytes() []byte

func (*MetaInfo) Encode

func (value *MetaInfo) Encode() enc.Wire

type MetaInfoEncoder

type MetaInfoEncoder struct {
	Length uint
}

func (*MetaInfoEncoder) Encode

func (encoder *MetaInfoEncoder) Encode(value *MetaInfo) enc.Wire

func (*MetaInfoEncoder) EncodeInto

func (encoder *MetaInfoEncoder) EncodeInto(value *MetaInfo, buf []byte)

func (*MetaInfoEncoder) Init

func (encoder *MetaInfoEncoder) Init(value *MetaInfo)

type MetaInfoParsingContext

type MetaInfoParsingContext struct {
}

func (*MetaInfoParsingContext) Init

func (context *MetaInfoParsingContext) Init()

func (*MetaInfoParsingContext) Parse

func (context *MetaInfoParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*MetaInfo, error)

type NameContainer added in v1.5.2

type NameContainer struct {
	//+field:name
	Name enc.Name `tlv:"0x07"`
}

func ParseNameContainer added in v1.5.2

func ParseNameContainer(reader enc.WireView, ignoreCritical bool) (*NameContainer, error)

func (*NameContainer) Bytes added in v1.5.2

func (value *NameContainer) Bytes() []byte

func (*NameContainer) Encode added in v1.5.2

func (value *NameContainer) Encode() enc.Wire

type NameContainerEncoder added in v1.5.2

type NameContainerEncoder struct {
	Length uint

	Name_length uint
}

func (*NameContainerEncoder) Encode added in v1.5.2

func (encoder *NameContainerEncoder) Encode(value *NameContainer) enc.Wire

func (*NameContainerEncoder) EncodeInto added in v1.5.2

func (encoder *NameContainerEncoder) EncodeInto(value *NameContainer, buf []byte)

func (*NameContainerEncoder) Init added in v1.5.2

func (encoder *NameContainerEncoder) Init(value *NameContainer)

type NameContainerParsingContext added in v1.5.2

type NameContainerParsingContext struct {
}

func (*NameContainerParsingContext) Init added in v1.5.2

func (context *NameContainerParsingContext) Init()

func (*NameContainerParsingContext) Parse added in v1.5.2

func (context *NameContainerParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*NameContainer, error)

type NetworkNack

type NetworkNack struct {
	//+field:natural
	Reason uint64 `tlv:"0x0321"`
}

func ParseNetworkNack

func ParseNetworkNack(reader enc.WireView, ignoreCritical bool) (*NetworkNack, error)

func (*NetworkNack) Bytes

func (value *NetworkNack) Bytes() []byte

func (*NetworkNack) Encode

func (value *NetworkNack) Encode() enc.Wire

type NetworkNackEncoder

type NetworkNackEncoder struct {
	Length uint
}

func (*NetworkNackEncoder) Encode

func (encoder *NetworkNackEncoder) Encode(value *NetworkNack) enc.Wire

func (*NetworkNackEncoder) EncodeInto

func (encoder *NetworkNackEncoder) EncodeInto(value *NetworkNack, buf []byte)

func (*NetworkNackEncoder) Init

func (encoder *NetworkNackEncoder) Init(value *NetworkNack)

type NetworkNackParsingContext

type NetworkNackParsingContext struct {
}

func (*NetworkNackParsingContext) Init

func (context *NetworkNackParsingContext) Init()

func (*NetworkNackParsingContext) Parse

func (context *NetworkNackParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*NetworkNack, error)

type Packet

type Packet struct {
	//+field:struct:Interest:nocopy
	Interest *Interest `tlv:"0x05"`
	//+field:struct:Data:nocopy
	Data *Data `tlv:"0x06"`
	//+field:struct:LpPacket:nocopy
	LpPacket *LpPacket `tlv:"0x64"`
}

+tlv-model:nocopy,private

type PacketEncoder

type PacketEncoder struct {
	Length uint

	Interest_encoder InterestEncoder
	Data_encoder     DataEncoder
	LpPacket_encoder LpPacketEncoder
	// contains filtered or unexported fields
}

func (*PacketEncoder) Encode

func (encoder *PacketEncoder) Encode(value *Packet) enc.Wire

func (*PacketEncoder) EncodeInto

func (encoder *PacketEncoder) EncodeInto(value *Packet, wire enc.Wire)

func (*PacketEncoder) Init

func (encoder *PacketEncoder) Init(value *Packet)

type PacketParsingContext

type PacketParsingContext struct {
	Interest_context InterestParsingContext
	Data_context     DataParsingContext
	LpPacket_context LpPacketParsingContext
}

func (*PacketParsingContext) Init

func (context *PacketParsingContext) Init()

func (*PacketParsingContext) Parse

func (context *PacketParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*Packet, error)

type SignatureInfo

type SignatureInfo struct {
	//+field:natural
	SignatureType uint64 `tlv:"0x1b"`
	//+field:struct:KeyLocator
	KeyLocator *KeyLocator `tlv:"0x1c"`
	//+field:binary
	SignatureNonce []byte `tlv:"0x26"`
	//+field:time:optional
	SignatureTime optional.Optional[time.Duration] `tlv:"0x28"`
	//+field:natural:optional
	SignatureSeqNum optional.Optional[uint64] `tlv:"0x2a"`
	//+field:struct:ValidityPeriod
	ValidityPeriod *ValidityPeriod `tlv:"0xfd"`
	//+field:struct:CertAdditionalDescription
	AdditionalDescription *CertAdditionalDescription `tlv:"0x0102"`
}

func ParseSignatureInfo

func ParseSignatureInfo(reader enc.WireView, ignoreCritical bool) (*SignatureInfo, error)

func (*SignatureInfo) Bytes

func (value *SignatureInfo) Bytes() []byte

func (*SignatureInfo) Encode

func (value *SignatureInfo) Encode() enc.Wire

type SignatureInfoEncoder

type SignatureInfoEncoder struct {
	Length uint

	KeyLocator_encoder KeyLocatorEncoder

	ValidityPeriod_encoder        ValidityPeriodEncoder
	AdditionalDescription_encoder CertAdditionalDescriptionEncoder
}

func (*SignatureInfoEncoder) Encode

func (encoder *SignatureInfoEncoder) Encode(value *SignatureInfo) enc.Wire

func (*SignatureInfoEncoder) EncodeInto

func (encoder *SignatureInfoEncoder) EncodeInto(value *SignatureInfo, buf []byte)

func (*SignatureInfoEncoder) Init

func (encoder *SignatureInfoEncoder) Init(value *SignatureInfo)

type SignatureInfoParsingContext

type SignatureInfoParsingContext struct {
	KeyLocator_context KeyLocatorParsingContext

	ValidityPeriod_context        ValidityPeriodParsingContext
	AdditionalDescription_context CertAdditionalDescriptionParsingContext
}

func (*SignatureInfoParsingContext) Init

func (context *SignatureInfoParsingContext) Init()

func (*SignatureInfoParsingContext) Parse

func (context *SignatureInfoParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*SignatureInfo, error)

type Spec

type Spec struct{}

func (Spec) MakeData

func (Spec) MakeData(name enc.Name, config *ndn.DataConfig, content enc.Wire, signer ndn.Signer) (*ndn.EncodedData, error)

MakeData encodes an NDN Data.

func (Spec) MakeInterest

func (Spec) MakeInterest(name enc.Name, config *ndn.InterestConfig, appParam enc.Wire, signer ndn.Signer) (*ndn.EncodedInterest, error)

MakeInterest encodes an NDN Interest.

func (Spec) ReadData

func (Spec) ReadData(reader enc.WireView) (ndn.Data, enc.Wire, error)

ReadData parses a Data from the reader. Precondition: reader contains only one TLV.

func (Spec) ReadInterest

func (Spec) ReadInterest(reader enc.WireView) (ndn.Interest, enc.Wire, error)

ReadInterest parses an Interest from the reader. Precondition: reader contains only one TLV.

type ValidityPeriod

type ValidityPeriod struct {
	//+field:string
	NotBefore string `tlv:"0xfe"`
	//+field:string
	NotAfter string `tlv:"0xff"`
}

func ParseValidityPeriod

func ParseValidityPeriod(reader enc.WireView, ignoreCritical bool) (*ValidityPeriod, error)

func (*ValidityPeriod) Bytes

func (value *ValidityPeriod) Bytes() []byte

func (*ValidityPeriod) Encode

func (value *ValidityPeriod) Encode() enc.Wire

type ValidityPeriodEncoder

type ValidityPeriodEncoder struct {
	Length uint
}

func (*ValidityPeriodEncoder) Encode

func (encoder *ValidityPeriodEncoder) Encode(value *ValidityPeriod) enc.Wire

func (*ValidityPeriodEncoder) EncodeInto

func (encoder *ValidityPeriodEncoder) EncodeInto(value *ValidityPeriod, buf []byte)

func (*ValidityPeriodEncoder) Init

func (encoder *ValidityPeriodEncoder) Init(value *ValidityPeriod)

type ValidityPeriodParsingContext

type ValidityPeriodParsingContext struct {
}

func (*ValidityPeriodParsingContext) Init

func (context *ValidityPeriodParsingContext) Init()

func (*ValidityPeriodParsingContext) Parse

func (context *ValidityPeriodParsingContext) Parse(reader enc.WireView, ignoreCritical bool) (*ValidityPeriod, error)

Jump to

Keyboard shortcuts

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