DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
dpdklibs
include
dpdklibs
ipv4_addr.hpp
Go to the documentation of this file.
1
#ifndef _IPV4_ADDR_H_
2
#define _IPV4_ADDR_H_
3
4
#include <string>
5
#include <vector>
6
#include <sstream>
7
#include <cstdint>
8
9
namespace
dunedaq::dpdklibs
{
10
11
struct
IpAddr
{
12
IpAddr
(uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3) :
13
addr_bytes
{byte0, byte1, byte2, byte3} {
14
}
15
IpAddr
(std::string ip_address) {
16
std::vector<uint8_t> bytes;
17
std::istringstream f(ip_address);
18
std::string s;
19
while
(getline(f, s,
'.'
)) {
20
//std::cout << s << std::endl;
21
bytes.push_back(std::stoi(s));
22
}
23
24
for
(
size_t
i = 0; i < bytes.size(); ++i) {
25
addr_bytes
[i] = bytes[i];
26
}
27
}
28
29
uint8_t
addr_bytes
[4];
30
};
31
32
}
33
34
#endif
/* _IPV4_ADDR_H_ */
35
dunedaq::dpdklibs
Definition
ARP.hpp:16
dunedaq::dpdklibs::IpAddr
Definition
ipv4_addr.hpp:11
dunedaq::dpdklibs::IpAddr::IpAddr
IpAddr(uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3)
Definition
ipv4_addr.hpp:12
dunedaq::dpdklibs::IpAddr::addr_bytes
uint8_t addr_bytes[4]
Definition
ipv4_addr.hpp:29
dunedaq::dpdklibs::IpAddr::IpAddr
IpAddr(std::string ip_address)
Definition
ipv4_addr.hpp:15
Generated on Sat Jun 28 2025 for DUNE-DAQ by
1.12.0