blob: eb1f9feca50466e58c8d62de45d914c643a58db2 [file] [log] [blame]
#pragma once
#include <ifaddrs.h>
#include <list>
#include <string>
#include <vector>
#include <map>
#include <memory>
namespace phosphor
{
namespace network
{
namespace systemd
{
namespace config
{
constexpr auto networkFilePrefix = "00-bmc-";
constexpr auto networkFileSuffix = ".network";
constexpr auto deviceFileSuffix = ".netdev";
}// namespace config
}// namespace systemd
using IntfName = std::string;
struct AddrInfo {
uint8_t addrType;
std::string ipaddress;
uint16_t prefix;
};
using Addr_t = ifaddrs*;
struct AddrDeleter
{
void operator()(Addr_t ptr) const
{
freeifaddrs(ptr);
}
};
using AddrPtr = std::unique_ptr<ifaddrs, AddrDeleter>;
using AddrList = std::list<AddrInfo>;
using IntfAddrMap = std::map<IntfName, AddrList>;
}//namespace network
}//namespace phosphor