DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::dpdklibs::IpAddr Struct Reference

#include <ipv4_addr.hpp>

Public Member Functions

 IpAddr (uint8_t byte0, uint8_t byte1, uint8_t byte2, uint8_t byte3)
 
 IpAddr (std::string ip_address)
 

Public Attributes

uint8_t addr_bytes [4]
 

Detailed Description

Definition at line 11 of file ipv4_addr.hpp.

Constructor & Destructor Documentation

◆ IpAddr() [1/2]

dunedaq::dpdklibs::IpAddr::IpAddr ( uint8_t byte0,
uint8_t byte1,
uint8_t byte2,
uint8_t byte3 )
inline

Definition at line 12 of file ipv4_addr.hpp.

12 :
13 addr_bytes{byte0, byte1, byte2, byte3} {
14 }

◆ IpAddr() [2/2]

dunedaq::dpdklibs::IpAddr::IpAddr ( std::string ip_address)
inline

Definition at line 15 of file ipv4_addr.hpp.

15 {
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 }

Member Data Documentation

◆ addr_bytes

uint8_t dunedaq::dpdklibs::IpAddr::addr_bytes[4]

Definition at line 29 of file ipv4_addr.hpp.


The documentation for this struct was generated from the following file: