|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
22 namespace nat_static_cmds {
26 const boost::asio::ip::address_v4& inside,
27 const boost::asio::ip::address_v4& outside)
37 return ((m_id == other.m_id) && (m_inside == other.m_inside) &&
38 (m_outside == other.m_outside));
44 msg_t req(
con.ctx(), std::ref(*
this));
46 auto& payload = req.get_request().get_payload();
49 payload.local_port = 0;
50 payload.external_port = 0;
51 payload.vrf_id = m_id;
52 payload.external_sw_if_index = ~0;
53 to_bytes(m_inside, payload.local_ip_address);
54 to_bytes(m_outside, payload.external_ip_address);
66 <<
" inside:" << m_inside.to_string()
67 <<
" outside:" << m_outside.to_string();
74 const boost::asio::ip::address_v4& inside,
75 const boost::asio::ip::address_v4& outside)
85 return ((m_id == other.m_id) && (m_inside == other.m_inside) &&
86 (m_outside == other.m_outside));
92 msg_t req(
con.ctx(), std::ref(*
this));
94 auto& payload = req.get_request().get_payload();
97 payload.local_port = 0;
98 payload.external_port = 0;
99 payload.vrf_id = m_id;
100 payload.external_sw_if_index = ~0;
101 to_bytes(m_inside, payload.local_ip_address);
102 to_bytes(m_outside, payload.external_ip_address);
115 std::ostringstream s;
117 <<
" inside:" << m_inside.to_string()
118 <<
" outside:" << m_outside.to_string();
144 return (
"nat-44-static-dump");
149 const boost::asio::ip::address_v6& inside,
150 const boost::asio::ip::address_v6& outside)
160 return ((m_id == other.m_id) && (m_inside == other.m_inside) &&
161 (m_outside == other.m_outside));
167 msg_t req(
con.ctx(), std::ref(*
this));
169 auto& payload = req.get_request().get_payload();
171 payload.vrf_id = m_id;
172 to_bytes(m_inside, payload.local_ip_address);
173 to_bytes(m_outside, payload.external_ip_address);
183 std::ostringstream s;
185 <<
" inside:" << m_inside.to_string()
186 <<
" outside:" << m_outside.to_string();
193 const boost::asio::ip::address_v6& inside,
194 const boost::asio::ip::address_v6& outside)
204 return ((m_id == other.m_id) && (m_inside == other.m_inside) &&
205 (m_outside == other.m_outside));
211 msg_t req(
con.ctx(), std::ref(*
this));
213 auto& payload = req.get_request().get_payload();
215 payload.vrf_id = m_id;
216 to_bytes(m_inside, payload.local_ip_address);
217 to_bytes(m_outside, payload.external_ip_address);
230 std::ostringstream s;
232 <<
" inside:" << m_inside.to_string()
233 <<
" outside:" << m_outside.to_string();
259 return (
"nat-static-dump");
vapi::Nat44_static_mapping_dump msg_t
rc_t wait()
Wait on the commands promise.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
The VPP Object Model (VOM) library.
const static rc_t OK
The HW write was successfull.
void to_bytes(const boost::asio::ip::address_v6 &addr, uint8_t *array)
bool operator==(const dump_44_cmd &i) const
Comparison operator - only used for UT.
delete_44_cmd(HW::item< bool > &item, route::table_id_t id, const boost::asio::ip::address_v4 &inside, const boost::asio::ip::address_v4 &outside)
Constructor.
A command class that creates NAT 66 static mapping.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Dumps all the nat_statics.
A base class for all RPC commands to VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A cmd class that Dumps all the nat_statics.
A cmd class that deletes a NAT 44 static mapping.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
std::unique_ptr< vapi::Nat44_static_mapping_dump > m_dump
The VAPI event registration.
delete_66_cmd(HW::item< bool > &item, route::table_id_t id, const boost::asio::ip::address_v6 &inside, const boost::asio::ip::address_v6 &outside)
Constructor.
rc_t issue(connection &con)
Issue the command to VPP/HW.
A command class that creates NAT 44 static mapping.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
bool operator==(const delete_66_cmd &i) const
Comparison operator - only used for UT.
create_44_cmd(HW::item< bool > &item, route::table_id_t id, const boost::asio::ip::address_v4 &inside, const boost::asio::ip::address_v4 &outside)
Constructor.
std::string to_string() const
convert to string format for debug purposes
A representation of the connection to VPP.
std::string to_string() const
convert to string format for debug purposes
std::string to_string() const
convert to string format for debug purposes
rc_t wait()
Wait for the issue of the command to complete.
bool operator==(const create_44_cmd &i) const
Comparison operator - only used for UT.
DEFINE_VAPI_MSG_IDS_NAT66_API_JSON
const static rc_t NOOP
The HW write/update action was/has not been attempted.
std::string to_string() const
convert to string format for debug purposes
DEFINE_VAPI_MSG_IDS_NAT_API_JSON
bool operator==(const delete_44_cmd &i) const
Comparison operator - only used for UT.
rc_t issue(connection &con)
Issue the command to VPP/HW.
vapi::Nat44_add_del_static_mapping msg_t
convenient typedef
rc_t issue(connection &con)
Issue the command to VPP/HW.
create_66_cmd(HW::item< bool > &item, route::table_id_t id, const boost::asio::ip::address_v6 &inside, const boost::asio::ip::address_v6 &outside)
Constructor.
std::string to_string() const
convert to string format for debug purposes
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const dump_66_cmd &i) const
Comparison operator - only used for UT.
std::string to_string() const
convert to string format for debug purposes
uint32_t table_id_t
type def the table-id
A cmd class that deletes a NAT 66 static mapping.
Error codes that VPP will return during a HW write.
std::string to_string() const
convert to string format for debug purposes
bool operator==(const create_66_cmd &i) const
Comparison operator - only used for UT.