I pulled down the 10.4.5 sources and ran make under Windoze cygwin. Got the following message when it came to the nl-sock compile.
Code: Select all
gcc -m32 -Wall -pedantic -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DCYGWIN nl-sock.c
nl-sock.c:65:8: error: redefinition of ‘struct icmp’
/usr/include/netinet/icmp6.h:143:8: note: originally defined here
nl-sock.c:70:19: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘.’ token
nl-sock.c: In function ‘p_netConnect’:
nl-sock.c:433:9: warning: array subscript has type ‘char’
nl-sock.c: In function ‘p_netListen’:
nl-sock.c:1224:9: warning: array subscript has type ‘char’
nl-sock.c: In function ‘ping’:
nl-sock.c:1965:21: error: storage size of ‘filter’ isn’t known
nl-sock.c:2006:5: warning: implicit declaration of function ‘ICMP6_FILTER_SETPASSALL’
nl-sock.c:2007:36: error: ‘ICMP6_FILTER’ undeclared (first use in this function)
nl-sock.c:2007:36: note: each undeclared identifier is reported only once for each function it appears in
nl-sock.c:2090:17: error: dereferencing pointer to incomplete type
nl-sock.c:2090:32: error: ‘ICMP6_ECHO_REQUEST’ undeclared (first use in this function)
nl-sock.c:2091:17: error: dereferencing pointer to incomplete type
nl-sock.c:2092:49: error: dereferencing pointer to incomplete type
nl-sock.c:2098:16: error: ‘struct icmp’ has no member named ‘icmp_hun’
nl-sock.c:2155:16: error: dereferencing pointer to incomplete type
nl-sock.c:2155:32: error: ‘ICMP6_ECHO_REPLY’ undeclared (first use in this function)
nl-sock.c:2156:16: error: dereferencing pointer to incomplete type
nl-sock.c:2157:59: error: dereferencing pointer to incomplete type
nl-sock.c:2162:15: error: ‘struct icmp’ has no member named ‘icmp_hun’
nl-sock.c:1965:21: warning: unused variable ‘filter’
makefile_cygwin:22: recipe for target `nl-sock.o' failed
make: *** [nl-sock.o] Error 1
Code: Select all
#ifdef CYGWIN
#include <netinet/icmp6.h> /* not on Cygwin, get from other OS */
#define ICMP_ECHO 8
struct icmp
{
unsigned char icmp_type;
unsigned char icmp_code;
unsigned short icmp_cksum;
unsigned short icmp_id;
unsigned short icmp_seq;
};
#endif
Code: Select all
struct icmp
{
u_int8_t icmp_type; /* type of message, see below */
u_int8_t icmp_code; /* type sub code */
u_int16_t icmp_cksum; /* ones complement checksum of struct */
union
{
u_char ih_pptr; /* ICMP_PARAMPROB */
struct in_addr ih_gwaddr; /* gateway address */
struct ih_idseq /* echo datagram */
{
u_int16_t icd_id;
u_int16_t icd_seq;
} ih_idseq;
u_int32_t ih_void;
/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
struct ih_pmtu
{
u_int16_t ipm_void;
u_int16_t ipm_nextmtu;
} ih_pmtu;
struct ih_rtradv
{
u_int8_t irt_num_addrs;
u_int8_t irt_wpa;
u_int16_t irt_lifetime;
} ih_rtradv;
} icmp_hun;
#define icmp_pptr icmp_hun.ih_pptr
#define icmp_gwaddr icmp_hun.ih_gwaddr
#define icmp_id icmp_hun.ih_idseq.icd_id
#define icmp_seq icmp_hun.ih_idseq.icd_seq
#define icmp_void icmp_hun.ih_void
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
union
{
struct
{
u_int32_t its_otime;
u_int32_t its_rtime;
u_int32_t its_ttime;
} id_ts;
struct
{
struct ip idi_ip;
/* options and then 64 bits of data */
} id_ip;
struct icmp_ra_addr id_radv;
u_int32_t id_mask;
u_int8_t id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
#define icmp_rtime icmp_dun.id_ts.its_rtime
#define icmp_ttime icmp_dun.id_ts.its_ttime
#define icmp_ip icmp_dun.id_ip.idi_ip
#define icmp_radv icmp_dun.id_radv
#define icmp_mask icmp_dun.id_mask
#define icmp_data icmp_dun.id_data
};
Thanks! --Rick