#include "../../csrc/ethface/xdp-locator.h"
#include "../../csrc/ndni/an.h"
#include <linux/bpf.h>
#include <linux/if_ether.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/udp.h>
#include <bpf/bpf_endian.h>
#include <bpf/bpf_helpers.h>
Go to the source code of this file.
◆ PacketPtrAs
| #define PacketPtrAs |
( |
|
ptr, |
|
|
|
... |
|
) |
| PacketPtrAs_((ptr), ##__VA_ARGS__, sizeof(*(ptr))) |
Perform bounds-checking on packet pointer.
This can be used within an XDP program, where `struct xdp_md* ctx` is declared. If the structure dereferenced from the given pointer is within the bounds of the packet, this returns the pointer; otherwise, the packet is dropped.
const Header* hdr =
PacketPtrAs((
const Header*)pkt, HDR_LEN);
#define PacketPtrAs(ptr,...)
Perform bounds-checking on packet pointer.
Definition: api.h:67
◆ PacketPtrAs_
| #define PacketPtrAs_ |
( |
|
ptr, |
|
|
|
size, |
|
|
|
... |
|
) |
| |
Value: __extension__({ \
if ((const uint8_t*)ptr + (size_t)(size) > (const uint8_t*)(long)ctx->data_end) { \
return XDP_DROP; \
} \
pkt; \
})
◆ GtpInnerHdr
◆ VxlanInnerHdr
◆ anonymous enum
| Enumerator |
|---|
| UDPPortVXLAN | |
| UDPPortGTP | |
◆ __rte_packed