38 <<
"ip:" << m_ip <<
" mac:" << m_mac.
to_string() <<
" bd:" << m_bd_id
39 <<
" rd:" << m_rd_id <<
"]";
47 return (nh.m_ip < m_ip);
53 return ((m_ip == nh.m_ip) && (m_mac == nh.m_mac) && (m_bd_id == nh.m_bd_id) &&
54 (m_rd_id == nh.m_rd_id));
85 gbp_rule::hash_mode_t::hash_mode_t(
int v,
const std::string s)
117 std::ostringstream s;
119 s <<
"hash-mode:" << m_hm.
to_string() <<
" next-hops:[";
120 auto it = m_nhs.cbegin();
121 while (it != m_nhs.cend()) {
122 s <<
" " << it->to_string();
125 s <<
" ] next-hop-size:" << m_nhs.size();
133 return ((m_hm == nhs.m_hm) && (m_nhs == nhs.m_nhs));
152 gbp_rule::action_t::action_t(
int v,
const std::string s)
171 : m_priority(priority)
178 : m_priority(priority)
187 return (other.m_priority < m_priority);
193 return ((m_action == rule.m_action) && (m_nhs == rule.m_nhs) &&
194 (m_priority == rule.m_priority));
200 std::ostringstream s;
203 <<
"priority:" << m_priority <<
" action:" << m_action.
to_string()
204 <<
" next-hop-set:[" << m_nhs.
to_string() <<
"]]";
std::string to_string() const
convert to string
bool operator==(const gbp_rule &rule) const
comparison operator (for testing)
A template base class for all enum types.
bool operator==(const next_hop_t &nh) const
comparison operator (for testing)
gbp_rule(uint32_t priority, const next_hop_set_t &nhs, const action_t &a)
Construct a new object matching the desried state.
static const hash_mode_t DST_IP
Flow hash is calculated based on DST IP.
bool operator==(const next_hop_set_t &nhs) const
Comparison operator.
const boost::asio::ip::address & getIp(void) const
get the IP address
std::string to_string() const
convert to string format for debug purposes
const uint32_t getRdId(void) const
get the route domain Id
static const hash_mode_t SYMMETRIC
Flow hash is calculated based on SRC IP, DST IP and Protocol.
Representation of set of next hops and associated hash mode profile.
bool operator<(const next_hop_t &nh) const
less-than operator
const next_hops_t & next_hops(void) const
get the set of next hops
const uint32_t getBdId(void) const
get the bridge domain Id
static const action_t REDIRECT
Redirect action.
const std::string & to_string() const
convert to string format for debug purposes
const mac_address_t & getMac(void) const
get the mac address
Representation of next hop.
bool operator<(const gbp_rule &rule) const
less-than operator
next_hop_set_t(const hash_mode_t &hm, next_hops_t &nhs)
Constructor for next_hop_set_t.
std::string to_string() const
String conversion.
The VPP Object Model (VOM) library.
std::set< next_hop_t > next_hops_t
unordered set of next hops
static const action_t DENY
Deny action.
static const hash_mode_t SRC_IP
Flow Hash is calculated based on SRC IP in case of load balancing.
const next_hop_set_t & nhs() const
Getters.
std::string to_string() const
convert to string
Type def of a Ethernet address.
const hash_mode_t & hash_mode(void) const
get the hash mode
static const hash_mode_t & from_int(vapi_enum_gbp_hash_mode i)
create the hash mode from int value
next_hop_t(const boost::asio::ip::address &ip, const mac_address_t &mac, uint32_t bd_id, uint32_t rd_id)
Constructor for next_hop_t.
const action_t & action() const
static const action_t & from_int(vapi_enum_gbp_rule_action i)
create the action from int value
static const action_t PERMIT
Permit action.