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_NEIGHBOUR_CMDS_H__
17 #define __VOM_NEIGHBOUR_CMDS_H__
19 #include "vom/dump_cmd.hpp"
20 #include "vom/srpc_cmd.hpp"
21 #include "neighbour.hpp"
23 #include <vapi/ip_neighbor.api.vapi.hpp>
26 namespace neighbour_cmds {
29 * A command class that creates or updates the bridge domain ARP Entry
31 class create_cmd : public srpc_cmd<vapi::Ip_neighbor_add_del>
37 create_cmd(HW::item<handle_t>& item,
39 const mac_address_t& mac,
40 const boost::asio::ip::address& ip_addr,
41 const neighbour::flags_t &flags);
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;
61 boost::asio::ip::address m_ip_addr;
62 const neighbour::flags_t &m_flags;
66 * A cmd class that deletes a bridge domain ARP entry
68 class delete_cmd : public srpc_cmd<vapi::Ip_neighbor_add_del>
74 delete_cmd(HW::item<handle_t>& item,
76 const mac_address_t& mac,
77 const boost::asio::ip::address& ip_addr,
78 const neighbour::flags_t &flags);
81 * Issue the command to VPP/HW
83 rc_t issue(connection& con);
86 * convert to string format for debug purposes
88 std::string to_string() const;
91 * Comparison operator - only used for UT
93 bool operator==(const delete_cmd& i) const;
98 boost::asio::ip::address m_ip_addr;
99 const neighbour::flags_t &m_flags;
103 * A cmd class that Dumps all the neighbours
105 class dump_cmd : public VOM::dump_cmd<vapi::Ip_neighbor_dump>
111 dump_cmd(const handle_t& itf, const l3_proto_t& proto);
112 dump_cmd(const dump_cmd& d);
115 * Issue the command to VPP/HW
117 rc_t issue(connection& con);
119 * convert to string format for debug purposes
121 std::string to_string() const;
124 * Comparison operator - only used for UT
126 bool operator==(const dump_cmd& i) const;
135 * The interface to dump
145 }; // namespace neighbour_cmds