Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ip: Protocol Independent IP Neighbors
[vpp.git]
/
extras
/
vom
/
vom
/
neighbour_cmds.cpp
diff --git
a/extras/vom/vom/neighbour_cmds.cpp
b/extras/vom/vom/neighbour_cmds.cpp
index
d43e508
..
d507bb7
100644
(file)
--- a/
extras/vom/vom/neighbour_cmds.cpp
+++ b/
extras/vom/vom/neighbour_cmds.cpp
@@
-16,24
+16,27
@@
#include "vom/neighbour_cmds.hpp"
#include "vom/api_types.hpp"
#include "vom/neighbour_cmds.hpp"
#include "vom/api_types.hpp"
+DEFINE_VAPI_MSG_IDS_IP_NEIGHBOR_API_JSON;
+
namespace VOM {
namespace neighbour_cmds {
namespace VOM {
namespace neighbour_cmds {
-create_cmd::create_cmd(HW::item<
bool
>& item,
+create_cmd::create_cmd(HW::item<
handle_t
>& item,
handle_t itf,
const mac_address_t& mac,
handle_t itf,
const mac_address_t& mac,
- const boost::asio::ip::address& ip_addr)
- : rpc_cmd(item)
+ const boost::asio::ip::address& ip_addr,
+ const neighbour::flags_t& flags)
+ : srpc_cmd(item)
, m_itf(itf)
, m_mac(mac)
, m_ip_addr(ip_addr)
, m_itf(itf)
, m_mac(mac)
, m_ip_addr(ip_addr)
-{
-}
+ , m_flags(flags)
+
{
}
bool
create_cmd::operator==(const create_cmd& other) const
{
return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) &&
bool
create_cmd::operator==(const create_cmd& other) const
{
return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) &&
- (m_itf == other.m_itf));
+ (m_itf == other.m_itf)
&& (m_flags == other.m_flags)
);
}
rc_t
}
rc_t
@@
-44,10
+47,10
@@
create_cmd::issue(connection& con)
auto& payload = req.get_request().get_payload();
payload.is_add = 1;
payload.neighbor.sw_if_index = m_itf.value();
auto& payload = req.get_request().get_payload();
payload.is_add = 1;
payload.neighbor.sw_if_index = m_itf.value();
- payload.neighbor.flags = IP_API_NEIGHBOR_FLAG_STATIC;
to_api(m_mac, payload.neighbor.mac_address);
to_api(m_ip_addr, payload.neighbor.ip_address);
to_api(m_mac, payload.neighbor.mac_address);
to_api(m_ip_addr, payload.neighbor.ip_address);
+ payload.neighbor.flags = to_api(m_flags);
VAPI_CALL(req.execute());
VAPI_CALL(req.execute());
@@
-65,16
+68,17
@@
create_cmd::to_string() const
return (s.str());
}
return (s.str());
}
-delete_cmd::delete_cmd(HW::item<
bool
>& item,
+delete_cmd::delete_cmd(HW::item<
handle_t
>& item,
handle_t itf,
const mac_address_t& mac,
handle_t itf,
const mac_address_t& mac,
- const boost::asio::ip::address& ip_addr)
- : rpc_cmd(item)
+ const boost::asio::ip::address& ip_addr,
+ const neighbour::flags_t& flags)
+ : srpc_cmd(item)
, m_itf(itf)
, m_mac(mac)
, m_ip_addr(ip_addr)
, m_itf(itf)
, m_mac(mac)
, m_ip_addr(ip_addr)
-{
-}
+ , m_flags(flags)
+
{
}
bool
delete_cmd::operator==(const delete_cmd& other) const
bool
delete_cmd::operator==(const delete_cmd& other) const
@@
-91,10
+95,10
@@
delete_cmd::issue(connection& con)
auto& payload = req.get_request().get_payload();
payload.is_add = 0;
payload.neighbor.sw_if_index = m_itf.value();
auto& payload = req.get_request().get_payload();
payload.is_add = 0;
payload.neighbor.sw_if_index = m_itf.value();
- payload.neighbor.flags = IP_API_NEIGHBOR_FLAG_STATIC;
to_api(m_mac, payload.neighbor.mac_address);
to_api(m_ip_addr, payload.neighbor.ip_address);
to_api(m_mac, payload.neighbor.mac_address);
to_api(m_ip_addr, payload.neighbor.ip_address);
+ payload.neighbor.flags = to_api(m_flags);
VAPI_CALL(req.execute());
VAPI_CALL(req.execute());
@@
-118,14
+122,12
@@
delete_cmd::to_string() const
dump_cmd::dump_cmd(const handle_t& hdl, const l3_proto_t& proto)
: m_itf(hdl)
, m_proto(proto)
dump_cmd::dump_cmd(const handle_t& hdl, const l3_proto_t& proto)
: m_itf(hdl)
, m_proto(proto)
-{
-}
+{}
dump_cmd::dump_cmd(const dump_cmd& d)
: m_itf(d.m_itf)
, m_proto(d.m_proto)
dump_cmd::dump_cmd(const dump_cmd& d)
: m_itf(d.m_itf)
, m_proto(d.m_proto)
-{
-}
+{}
bool
dump_cmd::operator==(const dump_cmd& other) const
bool
dump_cmd::operator==(const dump_cmd& other) const
@@
-140,7
+142,7
@@
dump_cmd::issue(connection& con)
auto& payload = m_dump->get_request().get_payload();
payload.sw_if_index = m_itf.value();
auto& payload = m_dump->get_request().get_payload();
payload.sw_if_index = m_itf.value();
- payload.
is_ipv6 = m_proto.is_ipv6(
);
+ payload.
af = to_api(m_proto
);
VAPI_CALL(m_dump->execute());
VAPI_CALL(m_dump->execute());