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_ROUTE_CMDS_H__
17 #define __VOM_ROUTE_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_route_cmds {
30 * A command class that creates or updates the route
32 class update_cmd : public rpc_cmd<HW::item<bool>, rc_t, vapi::Ip_add_del_route>
38 update_cmd(HW::item<bool>& item,
40 const prefix_t& prefix,
41 const path_list_t& paths);
44 * Issue the command to VPP/HW
46 rc_t issue(connection& con);
49 * convert to string format for debug purposes
51 std::string to_string() const;
54 * Comparison operator - only used for UT
56 bool operator==(const update_cmd& i) const;
59 route::table_id_t m_id;
61 const path_list_t m_paths;
65 * A cmd class that deletes a route
67 class delete_cmd : public rpc_cmd<HW::item<bool>, rc_t, vapi::Ip_add_del_route>
73 delete_cmd(HW::item<bool>& item, table_id_t id, const prefix_t& prefix);
76 * Issue the command to VPP/HW
78 rc_t issue(connection& con);
81 * convert to string format for debug purposes
83 std::string to_string() const;
86 * Comparison operator - only used for UT
88 bool operator==(const delete_cmd& i) const;
91 route::table_id_t m_id;
96 * A cmd class that Dumps ipv4 fib
98 class dump_v4_cmd : public VOM::dump_cmd<vapi::Ip_fib_dump>
105 dump_v4_cmd(const dump_cmd& d);
108 * Issue the command to VPP/HW
110 rc_t issue(connection& con);
112 * convert to string format for debug purposes
114 std::string to_string() const;
117 * Comparison operator - only used for UT
119 bool operator==(const dump_v4_cmd& i) const;
129 * A cmd class that Dumps ipv6 fib
131 class dump_v6_cmd : public VOM::dump_cmd<vapi::Ip6_fib_dump>
138 dump_v6_cmd(const dump_cmd& d);
141 * Issue the command to VPP/HW
143 rc_t issue(connection& con);
145 * convert to string format for debug purposes
147 std::string to_string() const;
150 * Comparison operator - only used for UT
152 bool operator==(const dump_v6_cmd& i) const;
161 }; // namespace ip_route_cmds
162 }; // namespace route
166 * fd.io coding-style-patch-verification: ON
169 * eval: (c-set-style "mozilla")