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_GBP_SUBNET_CMDS_H__
17 #define __VOM_GBP_SUBNET_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/gbp_subnet.hpp"
22 #include <vapi/gbp.api.vapi.hpp>
25 namespace gbp_subnet_cmds {
28 * A command class that creates or updates the GBP subnet
30 class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_subnet_add_del>
36 create_cmd(HW::item<bool>& item,
38 const route::prefix_t& prefix,
39 const gbp_subnet::type_t& type,
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 create_cmd& i) const;
59 const route::table_id_t m_rd;
60 const route::prefix_t m_prefix;
61 const gbp_subnet::type_t& m_type;
63 const sclass_t m_sclass;
67 * A cmd class that deletes a GBP subnet
69 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_subnet_add_del>
75 delete_cmd(HW::item<bool>& item,
77 const route::prefix_t& prefix);
80 * Issue the command to VPP/HW
82 rc_t issue(connection& con);
85 * convert to string format for debug purposes
87 std::string to_string() const;
90 * Comparison operator - only used for UT
92 bool operator==(const delete_cmd& i) const;
95 const route::table_id_t m_rd;
96 const route::prefix_t m_prefix;
100 * A cmd class that Dumps all the GBP subnets
102 class dump_cmd : public VOM::dump_cmd<vapi::Gbp_subnet_dump>
109 dump_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_cmd& i) const;
131 }; // namespace gbp_enpoint_cms
135 * fd.io coding-style-patch-verification: ON
138 * eval: (c-set-style "mozilla")