NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
op.h
Go to the documentation of this file.
1 #ifndef NDNDPDK_FILESERVER_OP_H
2 #define NDNDPDK_FILESERVER_OP_H
3 
6 #include "../ndni/lp.h"
7 #include "../ndni/name.h"
8 #include "enum.h"
9 
10 typedef struct FileServerFd FileServerFd;
11 
13 typedef struct FileServerOp {
15  uint64_t segment;
16  struct rte_mbuf* data;
17  int iovcnt;
18  uint16_t contentLen;
20  struct iovec iov[LpMaxFragments];
22 
33 #define FileServer_SignAndSend(p, ctx, fd, func, dataPkt, interestL3) \
34  __extension__({ \
35  Packet* dataNpkt = DataEnc_Sign((dataPkt), &(p)->mp, Face_PacketTxAlign((p)->face)); \
36  if (unlikely(dataNpkt == NULL)) { \
37  N_LOGW(func " fd=%d drop=data-sign-err", (fd)->fd); \
38  } else { \
39  Mbuf_SetTimestamp((dataPkt), (ctx)->now); \
40  *Packet_GetLpL3Hdr(dataNpkt) = (interestL3); \
41  (ctx)->data[(ctx)->nData++] = dataNpkt; \
42  } \
43  dataNpkt; \
44  })
45 
46 #endif // NDNDPDK_FILESERVER_OP_H
@ LpMaxFragments
Definition: enum.h:8
struct FileServerOp FileServerOp
File server readv operation.
File descriptor related information in the file server.
Definition: fd.h:21
File server readv operation.
Definition: op.h:13
uint64_t segment
Definition: op.h:15
struct iovec iov[LpMaxFragments]
Definition: op.h:20
uint16_t contentLen
Definition: op.h:18
LpL3 interestL3
Definition: op.h:19
FileServerFd * fd
Definition: op.h:14
struct rte_mbuf * data
Definition: op.h:16
int iovcnt
Definition: op.h:17
NDNLPv2 layer 3 fields.
Definition: lp.h:56