1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 19:51:34 +01:00

PacketSender now throws on error. Fixed the documentation on several header files.

This commit is contained in:
Matias Fontanini
2012-10-19 12:01:34 -03:00
parent 15b58b4f37
commit abaa2bf926
20 changed files with 251 additions and 176 deletions

View File

@@ -39,8 +39,8 @@
#endif
#include "utils.h"
#include "pdu.h"
#include "ip.h"
#include "arp.h"
#include "ethernetII.h"
#include "endianness.h"
#include "network_interface.h"
#include "packet_sender.h"
@@ -114,8 +114,8 @@ bool Utils::resolve_hwaddr(const NetworkInterface &iface, IPv4Address ip,
{
IPv4Address my_ip;
NetworkInterface::Info info(iface.addresses());
std::auto_ptr<PDU> packet(ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr));
std::auto_ptr<PDU> response(sender.send_recv(*packet));
EthernetII packet = ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr);
std::auto_ptr<PDU> response(sender.send_recv(packet));
if(response.get()) {
ARP *arp_resp = response->find_pdu<ARP>();
if(arp_resp)
@@ -130,8 +130,8 @@ HWAddress<6> Utils::resolve_hwaddr(const NetworkInterface &iface, IPv4Address ip
{
IPv4Address my_ip;
NetworkInterface::Info info(iface.addresses());
std::auto_ptr<PDU> packet(ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr));
std::auto_ptr<PDU> response(sender.send_recv(*packet));
EthernetII packet = ARP::make_arp_request(iface, ip, info.ip_addr, info.hw_addr);
std::auto_ptr<PDU> response(sender.send_recv(packet));
if(response.get()) {
const ARP *arp_resp = response->find_pdu<ARP>();
if(arp_resp)