NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
interest.h
Go to the documentation of this file.
1 #ifndef NDNDPDK_NDNI_INTEREST_H
2 #define NDNDPDK_NDNI_INTEREST_H
3 
6 #include "name.h"
7 
9 typedef struct PInterest {
10  uint32_t nonce;
11  uint32_t lifetime;
12 
13  uint32_t nonceOffset;
14  uint8_t guiderSize;
15 
16  uint8_t hopLimit;
17  struct {
18  bool canBePrefix : 1;
19  bool mustBeFresh : 1;
20  uint8_t nFwHints : 3;
21  int8_t activeFwHint : 3;
23 
25  const uint8_t* fwHintV[PInterestMaxFwHints];
28 
29  uint64_t diskSlot;
32 
39 __attribute__((nonnull)) bool
40 PInterest_Parse(PInterest* interest, struct rte_mbuf* pkt, ParseFor parseFor);
41 
49 __attribute__((nonnull)) bool
50 PInterest_SelectFwHint(PInterest* interest, int i);
51 
53 typedef struct InterestGuiders {
54  uint32_t nonce;
55  uint32_t lifetime;
56  uint8_t hopLimit;
58 
65 #define PRI_InterestGuiders "nonce=%08" PRIx32 " lifetime=%" PRIu32 " hopLimit=%" PRIu8
66 
71 #define InterestGuiders_Fmt(g) (g).nonce, (g).lifetime, (g).hopLimit
72 
79 __attribute__((nonnull)) Packet*
81  PacketTxAlign align);
82 
84 typedef struct InterestTemplate {
85  uint16_t prefixL;
86  uint16_t midLen;
87  uint16_t nonceVOffset;
91 
98 __attribute__((nonnull, returns_nonnull)) Packet*
99 InterestTemplate_Encode(const InterestTemplate* tpl, struct rte_mbuf* m, LName suffix,
100  uint32_t nonce);
101 
102 #endif // NDNDPDK_NDNI_INTEREST_H
struct PInterest PInterest
Parsed Interest packet.
Packet * Interest_ModifyGuiders(Packet *npkt, InterestGuiders guiders, PacketMempools *mp, PacketTxAlign align)
Modify Interest guiders.
Definition: interest.c:246
struct InterestGuiders InterestGuiders
Interest guider fields.
struct InterestTemplate InterestTemplate
Template for Interest encoding.
Packet * InterestTemplate_Encode(const InterestTemplate *tpl, struct rte_mbuf *m, LName suffix, uint32_t nonce)
Encode Interest with InterestTemplate.
Definition: interest.c:255
bool PInterest_Parse(PInterest *interest, struct rte_mbuf *pkt, ParseFor parseFor)
Parse Interest.
Definition: interest.c:37
bool PInterest_SelectFwHint(PInterest *interest, int i)
Retrieve i-th forwarding hint name.
Definition: interest.c:133
struct Packet Packet
Definition: common.h:11
@ NameMaxLength
Definition: enum.h:10
@ PInterestMaxFwHints
Definition: enum.h:14
@ InterestTemplateBufLen
Definition: enum.h:16
ParseFor
Definition: enum.h:29
Interest guider fields.
Definition: interest.h:53
uint32_t nonce
Definition: interest.h:54
uint32_t lifetime
Definition: interest.h:55
uint8_t hopLimit
Definition: interest.h:56
Template for Interest encoding.
Definition: interest.h:84
uint16_t prefixL
Name prefix length.
Definition: interest.h:85
uint8_t midBuf[InterestTemplateBufLen]
fields after Name
Definition: interest.h:89
uint16_t midLen
midBuf length
Definition: interest.h:86
uint8_t prefixV[NameMaxLength]
Name prefix.
Definition: interest.h:88
uint16_t nonceVOffset
Nonce TLV-VALUE offset within midBuf.
Definition: interest.h:87
Name in linear buffer.
Definition: name.h:11
Parsed Interest packet.
Definition: interest.h:9
bool canBePrefix
Definition: interest.h:18
bool mustBeFresh
Definition: interest.h:19
uint32_t nonceOffset
offset of Nonce within Interest TLV-VALUE
Definition: interest.h:13
int8_t activeFwHint
index of active forwarding hint
Definition: interest.h:21
PName fwHint
parsed forwarding hint at activeFwHint
Definition: interest.h:27
uint8_t guiderSize
size of Nonce+InterestLifetime+HopLimit
Definition: interest.h:14
struct PInterest::@64 __rte_packed
uint8_t nFwHints
number of forwarding hints, up to PInterestMaxFwHints
Definition: interest.h:20
uint8_t hopLimit
HopLimit value, "omitted" is same as 0xFF.
Definition: interest.h:16
uint64_t diskSlot
DiskStore slot number.
Definition: interest.h:29
Packet * diskData
DiskStore loaded Data.
Definition: interest.h:30
uint32_t nonce
Nonce.
Definition: interest.h:10
uint16_t fwHintL[PInterestMaxFwHints]
TLV-LENGTH of forwarding hints.
Definition: interest.h:26
const uint8_t * fwHintV[PInterestMaxFwHints]
TLV-VALUE of forwarding hints.
Definition: interest.h:25
PName name
Definition: interest.h:24
uint32_t lifetime
InterestLifetime in millis.
Definition: interest.h:11
Parsed name.
Definition: name.h:139
Mempools for packet modification.
Definition: common.h:17
mbuf alignment requirements for encoding or packet modification.
Definition: common.h:35