16 #ifndef __VOM_PREFIX_H__ 17 #define __VOM_PREFIX_H__ 19 #include <boost/asio/ip/address.hpp> 101 prefix_t(
const boost::asio::ip::address&
addr, uint8_t len);
106 prefix_t(
const boost::asio::ip::address& addr);
111 prefix_t(
const std::string& s, uint8_t len);
119 prefix_t(uint8_t is_ip6, uint8_t* addr, uint8_t len);
128 const boost::asio::ip::address& address()
const;
143 bool operator<(
const prefix_t& o)
const;
173 void to_vpp(uint8_t* is_ip6, uint8_t* addr, uint8_t* len)
const;
178 boost::asio::ip::address mask()
const;
199 boost::asio::ip::address m_addr;
208 boost::asio::ip::address_v4
operator|(
const boost::asio::ip::address_v4& addr1,
209 const boost::asio::ip::address_v4& addr2);
211 boost::asio::ip::address_v4
operator&(
const boost::asio::ip::address_v4& addr1,
212 const boost::asio::ip::address_v4& addr2);
214 boost::asio::ip::address_v4
operator~(
const boost::asio::ip::address_v4& addr1);
216 boost::asio::ip::address_v6
operator|(
const boost::asio::ip::address_v6& addr1,
217 const boost::asio::ip::address_v6& addr2);
219 boost::asio::ip::address_v6
operator&(
const boost::asio::ip::address_v6& addr1,
220 const boost::asio::ip::address_v6& addr2);
222 boost::asio::ip::address_v6
operator~(
const boost::asio::ip::address_v6& addr1);
224 boost::asio::ip::address
operator|(
const boost::asio::ip::address& addr1,
225 const boost::asio::ip::address& addr2);
227 boost::asio::ip::address
operator&(
const boost::asio::ip::address& addr1,
228 const boost::asio::ip::address& addr2);
230 boost::asio::ip::address
operator~(
const boost::asio::ip::address& addr1);
243 void to_bytes(
const boost::asio::ip::address_v4&
addr, uint8_t* array);
244 void to_bytes(
const boost::asio::ip::address_v6&
addr, uint8_t* array);
254 boost::asio::ip::address
from_bytes(uint8_t is_ip6, uint8_t* array);
uint32_t table_id_t
type def the table-id
A template base class for all enum types.
static const nh_proto_t IPV6
static const nh_proto_t IPV4
static const prefix_t ZEROv6
The all Zeros v6 prefix.
Types belonging to Routing.
static const l3_proto_t MPLS
A next-hop protocol describes the protocol of a peer to which packets are sent after matching a route...
static const l3_proto_t IPV4
static const l3_proto_t IPV6
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
static const table_id_t DEFAULT_TABLE
The table-id for the default table.
static void to_vpp(const l2_rule &rule, vapi_type_macip_acl_rule &payload)
boost::asio::ip::address_v4 operator|(const boost::asio::ip::address_v4 &addr1, const boost::asio::ip::address_v4 &addr2)
bool operator!=(const enum_base &e) const
Comparison operator.
boost::asio::ip::address_v4 operator~(const boost::asio::ip::address_v4 &addr1)
bool operator==(const enum_base &e) const
Comparison operator.
uint32_t mask_width(const boost::asio::ip::address &addr)
Get the prefix mask length of a host route from the boost address.
boost::asio::ip::address_v4 operator&(const boost::asio::ip::address_v4 &addr1, const boost::asio::ip::address_v4 &addr2)
boost::asio::ip::address from_bytes(uint8_t is_ip6, uint8_t *bytes)
Convert a VPP byte stinrg into a boost addresss.
enum_base & operator=(const enum_base &e)
Assignment.
std::ostream & operator<<(std::ostream &os, const std::pair< direction_t, interface::key_t > &key)
static const l3_proto_t & from_address(const boost::asio::ip::address &addr)
static const nh_proto_t MPLS
The VPP Object Model (VOM) library.
static const prefix_t ZERO
The all Zeros prefix.
const std::string & to_string() const
convert to string format for debug purposes
static const nh_proto_t ETHERNET