[Javanetsim-cvs] IceScan/icesockets crawsocket.h, 1.15, 1.16 sock_types.h, 1.19, 1.20 sock_win.h, 1
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-17 14:23:19
|
Update of /cvsroot/javanetsim/IceScan/icesockets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21646/icesockets Modified Files: crawsocket.h sock_types.h sock_win.h Log Message: Index: sock_types.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_types.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** sock_types.h 17 Dec 2006 11:46:35 -0000 1.19 --- sock_types.h 17 Dec 2006 14:23:15 -0000 1.20 *************** *** 4,7 **** --- 4,11 ---- #include "sock_win.h" + #ifndef __CYGWIN__ + #include <dnet.h> + #endif + #include <vector> #include <string> Index: crawsocket.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/crawsocket.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** crawsocket.h 17 Dec 2006 11:14:00 -0000 1.15 --- crawsocket.h 17 Dec 2006 14:23:15 -0000 1.16 *************** *** 3,6 **** --- 3,7 ---- #include "csocket.h" + #include "sock_eth.h" #include "sock_types.h" *************** *** 18,23 **** if(sid == -1){ ! this->sid = socket(domain, type, protocol); ! if(this->sid < 0) sockerror("socket"); else sstate = 0; }else{ --- 19,28 ---- if(sid == -1){ ! #ifdef WIN32 ! this->sid = WSASocket(domain, type, protocol, NULL, 0, 0); ! #else ! this->sid = socket(domain, type, protocol); ! #endif ! if(this->sid == SOCKET_ERROR) sockerror("socket"); else sstate = 0; }else{ *************** *** 140,144 **** struct tcphdr *tcp = (struct tcphdr *) (packet + sizeof(struct iphdr)); struct pseudo_header *pseudo = (struct pseudo_header *) (packet + sizeof(struct iphdr) - sizeof(struct pseudo_header)); ! int res; char myname[ICEMAXHOSTNAME + 1]; --- 145,149 ---- struct tcphdr *tcp = (struct tcphdr *) (packet + sizeof(struct iphdr)); struct pseudo_header *pseudo = (struct pseudo_header *) (packet + sizeof(struct iphdr) - sizeof(struct pseudo_header)); ! int res = -1; char myname[ICEMAXHOSTNAME + 1]; *************** *** 192,195 **** --- 197,201 ---- //print_tcppacket(packet,ntohs(ip->tot_len)); + #ifndef WIN32 if ((res = sendto(destination.c_str(), packet, ntohs(ip->tot_len), 0)) == -1) { *************** *** 198,201 **** --- 204,210 ---- return -1; } + #else + res = send_ip_packet(packet, ntohs(ip->tot_len)); + #endif free(packet); Index: sock_win.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_win.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sock_win.h 17 Dec 2006 12:14:35 -0000 1.5 --- sock_win.h 17 Dec 2006 14:23:15 -0000 1.6 *************** *** 19,22 **** --- 19,24 ---- #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "wpcap.lib") + #pragma comment(lib, "packet.lib") + #pragma comment(lib, "libdnet-stripped.lib") #pragma comment(lib, "iphlpapi.lib") #ifndef __NO_LIBPCRE__ |