Documentation ¶
Overview ¶
Package ndnlayer provides a GoPacket layer for NDN.
Index ¶
- Constants
- Variables
- func SerializeFrom(fields ...tlv.Fielder) gopacket.SerializableLayer
- type NDN
- func (NDN) CanDecode() gopacket.LayerClass
- func (l *NDN) DecodeFromBytes(wire []byte, df gopacket.DecodeFeedback) error
- func (l *NDN) LayerContents() []byte
- func (l *NDN) LayerPayload() []byte
- func (NDN) LayerType() gopacket.LayerType
- func (NDN) NextLayerType() gopacket.LayerType
- func (l *NDN) Payload() []byte
- func (l *NDN) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
- type TLV
Constants ¶
const ( EthernetTypeNDN layers.EthernetType = an.EtherTypeNDN UDPPortNDN layers.UDPPort = an.UDPPortNDN )
Assigned numbers.
Variables ¶
var LayerTypeNDN = gopacket.RegisterLayerType(1636, gopacket.LayerTypeMetadata{ Name: "NDN", Decoder: gopacket.DecodeFunc(decodeNDN), })
LayerTypeNDN identifies NDN layer.
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 ¶
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) LayerPayload ¶
LayerPayload returns TLV-VALUE of Interest ApplicationParameters or Data Content.
func (NDN) NextLayerType ¶
NextLayerType implements gopacket.DecodingLayer interface.
func (*NDN) SerializeTo ¶
func (l *NDN) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
SerializeTo implements gopacket.SerializableLayer interface.
type TLV ¶
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) NextLayerType ¶
NextLayerType implements gopacket.DecodingLayer interface.