ndnlayer

package
v0.0.0-...-1e60831 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: NIST-PD-fallback Imports: 6 Imported by: 1

Documentation

Overview

Package ndnlayer provides a GoPacket layer for NDN.

Index

Constants

View Source
const (
	EthernetTypeNDN layers.EthernetType = an.EtherTypeNDN
	UDPPortNDN      layers.UDPPort      = an.UDPPortNDN
)

Assigned numbers.

Variables

View Source
var LayerTypeNDN = gopacket.RegisterLayerType(1636, gopacket.LayerTypeMetadata{
	Name:    "NDN",
	Decoder: gopacket.DecodeFunc(decodeNDN),
})

LayerTypeNDN identifies NDN layer.

View Source
var LayerTypeTLV = gopacket.RegisterLayerType(1638, gopacket.LayerTypeMetadata{
	Name:    "NDN-TLV",
	Decoder: gopacket.DecodeFunc(decodeTLV),
})

LayerTypeTLV identifies NDN-TLV layer.

Functions

func SerializeFrom

func SerializeFrom(fields ...tlv.Fielder) gopacket.SerializableLayer

SerializeFrom creates a gopacket.SerializableLayer from a sequence of tlv.Fielders.

Types

type NDN

type NDN struct {
	Packet *ndn.Packet
	// contains filtered or unexported fields
}

NDN is the layer for NDN packets.

func (NDN) CanDecode

func (NDN) CanDecode() gopacket.LayerClass

CanDecode implements gopacket.DecodingLayer interface.

func (*NDN) DecodeFromBytes

func (l *NDN) DecodeFromBytes(wire []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes recognizes NDNLPv2 packet. Input must only contain one TLV element.

func (*NDN) LayerContents

func (l *NDN) LayerContents() []byte

LayerContents returns TLV bytes.

func (*NDN) LayerPayload

func (l *NDN) LayerPayload() []byte

LayerPayload returns TLV-VALUE of Interest ApplicationParameters or Data Content.

func (NDN) LayerType

func (NDN) LayerType() gopacket.LayerType

LayerType returns LayerTypeNDN.

func (NDN) NextLayerType

func (NDN) NextLayerType() gopacket.LayerType

NextLayerType implements gopacket.DecodingLayer interface.

func (*NDN) Payload

func (l *NDN) Payload() []byte

Payload implements gopacket.ApplicationLayer interface.

func (*NDN) SerializeTo

func (l *NDN) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo implements gopacket.SerializableLayer interface.

type TLV

type TLV struct {
	Element tlv.Element
	// contains filtered or unexported fields
}

TLV is the layer for NDN-TLV.

func (TLV) CanDecode

func (TLV) CanDecode() gopacket.LayerClass

CanDecode implements gopacket.DecodingLayer interface.

func (*TLV) DecodeFromBytes

func (l *TLV) DecodeFromBytes(wire []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes recognizes NDN-TLV structure. Input must start with an TLV element, and may contain padding at the end.

func (*TLV) LayerContents

func (l *TLV) LayerContents() []byte

LayerContents returns TLV bytes.

func (*TLV) LayerPayload

func (l *TLV) LayerPayload() []byte

LayerPayload returns TLV bytes.

func (TLV) LayerType

func (TLV) LayerType() gopacket.LayerType

LayerType returns LayerTypeTLV.

func (TLV) NextLayerType

func (TLV) NextLayerType() gopacket.LayerType

NextLayerType implements gopacket.DecodingLayer interface.

Jump to

Keyboard shortcuts

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