NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
txhdr.h
Go to the documentation of this file.
1 #ifndef NDNDPDK_ETHFACE_TXHDR_H
2 #define NDNDPDK_ETHFACE_TXHDR_H
3 
6 #include "locator.h"
7 
8 typedef enum EthTxHdrAct {
11 
17 
19 typedef enum EthTxHdrFlags {
21  EthTxHdrFlagsNewBurst = RTE_BIT32(0),
23  EthTxHdrFlagsGtpip = RTE_BIT32(1),
25 
26 typedef struct EthTxHdr EthTxHdr;
27 typedef void (*EthTxHdr_PrependFunc)(const EthTxHdr* hdr, struct rte_mbuf* m, EthTxHdrFlags flags);
29 
31 struct EthTxHdr {
33  uint8_t len;
34  uint8_t l2len;
35  char tunnel;
37 };
38 
40 __attribute__((nonnull)) void
41 EthTxHdr_Prepare(EthTxHdr* hdr, const EthLocator* loc, bool hasChecksumOffloads);
42 
44 __attribute__((nonnull)) static inline void
45 EthTxHdr_Prepend(const EthTxHdr* hdr, struct rte_mbuf* m, EthTxHdrFlags flags) {
46  EthTxHdr_PrependJmp[hdr->act](hdr, m, flags);
47 }
48 
49 #endif // NDNDPDK_ETHFACE_TXHDR_H
struct vlanhdr __rte_packed
@ EthLocator_MaxHdrLen
EthLocator derived header buffer length.
Definition: locator.h:52
EthFace address information.
Definition: locator.h:10
EthFace TX header template.
Definition: txhdr.h:31
char tunnel
Definition: txhdr.h:35
uint8_t l2len
Definition: txhdr.h:34
uint8_t buf[EthLocator_MaxHdrLen]
Definition: txhdr.h:36
EthTxHdrAct act
Definition: txhdr.h:32
uint8_t len
Definition: txhdr.h:33
EthTxHdrFlags
Bit flags for EthTxHdr_Prepend .
Definition: txhdr.h:19
@ EthTxHdrFlagsGtpip
Whether mbuf contains Ethernet+IPv4 instead of NDN.
Definition: txhdr.h:23
@ EthTxHdrFlagsNewBurst
Whether mbuf is the first frame in a new burst.
Definition: txhdr.h:21
void(* EthTxHdr_PrependFunc)(const EthTxHdr *hdr, struct rte_mbuf *m, EthTxHdrFlags flags)
Definition: txhdr.h:27
EthTxHdrAct
Definition: txhdr.h:8
@ EthTxHdrActUdp6Checksum
Definition: txhdr.h:14
@ EthTxHdrActUdp6Offload
Definition: txhdr.h:15
@ EthTxHdrActUdp4Checksum
Definition: txhdr.h:12
@ EthTxHdrActUdp4Offload
Definition: txhdr.h:13
@ EthTxHdrActNoHdr
Definition: txhdr.h:9
@ EthTxHdrActEther
Definition: txhdr.h:10
void EthTxHdr_Prepare(EthTxHdr *hdr, const EthLocator *loc, bool hasChecksumOffloads)
Prepare TX header from locator.
Definition: txhdr.c:123
const EthTxHdr_PrependFunc EthTxHdr_PrependJmp[]
Definition: txhdr.c:113