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_IP_UNNUMBERED_CMDS_H__
17 #define __VOM_IP_UNNUMBERED_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/ip_unnumbered.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/interface.api.vapi.hpp>
24 #include <vapi/ip.api.vapi.hpp>
27 namespace ip_unnumbered_cmds {
30 *A command class that configures the IP unnumbered
33 : public rpc_cmd<HW::item<bool>, vapi::Sw_interface_set_unnumbered>
39 config_cmd(HW::item<bool>& item, const handle_t& itf, const handle_t& l3_itf);
42 * Issue the command to VPP/HW
44 rc_t issue(connection& con);
46 * convert to string format for debug purposes
48 std::string to_string() const;
51 * Comparison operator - only used for UT
53 bool operator==(const config_cmd& i) const;
57 * Reference to the interface for which the address is required
59 const handle_t& m_itf;
61 * Reference to the interface which has an address
63 const handle_t& m_l3_itf;
67 * A cmd class that Unconfigs L3 Config from an interface
70 : public rpc_cmd<HW::item<bool>, vapi::Sw_interface_set_unnumbered>
76 unconfig_cmd(HW::item<bool>& item,
78 const handle_t& l3_itf);
81 * Issue the command to VPP/HW
83 rc_t issue(connection& con);
85 * convert to string format for debug purposes
87 std::string to_string() const;
90 * Comparison operator - only used for UT
92 bool operator==(const unconfig_cmd& i) const;
96 * Reference to the interface for which the address is required
98 const handle_t& m_itf;
100 * Reference to the interface which has an address
102 const handle_t& m_l3_itf;
106 * A cmd class that Dumps all the IP unnumbered interfaces
108 class dump_cmd : public VOM::dump_cmd<vapi::Ip_unnumbered_dump>
114 dump_cmd() = default;
117 * Issue the command to VPP/HW
119 rc_t issue(connection& con);
121 * convert to string format for debug purposes
123 std::string to_string() const;
126 * Comparison operator - only used for UT
128 bool operator==(const dump_cmd& i) const;
136 }; // namespace ip_unnumbered_cmds
140 * fd.io coding-style-patch-verification: ON
143 * eval: (c-set-style "mozilla")