NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
lp.h
Go to the documentation of this file.
1#ifndef NDNDPDK_NDNI_LP_H
2#define NDNDPDK_NDNI_LP_H
3
5
6#include "common.h"
7
9typedef struct LpL2 {
10 uint64_t seqNumBase;
11 uint8_t fragIndex;
12 uint8_t fragCount;
13
22 uint32_t reassBitmap;
23 struct cds_list_head reassNode;
26static_assert(LpMaxFragments <= UINT8_MAX, "");
27static_assert(LpMaxFragments < CHAR_BIT * RTE_SIZEOF_FIELD(LpL2, reassBitmap), "");
28
29static __rte_always_inline uint64_t
30LpL2_GetSeqNum(const LpL2* l2) {
31 return l2->seqNumBase + l2->fragIndex;
32}
33
35typedef struct __rte_packed_begin LpPitToken {
36 uint8_t length;
37 uint8_t value[32];
39
41__attribute__((nonnull)) static __rte_always_inline void
42LpPitToken_Set(LpPitToken* token, uint8_t length, const uint8_t* value) {
43 token->length = length;
44 rte_memcpy(token->value, value, length);
45 memset(RTE_PTR_ADD(token->value, length), 0, sizeof(token->value) - length);
46}
47
52__attribute__((nonnull, returns_nonnull)) const char*
54
56typedef struct LpL3 {
57 uint8_t nackReason;
58 uint8_t congMark;
61
63typedef struct LpHeader {
67
84__attribute__((nonnull)) bool
85LpHeader_Parse(LpHeader* lph, struct rte_mbuf* pkt);
86
93__attribute__((nonnull)) void
94LpHeader_Prepend(struct rte_mbuf* pkt, const LpL3* l3, const LpL2* l2);
95
96#endif // NDNDPDK_NDN_LP_H
struct __rte_packed_begin vlanhdr __rte_packed_end
bool LpHeader_Parse(LpHeader *lph, struct rte_mbuf *pkt)
Parse NDNLPv2 header and strip from mbuf.
Definition lp.c:45
const char * LpPitToken_ToString(const LpPitToken *token)
Print PIT token as string for logging.
Definition lp.c:8
void LpHeader_Prepend(struct rte_mbuf *pkt, const LpL3 *l3, const LpL2 *l2)
Prepend NDNLPv2 header to mbuf.
Definition lp.c:144
struct Packet Packet
Definition common.h:11
@ LpMaxFragments
Definition enum.h:8
Parsed NDNLPv2 header.
Definition lp.h:63
LpL2 l2
Definition lp.h:65
LpL3 l3
Definition lp.h:64
NDNLPv2 layer 2 fields and reassembler state.
Definition lp.h:9
uint64_t seqNumBase
seqNum-fragIndex
Definition lp.h:10
uint32_t reassBitmap
A bitmap of fragment arrival status.
Definition lp.h:22
Packet * reassFrags[LpMaxFragments]
Definition lp.h:24
struct cds_list_head reassNode
Definition lp.h:23
uint8_t fragCount
Definition lp.h:12
uint8_t fragIndex
Definition lp.h:11
NDNLPv2 layer 3 fields.
Definition lp.h:56
uint8_t nackReason
Definition lp.h:57
LpPitToken pitToken
Definition lp.h:59
uint8_t congMark
Definition lp.h:58
NDNLPv2 PIT token value.
Definition lp.h:35
uint8_t value[32]
Definition lp.h:37
uint8_t length
Definition lp.h:36