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_epg_id == other.m_epg_id));
45 static vapi_enum_gbp_subnet_type
61 msg_t req(con.
ctx(), std::ref(*
this));
63 auto& payload = req.get_request().get_payload();
66 payload.subnet.rd_id = m_rd;
67 payload.subnet.sw_if_index = m_itf.
value();
68 payload.subnet.epg_id = m_epg_id;
69 payload.subnet.prefix =
to_api(m_prefix);
81 <<
", " << m_rd <<
":" << m_prefix.
to_string() <<
" itf:" << m_itf
82 <<
" epg-id:" << m_epg_id;
99 return ((m_rd == other.m_rd) && (m_prefix == other.m_prefix));
105 msg_t req(con.
ctx(), std::ref(*
this));
107 auto& payload = req.get_request().get_payload();
109 payload.subnet.rd_id = m_rd;
110 payload.subnet.prefix =
to_api(m_prefix);
120 std::ostringstream s;
140 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
152 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
uint32_t epg_id_t
EPG IDs are 32 bit integers.
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
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.
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.
void to_api(const ip_address_t &a, vapi_type_address &v)
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.
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, epg_id_t epg_id)
Constructor.
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.