This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Missing inet_aton - Unsupported IP_HDRINCL

Hi guys
             I'm new to cygwin  so I am sorry if the topic is not new. I've
checked the ml files before asking but all i could find was a question about
the inet_aton stuff but there was no answer to it.

The problem is: I decided to port some short program that calls inet_aton.
The function proto is in the header included in cygwin package

unsigned long  inet_addr (const char *);
int   inet_aton (const char *, struct in_addr *);   <<<======== HERE
unsigned long  inet_lnaof (struct in_addr);
struct in_addr  inet_makeaddr (unsigned long , unsigned long);
unsigned int  inet_netof (struct in_addr);
unsigned int  inet_network (const char *);
char  *inet_ntoa (struct in_addr);

but the object code is not in the respective lib ...then (heh) when i try to
compile that i get an undefined ref error msg:
hev@YEEHA ~
$ gcc -o injection.exe injection.c
injection.c: In function `main':
injection.c:372: warning: return type of `main' is not `int'
/cygdrive/c/WIN95/TEMP/ccBKKgud.o(.text+0x442):injection.c: undefined
referenceto `inet_aton'
collect2: ld returned 1 exit status

The same error was detected in versions and of cygwin but i
guess the problem is with the gcc port (my current version is 2.95.2-4 but
it was the same with 2 precedent versions i already deleted) . I grabbed the
source code for that function from some other package and included it in my
source file with satisfactory results but what makes me wonder is the fact
that the same function is missing in both cygwin and uwin? Does anyone know
if there is some obscure reason for that i don't know of?

Now lets go to the IP_HDRINCL (this has to do with cygwin (blame on
Miscros**t) ). IP_HDRINCL is undeclared so i decided to declare it but
cygwins dll complaints about this being an invalid argument for setsockopt,
which is reasonable. 1)does it have something to do with most of the windows
platforms (lets say winsocks) not supporting this option? 2)Ive read only
Windows 2000 (not even NT) supports IP_HDRINCL. Has anyone tried it on W2K?
(I don't have any computer running W2K handy right now so i couldnt test it
by myself and i'd like to know before installing it). 3)Does anyone know of
some relatively simple or ready-made workaround for this limitation?

Regards, Hugo Voras
MetroStar S.R.L.

"Blink your eyelids periodically to lubricate your eyes."    - Page 16 of
the HP "Environmental, Health Safety Handbook for Employees"

Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]