NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
api.h
Go to the documentation of this file.
1
#ifndef NDNDPDK_BPF_XDP_API_H
2
#define NDNDPDK_BPF_XDP_API_H
3
5
6
#include "
../../csrc/ethface/xdp-locator.h
"
7
#include "
../../csrc/ndni/an.h
"
8
9
#include <linux/bpf.h>
10
#include <linux/if_ether.h>
11
#include <linux/in.h>
12
#include <linux/ip.h>
13
#include <linux/ipv6.h>
14
#include <linux/udp.h>
15
16
#include <bpf/bpf_endian.h>
17
#include <bpf/bpf_helpers.h>
18
19
struct
__rte_packed_begin
vlanhdr
{
20
uint16_t
vlan_tci
;
21
uint16_t
eth_proto
;
22
}
__rte_packed_end
;
23
24
struct
__rte_packed_begin
vxlanhdr
{
25
uint8_t
flags
;
26
uint8_t
rsvd0
[3];
27
uint8_t
vni
[3];
28
uint8_t
rsvd1
;
29
}
__rte_packed_end
;
30
31
typedef
struct
__rte_packed_begin
VxlanInnerHdr
{
32
struct
vxlanhdr
vx
;
33
struct
ethhdr
eth
;
34
}
__rte_packed_end
VxlanInnerHdr
;
35
36
typedef
struct
__rte_packed_begin
GtpInnerHdr
{
37
EthGtpHdr
gtp
;
38
struct
iphdr
ipv4
;
39
struct
udphdr
udp
;
40
}
__rte_packed_end
GtpInnerHdr
;
41
42
enum
{
43
UDPPortVXLAN
= 4789,
44
UDPPortGTP
= 2152,
45
};
46
47
#define PacketPtrAs_(ptr, size, ...) \
48
__extension__({ \
49
if ((const uint8_t*)ptr + (size_t)(size) > (const uint8_t*)(long)ctx->data_end) { \
50
return XDP_DROP; \
51
} \
52
pkt; \
53
})
54
67
#define PacketPtrAs(ptr, ...) PacketPtrAs_((ptr), ##__VA_ARGS__, sizeof(*(ptr)))
68
69
#endif
// NDNDPDK_BPF_XDP_API_H
UDPPortGTP
@ UDPPortGTP
Definition
api.h:44
UDPPortVXLAN
@ UDPPortVXLAN
Definition
api.h:43
__rte_packed_end
struct __rte_packed_begin vlanhdr __rte_packed_end
an.h
EthGtpHdr
GTP-U header with PDU session container.
Definition
xdp-locator.h:46
GtpInnerHdr
Definition
api.h:36
GtpInnerHdr::gtp
EthGtpHdr gtp
Definition
api.h:37
GtpInnerHdr::ipv4
struct iphdr ipv4
Definition
api.h:38
GtpInnerHdr::udp
struct udphdr udp
Definition
api.h:39
VxlanInnerHdr
Definition
api.h:31
VxlanInnerHdr::eth
struct ethhdr eth
Definition
api.h:33
VxlanInnerHdr::vx
struct vxlanhdr vx
Definition
api.h:32
vlanhdr
Definition
api.h:19
vlanhdr::vlan_tci
uint16_t vlan_tci
Definition
api.h:20
vlanhdr::eth_proto
uint16_t eth_proto
Definition
api.h:21
vxlanhdr
Definition
api.h:24
vxlanhdr::flags
uint8_t flags
Definition
api.h:25
vxlanhdr::vni
uint8_t vni[3]
Definition
api.h:27
vxlanhdr::rsvd1
uint8_t rsvd1
Definition
api.h:28
vxlanhdr::rsvd0
uint8_t rsvd0[3]
Definition
api.h:26
xdp-locator.h
bpf
xdp
api.h
Generated by
1.15.0