16 #ifndef __VOM_PREFIX_H__ 17 #define __VOM_PREFIX_H__ 19 #include <boost/asio/ip/address.hpp> 103 prefix_t(
const boost::asio::ip::address&
addr, uint8_t len);
108 prefix_t(
const boost::asio::ip::address& addr);
113 prefix_t(
const std::string& s, uint8_t len);
121 prefix_t(uint8_t is_ip6, uint8_t* addr, uint8_t len);
130 const boost::asio::ip::address& address()
const;
145 bool operator<(
const prefix_t& o)
const;
175 void to_vpp(uint8_t* is_ip6, uint8_t* addr, uint8_t* len)
const;
180 boost::asio::ip::address mask()
const;
201 boost::asio::ip::address m_addr;
210 boost::asio::ip::address_v4
operator|(
const boost::asio::ip::address_v4& addr1,
211 const boost::asio::ip::address_v4& addr2);
213 boost::asio::ip::address_v4
operator&(
const boost::asio::ip::address_v4& addr1,
214 const boost::asio::ip::address_v4& addr2);
216 boost::asio::ip::address_v4
operator~(
const boost::asio::ip::address_v4& addr1);
218 boost::asio::ip::address_v6
operator|(
const boost::asio::ip::address_v6& addr1,
219 const boost::asio::ip::address_v6& addr2);
221 boost::asio::ip::address_v6
operator&(
const boost::asio::ip::address_v6& addr1,
222 const boost::asio::ip::address_v6& addr2);
224 boost::asio::ip::address_v6
operator~(
const boost::asio::ip::address_v6& addr1);
226 boost::asio::ip::address
operator|(
const boost::asio::ip::address& addr1,
227 const boost::asio::ip::address& addr2);
229 boost::asio::ip::address
operator&(
const boost::asio::ip::address& addr1,
230 const boost::asio::ip::address& addr2);
232 boost::asio::ip::address
operator~(
const boost::asio::ip::address& addr1);
245 void to_bytes(
const boost::asio::ip::address_v4&
addr, uint8_t* array);
246 void to_bytes(
const boost::asio::ip::address_v6&
addr, uint8_t* array);
256 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.
An L3 protocol can be used to construct a prefix that is used to match packets are part of a route...
static const nh_proto_t & from_address(const boost::asio::ip::address &addr)
static const l3_proto_t MPLS
Types belonging to Routing.
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 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