tubik: Fix objdir builds
[openafs.git] / src / util / netutils.c
index 4ff10a0..41e4773 100644 (file)
 #include <afs/param.h>
 #endif
 
-RCSID
-    ("$Header$");
 
 #include <stdlib.h>
 #include <stdio.h>
-#ifdef HAVE_STRING_H
 #include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
 #include <ctype.h>
 #ifdef KERNEL
 #include "afs/sysincludes.h"
 #include "afsincludes.h"
 #else
+#ifdef AFS_NT40_ENV
+#include <winsock2.h>
+#else 
 #ifdef __FreeBSD__
 #include <sys/types.h>
 #endif
 #include <netinet/in.h>
-#include <errno.h>
 #include <sys/errno.h>
 #endif
+#include <errno.h>
+#endif
+
+#include <rx/rx.h>
 
 #include "assert.h"
 #include "afsutil.h"
-#include "dirpath.h"
+#include <afs/dirpath.h>
 
 #define AFS_IPINVALID        0xffffffff        /* invalid IP address */
 #define AFS_IPINVALIDIGNORE  0xfffffffe        /* no input given to extractAddr */
 #define MAX_NETFILE_LINE       2048    /* length of a line in the netrestrict file */
 #define MAXIPADDRS             1024    /* from afsd.c */
 
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK (afs_uint32)0x7f000001
-#endif
-
+int ParseNetInfoFile_int(afs_uint32 *, afs_uint32 *, afs_uint32 *,
+                         int, char reason[], const char *,
+                         int);
 /* 
  * The line parameter is a pointer to a buffer containing a string of 
  * bytes of the form 
@@ -119,7 +116,7 @@ extract_Addr(char *line, int maxSize)
  * caller can choose to ignore the entire file but should write
  * something to a log file).
  *
- * All addresses should be in NBO (as returned by rx_getAllAddr() and
+ * All addresses should be in NBO (as returned by rx_getAllAddrMaskMtu() and
  * parsed by extract_Addr().
  */
 /*
@@ -157,7 +154,7 @@ parseNetRestrictFile_int(afs_uint32 outAddrs[], afs_uint32 * mask,
     strcpy(reason, "");
 
     /* get all network interfaces from the kernel */
-    neaddrs = rxi_getAllAddrMaskMtu(eAddrs, eMask, eMtu, MAXIPADDRS);
+    neaddrs = rx_getAllAddrMaskMtu(eAddrs, eMask, eMtu, MAXIPADDRS);
     if (neaddrs <= 0) {
        sprintf(reason, "No existing IP interfaces found");
        return -1;
@@ -272,7 +269,7 @@ ParseNetInfoFile_int(afs_uint32 * final, afs_uint32 * mask, afs_uint32 * mtu,
 
     /* get all network interfaces from the kernel */
     existNu =
-       rxi_getAllAddrMaskMtu(existingAddr, existingMask, existingMtu,
+       rx_getAllAddrMaskMtu(existingAddr, existingMask, existingMtu,
                              MAXIPADDRS);
     if (existNu < 0)
        return existNu;
@@ -411,7 +408,7 @@ filterAddrs(afs_uint32 addr1[], afs_uint32 addr2[], afs_uint32 mask1[],
        }
 
        /* Always mask loopback address */
-       if (found && addr1[i] == INADDR_LOOPBACK) 
+       if (found && rx_IsLoopbackAddr(addr1[i]))
            found = 0;
 
        if (found) {