mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
PacketSender now throws on error. Fixed the documentation on several header files.
This commit is contained in:
@@ -19,7 +19,7 @@ portscan:
|
||||
$(CXX) portscan.cpp -o portscan $(CXXFLAGS) $(LDFLAGS) -lpthread
|
||||
|
||||
traceroute:
|
||||
$(CXX) traceroute.cpp -o traceroute -std=c++0x $(CXXFLAGS) $(LDFLAGS)
|
||||
$(CXX) traceroute.cpp -o traceroute -std=c++0x $(CXXFLAGS) $(LDFLAGS) -lpthread
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDE) $< -o $@
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ private:
|
||||
// ICMPs are icmp-requests by default
|
||||
IP ip(addr, iface.addresses().ip_addr, new ICMP());
|
||||
// We'll find at most 10 hops.
|
||||
|
||||
for(auto i = 1; i <= 10; ++i) {
|
||||
// Set this "unique" id
|
||||
ip.id(i);
|
||||
|
||||
Reference in New Issue
Block a user