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>, vapi::Ip_add_del_route>
38 update_cmd(HW::item<bool>& item,
40 const prefix_t& prefix,
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;
65 * A cmd class that deletes a route
67 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_add_del_route>
73 delete_cmd(HW::item<bool>& item,
75 const prefix_t& prefix,
79 * Issue the command to VPP/HW
81 rc_t issue(connection& con);
84 * convert to string format for debug purposes
86 std::string to_string() const;
89 * Comparison operator - only used for UT
91 bool operator==(const delete_cmd& i) const;
94 route::table_id_t m_id;
100 * A cmd class that Dumps ipv4 fib
102 class dump_v4_cmd : public VOM::dump_cmd<vapi::Ip_fib_dump>
109 dump_v4_cmd(const dump_cmd& d);
112 * Issue the command to VPP/HW
114 rc_t issue(connection& con);
116 * convert to string format for debug purposes
118 std::string to_string() const;
121 * Comparison operator - only used for UT
123 bool operator==(const dump_v4_cmd& i) const;
133 * A cmd class that Dumps ipv6 fib
135 class dump_v6_cmd : public VOM::dump_cmd<vapi::Ip6_fib_dump>
142 dump_v6_cmd(const dump_cmd& d);
145 * Issue the command to VPP/HW
147 rc_t issue(connection& con);
149 * convert to string format for debug purposes
151 std::string to_string() const;
154 * Comparison operator - only used for UT
156 bool operator==(const dump_v6_cmd& i) const;
165 }; // namespace ip_route_cmds
166 }; // namespace route
170 * fd.io coding-style-patch-verification: ON
173 * eval: (c-set-style "mozilla")