Index: /trunk/src/VBox/Devices/Network/slirp/ext.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/ext.h	(revision 22894)
+++ /trunk/src/VBox/Devices/Network/slirp/ext.h	(revision 22894)
@@ -0,0 +1,89 @@
+/** $Id$ */
+/** @file
+ * some externals helpers
+ */
+
+/*
+ * Copyright (C) 2007 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+#ifdef VBOX_WITH_SLIRP_BSD_MBUF
+# ifndef IN_BSD
+#  define zone_mbuf slirp_zone_mbuf(pData)
+#  define zone_clust slirp_zone_clust(pData)
+#  define zone_pack slirp_zone_pack(pData)
+#  define zone_jumbop slirp_zone_jumbop(pData)
+#  define zone_jumbo9 slirp_zone_jumbo9(pData)
+#  define zone_jumbo16 slirp_zone_jumbo16(pData)
+#  define zone_ext_refcnt slirp_zone_ext_refcnt(pData)
+static inline uma_zone_t slirp_zone_mbuf(PNATState);
+static inline uma_zone_t slirp_zone_clust(PNATState);
+static inline uma_zone_t slirp_zone_pack(PNATState);
+static inline uma_zone_t slirp_zone_jumbop(PNATState);
+static inline uma_zone_t slirp_zone_jumbo9(PNATState);
+static inline uma_zone_t slirp_zone_jumbo16(PNATState);
+static inline uma_zone_t slirp_zone_ext_refcnt(PNATState);
+# else
+#  undef zone_mbuf
+#  undef zone_clust
+#  undef zone_pack
+#  undef zone_jumbop
+#  undef zone_jumbo9
+#  undef zone_jumbo16
+#  undef zone_ext_refcnt
+
+#  define zone_mbuf pData->zone_mbuf
+#  define zone_clust pData->zone_clust
+#  define zone_pack pData->zone_pack
+#  define zone_jumbop pData->zone_jumbop
+#  define zone_jumbo9 pData->zone_jumbo9
+#  define zone_jumbo16 pData->zone_jumbo16
+#  define zone_ext_refcnt pData->zone_ext_refcnt
+# endif
+#endif
+
+#ifndef _EXT_H_
+#define _EXT_H_
+#ifndef vbox_slirp_printfV
+static void vbox_slirp_printV(char *format, va_list args)
+{
+    char buffer[1024];
+    memset(buffer, 0, 1024);
+    RTStrPrintfV(buffer, 1024, format, args);
+
+    Log2(("NAT:EXT: %s\n", buffer));
+}
+#endif
+
+#ifndef vbox_slirp_printf
+static void vbox_slirp_printf(char *format, ...)
+{
+    va_list args;
+    va_start(args, format);
+    vbox_slirp_printV(format, args);
+    va_end(args);
+}
+#endif
+
+#ifndef vbox_slirp_fprintf
+static void vbox_slirp_fprintf(void *ignored, char *format, ...)
+{
+    va_list args;
+    va_start(args, format);
+    vbox_slirp_printV(format, args);
+    va_end(args);
+}
+#endif
+#endif
Index: /trunk/src/VBox/Devices/Network/slirp/slirp.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/slirp.h	(revision 22893)
+++ /trunk/src/VBox/Devices/Network/slirp/slirp.h	(revision 22894)
@@ -264,5 +264,11 @@
 
 /* cksum.c */
+#ifndef VBOX_WITH_SLIRP_BSD_MBUF
 int cksum(struct mbuf *m, int len);
+#else
+typedef uint16_t u_short;
+typedef unsigned int u_int;
+#include "in_cksum.h"
+#endif
 
 /* if.c */
@@ -358,5 +364,9 @@
 
 # ifdef alias_addr
-#  error  alias_addr has already defined!!!
+#  ifndef VBOX_SLIRP_BSD
+#   error alias_addr has already defined!!!
+#  else
+#   undef alias_addr
+#  endif
 # endif
 
@@ -390,31 +400,35 @@
 # define fprintf vbox_slirp_fprintf
 # define printf vbox_slirp_printf
-static void vbox_slirp_printV(char *format, va_list args)
+# include "ext.h"
+#endif /*VBOX_SLIRP_ALIAS*/
+
+#ifdef VBOX_WITH_SLIRP_BSD_MBUF
+/* @todo might be useful to make it configurable, 
+ * especially in terms of Intnet behind NAT
+ */
+# define maxusers 32 
+# define max_protohdr 0
+/* @todo (r=vvl) for now ignore value,
+ * latter here should be fetching of tuning parameters entered
+ */
+# define TUNABLE_INT_FETCH(name, pval) do { } while (0)
+# define SYSCTL_PROC(a0, a1, a2, a3, a4, a5, a6, a7, a8)
+# define SYSCTL_STRUCT(a0, a1, a2, a3, a4, a5, a6)
+# define SYSINIT(a0, a1, a2, a3, a4)
+# define sysctl_handle_int(a0, a1, a2, a3) 0
+# define EVENTHANDLER_INVOKE(a) do{}while(0)
+# define EVENTHANDLER_REGISTER(a0, a1, a2, a3) do{}while(0)
+# define KASSERT AssertMsg
+
+struct dummy_req
 {
-    char buffer[1024];
-    memset(buffer, 0, 1024);
-    RTStrPrintfV(buffer, 1024, format, args);
-
-# if defined(DEBUG_vvl)
-    LogRel(("NAT:ALIAS: %s\n", buffer));
-# else
-    Log2(("NAT:ALIAS: %s\n", buffer));
-# endif
-}
-static void vbox_slirp_printf(char *format, ...)
-{
-    va_list args;
-    va_start(args, format);
-    vbox_slirp_printV(format, args);
-    va_end(args);
-}
-static void vbox_slirp_fprintf(void *ignored, char *format, ...)
-{
-    va_list args;
-    va_start(args, format);
-    vbox_slirp_printV(format, args);
-    va_end(args);
-}
-#endif /*VBOX_SLIRP_ALIAS*/
+    void *newptr;
+};
+  
+#define SYSCTL_HANDLER_ARGS PNATState pData, void *oidp, struct dummy_req *req
+
+void	mbuf_init(void *);
+# define cksum(m, len) in_cksum_skip((m), (len), 0)
+#endif
 
 int ftp_alias_load(PNATState);
