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_ARP_PROXY_CONFIG_CMDS_H__
17 #define __VOM_ARP_PROXY_CONFIG_CMDS_H__
19 #include "vom/arp_proxy_config.hpp"
20 #include "vom/dump_cmd.hpp"
21 #include "vom/rpc_cmd.hpp"
23 #include <vapi/ip.api.vapi.hpp>
26 namespace arp_proxy_config_cmds {
28 * A command class that adds the ARP Proxy config
30 class config_cmd : public rpc_cmd<HW::item<bool>, rc_t, vapi::Proxy_arp_add_del>
36 config_cmd(HW::item<bool>& item,
37 const boost::asio::ip::address_v4& lo,
38 const boost::asio::ip::address_v4& high);
41 * Issue the command to VPP/HW
43 rc_t issue(connection& con);
45 * convert to string format for debug purposes
47 std::string to_string() const;
50 * Comparison operator - only used for UT
52 bool operator==(const config_cmd& i) const;
58 const boost::asio::ip::address_v4 m_low;
59 const boost::asio::ip::address_v4 m_high;
63 * A cmd class that Unconfigs ArpProxy Config from an interface
66 : public rpc_cmd<HW::item<bool>, rc_t, vapi::Proxy_arp_add_del>
72 unconfig_cmd(HW::item<bool>& item,
73 const boost::asio::ip::address_v4& lo,
74 const boost::asio::ip::address_v4& hig);
77 * Issue the command to VPP/HW
79 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 unconfig_cmd& i) const;
94 const boost::asio::ip::address_v4 m_low;
95 const boost::asio::ip::address_v4 m_high;
99 * A cmd class that Dumps all the Proxy ARP configs
101 class dump_cmd : public VOM::dump_cmd<vapi::Proxy_arp_dump>
107 dump_cmd() = default;
110 * Issue the command to VPP/HW
112 rc_t issue(connection& con);
114 * convert to string format for debug purposes
116 std::string to_string() const;
119 * Comparison operator - only used for UT
121 bool operator==(const dump_cmd& i) const;
134 * fd.io coding-style-patch-verification: ON
137 * eval: (c-set-style "mozilla")