2 * Copyright (c) 2017 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_MROUTE_CMDS_H__
17 #define __VOM_MROUTE_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/route.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/ip.api.vapi.hpp>
27 namespace ip_mroute_cmds {
30 * A command class that creates or updates the route
32 class update_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_mroute_add_del>
38 update_cmd(HW::item<bool>& item,
40 const mprefix_t& mprefix,
42 const itf_flags_t& flags);
45 * Issue the command to VPP/HW
47 rc_t issue(connection& con);
50 * convert to string format for debug purposes
52 std::string to_string() const;
55 * Comparison operator - only used for UT
57 bool operator==(const update_cmd& i) const;
60 route::table_id_t m_id;
63 const itf_flags_t& m_flags;
67 * A cmd class that deletes a route
69 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_mroute_add_del>
75 delete_cmd(HW::item<bool>& item,
77 const mprefix_t& mprefix,
79 const itf_flags_t& flags);
82 * Issue the command to VPP/HW
84 rc_t issue(connection& con);
87 * convert to string format for debug purposes
89 std::string to_string() const;
92 * Comparison operator - only used for UT
94 bool operator==(const delete_cmd& i) const;
97 route::table_id_t m_id;
100 const itf_flags_t& m_flags;
104 * A cmd class that Dumps ipv4 fib
106 class dump_v4_cmd : public VOM::dump_cmd<vapi::Ip_mfib_dump>
113 dump_v4_cmd(const dump_cmd& d);
116 * Issue the command to VPP/HW
118 rc_t issue(connection& con);
120 * convert to string format for debug purposes
122 std::string to_string() const;
125 * Comparison operator - only used for UT
127 bool operator==(const dump_v4_cmd& i) const;
137 * A cmd class that Dumps ipv6 fib
139 class dump_v6_cmd : public VOM::dump_cmd<vapi::Ip6_mfib_dump>
146 dump_v6_cmd(const dump_cmd& d);
149 * Issue the command to VPP/HW
151 rc_t issue(connection& con);
153 * convert to string format for debug purposes
155 std::string to_string() const;
158 * Comparison operator - only used for UT
160 bool operator==(const dump_v6_cmd& i) const;
169 }; // namespace ip_mroute_cmds
170 }; // namespace route
174 * fd.io coding-style-patch-verification: ON
177 * eval: (c-set-style "mozilla")