1 #pragma once
2 #include <nlohmann/json.hpp>
3 
4 namespace ip_addresses
5 {
6 // clang-format off
7 
8 enum class IPv4AddressOrigin{
9     Invalid,
10     Static,
11     DHCP,
12     BOOTP,
13     IPv4LinkLocal,
14 };
15 
16 enum class IPv6AddressOrigin{
17     Invalid,
18     Static,
19     DHCPv6,
20     LinkLocal,
21     SLAAC,
22 };
23 
24 enum class AddressState{
25     Invalid,
26     Preferred,
27     Deprecated,
28     Tentative,
29     Failed,
30 };
31 
32 NLOHMANN_JSON_SERIALIZE_ENUM(IPv4AddressOrigin, {
33     {IPv4AddressOrigin::Invalid, "Invalid"},
34     {IPv4AddressOrigin::Static, "Static"},
35     {IPv4AddressOrigin::DHCP, "DHCP"},
36     {IPv4AddressOrigin::BOOTP, "BOOTP"},
37     {IPv4AddressOrigin::IPv4LinkLocal, "IPv4LinkLocal"},
38 });
39 
40 NLOHMANN_JSON_SERIALIZE_ENUM(IPv6AddressOrigin, {
41     {IPv6AddressOrigin::Invalid, "Invalid"},
42     {IPv6AddressOrigin::Static, "Static"},
43     {IPv6AddressOrigin::DHCPv6, "DHCPv6"},
44     {IPv6AddressOrigin::LinkLocal, "LinkLocal"},
45     {IPv6AddressOrigin::SLAAC, "SLAAC"},
46 });
47 
48 NLOHMANN_JSON_SERIALIZE_ENUM(AddressState, {
49     {AddressState::Invalid, "Invalid"},
50     {AddressState::Preferred, "Preferred"},
51     {AddressState::Deprecated, "Deprecated"},
52     {AddressState::Tentative, "Tentative"},
53     {AddressState::Failed, "Failed"},
54 });
55 
56 }
57 // clang-format on
58