equal
deleted
inserted
replaced
28 #include <ctype.h> |
28 #include <ctype.h> |
29 #include <stdio.h> |
29 #include <stdio.h> |
30 #include <stdlib.h> |
30 #include <stdlib.h> |
31 #include <malloc.h> |
31 #include <malloc.h> |
32 #include <sys/types.h> |
32 #include <sys/types.h> |
|
33 #include <process.h> |
33 |
34 |
34 #include "java_net_InetAddress.h" |
35 #include "java_net_InetAddress.h" |
35 #include "java_net_Inet4AddressImpl.h" |
36 #include "java_net_Inet4AddressImpl.h" |
36 #include "net_util.h" |
37 #include "net_util.h" |
37 #include "icmp.h" |
38 #include "icmp.h" |
139 const char *hostname; |
140 const char *hostname; |
140 struct hostent *hp; |
141 struct hostent *hp; |
141 unsigned int addr[4]; |
142 unsigned int addr[4]; |
142 |
143 |
143 jobjectArray ret = NULL; |
144 jobjectArray ret = NULL; |
144 jclass byteArrayCls; |
|
145 |
145 |
146 if (!initialized) { |
146 if (!initialized) { |
147 ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); |
147 ni_iacls = (*env)->FindClass(env, "java/net/InetAddress"); |
148 ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); |
148 ni_iacls = (*env)->NewGlobalRef(env, ni_iacls); |
149 ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); |
149 ni_ia4cls = (*env)->FindClass(env, "java/net/Inet4Address"); |
313 /* Initialize the sequence number to a suitable random number and |
313 /* Initialize the sequence number to a suitable random number and |
314 shift right one place to allow sufficient room for increamenting. */ |
314 shift right one place to allow sufficient room for increamenting. */ |
315 seq = ((unsigned short)rand()) >> 1; |
315 seq = ((unsigned short)rand()) >> 1; |
316 |
316 |
317 /* icmp_id is a 16 bit data type, therefore down cast the pid */ |
317 /* icmp_id is a 16 bit data type, therefore down cast the pid */ |
318 pid = (u_short) getpid(); |
318 pid = (u_short) _getpid(); |
319 size = 60*1024; |
319 size = 60*1024; |
320 setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (const char *) &size, sizeof(size)); |
320 setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (const char *) &size, sizeof(size)); |
321 /** |
321 /** |
322 * A TTL was specified, let's set the socket option. |
322 * A TTL was specified, let's set the socket option. |
323 */ |
323 */ |