[Javanetsim-cvs] IceScan/icesockets crawsocket.h, 1.18, 1.19 sock_eth.h, 1.4, 1.5 sock_name.h, 1.10
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-17 18:49:59
|
Update of /cvsroot/javanetsim/IceScan/icesockets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26141/icesockets Modified Files: crawsocket.h sock_eth.h sock_name.h sock_types.h Log Message: Index: sock_types.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_types.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** sock_types.h 17 Dec 2006 14:23:15 -0000 1.20 --- sock_types.h 17 Dec 2006 18:49:55 -0000 1.21 *************** *** 195,203 **** tcp_seq th_ack; /* acknowledgement number */ #if BYTE_ORDER == LITTLE_ENDIAN ! u_int th_x2:4, /* (unused) */ ! th_off:4; /* data offset */ #else if BYTE_ORDER == BIG_ENDIAN ! u_int th_off:4, /* data offset */ ! th_x2:4; /* (unused) */ #endif u_char th_flags; --- 195,203 ---- tcp_seq th_ack; /* acknowledgement number */ #if BYTE_ORDER == LITTLE_ENDIAN ! u_char th_x2:4, /* (unused) */ ! th_off:4; /* data offset */ #else if BYTE_ORDER == BIG_ENDIAN ! u_char th_off:4, /* data offset */ ! th_x2:4; /* (unused) */ #endif u_char th_flags; *************** *** 342,352 **** { #if __BYTE_ORDER == __LITTLE_ENDIAN ! unsigned int ihl:4; ! unsigned int version:4; #elif __BYTE_ORDER == __BIG_ENDIAN ! unsigned int version:4; ! unsigned int ihl:4; #else ! # error "Please fix <bits/endian.h>" #endif my_uint8_t tos; --- 342,352 ---- { #if __BYTE_ORDER == __LITTLE_ENDIAN ! unsigned char ihl:4; ! unsigned char version:4; #elif __BYTE_ORDER == __BIG_ENDIAN ! unsigned char version:4; ! unsigned char ihl:4; #else ! # error "Please fix <bits/endian.h>" #endif my_uint8_t tos; Index: crawsocket.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/crawsocket.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** crawsocket.h 17 Dec 2006 15:51:54 -0000 1.18 --- crawsocket.h 17 Dec 2006 18:49:55 -0000 1.19 *************** *** 201,205 **** }else if ((res = sendto(destination.c_str(), packet, ntohs(ip->tot_len), 0)) == -1) { ! perror("sendto in send_tcp_raw"); #ifdef WIN32 free(packet); --- 201,205 ---- }else if ((res = sendto(destination.c_str(), packet, ntohs(ip->tot_len), 0)) == -1) { ! perror("sendto in send_tcp_raw"); #ifdef WIN32 free(packet); *************** *** 208,212 **** } - #ifdef WIN32 free(packet); --- 208,211 ---- Index: sock_name.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_name.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sock_name.h 16 Dec 2006 20:44:18 -0000 1.10 --- sock_name.h 17 Dec 2006 18:49:55 -0000 1.11 *************** *** 106,110 **** int len = make_sockname(saddr, nisname.c_str(), 53, AF_INET); ! if( (rc = getnameinfo((sockaddr *) &saddr, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) < 0) { //perror("getnameinfo"); return -1; --- 106,110 ---- int len = make_sockname(saddr, nisname.c_str(), 53, AF_INET); ! if( (rc = getnameinfo((sockaddr *) &saddr, len, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD)) != 0) { //CHECK IN LINUX/BSD!!! //perror("getnameinfo"); return -1; Index: sock_eth.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_eth.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sock_eth.h 17 Dec 2006 15:51:54 -0000 1.4 --- sock_eth.h 17 Dec 2006 18:49:55 -0000 1.5 *************** *** 2,17 **** #define _iceeth_H - /*#ifdef WIN3 - #include "sock_types.h" - - int send_ip_packet(const void *buf, size_t len){ - ip_t *i = ip_open(); - - ip_send(i, buf, len); - - ip_close(i); - - return 0; - }*/ #ifdef __CYGWIN__ int send_ip_packet(const void *buf, size_t len){ --- 2,5 ---- *************** *** 154,158 **** iph = (struct ip_hdr *)buf; ! if ((ipi = i_lookup_ip_intf(ip, iph->ip_dst)) == NULL) { errno = EHOSTUNREACH; return (-1); --- 142,146 ---- iph = (struct ip_hdr *)buf; ! if ((ipi = i_lookup_ip_intf(ip, iph->ip_dst)) == NULL) { errno = EHOSTUNREACH; return (-1); *************** *** 216,220 **** --- 204,210 ---- } return (len); + #define ip_hl ip_hv&0x0f } + memcpy(frame + ETH_HDR_LEN, buf, len); i = ETH_HDR_LEN + len; *************** *** 222,227 **** return (-1); - #define ip_hl ip_hv&0x0f - return (len); } --- 212,215 ---- |