2 * networking-missing.c: Implements missing standard socket functions.
5 * Rodrigo Kumpera (kumpera@gmail.com)
10 #include <mono/utils/networking.h>
17 #ifndef HAVE_INET_PTON
20 inet_pton (int family, const char *address, void *inaddrp)
22 if (family == AF_INET) {
24 struct in_addr inaddr;
26 if (!inet_aton (address, &inaddr))
29 memcpy (inaddrp, &inaddr, sizeof (struct in_addr));
32 /* assume the system has inet_addr(), if it doesn't
33 have that we're pretty much screwed... */
36 if (!strcmp (address, "255.255.255.255")) {
37 /* special-case hack */
40 inaddr = inet_addr (address);
42 #define INADDR_NONE ((in_addr_t) -1)
44 if (inaddr == INADDR_NONE)
48 memcpy (inaddrp, &inaddr, sizeof (guint32));
50 #endif /* HAVE_INET_ATON */
56 #endif /* !HAVE_INET_PTON */