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_ENDPOINT_GROUP_CMDS_H__
17 #define __VOM_GBP_ENDPOINT_GROUP_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/gbp_endpoint_group.hpp"
22 #include <vapi/gbp.api.vapi.hpp>
25 namespace gbp_endpoint_group_cmds {
28 * A command class that creates or updates the GBP endpoint_group
30 class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_endpoint_group_add>
36 create_cmd(HW::item<bool>& item,
40 route::table_id_t rd_id,
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 epg_id_t m_epg_id;
60 const uint16_t m_sclass;
61 const uint32_t m_bd_id;
62 const route::table_id_t m_rd_id;
67 * A cmd class that deletes a GBP endpoint_group
69 class delete_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_endpoint_group_del>
75 delete_cmd(HW::item<bool>& item, epg_id_t epg_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;
93 const epg_id_t m_epg_id;
97 * A cmd class that Dumps all the GBP endpoint_groups
99 class dump_cmd : public VOM::dump_cmd<vapi::Gbp_endpoint_group_dump>
106 dump_cmd(const dump_cmd& d);
109 * Issue the command to VPP/HW
111 rc_t issue(connection& con);
113 * convert to string format for debug purposes
115 std::string to_string() const;
118 * Comparison operator - only used for UT
120 bool operator==(const dump_cmd& i) const;
128 }; // namespace gbp_enpoint_cms
132 * fd.io coding-style-patch-verification: ON
135 * eval: (c-set-style "mozilla")