blob: eb1f9feca50466e58c8d62de45d914c643a58db2 [file] [log] [blame]
Ratan Gupta82549cc2017-04-21 08:45:23 +05301#pragma once
2
Ratan Gupta3681a502017-06-17 19:20:04 +05303#include <ifaddrs.h>
4
Ratan Gupta82549cc2017-04-21 08:45:23 +05305#include <list>
6#include <string>
7#include <vector>
8#include <map>
Ratan Gupta3681a502017-06-17 19:20:04 +05309#include <memory>
Ratan Gupta82549cc2017-04-21 08:45:23 +053010
11namespace phosphor
12{
13namespace network
14{
Ratan Guptabc886292017-07-25 18:29:57 +053015namespace systemd
16{
17namespace config
18{
19
20constexpr auto networkFilePrefix = "00-bmc-";
21constexpr auto networkFileSuffix = ".network";
22constexpr auto deviceFileSuffix = ".netdev";
23
24}// namespace config
25}// namespace systemd
Ratan Gupta82549cc2017-04-21 08:45:23 +053026
27using IntfName = std::string;
28
29struct AddrInfo {
30 uint8_t addrType;
31 std::string ipaddress;
32 uint16_t prefix;
33};
34
Ratan Gupta3681a502017-06-17 19:20:04 +053035using Addr_t = ifaddrs*;
36
37struct AddrDeleter
38{
39 void operator()(Addr_t ptr) const
40 {
41 freeifaddrs(ptr);
42 }
43};
44
45using AddrPtr = std::unique_ptr<ifaddrs, AddrDeleter>;
46
47
Ratan Gupta82549cc2017-04-21 08:45:23 +053048using AddrList = std::list<AddrInfo>;
49using IntfAddrMap = std::map<IntfName, AddrList>;
50
51
52}//namespace network
53}//namespace phosphor