1 #ifndef NDNDPDK_PDUMP_PARSE_H
2 #define NDNDPDK_PDUMP_PARSE_H
6 #include "../ndni/name.h"
7 #include "../ndni/tlv-decoder.h"
9 __attribute__((nonnull))
static inline LName
11 uint32_t length, type = TlvDecoder_ReadTL_MaybeTruncated(d, &length);
12 if (unlikely(type !=
TtName)) {
16 .value = rte_pktmbuf_mtod_offset(d->
m,
const uint8_t*, d->
offset),
17 .length = RTE_MIN(length, d->
m->data_len - d->
offset),
29 __attribute__((nonnull))
static inline LName
30 Pdump_ExtractName(
struct rte_mbuf* pkt) {
32 uint32_t length0, type0 = TlvDecoder_ReadTL(&d, &length0);
36 return Pdump_ExtractNameL3_(&d);
46 uint8_t fragIndex = 0;
53 uint32_t length2, type2 = TlvDecoder_ReadTL_MaybeTruncated(&d, &length2);
57 return Pdump_ExtractNameL3_(&d);
64 TlvDecoder_Skip(&d, length1);
@ TtName
Definition: an.h:20
@ TtFragIndex
Definition: an.h:14
@ TtInterest
Definition: an.h:30
@ TtData
Definition: an.h:40
@ TtLpPayload
Definition: an.h:12
@ TtLpPacket
Definition: an.h:11
Name in linear buffer.
Definition: name.h:11
TLV decoder.
Definition: tlv-decoder.h:15
uint16_t offset
offset within current segment
Definition: tlv-decoder.h:19
struct rte_mbuf * m
current segment
Definition: tlv-decoder.h:17
#define TlvDecoder_ReadNniTo(...)
Read non-negative integer to a pointer of any unsigned type.
Definition: tlv-decoder.h:321
#define TlvDecoder_EachTL(d, typeVar, lengthVar)
Iterate over TLV elements.
Definition: tlv-decoder.h:257