28 rule.
src_ip().
to_vpp(&payload.is_ipv6, payload.src_ip_addr,
29 &payload.src_ip_prefix_len);
38 rule.
src().
to_vpp(&payload.is_ipv6, payload.src_ip_addr,
39 &payload.src_ip_prefix_len);
40 rule.
dst().
to_vpp(&payload.is_ipv6, payload.dst_ip_addr,
41 &payload.dst_ip_prefix_len);
43 payload.proto = rule.
proto();
57 msg_t req(con.
ctx(), m_rules.size(), std::ref(*
this));
60 auto& payload = req.get_request().get_payload();
62 payload.count = m_rules.size();
63 memset(payload.tag, 0,
sizeof(payload.tag));
64 memcpy(payload.tag, m_key.c_str(),
65 std::min(m_key.length(),
sizeof(payload.tag)));
67 auto it = m_rules.cbegin();
69 while (it != m_rules.cend()) {
70 to_vpp(*it, payload.r[ii]);
89 msg_t req(con.
ctx(), std::ref(*
this));
91 auto& payload = req.get_request().get_payload();
108 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
110 auto& payload = m_dump->get_request().get_payload();
111 payload.acl_index = ~0;
124 msg_t req(con.
ctx(), m_rules.size(), std::ref(*
this));
127 auto& payload = req.get_request().get_payload();
129 payload.count = m_rules.size();
130 memset(payload.tag, 0,
sizeof(payload.tag));
131 memcpy(payload.tag, m_key.c_str(),
132 std::min(m_key.length(),
sizeof(payload.tag)));
134 auto it = m_rules.cbegin();
136 while (it != m_rules.cend()) {
137 to_vpp(*it, payload.r[ii]);
156 msg_t req(con.
ctx(), std::ref(*
this));
158 auto& payload = req.get_request().get_payload();
175 m_dump.reset(
new msg_t(con.
ctx(), std::ref(*
this)));
177 auto& payload = m_dump->get_request().get_payload();
178 payload.acl_index = ~0;
const action_t & action() const
static const rc_t NOOP
The HW write/update action was/has not been attempted.
uint32_t value() const
get the value of the handle
uint16_t srcport_or_icmptype_last() const
rc_t rc() const
Get the HW return code.
Error codes that VPP will return during a HW write.
void to_bytes(uint8_t *array, uint8_t len) const
Convert to byte array.
int value() const
Return the value of the enum - same as integer conversion.
rc_t wait()
Wait on the commands promise.
T & data()
Return the data read/written.
const action_t & action() const
const mac_address_t & mac_mask() const
rc_t issue(connection &con)
Issue the command to VPP/HW.
A representation of the connection to VPP.
void to_vpp(uint8_t *is_ip6, uint8_t *addr, uint8_t *len) const
Convert the prefix into VPP API parameters.
static void to_vpp(const l2_rule &rule, vapi_type_macip_acl_rule &payload)
uint16_t dstport_or_icmpcode_last() const
An ACL rule is the building block of an ACL.
uint16_t dstport_or_icmpcode_first() const
const route::prefix_t & dst() const
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
const route::prefix_t & src() const
Getters.
static const rc_t OK
The HW write was successfull.
const route::prefix_t & src_ip() const
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
The VPP Object Model (VOM) library.
An ACL rule is the building block of an ACL.
rc_t issue(connection &con)
Issue the command to VPP/HW.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
uint16_t srcport_or_icmptype_first() const
uint8_t tcp_flags_mask() const
rc_t issue(connection &con)
Issue the command to VPP/HW.
const mac_address_t & mac() const
uint8_t tcp_flags_value() const
HW::item< handle_t > & m_hw_item
A reference to an object's HW::item that the command will update.
UPDATE msg_t
convenient typedef