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_DOMAIN_CMDS_H__
17 #define __VOM_ROUTE_DOMAIN_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/route_domain.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/ip.api.vapi.hpp>
26 namespace route_domain_cmds {
29 * A command class that creates the IP table
31 class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_table_add_del>
37 create_cmd(HW::item<bool>& item, l3_proto_t proto, route::table_id_t id);
40 * Issue the command to VPP/HW
42 rc_t issue(connection& con);
45 * convert to string format for debug purposes
47 std::string to_string() const;
50 * Comparison operator - only used for UT
52 bool operator==(const create_cmd& i) const;
58 route::table_id_t m_id;
61 * L3 protocol of the table
67 * A cmd class that Deletes the IP Table
69 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Ip_table_add_del>
75 delete_cmd(HW::item<bool>& item, l3_proto_t proto, route::table_id_t id);
78 * Issue the command to VPP/HW
80 rc_t issue(connection& con);
83 * convert to string format for debug purposes
85 std::string to_string() const;
88 * Comparison operator - only used for UT
90 bool operator==(const delete_cmd& i) const;
96 route::table_id_t m_id;
99 * L3 protocol of the table
105 * A cmd class that Dumps IP fib tables
107 class dump_cmd : public VOM::dump_cmd<vapi::Ip_table_dump>
114 dump_cmd(const dump_cmd& d);
117 * Issue the command to VPP/HW
119 rc_t issue(connection& con);
121 * convert to string format for debug purposes
123 std::string to_string() const;
126 * Comparison operator - only used for UT
128 bool operator==(const dump_cmd& i) const;
137 }; // namespace route_domain_cmds
141 * fd.io coding-style-patch-verification: ON
144 * eval: (c-set-style "mozilla")