NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions | Variables
packet.h File Reference
#include "data.h"
#include "nack.h"
#include "tlv-encoder.h"

Go to the source code of this file.

Data Structures

union  PacketPriv
 mbuf private data for NDN packet. More...
 

Typedefs

typedef union PacketPriv PacketPriv
 mbuf private data for NDN packet. More...
 

Functions

bool Packet_Parse (Packet *npkt, ParseFor parseFor)
 Parse layer 2 and layer 3 in mbuf. More...
 
bool Packet_ParseL3 (Packet *npkt, ParseFor parseFor)
 Parse layer 3 in mbuf. More...
 
PacketPacket_Clone (Packet *npkt, PacketMempools *mp, PacketTxAlign align)
 Clone packet to new mbufs. More...
 

Variables

const char * PktType_Strings_ []
 

Typedef Documentation

◆ PacketPriv

typedef union PacketPriv PacketPriv

mbuf private data for NDN packet.

Function Documentation

◆ Packet_Clone()

Packet* Packet_Clone ( Packet npkt,
PacketMempools mp,
PacketTxAlign  align 
)

Clone packet to new mbufs.

Return values
NULLallocation failure.
Returns
new mbufs that fulfill align requirements.
Postcondition
npkt is unaffected.

◆ Packet_Parse()

bool Packet_Parse ( Packet npkt,
ParseFor  parseFor 
)

Parse layer 2 and layer 3 in mbuf.

Parameters
npkta uniquely owned, possibly segmented, direct mbuf.
parseForsee PInterest_Parse and PData_Parse .
Returns
whether success.
Postcondition
If the packet is fragmented, Packet_GetType(npkt) returns PktFragment . Otherwise, same as Packet_ParseL3 .

◆ Packet_ParseL3()

bool Packet_ParseL3 ( Packet npkt,
ParseFor  parseFor 
)

Parse layer 3 in mbuf.

Parameters
npkta uniquely owned, possibly segmented, direct mbuf. Its PacketPriv.lpl3 should have been initialized.
parseForsee PInterest_Parse and PData_Parse .
Returns
whether success.
Postcondition
Packet_GetType(npkt) returns PktInterest , PktData , or PktNack .
One of PInterest , PData , or PNack is initialized.

Variable Documentation

◆ PktType_Strings_

const char* PktType_Strings_[]
extern