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__ -I${RTE_SDK}/${RTE_TARGET}/include \
12 * -target bpf -Wno-int-to-void-pointer-cast -c t3.c
15 * clang -O2 -I/usr/include/aarch64-linux-gnu \
16 * -I${RTE_SDK}/${RTE_TARGET}/include -target bpf \
17 * -Wno-int-to-void-pointer-cast -c t3.c
23 #include <net/ethernet.h>
24 #include <rte_config.h>
26 #include <arpa/inet.h>
28 extern void rte_pktmbuf_dump(FILE *, const struct rte_mbuf *, unsigned int);
31 entry(const void *pkt)
33 const struct rte_mbuf *mb;
34 const struct ether_header *eth;
37 eth = rte_pktmbuf_mtod(mb, const struct ether_header *);
39 if (eth->ether_type == htons(ETHERTYPE_ARP))
40 rte_pktmbuf_dump(stdout, mb, 64);