Windows: restructure daemon state tracking
[openafs.git] / tests / common / network.c
index e605b28..5611003 100644 (file)
@@ -1,44 +1,44 @@
 #include <afsconfig.h>
 #include <afs/param.h>
+
+#include <roken.h>
+
 #include <afs/cellconfig.h>
 #include <rx/rx.h>
 
-#include <stdio.h>
-#include <unistd.h>
-#include <netdb.h>
-#include <string.h>
-
 #include <tests/tap/basic.h>
 #include "common.h"
 
-extern int h_errno;
-
-/*! Check if the current machine's hostname resolves to the loopback
+/*!
+ * Check if the current machine's hostname resolves to the loopback
  * network.
  */
 int
-afstest_IsLoopbackNetworkDefault(void) {
-  char hostname[MAXHOSTCHARS];
-  afs_uint32 addr;
-  struct hostent *host;
+afstest_IsLoopbackNetworkDefault(void)
+{
+    char hostname[MAXHOSTCHARS];
+    afs_uint32 addr;
+    struct hostent *host;
 
-  gethostname(hostname, sizeof(hostname));
-  host = gethostbyname(hostname);
-  memcpy(&addr, host->h_addr, sizeof(addr));
+    gethostname(hostname, sizeof(hostname));
+    host = gethostbyname(hostname);
+    memcpy(&addr, host->h_addr, sizeof(addr));
 
-  return(rx_IsLoopbackAddr(ntohl(addr)));
+    return(rx_IsLoopbackAddr(ntohl(addr)));
 }
 
-/*! Skips all TAP tests if the current machine's hostname resolves to the
+/*!
+ * Skips all TAP tests if the current machine's hostname resolves to the
  * loopback network.
  */
 int
-afstest_SkipTestsIfLoopbackNetIsDefault(void) {
-  int retval=0;
-  retval=afstest_IsLoopbackNetworkDefault();
-  if(retval==1) {
-    skip_all("Default IP address is on the loopback network!\n");
-  }
-
-  return retval;
+afstest_SkipTestsIfLoopbackNetIsDefault(void)
+{
+    int retval;
+
+    retval = afstest_IsLoopbackNetworkDefault();
+    if (retval == 1) {
+       skip_all("Default IP address is on the loopback network!\n");
+    }
+    return retval;
 }