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() <<
"]]";
bool operator==(const gbp_rule &rule) const
comparison operator (for testing)
A template base class for all enum types.
gbp_rule(uint32_t priority, const next_hop_set_t &nhs, const action_t &a)
Construct a new object matching the desried state.
bool operator==(const next_hop_set_t &nhs) const
Comparison operator.
std::string to_string() const
String conversion.
static const hash_mode_t DST_IP
Flow hash is calculated based on DST IP.
const hash_mode_t & hash_mode(void) const
get the hash mode
const uint32_t getRdId(void) const
get the route domain Id
std::string to_string() const
convert to string
const next_hops_t & next_hops(void) const
get the set of next hops
std::string to_string() const
convert to string format for debug purposes
bool operator<(const next_hop_t &nh) const
less-than operator
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.
const action_t & action() const
const next_hop_set_t & nhs() const
Getters.
static const action_t REDIRECT
Redirect action.
std::string to_string() const
convert to string
const boost::asio::ip::address & getIp(void) const
get the IP address
bool operator<(const gbp_rule &rule) const
less-than operator
Representation of next hop.
next_hop_set_t(const hash_mode_t &hm, next_hops_t &nhs)
Constructor for next_hop_set_t.
bool operator==(const next_hop_t &nh) const
comparison operator (for testing)
The VPP Object Model (VOM) library.
const uint32_t getBdId(void) const
get the bridge domain Id
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 std::string & to_string() const
convert to string format for debug purposes
Type def of a Ethernet address.
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.
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.
const mac_address_t & getMac(void) const
get the mac address