1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 21:14:28 +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

@@ -80,8 +80,8 @@ int do_arp_spoofing(NetworkInterface iface, IPv4Address gw, IPv4Address victim,
EthernetII to_victim(iface, victim_hw, info.hw_addr, victim_arp);
while(true) {
// Just send them once every 5 seconds.
if(!sender.send(to_gw) || !sender.send(to_victim))
return 7;
sender.send(to_gw);
sender.send(to_victim);
sleep(5);
}
}
@@ -114,6 +114,12 @@ int main(int argc, char *argv[]) {
cout << ex.what() << endl;
return 3;
}
return do_arp_spoofing(iface, gw, victim, info);
try {
return do_arp_spoofing(iface, gw, victim, info);
}
catch(std::runtime_error &ex) {
std::cout << "Runtime error: " << ex.what() << std::endl;
return 7;
}
}