2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __VOM_IGMP_LISTEN_CMDS_H__
17 #define __VOM_IGMP_LISTEN_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/igmp_listen.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/igmp.api.vapi.hpp>
26 namespace igmp_listen_cmds {
29 * A functor class that binds the igmp group to the interface
31 class listen_cmd : public rpc_cmd<HW::item<bool>, vapi::Igmp_listen>
37 listen_cmd(HW::item<bool>& item,
39 const boost::asio::ip::address_v4& gaddr,
40 const igmp_listen::src_addrs_t& saddrs);
43 * Issue the command to VPP/HW
45 rc_t issue(connection& con);
47 * convert to string format for debug purposes
49 std::string to_string() const;
52 * Comparison operator - only used for UT
54 bool operator==(const listen_cmd& i) const;
58 * Reference to the interface to bind to
60 const handle_t& m_itf;
63 * The igmp group to bind
65 const boost::asio::ip::address_v4& m_gaddr;
68 * The igmp srouce specific addresses to listen them
70 const igmp_listen::src_addrs_t& m_saddrs;
74 * A cmd class that Unbinds igmp group from an interface
76 class unlisten_cmd : public rpc_cmd<HW::item<bool>, vapi::Igmp_listen>
82 unlisten_cmd(HW::item<bool>& item,
84 const boost::asio::ip::address_v4& gaddr);
87 * Issue the command to VPP/HW
89 rc_t issue(connection& con);
92 * convert to string format for debug purposes
94 std::string to_string() const;
97 * Comparison operator - only used for UT
99 bool operator==(const unlisten_cmd& i) const;
103 * Reference to the interface to unbind
105 const handle_t& m_itf;
108 * The igmp group to unlisten
110 const boost::asio::ip::address_v4& m_gaddr;
114 * A cmd class that Dumps all the igmp configs
116 class dump_cmd : public VOM::dump_cmd<vapi::Igmp_dump>
122 dump_cmd(const handle_t& itf);
123 dump_cmd(const dump_cmd& d);
126 * Issue the command to VPP/HW
128 rc_t issue(connection& con);
130 * convert to string format for debug purposes
132 std::string to_string() const;
135 * Comparison operator - only used for UT
137 bool operator==(const dump_cmd& i) const;
146 * The interface to get the igmp config for
148 const handle_t& m_itf;
151 }; // namespace igmp_listen_cmds
155 * fd.io coding-style-patch-verification: ON
158 * eval: (c-set-style "mozilla")