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_BOND_GROUP_BINDING_CMDS_H__
17 #define __VOM_BOND_GROUP_BINDING_CMDS_H__
19 #include "vom/bond_group_binding.hpp"
20 #include "vom/dump_cmd.hpp"
22 #include <vapi/bond.api.vapi.hpp>
25 namespace bond_group_binding_cmds {
27 * A command class that binds the slave interface to the bond interface
29 class bind_cmd : public rpc_cmd<HW::item<bool>, vapi::Bond_enslave>
35 bind_cmd(HW::item<bool>& item,
36 const handle_t& bond_itf,
37 const bond_member& itf);
40 * Issue the command to VPP/HW
42 rc_t issue(connection& con);
44 * convert to string format for debug purposes
46 std::string to_string() const;
49 * Comparison operator - only used for UT
51 bool operator==(const bind_cmd& i) const;
55 * sw_if_index of bond interface
57 const handle_t m_bond_itf;
60 * member interface of bond group
62 const bond_member m_itf;
66 * A cmd class that detach slave from a bond interface
68 class unbind_cmd : public rpc_cmd<HW::item<bool>, vapi::Bond_detach_slave>
74 unbind_cmd(HW::item<bool>& item, const handle_t& itf);
77 * Issue the command to VPP/HW
79 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 unbind_cmd& i) const;
92 * slave interface of bond group
98 * A cmd class that Dumps slave itfs
100 class dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_slave_dump>
104 * Default Constructor
106 dump_cmd(const handle_t& itf);
107 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;
117 * Comparison operator - only used for UT
119 bool operator==(const dump_cmd& i) const;
123 * The interface to get the addresses for
125 const handle_t m_itf;
131 * fd.io coding-style-patch-verification: ON
134 * eval: (c-set-style "mozilla")