1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-24 19:21:35 +01:00

Added PDU::rfind_pdu.

This commit is contained in:
Matias Fontanini
2013-04-19 22:27:48 -03:00
parent 91bdcca577
commit 2ea952d6ab
8 changed files with 83 additions and 22 deletions

View File

@@ -117,11 +117,7 @@ bool resolve_hwaddr(const NetworkInterface &iface, IPv4Address ip,
IPv4Address my_ip;
NetworkInterface::Info info(iface.addresses());
EthernetII packet = ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr);
#if TINS_IS_CXX11
std::unique_ptr<PDU> response(sender.send_recv(packet));
#else
std::auto_ptr<PDU> response(sender.send_recv(packet));
#endif
Internals::smart_ptr<PDU>::type response(sender.send_recv(packet));
if(response.get()) {
ARP *arp_resp = response->find_pdu<ARP>();
if(arp_resp)
@@ -137,12 +133,7 @@ HWAddress<6> resolve_hwaddr(const NetworkInterface &iface, IPv4Address ip, Packe
IPv4Address my_ip;
NetworkInterface::Info info(iface.addresses());
EthernetII packet = ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr);
#if TINS_IS_CXX11
std::unique_ptr<PDU>
#else
std::auto_ptr<PDU>
#endif
response(sender.send_recv(packet));
Internals::smart_ptr<PDU>::type response(sender.send_recv(packet));
if(response.get()) {
const ARP *arp_resp = response->find_pdu<ARP>();
if(arp_resp)