[Icescan-cvs] IceScan/icesockets cpcapreader.h, 1.12, 1.13 crouter.h, 1.10, 1.11
Status: Alpha
Brought to you by:
darkkey
From: ruttino <ru...@us...> - 2007-01-26 18:24:36
|
Update of /cvsroot/icescan/IceScan/icesockets In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1330/icesockets Modified Files: cpcapreader.h crouter.h Log Message: RTT timeouts expiring and options like --rtt-max_timeout/min_timeout/ini_timeout --scan-delay Index: cpcapreader.h =================================================================== RCS file: /cvsroot/icescan/IceScan/icesockets/cpcapreader.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cpcapreader.h 14 Jan 2007 09:52:29 -0000 1.12 --- cpcapreader.h 26 Jan 2007 18:24:33 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- pcap_t* p; + /// LINK TYPE OF THE INTERFACE + int link_type; + public: *************** *** 26,30 **** pcap_block(p, block); ! if(filter_exp) pcap_filter(p, filter_exp); } --- 29,37 ---- pcap_block(p, block); ! if(filter_exp) ! pcap_filter(p, filter_exp); ! ! /// get LINK TYPE OF THE INTERFACE ! link_type = pcap_datalink(p); } *************** *** 37,40 **** --- 44,72 ---- } + u_long get_speed_device(){ + u_long out = 0; + + switch(link_type){ + case DLT_EN10MB: /* Ethernet (10Mb) */ + out = 10000000; + break; + case DLT_EN3MB: /* Experimental Ethernet (3Mb) */ + out = 30000000; + break; + case DLT_AX25: /* Amateur Radio AX.25 */ + case DLT_PRONET: /* Proteon ProNET Token Ring */ + case DLT_CHAOS: /* Chaos */ + case DLT_IEEE802: /* IEEE 802 Networks */ + case DLT_ARCNET: /* ARCNET, with BSD-style header */ + case DLT_FDDI: /* FDDI */ + case DLT_RAW: /* raw IP */ + case DLT_IEEE802_11: /* IEEE 802.11 wireless */ + out = 11000000; /* a/b/g */ + case DLT_FRELAY: + break; + } + return out; + } + void block(bool block){ pcap_block(p, block); Index: crouter.h =================================================================== RCS file: /cvsroot/icescan/IceScan/icesockets/crouter.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** crouter.h 18 Jan 2007 17:09:02 -0000 1.10 --- crouter.h 26 Jan 2007 18:24:33 -0000 1.11 *************** *** 26,29 **** --- 26,31 ---- public: + enum ROUTE_TYPE {ROUTE_UNKNOWN = 0,ROUTE_LAN,ROUTE_LOOPBACK,ROUTE_OTHER}; + crouter(std::map <int, struct net_interface> &i) : ifaces(i){ local_interface = 0; *************** *** 42,46 **** //make routing procedure for destination ip //returns iface number and source ip ! int route(const icestring &dst, icestring &src){ struct sockaddr_in dip; --- 44,48 ---- //make routing procedure for destination ip //returns iface number and source ip ! int route(const icestring &dst, icestring &src,int& type_route){ struct sockaddr_in dip; *************** *** 65,68 **** --- 67,72 ---- src.assign(dst); + type_route = crouter::ROUTE_LOOPBACK; + return local_interface ? local_interface : (*i).first; } *************** *** 71,74 **** --- 75,80 ---- src.assign((*i).second.ip); + + type_route = crouter::ROUTE_LAN; return (*i).first; *************** *** 94,97 **** --- 100,105 ---- src.assign(ifaces[routes[j].iface].ip); + type_route = crouter::ROUTE_OTHER; + return routes[j].iface; } |