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_L2_XCONNECT_CMDS_H__
17 #define __VOM_L2_XCONNECT_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/l2_xconnect.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/l2.api.vapi.hpp>
24 #include <vapi/vpe.api.vapi.hpp>
27 namespace l2_xconnect_cmds {
30 * A functor class that binds L2 configuration to an interface
33 : public rpc_cmd<HW::item<bool>, vapi::Sw_interface_set_l2_xconnect>
39 bind_cmd(HW::item<bool>& item,
40 const handle_t& east_itf,
41 const handle_t& west_itf);
44 * Issue the command to VPP/HW
46 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 bind_cmd& i) const;
59 * The east interface for cross_connect
61 const handle_t m_east_itf;
64 * The west interface for x-connect
66 const handle_t m_west_itf;
70 * A cmd class that Unbinds L2 configuration from an interface
73 : public rpc_cmd<HW::item<bool>, vapi::Sw_interface_set_l2_xconnect>
79 unbind_cmd(HW::item<bool>& item,
80 const handle_t& east_itf,
81 const handle_t& west_itf);
84 * Issue the command to VPP/HW
86 rc_t issue(connection& con);
89 * convert to string format for debug purposes
91 std::string to_string() const;
94 * Comparison operator - only used for UT
96 bool operator==(const unbind_cmd& i) const;
100 * The east interface for x-connect
102 const handle_t m_east_itf;
105 * The west interface for x-connect
107 const handle_t m_west_itf;
111 * A cmd class that Dumps all the bridge domains
113 class dump_cmd : public VOM::dump_cmd<vapi::L2_xconnect_dump>
122 * Issue the command to VPP/HW
124 rc_t issue(connection& con);
126 * convert to string format for debug purposes
128 std::string to_string() const;
131 * Comparison operator - only used for UT
133 bool operator==(const dump_cmd& i) const;
136 }; // namespace l2_xconnect_cmds
140 * fd.io coding-style-patch-verification: ON
143 * eval: (c-set-style "mozilla")