Solaris compile fixes.

This commit is contained in:
Patrik Stridvall 1999-11-10 20:21:37 +00:00 committed by Alexandre Julliard
parent 248c75e613
commit f11d29e2ca
1 changed files with 25 additions and 11 deletions

View File

@ -19,13 +19,17 @@
* - Using the winsock functions has not been tested. * - Using the winsock functions has not been tested.
*/ */
#include "config.h"
#define __USE_BSD #include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> # include <sys/socket.h>
#endif
#include <netdb.h> #include <netdb.h>
#include <netinet/in_systm.h> #include <netinet/in_systm.h>
#include <netinet/in.h> #ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#include <netinet/ip.h> #include <netinet/ip.h>
#include <netinet/ip_icmp.h> #include <netinet/ip_icmp.h>
#include <sys/time.h> #include <sys/time.h>
@ -33,7 +37,9 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <arpa/inet.h> #ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
@ -221,19 +227,19 @@ DWORD WINAPI IcmpSendEcho(
int len; int len;
/* Before we mess with the options, get the default values */ /* Before we mess with the options, get the default values */
len=sizeof(val); len=sizeof(val);
ISOCK_getsockopt(icp->sid,SOL_IP,IP_TTL,&val,&len); ISOCK_getsockopt(icp->sid,IPPROTO_IP,IP_TTL,(char *)&val,&len);
icp->default_opts.Ttl=val; icp->default_opts.Ttl=val;
len=sizeof(val); len=sizeof(val);
ISOCK_getsockopt(icp->sid,SOL_IP,IP_TOS,&val,&len); ISOCK_getsockopt(icp->sid,IPPROTO_IP,IP_TOS,(char *)&val,&len);
icp->default_opts.Tos=val; icp->default_opts.Tos=val;
/* FIXME: missing: handling of IP 'flags', and all the other options */ /* FIXME: missing: handling of IP 'flags', and all the other options */
} }
val=RequestOptions->Ttl; val=RequestOptions->Ttl;
ISOCK_setsockopt(icp->sid,SOL_IP,IP_TTL,&val,sizeof(val)); ISOCK_setsockopt(icp->sid,IPPROTO_IP,IP_TTL,(char *)&val,sizeof(val));
val=RequestOptions->Tos; val=RequestOptions->Tos;
ISOCK_setsockopt(icp->sid,SOL_IP,IP_TOS,&val,sizeof(val)); ISOCK_setsockopt(icp->sid,IPPROTO_IP,IP_TOS,(char *)&val,sizeof(val));
/* FIXME: missing: handling of IP 'flags', and all the other options */ /* FIXME: missing: handling of IP 'flags', and all the other options */
icp->default_opts.OptionsSize=IP_OPTS_CUSTOM; icp->default_opts.OptionsSize=IP_OPTS_CUSTOM;
@ -242,9 +248,9 @@ DWORD WINAPI IcmpSendEcho(
/* Restore the default options */ /* Restore the default options */
val=icp->default_opts.Ttl; val=icp->default_opts.Ttl;
ISOCK_setsockopt(icp->sid,SOL_IP,IP_TTL,&val,sizeof(val)); ISOCK_setsockopt(icp->sid,IPPROTO_IP,IP_TTL,(char *)&val,sizeof(val));
val=icp->default_opts.Tos; val=icp->default_opts.Tos;
ISOCK_setsockopt(icp->sid,SOL_IP,IP_TOS,&val,sizeof(val)); ISOCK_setsockopt(icp->sid,IPPROTO_IP,IP_TOS,(char *)&val,sizeof(val));
/* FIXME: missing: handling of IP 'flags', and all the other options */ /* FIXME: missing: handling of IP 'flags', and all the other options */
icp->default_opts.OptionsSize=IP_OPTS_DEFAULT; icp->default_opts.OptionsSize=IP_OPTS_DEFAULT;
@ -319,10 +325,18 @@ DWORD WINAPI IcmpSendEcho(
case ICMP_UNREACH: case ICMP_UNREACH:
switch (icmp_header->icmp_code) { switch (icmp_header->icmp_code) {
case ICMP_UNREACH_HOST: case ICMP_UNREACH_HOST:
#ifdef ICMP_UNREACH_HOST_UNKNOWN
case ICMP_UNREACH_HOST_UNKNOWN: case ICMP_UNREACH_HOST_UNKNOWN:
#endif
#ifdef ICMP_UNREACH_ISOLATED
case ICMP_UNREACH_ISOLATED: case ICMP_UNREACH_ISOLATED:
#endif
#ifdef ICMP_UNREACH_HOST_PROHIB
case ICMP_UNREACH_HOST_PROHIB: case ICMP_UNREACH_HOST_PROHIB:
#endif
#ifdef ICMP_UNREACH_TOSHOST
case ICMP_UNREACH_TOSHOST: case ICMP_UNREACH_TOSHOST:
#endif
ier->Status=IP_DEST_HOST_UNREACHABLE; ier->Status=IP_DEST_HOST_UNREACHABLE;
break; break;
case ICMP_UNREACH_PORT: case ICMP_UNREACH_PORT: