1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Added TCPStreamFollower class. It seems to be working right.

This commit is contained in:
Matias Fontanini
2012-09-04 23:20:32 -03:00
parent 832a79a1e1
commit 2aa4e10b91
8 changed files with 542 additions and 139 deletions

View File

@@ -93,15 +93,15 @@ private:
}
bool sniff_callback(PDU *pdu) {
IP *ip = pdu->find_inner_pdu<IP>();
RawPDU *raw = pdu->find_inner_pdu<RawPDU>();
IP *ip = pdu->find_pdu<IP>();
RawPDU *raw = pdu->find_pdu<RawPDU>();
if(ip && raw) {
ttl_map::const_iterator iter;
IP inner_ip;
// This will fail if its a corrupted packet
try {
// Fetch the IP PDU attached to the ICMP response
inner_ip = IP(raw->payload(), raw->header_size());
inner_ip = IP(&raw->payload()[0], raw->payload_size());
}
catch(std::runtime_error &ex) {
return running;