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_SUB_INTERFACE_CMDS_H__
17 #define __VOM_SUB_INTERFACE_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/rpc_cmd.hpp"
21 #include "vom/sub_interface.hpp"
23 #include <vapi/interface.api.vapi.hpp>
26 namespace sub_interface_cmds {
29 * A functor class that creates an interface
31 class create_cmd : public interface::create_cmd<vapi::Create_vlan_subif>
35 * Cstrunctor taking the reference to the parent
36 * and the sub-interface's VLAN
38 create_cmd(HW::item<handle_t>& item,
39 const std::string& name,
40 const handle_t& parent,
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;
60 * Refernece to the parents handle
62 const handle_t& m_parent;
65 * The VLAN of the sub-interface
71 * A cmd class that Delete an interface
73 class delete_cmd : public interface::delete_cmd<vapi::Delete_subif>
79 delete_cmd(HW::item<handle_t>& item);
82 * Issue the command to VPP/HW
84 rc_t issue(connection& con);
87 * convert to string format for debug purposes
89 std::string to_string() const;
92 * Comparison operator - only used for UT
94 bool operator==(const delete_cmd& i) const;
97 }; // namespace sub_interface_cmds
101 * fd.io coding-style-patch-verification: ON
104 * eval: (c-set-style "mozilla")