the alternative function for inet_aton

Polytropon freebsd at
Mon Jul 4 18:30:03 UTC 2011

On Mon, 4 Jul 2011 22:35:28 +0430, ahmad javadi wrote:
> hi
> I use " inet_aton"  function in the kernel socket programming but i have the
> following warrning:
> "crypto.c:63: warning: implicit declaration of function 'inet_aton'
> crypto.c:63: warning: nested extern declaration of  'inet_aton'
> "
> this function required that "<arpa/inet,h>" be included but this folder did
> not exit in the my freebsd.

Does the directory /usr/include/arpa _not_ exist, or just the
file inet.h in that directory? (If this is, your system include
files are incomplete.)

I also assume that "inet comma h" is a typo, and you've used
#include <arpa/inet.h> ("inet dot h") correctly. I also assume
you didn't modify the settings from where header files included
with #include <...> should be imported (cc -I).

Which FreeBSD version do you use? I'm using 7-STABLE here and
the file is present, it also contains the function prototype.

#define inet_aton               __inet_aton
int              inet_aton(const char *, struct in_addr *);

If you've installed the sources (at the correct version of the
OS you're using), you can find /usr/src/include/arpa with the
file, and you should be able to "make install" (not tested here)
from there to install arpa/inet.h into the correct location.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list