summaryrefslogtreecommitdiffstats
path: root/types.hpp
blob: ca3542147d89beef58b4f34142248809996e0de6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once

#include <ifaddrs.h>

#include <list>
#include <string>
#include <vector>
#include <map>
#include <memory>

namespace phosphor
{
namespace network
{

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
OpenPOWER on IntegriCloud