1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
7 * Accepts pointer to struct rte_mbuf as an input parameter.
8 * Dump the mbuf into stdout if it is an ARP packet (aka tcpdump 'arp').
11 * clang -O2 -U __GNUC__ -target bpf -Wno-int-to-void-pointer-cast -c t3.c
14 * clang -O2 -I/usr/include/aarch64-linux-gnu -target bpf \
15 * -Wno-int-to-void-pointer-cast -c t3.c
17 * NOTE: if DPDK is not installed system-wide, add compiler flag with path
18 * to DPDK rte_mbuf.h file to above commands,
19 * e.g. "clang -I/path/to/dpdk/headers -O2 ..."
25 #include <net/ethernet.h>
26 #include <rte_config.h>
27 #include <rte_mbuf_core.h>
28 #include <arpa/inet.h>
30 extern void rte_pktmbuf_dump(FILE *, const struct rte_mbuf *, unsigned int);
33 entry(const void *pkt)
35 const struct rte_mbuf *mb;
36 const struct ether_header *eth;
39 eth = rte_pktmbuf_mtod(mb, const struct ether_header *);
41 if (eth->ether_type == htons(ETHERTYPE_ARP))
42 rte_pktmbuf_dump(stdout, mb, 64);