Index: /trunk/src/VBox/Devices/Network/slirp/misc.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/misc.c	(revision 41321)
+++ /trunk/src/VBox/Devices/Network/slirp/misc.c	(revision 41322)
@@ -25,8 +25,9 @@
  */
 
+#ifndef VBOX_NAT_TST_QUEUE
 #include <slirp.h>
 #include "zone.h"
 
-#ifndef HAVE_INET_ATON
+# ifndef HAVE_INET_ATON
 int
 inet_aton(const char *cp, struct in_addr *ia)
@@ -38,5 +39,5 @@
     return 1;
 }
-#endif
+# endif
 
 /*
@@ -48,5 +49,7 @@
     our_addr.s_addr = loopback_addr.s_addr;
 }
-
+#else /* VBOX_NAT_TST_QUEUE */
+# include "misc.h"
+#endif
 struct quehead
 {
@@ -78,5 +81,5 @@
 }
 
-
+#ifndef VBOX_NAT_TST_QUEUE
 /*
  * Set fd blocking and non-blocking
@@ -85,9 +88,9 @@
 fd_nonblock(int fd)
 {
-#ifdef FIONBIO
+# ifdef FIONBIO
     int opt = 1;
 
     ioctlsocket(fd, FIONBIO, &opt);
-#else
+# else /* !FIONBIO */
     int opt;
 
@@ -95,22 +98,22 @@
     opt |= O_NONBLOCK;
     fcntl(fd, F_SETFL, opt);
-#endif
-}
-
-#if !defined(VBOX_NAT_MEM_DEBUG) && defined(LOG_ENABLED)
-# undef LogFlowFunc
-# define LogFlowFunc(x)
-
-# undef LogFlowFuncEnter
-# define LogFlowFuncEnter()
-
-# undef LogFlowFuncLeave
-# define LogFlowFuncLeave()
-
-# undef Log2
-# define Log2(x)
-#else
+# endif
+}
+
+# if !defined(VBOX_NAT_MEM_DEBUG) && defined(LOG_ENABLED)
+#  undef LogFlowFunc
+#  define LogFlowFunc(x)
+
+#  undef LogFlowFuncEnter
+#  define LogFlowFuncEnter()
+
+#  undef LogFlowFuncLeave
+#  define LogFlowFuncLeave()
+
+#  undef Log2
+#  define Log2(x)
+# else /* VBOX_NAT_MEM_DEBUG */
 # define NAT_MEM_LOG_ENABLED
-#endif
+# endif
 
 
@@ -150,9 +153,9 @@
 
     LogFlowFunc(("ENTER: %R[mzone], size:%d, pflags:%p, %RTbool\n", zone, size, pflags, fWait));
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(size);
     NOREF(pflags);
     NOREF(fWait);
-#endif
+# endif
     RTCritSectEnter(&zone->csZone);
     for (;;)
@@ -228,8 +231,8 @@
     struct item *it;
     uma_zone_t zone;
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(size);
     NOREF(flags);
-#endif
+# endif
 
     Assert(item);
@@ -263,8 +266,8 @@
 {
     uma_zone_t zone = NULL;
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(flags1);
     NOREF(flags2);
-#endif
+# endif
     LogFlowFunc(("ENTER: name:%s size:%d, ctor:%p, dtor:%p, init:%p, fini:%p, flags1:%RX32, flags2:%RX32\n",
                 name, ctor, dtor, init, fini, flags1, flags2));
@@ -354,7 +357,7 @@
     reference counters */
     struct item *it = NULL;
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(zone);
-#endif
+# endif
     LogFlowFunc(("ENTER: zone:%R[mzone], mem:%p\n", zone, mem));
     it = (struct item *)mem; /* 1st element */
@@ -370,7 +373,7 @@
 {
     void *mem;
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(how);
-#endif
+# endif
     Assert(zone->magic == ZONE_MAGIC);
     LogFlowFunc(("ENTER: zone:%R[mzone], args:%p, how:%RX32\n", zone, args, how));
@@ -406,7 +409,7 @@
     Assert((mem));
     LogFlowFunc(("ENTER: zone:%R[mzone], mem:%p, flags:%p\n", zone, mem, flags));
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(flags);
-#endif
+# endif
 
     RTCritSectEnter(&zone->csZone);
@@ -466,7 +469,7 @@
     LogFlowFunc(("ENTER: mem:%p, arg:%p\n", mem, arg));
     Assert(mem);
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(arg);
-#endif
+# endif
     RTMemFree(mem);
     LogFlowFuncLeave();
@@ -475,8 +478,8 @@
 void *uma_zalloc(uma_zone_t zone, int len)
 {
-#ifndef NAT_MEM_LOG_ENABLED
+# ifndef NAT_MEM_LOG_ENABLED
     NOREF(zone);
     NOREF(len);
-#endif
+# endif
     LogFlowFunc(("ENTER: zone:%R[mzone], len:%d\n", zone, len));
     LogFlowFunc(("LEAVE: NULL"));
@@ -542,5 +545,5 @@
 {
     LogFlowFuncEnter();
-#define ZONE_DESTROY(zone) do { zone_destroy((zone)); (zone) = NULL;} while (0)
+# define ZONE_DESTROY(zone) do { zone_destroy((zone)); (zone) = NULL;} while (0)
     ZONE_DESTROY(pData->zone_clust);
     ZONE_DESTROY(pData->zone_pack);
@@ -549,5 +552,5 @@
     ZONE_DESTROY(pData->zone_jumbo9);
     ZONE_DESTROY(pData->zone_jumbo16);
-#undef ZONE_DESTROY
+# undef ZONE_DESTROY
     /** @todo do finalize here.*/
     LogFlowFuncLeave();
@@ -563,2 +566,3 @@
     if_mru = 1500;
 }
+#endif /* VBOX_NAT_TST_QUEUE */
Index: /trunk/src/VBox/Devices/Network/slirp/misc.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/misc.h	(revision 41321)
+++ /trunk/src/VBox/Devices/Network/slirp/misc.h	(revision 41322)
@@ -28,8 +28,12 @@
 #define _MISC_H_
 
+#ifdef VBOX_NAT_TST_QUEUE
+typedef void *PNATState;
+#endif
 
-void getouraddr (PNATState);
 void slirp_insque  (PNATState, void *, void *);
 void slirp_remque  (PNATState, void *);
+# ifndef VBOX_NAT_TST_QUEUE
+void getouraddr (PNATState);
 void fd_nonblock (int);
 
@@ -68,4 +72,7 @@
 void slirp_null_arg_free(void *, void *);
 void m_fini(PNATState pData);
-
+# else /* VBOX_NAT_TST_QUEUE */
+#  define insque slirp_insque
+#  define remque slirp_remque
+# endif
 #endif
