NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
txhdr.h
Go to the documentation of this file.
1#ifndef NDNDPDK_ETHFACE_TXHDR_H
2#define NDNDPDK_ETHFACE_TXHDR_H
3
5
6#include "locator.h"
7
17
19typedef enum __rte_packed_begin EthTxHdrFlags {
21 EthTxHdrFlagsNewBurst = RTE_BIT32(0),
23 EthTxHdrFlagsGtpip = RTE_BIT32(1),
25
26typedef struct EthTxHdr EthTxHdr;
27typedef void (*EthTxHdr_PrependFunc)(const EthTxHdr* hdr, struct rte_mbuf* m, EthTxHdrFlags flags);
29
31struct EthTxHdr {
33 uint8_t len;
34 uint8_t l2len;
35 char tunnel;
37};
38
40__attribute__((nonnull)) void
41EthTxHdr_Prepare(EthTxHdr* hdr, const EthLocator* loc, bool hasChecksumOffloads);
42
44__attribute__((nonnull)) static inline void
45EthTxHdr_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 __rte_packed_begin vlanhdr __rte_packed_end
@ 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
const EthTxHdr_PrependFunc EthTxHdr_PrependJmp[]
Definition txhdr.c:113
EthTxHdrFlagsNewBurst
Whether mbuf is the first frame in a new burst.
Definition txhdr.h:21
EthTxHdrActUdp4Checksum
Definition txhdr.h:12
EthTxHdrActUdp6Checksum
Definition txhdr.h:14
EthTxHdrFlagsGtpip
Whether mbuf contains Ethernet+IPv4 instead of NDN.
Definition txhdr.h:23
enum __rte_packed_begin EthTxHdrFlags EthTxHdrFlags
Bit flags for EthTxHdr_Prepend .
Definition txhdr.h:19
EthTxHdrActUdp6Offload
Definition txhdr.h:15
enum __rte_packed_begin EthTxHdrAct EthTxHdrAct
Definition txhdr.h:8
EthTxHdrActNoHdr
Definition txhdr.h:9
EthTxHdrActEther
Definition txhdr.h:10
EthTxHdrActUdp4Offload
Definition txhdr.h:13
void(* EthTxHdr_PrependFunc)(const EthTxHdr *hdr, struct rte_mbuf *m, EthTxHdrFlags flags)
Definition txhdr.h:27
void EthTxHdr_Prepare(EthTxHdr *hdr, const EthLocator *loc, bool hasChecksumOffloads)
Prepare TX header from locator.
Definition txhdr.c:123