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_INTERFACE_CMDS_H__
17 #define __VOM_BOND_INTERFACE_CMDS_H__
19 #include "vom/bond_interface.hpp"
20 #include "vom/dump_cmd.hpp"
21 #include "vom/interface.hpp"
22 #include "vom/rpc_cmd.hpp"
24 #include <vapi/bond.api.vapi.hpp>
25 #include <vapi/interface.api.vapi.hpp>
28 namespace bond_interface_cmds {
31 * A functor class that creates an interface
33 class create_cmd : public interface::create_cmd<vapi::Bond_create>
36 create_cmd(HW::item<handle_t>& item,
37 const std::string& name,
38 const bond_interface::mode_t& mode,
39 const bond_interface::lb_t& lb,
40 const l2_address_t& l2_address);
43 * Issue the command to VPP/HW
45 rc_t issue(connection& con);
47 * convert to string format for debug purposes
49 std::string to_string() const;
52 const bond_interface::mode_t m_mode;
53 const bond_interface::lb_t m_lb;
54 const l2_address_t m_l2_address;
58 * A functor class that deletes a Tap interface
60 class delete_cmd : public interface::delete_cmd<vapi::Bond_delete>
63 delete_cmd(HW::item<handle_t>& item);
66 * Issue the command to VPP/HW
68 rc_t issue(connection& con);
70 * convert to string format for debug purposes
72 std::string to_string() const;
76 * A cmd class that Dumps all the Vpp Interfaces
78 class dump_cmd : public VOM::dump_cmd<vapi::Sw_interface_bond_dump>
87 * Issue the command to VPP/HW
89 rc_t issue(connection& con);
91 * convert to string format for debug purposes
93 std::string to_string() const;
96 * Comparison operator - only used for UT
98 bool operator==(const dump_cmd& i) const;
101 }; // namespace bond_interface_cmds
105 * fd.io coding-style-patch-verification: ON
108 * eval: (c-set-style "mozilla")