DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
PacketCtor.hpp
Go to the documentation of this file.
1
9#ifndef DPDKLIBS_INCLUDE_DPDKLIBS_UDP_PACKETCTOR_HPP_
10#define DPDKLIBS_INCLUDE_DPDKLIBS_UDP_PACKETCTOR_HPP_
11
12#include <rte_byteorder.h>
13#include "IPV4UDPPacket.hpp"
14
16
17#include <string>
18
19namespace dunedaq {
20namespace dpdklibs {
21namespace udp {
22
23rte_le16_t packet_fill(struct ipv4_udp_packet_hdr * packet_hdr);
24
25 void pktgen_udp_hdr_ctor(struct ipv4_udp_packet_hdr * packet_hdr, rte_le16_t packet_len, int sport = 55677, int dport = 55678);
26
27 void pktgen_ipv4_ctor(struct ipv4_udp_packet_hdr * packet_hdr, rte_le16_t packet_len, const std::string& src_ip_addr = "0.0.0.0", const std::string& dst_ip_addr = "0.0.0.0");
28
29 void pktgen_ether_hdr_ctor(struct ipv4_udp_packet_hdr * packet_hdr, const std::string& dst_mac_address = "0a:00:10:c2:15:c1", const int port_id = 0);
30
31/* Convert 00:11:22:33:44:55 to ethernet address */
32 bool get_ether_addr6(const char *s0, struct rte_ether_addr *ea);
33
34 // n.b. The memory pool which bufs is pointing to must be allocated, otherwise you'll get a crash
35 void construct_packets_for_burst(const int port_id, const std::string& dst_mac_addr, const int payload_bytes, const int burst_size, rte_mbuf** bufs);
36
37} // namespace udp
38} // namespace dpdklibs
39} // namespace dunedaq
40
41#endif // DPDKLIBS_INCLUDE_DPDKLIBS_PACKETCTOR_HPP_
void pktgen_ether_hdr_ctor(struct ipv4_udp_packet_hdr *packet_hdr, const std::string &dst_mac_address="0a:00:10:c2:15:c1", const int port_id=0)
void construct_packets_for_burst(const int port_id, const std::string &dst_mac_addr, const int payload_bytes, const int burst_size, rte_mbuf **bufs)
void pktgen_ipv4_ctor(struct ipv4_udp_packet_hdr *packet_hdr, rte_le16_t packet_len, const std::string &src_ip_addr="0.0.0.0", const std::string &dst_ip_addr="0.0.0.0")
rte_le16_t packet_fill(struct ipv4_udp_packet_hdr *packet_hdr)
void pktgen_udp_hdr_ctor(struct ipv4_udp_packet_hdr *packet_hdr, rte_le16_t packet_len, int sport=55677, int dport=55678)
bool get_ether_addr6(const char *s0, struct rte_ether_addr *ea)
Including Qt Headers.