NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
lp.c File Reference
#include "lp.h"
#include "../core/base16.h"
#include "../core/logger.h"
#include "tlv-decoder.h"
#include "tlv-encoder.h"

Functions

const char * LpPitToken_ToString (const LpPitToken *token)
 Print PIT token as string for logging. More...
 
bool LpHeader_Parse (LpHeader *lph, struct rte_mbuf *pkt)
 Parse NDNLPv2 header and strip from mbuf. More...
 
void LpHeader_Prepend (struct rte_mbuf *pkt, const LpL3 *l3, const LpL2 *l2)
 Prepend NDNLPv2 header to mbuf. More...
 

Function Documentation

◆ LpHeader_Parse()

bool LpHeader_Parse ( LpHeader lph,
struct rte_mbuf *  pkt 
)

Parse NDNLPv2 header and strip from mbuf.

Parameters
pkta uniquely owned, possibly segmented, direct mbuf.
Returns
whether success.
Postcondition
pkt contains only (fragment of) network layer packet.

This function recognizes these NDNLPv2 features:

  • indexed fragmentation-reassembly
  • PIT token
  • network nack
  • congestion mark

This function does not check whether header fields are applicable to network layer packet type, because network layer type is unknown before reassembly. For example, it would accept Nack header on Data packet.

◆ LpHeader_Prepend()

void LpHeader_Prepend ( struct rte_mbuf *  pkt,
const LpL3 l3,
const LpL2 l2 
)

Prepend NDNLPv2 header to mbuf.

Parameters
pkttarget mbuf, must have enough headroom.
Precondition
pkt contains (fragment of) network layer packet.
Postcondition
pkt contains LpPacket.

◆ LpPitToken_ToString()

const char* LpPitToken_ToString ( const LpPitToken token)

Print PIT token as string for logging.

Returns
see DebugString_Get