DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dpdklibs
include
dpdklibs
arp
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>
13
#include "
dpdklibs/udp/Utils.hpp
"
14
15
namespace
dunedaq
{
16
namespace
dpdklibs
{
17
namespace
arp
{
18
19
// RARP and ARP opcodes
20
enum
{
21
ARP_REQUEST
= 1,
22
ARP_REPLY
= 2,
23
RARP_REQUEST
= 3,
24
RARP_REPLY
= 4,
25
GRATUITOUS_ARP
= 5
26
};
27
28
// Queue flags
29
enum
{
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
35
inline
void
36
uint16Swap
(
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
46
inline
void
47
ethAddrSwap
(
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
56
inline
void
57
inetAddrSwap
(
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 */
67
inline
void
68
inetAddrCopy
(
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
76
void
pktgen_send_garp
(
struct
rte_mbuf *m, uint32_t port_id, rte_be32_t binary_ip_address);
77
78
// Reply to ARP
79
void
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_
Utils.hpp
dunedaq::dpdklibs::arp
Definition
ARP.hpp:17
dunedaq::dpdklibs::arp::inetAddrCopy
void inetAddrCopy(void *t, void *f)
Definition
ARP.hpp:68
dunedaq::dpdklibs::arp::DO_TX_FLUSH
@ DO_TX_FLUSH
Definition
ARP.hpp:31
dunedaq::dpdklibs::arp::CLEAR_FAST_ALLOC_FLAG
@ CLEAR_FAST_ALLOC_FLAG
Definition
ARP.hpp:30
dunedaq::dpdklibs::arp::ethAddrSwap
void ethAddrSwap(void *t, void *f)
Definition
ARP.hpp:47
dunedaq::dpdklibs::arp::pktgen_send_garp
void pktgen_send_garp(struct rte_mbuf *m, uint32_t port_id, rte_be32_t binary_ip_address)
Definition
ARP.cpp:23
dunedaq::dpdklibs::arp::uint16Swap
void uint16Swap(void *t, void *f)
Definition
ARP.hpp:36
dunedaq::dpdklibs::arp::ARP_REPLY
@ ARP_REPLY
Definition
ARP.hpp:22
dunedaq::dpdklibs::arp::RARP_REQUEST
@ RARP_REQUEST
Definition
ARP.hpp:23
dunedaq::dpdklibs::arp::GRATUITOUS_ARP
@ GRATUITOUS_ARP
Definition
ARP.hpp:25
dunedaq::dpdklibs::arp::RARP_REPLY
@ RARP_REPLY
Definition
ARP.hpp:24
dunedaq::dpdklibs::arp::ARP_REQUEST
@ ARP_REQUEST
Definition
ARP.hpp:21
dunedaq::dpdklibs::arp::pktgen_process_arp
void pktgen_process_arp(struct rte_mbuf *m, uint32_t pid, rte_be32_t binary_ip_address)
Definition
ARP.cpp:78
dunedaq::dpdklibs::arp::inetAddrSwap
void inetAddrSwap(void *t, void *f)
Definition
ARP.hpp:57
dunedaq::dpdklibs
Definition
ARP.hpp:16
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::v
default char v[0]
Definition
Serialization.hpp:266
Generated on
for DUNE-DAQ by
1.17.0