22 namespace igmp_listen_cmds {
25 const boost::asio::ip::address_v4& gaddr,
37 return ((m_itf == other.m_itf) && (m_gaddr == other.m_gaddr) &&
38 (m_saddrs == other.m_saddrs));
45 msg_t req(con.
ctx(),
sizeof(vapi_type_ip4_address) * size, std::ref(*
this));
47 auto& payload = req.get_request().get_payload();
48 payload.group.sw_if_index = m_itf.
value();
49 to_api(m_gaddr, payload.group.gaddr);
54 payload.group.n_srcs = 0;
60 for (
auto addr : m_saddrs) {
64 payload.group.n_srcs =
i;
75 auto addr = m_saddrs.cbegin();
78 <<
" group:" << m_gaddr <<
" src-addrs:[";
79 while (
addr != m_saddrs.cend()) {
89 const boost::asio::ip::address_v4& gaddr)
99 return ((m_itf == other.m_itf) && (m_gaddr == other.m_gaddr));
105 msg_t req(con.
ctx(), 0, std::ref(*
this));
107 auto& payload = req.get_request().get_payload();
108 payload.group.sw_if_index = m_itf.
value();
109 payload.group.n_srcs = 0;
110 payload.group.filter =
INCLUDE;
111 to_api(m_gaddr, payload.group.gaddr);
124 std::ostringstream s;
126 <<
" itf:" << m_itf.
to_string() <<
" group:" << m_gaddr;
152 auto& payload =
m_dump->get_request().get_payload();
153 payload.sw_if_index = m_itf.
value();
165 return (
"igmp-listen-dump");
static const 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
uint32_t value() const
get the value of the handle
Error codes that VPP will return during a HW write.
vapi_enum_ip_neighbor_flags to_api(const neighbour::flags_t &f)
bool operator==(const dump_cmd &i) const
Comparison operator - only used for UT.
rc_t wait()
Wait on the commands promise.
std::string to_string() const
convert to string format for debug purposes
A functor class that binds the igmp group to the interface.
std::string to_string() const
convert to string format for debug purposes
A representation of the connection to VPP.
dump_cmd()
Default Constructor.
listen_cmd(HW::item< bool > &item, const handle_t &itf, const boost::asio::ip::address_v4 &gaddr, const igmp_listen::src_addrs_t &saddrs)
Constructor.
A base class for all RPC commands to VPP.
#define VAPI_CALL(_stmt)
Convenince wrapper macro for error handling in VAPI sends.
A cmd class that Unbinds igmp group from an interface.
std::set< boost::asio::ip::address_v4 > src_addrs_t
std::string to_string() const
convert to string format for debug purposes
A type declaration of an interface handle in VPP.
rc_t issue(connection &con)
Issue the command to VPP/HW.
static const rc_t OK
The HW write was successfull.
A cmd class that Dumps all the igmp configs.
rc_t wait()
Wait for the issue of the command to complete.
rc_t issue(connection &con)
Issue the command to VPP/HW.
bool operator==(const unlisten_cmd &i) const
Comparison operator - only used for UT.
vapi::Connection & ctx()
Retrun the VAPI context the commands will use.
rc_t issue(connection &con)
Issue the command to VPP/HW.
The VPP Object Model (VOM) library.
void set(const rc_t &rc)
Set the HW return code - should only be called from the family of Command objects.
std::unique_ptr< vapi::Igmp_dump > m_dump
The VAPI event registration.
bool operator==(const listen_cmd &i) const
Comparison operator - only used for UT.
unlisten_cmd(HW::item< bool > &item, const handle_t &itf, const boost::asio::ip::address_v4 &gaddr)
Constructor.
HW::item< bool > & m_hw_item
A reference to an object's HW::item that the command will update.
DEFINE_VAPI_MSG_IDS_IGMP_API_JSON
std::string to_string() const
convert to string format for debug purposes
HW::item< bool > & item()
return the HW item the command updates
vapi::Igmp_listen msg_t
convenient typedef