Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/net/rumptest Make build with PF_INET-is-the-"NIC" s...



details:   https://anonhg.NetBSD.org/src/rev/07b3c819ee00
branches:  trunk
changeset: 750940:07b3c819ee00
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Jan 19 17:51:03 2010 +0000

description:
Make build with PF_INET-is-the-"NIC" support again.

diffstat:

 sys/rump/net/rumptest/rumptest_net.c |  56 ++++++++++++++++++-----------------
 1 files changed, 29 insertions(+), 27 deletions(-)

diffs (91 lines):

diff -r 07080e616895 -r 07b3c819ee00 sys/rump/net/rumptest/rumptest_net.c
--- a/sys/rump/net/rumptest/rumptest_net.c      Tue Jan 19 16:24:44 2010 +0000
+++ b/sys/rump/net/rumptest/rumptest_net.c      Tue Jan 19 17:51:03 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumptest_net.c,v 1.14 2010/01/16 20:47:01 pooka Exp $  */
+/*     $NetBSD: rumptest_net.c,v 1.15 2010/01/19 17:51:03 pooka Exp $  */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -58,6 +58,8 @@
 #define DEST_ADDR "204.152.190.12"     /* www.NetBSD.org */
 #define DEST_PORT 80                   /* take a wild guess */
 
+static in_addr_t youraddr;
+
 #ifdef FULL_NETWORK_STACK
 /*
  * If we are running with the full networking stack, configure
@@ -79,7 +81,7 @@
 #define MYGW "10.181.181.1"
 #define IFNAME "virt0" /* XXX: hardcoded */
 
-static in_addr_t myaddr, youraddr;
+static in_addr_t myaddr;
 
 static void
 configure_interface(void)
@@ -178,31 +180,6 @@
                err(1, "routing incomplete");
        rump_sys_close(s);
 }
-#endif /* FULL_NETWORK_STACK */
-
-static void
-printstats(void)
-{
-       struct mbstat mbstat;
-       int ctl[] = { CTL_KERN, KERN_MBUF, MBUF_STATS };
-       int totalmbuf = 0;
-       size_t mbslen = sizeof(struct mbstat);
-       unsigned i;
-
-       if (rump_sys___sysctl(ctl, __arraycount(ctl), &mbstat, &mbslen,
-           NULL, 0) == -1)
-               return;
-
-       printf("  mbuf count:\n");
-       for (i = 0; i < __arraycount(mbstat.m_mtypes); i++) {
-               if (mbstat.m_mtypes[i] == 0)
-                       continue;
-               printf("%s (%d) mbuf count %d\n",
-                   i == MT_DATA ? "data" : "unknown", i, mbstat.m_mtypes[i]);
-               totalmbuf += mbstat.m_mtypes[i];
-       }
-       printf("total mbufs: %d\n", totalmbuf);
-}
 
 static void
 dobpfread(void)
@@ -315,6 +292,31 @@
                }
        }
 }
+#endif /* FULL_NETWORK_STACK */
+
+static void
+printstats(void)
+{
+       struct mbstat mbstat;
+       int ctl[] = { CTL_KERN, KERN_MBUF, MBUF_STATS };
+       int totalmbuf = 0;
+       size_t mbslen = sizeof(struct mbstat);
+       unsigned i;
+
+       if (rump_sys___sysctl(ctl, __arraycount(ctl), &mbstat, &mbslen,
+           NULL, 0) == -1)
+               return;
+
+       printf("  mbuf count:\n");
+       for (i = 0; i < __arraycount(mbstat.m_mtypes); i++) {
+               if (mbstat.m_mtypes[i] == 0)
+                       continue;
+               printf("%s (%d) mbuf count %d\n",
+                   i == MT_DATA ? "data" : "unknown", i, mbstat.m_mtypes[i]);
+               totalmbuf += mbstat.m_mtypes[i];
+       }
+       printf("total mbufs: %d\n", totalmbuf);
+}
 
 int
 main(int argc, char *argv[])



Home | Main Index | Thread Index | Old Index