20 namespace gbp_subnet_cmds {
40 return ((m_itf == other.m_itf) && (m_rd == other.m_rd) &&
41 (m_prefix == other.m_prefix) && (m_type == other.m_type) &&
42 (m_itf == other.m_itf) && (m_sclass == other.m_sclass));
45 static vapi_enum_gbp_subnet_type
63 msg_t req(con.
ctx(), std::ref(*
this));
65 auto& payload = req.get_request().get_payload();
68 payload.subnet.rd_id = m_rd;
69 payload.subnet.sw_if_index = m_itf.
value();
70 payload.subnet.sclass = m_sclass;
71 payload.subnet.prefix =
to_api(m_prefix);
83 <<
", " << m_rd <<
":" << m_prefix.
to_string() <<
" itf:" << m_itf
84 <<
" sclass:" << m_sclass;
101 return ((m_rd == other.m_rd) && (m_prefix == other.m_prefix));
107 msg_t req(con.
ctx(), std::ref(*
this));
109 auto& payload = req.get_request().get_payload();
111 payload.subnet.rd_id = m_rd;
112 payload.subnet.prefix =
to_api(m_prefix);
122 std::ostringstream s;
142 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
154 return (
"gbp-subnet-dump");
uint32_t table_id_t
type def the table-id
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
uint32_t value() const
get the value of the handle
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
create_cmd(HW::item< bool > &item, route::table_id_t rd, const route::prefix_t &prefix, const gbp_subnet::type_t &type, const handle_t &itf, sclass_t sclass)
Constructor.
static const type_t TRANSPORT
A transport subnet, sent via the RD's UU-fwd interface.
Error codes that VPP will return during a HW write.
rc_t issue(connection &con)
Issue the command to VPP/HW.
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
A cmd class that Dumps all the GBP subnets.
A representation of the connection to VPP.
static const type_t STITCHED_INTERNAL
Internal subnet is reachable through the source EPG's uplink interface.
A base class for all RPC commands to VPP.
std::string to_string() const
convert to string format for debug purposes
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
bool operator==(const create_cmd &i) const
Comparison operator - only used for UT.
A cmd class that deletes a GBP subnet.
static const type_t STITCHED_EXTERNAL
External subnet requires NAT translation before egress.
A type declaration of an interface handle in VPP.
static const rc_t OK
The HW write was successfull.
static vapi_enum_gbp_subnet_type gbp_subnet_type_to_api(const gbp_subnet::type_t &type)
std::string to_string() const
convert to string format for debug purposes
A command class that creates or updates the GBP subnet.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
The VPP Object Model (VOM) library.
delete_cmd(HW::item< bool > &item, route::table_id_t rd, const route::prefix_t &prefix)
Constructor.
rc_t issue(connection &con)
Issue the command to VPP/HW.
rc_t issue(connection &con)
Issue the command to VPP/HW.
static const type_t L3_OUT
A transport subnet, sent via the RD's UU-fwd interface.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
HW::item< bool > & item()
return the HW item the command updates
vapi::Gbp_subnet_add_del msg_t
convenient typedef
bool operator==(const delete_cmd &i) const
Comparison operator - only used for UT.