DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ARP.hpp
Go to the documentation of this file.
1
8#ifndef DPDKLIBS_INCLUDE_DPDKLIBS_ARP_ARP_HPP_
9#define DPDKLIBS_INCLUDE_DPDKLIBS_ARP_ARP_HPP_
10
11#include <cstdint>
12#include <rte_mbuf.h>
14
15namespace dunedaq {
16namespace dpdklibs {
17namespace arp {
18
19// RARP and ARP opcodes
20enum {
26};
27
28// Queue flags
29enum {
30 CLEAR_FAST_ALLOC_FLAG = 0x00000001, // < Clear the TX fast alloc flag
31 DO_TX_FLUSH = 0x00000002 // Do a TX Flush by sending all of the pkts in the queue
32};
33
34// ethSwap(u16_t * to, u16_t * from) - Swap two 16 bit values
35inline void
36uint16Swap(void *t, void *f) {
37 uint16_t *d = (uint16_t *)t;
38 uint16_t *s = (uint16_t *)f;
39 uint16_t v;
40 v = *d;
41 *d = *s;
42 *s = v;
43}
44
45// ethAddrSwap( u16_t * to, u16_t * from ) - Swap two ethernet addresses
46inline void
47ethAddrSwap(void *t, void *f) {
48 uint16_t *d = (uint16_t *)t;
49 uint16_t *s = (uint16_t *)f;
50 uint16Swap(d++, s++);
51 uint16Swap(d++, s++);
52 uint16Swap(d, s);
53}
54
55// inetAddrSwap( void * t, void * f ) - Swap two IPv4 addresses
56inline void
57inetAddrSwap(void *t, void *f) {
58 uint32_t *d = (uint32_t *)t;
59 uint32_t *s = (uint32_t *)f;
60 uint32_t v;
61 v = *d;
62 *d = *s;
63 *s = v;
64}
65
66/* inetAddrCopy( void * t, void * f ) - Copy IPv4 address */
67inline void
68inetAddrCopy(void *t, void *f) {
69 uint32_t *d = (uint32_t *)t;
70 uint32_t *s = (uint32_t *)f;
71
72 *d = *s;
73}
74
75// Send GARP
76void pktgen_send_garp(struct rte_mbuf *m, uint32_t port_id, rte_be32_t binary_ip_address);
77
78// Reply to ARP
79void pktgen_process_arp(struct rte_mbuf *m, uint32_t pid, rte_be32_t binary_ip_address);
80
81} // namespace arp
82} // namespace dpdklibs
83} // namespace dunedaq
84
85#endif // DPDKLIBS_INCLUDE_DPDKLIBS_ARP_ARP_HPP_
void inetAddrCopy(void *t, void *f)
Definition ARP.hpp:68
void ethAddrSwap(void *t, void *f)
Definition ARP.hpp:47
void pktgen_send_garp(struct rte_mbuf *m, uint32_t port_id, rte_be32_t binary_ip_address)
Definition ARP.cpp:23
void uint16Swap(void *t, void *f)
Definition ARP.hpp:36
void pktgen_process_arp(struct rte_mbuf *m, uint32_t pid, rte_be32_t binary_ip_address)
Definition ARP.cpp:77
void inetAddrSwap(void *t, void *f)
Definition ARP.hpp:57
Including Qt Headers.