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_PIPE_CMDS_H__
17 #define __VOM_PIPE_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/pipe.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/pipe.api.vapi.hpp>
28 * A functor class that creates an interface
30 class create_cmd : public interface::create_cmd<vapi::Pipe_create>
34 * Cstrunctor taking the reference to the parent
35 * and the sub-interface's VLAN
37 create_cmd(HW::item<handle_t>& item,
38 const std::string& name,
40 HW::item<pipe::handle_pair_t>& ends);
43 * Issue the command to VPP/HW
45 rc_t issue(connection& con);
48 * convert to string format for debug purposes
50 std::string to_string() const;
53 * Comparison operator - only used for UT
55 bool operator==(const create_cmd& i) const;
57 virtual vapi_error_e operator()(vapi::Pipe_create& reply);
60 HW::item<pipe::handle_pair_t>& m_hdl_pair;
65 * A cmd class that Delete an interface
67 class delete_cmd : public interface::delete_cmd<vapi::Pipe_delete>
73 delete_cmd(HW::item<handle_t>& item, HW::item<pipe::handle_pair_t>& end_pair);
76 * Issue the command to VPP/HW
78 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 delete_cmd& i) const;
91 HW::item<pipe::handle_pair_t>& m_hdl_pair;
95 * A cmd class that Dumps all the Vpp interfaces
97 class dump_cmd : public VOM::dump_cmd<vapi::Pipe_dump>
101 * Default Constructor
103 dump_cmd() = default;
106 * Issue the command to VPP/HW
108 rc_t issue(connection& con);
110 * convert to string format for debug purposes
112 std::string to_string() const;
115 * Comparison operator - only used for UT
117 bool operator==(const dump_cmd& i) const;
120 }; // namespace pipe_cmds
124 * fd.io coding-style-patch-verification: ON
127 * eval: (c-set-style "mozilla")