25 memcpy(v.un.ip4, a.to_v4().to_bytes().data(), 4);
28 memcpy(v.un.ip6, a.to_v6().to_bytes().data(), 16);
34 vapi_union_address_union& u,
35 vapi_enum_address_family& af)
39 memcpy(u.ip4, a.to_v4().to_bytes().data(), 4);
42 memcpy(u.ip6, a.to_v6().to_bytes().data(), 16);
49 memcpy(v, a.to_v4().to_bytes().data(), 4);
58 std::array<uint8_t, 16>
a;
59 std::copy(v.un.ip6, v.un.ip6 + 16, std::begin(a));
60 boost::asio::ip::address_v6 v6(a);
63 std::array<uint8_t, 4>
a;
64 std::copy(v.un.ip6, v.un.ip6 + 4, std::begin(a));
65 boost::asio::ip::address_v4 v4(a);
73 from_api(
const vapi_union_address_union& u, vapi_enum_address_family af)
78 std::array<uint8_t, 16>
a;
79 std::copy(u.ip6, u.ip6 + 16, std::begin(a));
80 boost::asio::ip::address_v6 v6(a);
83 std::array<uint8_t, 4>
a;
84 std::copy(u.ip6, u.ip6 + 4, std::begin(a));
85 boost::asio::ip::address_v4 v4(a);
95 std::copy(std::begin(a.
bytes), std::end(a.
bytes), v);
123 from_api(v.grp_address, v.af), v.grp_address_length);
129 vapi_enum_address_family af;
boost::asio::ip::address ip_address_t
const boost::asio::ip::address & address() const
Get the address.
const boost::asio::ip::address & grp_address() const
Get the address.
ip_address_t from_api(const vapi_type_address &v)
uint8_t mask_width() const
Get the network mask width.
uint8_t mask_width() const
Get the network mask width.
const boost::asio::ip::address & src_address() const
void to_api(const ip_address_t &a, vapi_type_address &v)
struct mac_address_t_ mac_address_t
std::array< uint8_t, 6 > bytes
Underlying bytes array.
The VPP Object Model (VOM) library.
Type def of a Ethernet address.