DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Structs.hpp
Go to the documentation of this file.
1/*
2 * This file is 100% generated. Any manual edits will likely be lost.
3 *
4 * This contains struct and other type definitions for shema in
5 * namespace dunedaq::dpdklibs::nicreader.
6 */
7#ifndef DUNEDAQ_DPDKLIBS_NICREADER_STRUCTS_HPP
8#define DUNEDAQ_DPDKLIBS_NICREADER_STRUCTS_HPP
9
10#include <cstdint>
11
12#include <string>
13#include <vector>
14
16
17// @brief A count of more things
18using BigCount = int64_t;
19
20// @brief
21using Choice = bool;
22
23// @brief PCIe address string
24using pci = std::string;
25
26// @brief mac string
27using mac = std::string;
28
29// @brief ipv4 string
30using ipv4 = std::string;
31
32// @brief Count of things
33using Count = uint32_t; // NOLINT
34
35// @brief An ID of a thingy
36using Identifier = int32_t;
37
38// @brief Source GeoID Information
40{
41
42 // @brief Detector ID
44
45 // @brief Crate ID
47
48 // @brief Slot ID
50};
51
52// @brief A stream map
54{
55
56 // @brief Source ID
58
59 // @brief Stream ID
61};
62
63// @brief A list of streams
64using SrcStreamsMapping = std::vector<dunedaq::dpdklibs::nicreader::StreamMap>;
65
66// @brief Source field
67struct Source
68{
69
70 // @brief ID of a source
71 Identifier id = 0;
72
73 // @brief Source IP address
74 ipv4 ip_addr = "192.168.0.1";
75
76 // @brief Assigned CPU lcore
78
79 // @brief Assigned RX queue of interface
81
82 // @brief Source information
83 SrcGeoInfo src_info = { 0, 0, 0 };
84
85 // @brief Source streams mapping
87};
88
89// @brief A list of sources
90using Sources = std::vector<dunedaq::dpdklibs::nicreader::Source>;
91
92// @brief Source field
94{
95
96 // @brief Expected sequence ID increase per packet in a stream
98
99 // @brief Expected timestamp increase per packet in a stream
101
102 // @brief Expected packet size
104
105 // @brief Analyze only every (1/analyze_nth_packet) packet
107};
108
109// @brief Configuration an Ethernet interface through DPDK RTE
111{
112
113 // @brief PCIe address of the interface
114 pci pci_addr = "0000:00:00.0";
115
116 // @brief MAC address of the interface
117 mac mac_addr = "AA:BB:CC:DD:EE:FF";
118
119 // @brief IP address of interface
120 ipv4 ip_addr = "192.168.0.1";
121
122 // @brief FlowAPI enabled
124
125 // @brief Promiscuous mode enabled
127
128 // @brief MTU of interface
129 Count mtu = 9000;
130
131 // @brief Size of a single RX ring
133
134 // @brief Size of a single TX ring
136
137 // @brief Number of total MBUFs
139
140 // @brief MBUF cache size
142
143 // @brief RX burst size
145
146 // @brief LCore loop sleep in microseconds - 0 to disable
148
149 // @brief A list of expected sources
151
152 // @brief Defines how stats are reported
153 StatsReporting stats_reporting_cfg = { 1, -999, 7243, 1 };
154};
155
156// @brief A list of interfaces to use
157using IfaceList = std::vector<dunedaq::dpdklibs::nicreader::Interface>;
158
159// @brief A string field
160using String = std::string;
161
162// @brief Generic UIO reader DAQ Module Configuration
163struct Conf
164{
165
166 // @brief List of interfaces to configure
168
169 // @brief A string with EAL arguments
170 String eal_arg_list = "daq_application";
171};
172
173// @brief A float number
174using Float = float;
175
176} // namespace dunedaq::dpdklibs::nicreader
177
178#endif // DUNEDAQ_DPDKLIBS_NICREADER_STRUCTS_HPP
std::vector< dunedaq::dpdklibs::nicreader::StreamMap > SrcStreamsMapping
Definition Structs.hpp:64
std::vector< dunedaq::dpdklibs::nicreader::Source > Sources
Definition Structs.hpp:90
std::vector< dunedaq::dpdklibs::nicreader::Interface > IfaceList
Definition Structs.hpp:157
Unknown serialization type<< t,((char) t)) template< typename T > inline std::string datatype_to_string() { return "Unknown";} namespace serialization { template< typename T > struct is_serializable :std::false_type {};enum SerializationType { kMsgPack };inline SerializationType from_string(const std::string s) { if(s=="msgpack") return kMsgPack;throw UnknownSerializationTypeString(ERS_HERE, s);} constexpr uint8_t serialization_type_byte(SerializationType stype) { switch(stype) { case kMsgPack:return 'M';default:throw UnknownSerializationTypeEnum(ERS_HERE);} } constexpr SerializationType DEFAULT_SERIALIZATION_TYPE=kMsgPack;template< class T > std::vector< uint8_t > serialize(const T &obj, SerializationType stype=DEFAULT_SERIALIZATION_TYPE) { switch(stype) { case kMsgPack:{ msgpack::sbuffer buf;msgpack::pack(buf, obj);std::vector< uint8_t > ret(buf.size()+1);ret[0]=serialization_type_byte(stype);std::copy(buf.data(), buf.data()+buf.size(), ret.begin()+1);return ret;} default:throw UnknownSerializationTypeEnum(ERS_HERE);} } template< class T, typename CharType=unsigned char > T deserialize(const std::vector< CharType > &v) { switch(v[0]) { case serialization_type_byte(kMsgPack):{ try { msgpack::object_handle oh=msgpack::unpack(const_cast< char * >(reinterpret_cast< const char * >(v.data()+1)), v.size() - 1,[](msgpack::type::object_type, std::size_t, void *) -> bool
SrcStreamsMapping src_streams_mapping
Definition Structs.hpp:86