summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg>2006-03-19 22:03:29 +0000
committerjoerg <joerg>2006-03-19 22:03:29 +0000
commit724636ab3701c412a2206ad626807f003f15bbda (patch)
tree7a07053e652be435f50921a58ec1829362361cdc
parentd651396de7a63b53a6cf9ba037179d5aa96f9c84 (diff)
downloadpkgsrc-724636ab3701c412a2206ad626807f003f15bbda.tar.gz
Add DragonFly support. Bump revision due to PLIST changes.
-rw-r--r--net/net-snmp/Makefile5
-rw-r--r--net/net-snmp/PLIST3
-rw-r--r--net/net-snmp/distinfo28
-rw-r--r--net/net-snmp/files/dragonfly.h24
-rw-r--r--net/net-snmp/patches/patch-af128
-rw-r--r--net/net-snmp/patches/patch-ag16
-rw-r--r--net/net-snmp/patches/patch-am15
-rw-r--r--net/net-snmp/patches/patch-da12
-rw-r--r--net/net-snmp/patches/patch-db12
-rw-r--r--net/net-snmp/patches/patch-dc22
-rw-r--r--net/net-snmp/patches/patch-dd12
-rw-r--r--net/net-snmp/patches/patch-de313
-rw-r--r--net/net-snmp/patches/patch-df13
-rw-r--r--net/net-snmp/patches/patch-dg12
-rw-r--r--net/net-snmp/patches/patch-dh14
-rw-r--r--net/net-snmp/patches/patch-di10
-rw-r--r--net/net-snmp/patches/patch-dj13
-rw-r--r--net/net-snmp/patches/patch-dk16
-rw-r--r--net/net-snmp/patches/patch-dl16
-rw-r--r--net/net-snmp/patches/patch-dm167
-rw-r--r--net/net-snmp/patches/patch-dn70
-rw-r--r--net/net-snmp/patches/patch-do16
-rw-r--r--net/net-snmp/patches/patch-dp16
-rw-r--r--net/net-snmp/patches/patch-dq16
-rw-r--r--net/net-snmp/patches/patch-dr47
-rw-r--r--net/net-snmp/patches/patch-ds47
-rw-r--r--net/net-snmp/patches/patch-dt18
27 files changed, 1067 insertions, 14 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile
index d3164d19c08..fc2571f9ac7 100644
--- a/net/net-snmp/Makefile
+++ b/net/net-snmp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.47 2006/03/14 01:14:31 jlam Exp $
+# $NetBSD: Makefile,v 1.48 2006/03/19 22:03:29 joerg Exp $
DISTNAME= net-snmp-5.3.0.1
PKGREVISION= 2
@@ -93,6 +93,9 @@ REPLACE.bash.old= /bin/bash
REPLACE.bash.new= ${SH}
REPLACE_FILES.bash= local/mib2c-update
+post-extract:
+ ${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/include/net-snmp/system
+
post-wrapper:
.if !empty(MACHINE_PLATFORM:MNetBSD-1.5.[123]*-i386)
${MKDIR} ${BUILDLINK_DIR}/include/sys
diff --git a/net/net-snmp/PLIST b/net/net-snmp/PLIST
index 9b02fc230f1..68f14a3bde7 100644
--- a/net/net-snmp/PLIST
+++ b/net/net-snmp/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.13 2006/01/24 22:16:55 adam Exp $
+@comment $NetBSD: PLIST,v 1.14 2006/03/19 22:03:29 joerg Exp $
bin/encode_keychange
bin/fixproc
bin/ipf-mod.pl
@@ -143,6 +143,7 @@ include/net-snmp/system/cygwin.h
include/net-snmp/system/darwin.h
include/net-snmp/system/darwin7.h
include/net-snmp/system/darwin8.h
+include/net-snmp/system/dragonfly.h
include/net-snmp/system/dynix.h
include/net-snmp/system/freebsd.h
include/net-snmp/system/freebsd2.h
diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo
index 9f8bfb40df9..1ba514a752d 100644
--- a/net/net-snmp/distinfo
+++ b/net/net-snmp/distinfo
@@ -1,13 +1,33 @@
-$NetBSD: distinfo,v 1.21 2006/03/11 16:59:54 rillig Exp $
+$NetBSD: distinfo,v 1.22 2006/03/19 22:03:29 joerg Exp $
SHA1 (net-snmp-5.3.0.1.tar.gz) = c58ddabe4281c3681a268bd48de6865e812f2ec5
RMD160 (net-snmp-5.3.0.1.tar.gz) = 86b7e56b512faf73d2a08ac3df2def4560b62945
Size (net-snmp-5.3.0.1.tar.gz) = 4183370 bytes
SHA1 (patch-ae) = 750412088b9ccd5fb50bd6e7fc049903f6113a39
-SHA1 (patch-af) = 0a2819ff5113315a64de555e22c061bddc21b44e
-SHA1 (patch-ag) = 16ea17094d5d11de8d86f1f8808575dd0ae5d8e3
+SHA1 (patch-af) = f7c95d2276ccd8332e7dc39f2bf88c857bdfde9f
+SHA1 (patch-ag) = 9bad3789cfb12bb68c2b306e82600d866467471a
SHA1 (patch-aj) = eb17148368c9d02c0e589052b99003e7e21f2917
SHA1 (patch-al) = 2609e273d557e1ce06c1295d86965fe26ac7ff08
-SHA1 (patch-am) = 9a9ed6feb2f249b294d939a00e92d3ef9dbde21b
+SHA1 (patch-am) = 4db69b58419b809f7251d0ca555b3adb3e989710
SHA1 (patch-an) = 167f23c62c085efc96a25bc2be5dca3c746dde6f
+SHA1 (patch-da) = 7466445c8388492344acdee236b153cb5f5b45e1
+SHA1 (patch-db) = bec0bee1860ee42ba64b4c07df2280e206eaf582
+SHA1 (patch-dc) = 43e430f42c9f8a89c95a2eae91053805fa3e2373
+SHA1 (patch-dd) = 56957eaf21224d788baf315e35768d2c7b2f2c95
+SHA1 (patch-de) = f6e97f3cc60102c8542409a29fb744339569ef9f
+SHA1 (patch-df) = 3a82b023d3b284150562c66aa8f5c41c6c455367
+SHA1 (patch-dg) = 6e6e396add0613dd76e3b8618008a7ebf8103c7c
+SHA1 (patch-dh) = 1c88c853f867aa363f8995df8ab7023daaba6509
+SHA1 (patch-di) = e0e1039c1adbf10ae56c50998ff74b39193e7348
+SHA1 (patch-dj) = 392a5bcd7e63f0831fc6a6aa34904dd590b05703
+SHA1 (patch-dk) = fdd71ac507b0b589ae4464c2810300a5d2de17a0
+SHA1 (patch-dl) = 571b12bcdc1f801b47274d46a17b6e94294c0b4e
+SHA1 (patch-dm) = 05c182f5bc1751ea0a0bcc7e21f24684b3c4933a
+SHA1 (patch-dn) = 16c68c667c129c4fcccdbff704d7d25481691710
+SHA1 (patch-do) = 7a69e6e81cbddbb7fc610f4260fe521a5e4c2348
+SHA1 (patch-dp) = 3ecdfa78a5c7a86715d3fd3ab8bbd0208a0d685d
+SHA1 (patch-dq) = 619d94d9937098b684ee8d0f1a3a92dfdff2155c
+SHA1 (patch-dr) = ab75e5cf3448d9c0520b6e7d2c68adfbf3ab639b
+SHA1 (patch-ds) = b27b0dc9c0da0ab688f26e2821e90c145c6ae641
+SHA1 (patch-dt) = 0cbf8245fbb5475dc864acc4e7c1490095377a6e
SHA1 (patch-mib2cupdate) = d6773633c8737fe45a58e378967995e21012d21d
diff --git a/net/net-snmp/files/dragonfly.h b/net/net-snmp/files/dragonfly.h
new file mode 100644
index 00000000000..f6294b1735d
--- /dev/null
+++ b/net/net-snmp/files/dragonfly.h
@@ -0,0 +1,24 @@
+#include "freebsd.h"
+
+/*
+ * dragonfly is a superset of freebsd4
+ */
+#define freebsd2 1
+#define freebsd3 1
+#define freebsd4 1
+
+#undef IFADDR_SYMBOL
+#define IFADDR_SYMBOL "in_ifaddrhead"
+
+#undef PROC_SYMBOL
+#define PROC_SYMBOL "allproc"
+
+#undef NPROC_SYMBOL
+#define NPROC_SYMBOL "nprocs"
+
+#undef TOTAL_MEMORY_SYMBOL
+
+#undef MBSTAT_SYMBOL
+
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_next
diff --git a/net/net-snmp/patches/patch-af b/net/net-snmp/patches/patch-af
index 8aeb61b1488..85f694d9b86 100644
--- a/net/net-snmp/patches/patch-af
+++ b/net/net-snmp/patches/patch-af
@@ -1,7 +1,16 @@
-$NetBSD: patch-af,v 1.5 2006/01/24 22:16:55 adam Exp $
+$NetBSD: patch-af,v 1.6 2006/03/19 22:03:29 joerg Exp $
---- configure.orig 2006-01-14 02:51:51.000000000 +0100
+--- configure.orig 2006-01-14 01:51:51.000000000 +0000
+++ configure
+@@ -13421,7 +13421,7 @@ else
+ default_mibs=IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:HOST-RESOURCES-MIB:SNMPv2-MIB:RFC1213-MIB:NOTIFICATION-LOG-MIB:DISMAN-EVENT-MIB:DISMAN-SCHEDULE-MIB
+
+ case $target_os in
+- linux* | mingw32* | cygwin* | freebsd* | dynix* | solaris2* | hpux* )
++ linux* | mingw32* | cygwin* | freebsd* | dynix* | solaris2* | hpux* | dragonfly* )
+ new_module_list="$new_module_list host"
+ ;;
+ *)
@@ -15503,6 +15503,53 @@ fi
fi
@@ -56,3 +65,118 @@ $NetBSD: patch-af,v 1.5 2006/01/24 22:16:55 adam Exp $
# Check for libraries that the agent needs
# saving old libraries
NONAGENTLIBS=$LIBS
+@@ -27716,7 +27763,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -27814,7 +27863,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -27912,10 +27963,14 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+-#undef _KERNEL
++#if !defined(__DragonFly__)
++#define _KERNEL
++#endif
+ #include <net/route.h>
+
+
+@@ -27999,7 +28054,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28066,7 +28123,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28204,7 +28263,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28299,7 +28360,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28398,7 +28461,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28497,7 +28562,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -28596,7 +28663,9 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #endif
+ #include <sys/types.h>
+ #define KERNEL
++#if !defined(__DragonFly__)
+ #define _KERNEL
++#endif
+ #include <sys/socket.h>
+ #undef KERNEL
+ #undef _KERNEL
+@@ -34718,6 +34787,8 @@ do
+ _ACEOF
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
diff --git a/net/net-snmp/patches/patch-ag b/net/net-snmp/patches/patch-ag
index 9198fab106c..fac9a4ab6cc 100644
--- a/net/net-snmp/patches/patch-ag
+++ b/net/net-snmp/patches/patch-ag
@@ -1,6 +1,6 @@
-$NetBSD: patch-ag,v 1.6 2006/03/08 02:47:13 minskim Exp $
+$NetBSD: patch-ag,v 1.7 2006/03/19 22:03:29 joerg Exp $
---- agent/mibgroup/host/hr_storage.c.orig 2005-10-31 01:14:38.000000000 -0800
+--- agent/mibgroup/host/hr_storage.c.orig 2005-10-31 09:14:38.000000000 +0000
+++ agent/mibgroup/host/hr_storage.c
@@ -73,6 +73,13 @@
#endif
@@ -16,7 +16,14 @@ $NetBSD: patch-ag,v 1.6 2006/03/08 02:47:13 minskim Exp $
#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
#include <uvm/uvm_param.h>
#include <uvm/uvm_extern.h>
-@@ -86,13 +93,6 @@
+@@ -80,20 +87,13 @@
+ #include <vm/vm_param.h>
+ #include <vm/vm_extern.h>
+ #endif
++#endif
+ #if HAVE_KVM_H
+ #include <kvm.h>
+ #endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -27,9 +34,10 @@ $NetBSD: patch-ag,v 1.6 2006/03/08 02:47:13 minskim Exp $
-#else
-#undef HAVE_SYS_POOL_H
-#endif
- #endif
+-#endif
#if HAVE_SYS_MBUF_H
#include <sys/mbuf.h>
+ #endif
@@ -732,11 +732,6 @@ really_try_next:
case HRS_TYPE_SWAP:
long_return = -1;
diff --git a/net/net-snmp/patches/patch-am b/net/net-snmp/patches/patch-am
index 6f49d335228..94625796db9 100644
--- a/net/net-snmp/patches/patch-am
+++ b/net/net-snmp/patches/patch-am
@@ -1,6 +1,6 @@
-$NetBSD: patch-am,v 1.3 2006/01/24 22:16:55 adam Exp $
+$NetBSD: patch-am,v 1.4 2006/03/19 22:03:29 joerg Exp $
---- agent/mibgroup/host/hr_swrun.c.orig 2005-10-28 23:28:45.000000000 +0200
+--- agent/mibgroup/host/hr_swrun.c.orig 2005-10-28 21:28:45.000000000 +0000
+++ agent/mibgroup/host/hr_swrun.c
@@ -884,6 +884,8 @@ var_hrswrun(struct variable * vp,
else
@@ -11,3 +11,14 @@ $NetBSD: patch-am,v 1.3 2006/01/24 22:16:55 adam Exp $
#else
long_return = 4; /* application */
#endif
+@@ -1025,6 +1027,10 @@ var_hrswrun(struct variable * vp,
+ long_return = 0;
+ #elif defined(freebsd5)
+ long_return = proc_table[LowProcIndex].ki_runtime / 100000;
++ #elif defined(dragonfly)
++ long_return = proc_table[LowProcIndex].kp_eproc.e_uticks +
++ proc_table[LowProcIndex].kp_eproc.e_sticks +
++ proc_table[LowProcIndex].kp_eproc.e_iticks;
+ #else
+ long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
+ proc_table[LowProcIndex].kp_proc.p_sticks +
diff --git a/net/net-snmp/patches/patch-da b/net/net-snmp/patches/patch-da
new file mode 100644
index 00000000000..782f5918e15
--- /dev/null
+++ b/net/net-snmp/patches/patch-da
@@ -0,0 +1,12 @@
+$NetBSD: patch-da,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- ov/UCD-fields.orig 2006-03-19 18:20:29.000000000 +0000
++++ ov/UCD-fields
+@@ -11,6 +11,7 @@ Field "SNMPAgent" {
+ "UCD Ultrix",
+ "UCD NetBSD",
+ "UCD FreeBSD",
++ "UCD DragonFly",
+ "UCD IRIX",
+ "UCD Linux",
+ "UCD BSD/OS",
diff --git a/net/net-snmp/patches/patch-db b/net/net-snmp/patches/patch-db
new file mode 100644
index 00000000000..a86b142fba3
--- /dev/null
+++ b/net/net-snmp/patches/patch-db
@@ -0,0 +1,12 @@
+$NetBSD: patch-db,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- ov/oid_to_type.in.orig 2006-03-19 18:20:47.000000000 +0000
++++ ov/oid_to_type.in
+@@ -6,6 +6,7 @@ EXTENSIBLEDOTMIB.AGENTID.OSFID:DEC:UCD O
+ EXTENSIBLEDOTMIB.AGENTID.ULTRIXID:DEC:UCD Ultrix
+ EXTENSIBLEDOTMIB.AGENTID.NETBSD1ID:NetBSD:UCD NetBSD
+ EXTENSIBLEDOTMIB.AGENTID.FREEBSDID:FreeBSD:UCD FreeBSD
++EXTENSIBLEDOTMIB.AGENTID.DRAGONFLYID:FreeBSD:UCD DragonFly
+ EXTENSIBLEDOTMIB.AGENTID.IRIXID:SGI:UCD IRIX
+ EXTENSIBLEDOTMIB.AGENTID.LINUXID:Linux:UCD Linux
+ EXTENSIBLEDOTMIB.AGENTID.BSDIID:BSDI:UCD BSD/OS
diff --git a/net/net-snmp/patches/patch-dc b/net/net-snmp/patches/patch-dc
new file mode 100644
index 00000000000..94b7ec1a09c
--- /dev/null
+++ b/net/net-snmp/patches/patch-dc
@@ -0,0 +1,22 @@
+$NetBSD: patch-dc,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- include/net-snmp/net-snmp-config.h.in.orig 2005-12-08 11:08:34.000000000 +0000
++++ include/net-snmp/net-snmp-config.h.in
+@@ -1219,6 +1219,7 @@
+ #define HPUX11ID 14
+ #define AIXID 15
+ #define MACOSXID 16
++#define DRAGONFLYID 17
+ #define UNKNOWNID 255
+
+ #ifdef hpux9
+@@ -1248,6 +1249,9 @@
+ #if defined(__FreeBSD__)
+ #define OSTYPE FREEBSDID
+ #endif
++#if defined(__DragonFly__)
++#define OSTYPE DRAGONFLYID
++#endif
+ #if defined(irix6) || defined(irix5)
+ #define OSTYPE IRIXID
+ #endif
diff --git a/net/net-snmp/patches/patch-dd b/net/net-snmp/patches/patch-dd
new file mode 100644
index 00000000000..1916627b968
--- /dev/null
+++ b/net/net-snmp/patches/patch-dd
@@ -0,0 +1,12 @@
+$NetBSD: patch-dd,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- sedscript.in.orig 2006-03-19 18:22:17.000000000 +0000
++++ sedscript.in
+@@ -88,6 +88,7 @@ s/FREMOVEMEREEBSDID/FREEBSDID/g
+ s/IREMOVEMERIXID/IRIXID/g
+ s/LREMOVEMEINUXID/LINUXID/g
+ s/BREMOVEMESDIID/BSDIID/g
++s/DREMOVEMERAGONFLYID/DRAGONFLYID/g
+ s/UREMOVEMENKNOWNID/UNKNOWNID/g
+
+ s#PREMOVEMESCMD#PSCMD#g
diff --git a/net/net-snmp/patches/patch-de b/net/net-snmp/patches/patch-de
new file mode 100644
index 00000000000..b8f1e4c65cc
--- /dev/null
+++ b/net/net-snmp/patches/patch-de
@@ -0,0 +1,313 @@
+$NetBSD: patch-de,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/ipv6.c.orig 2005-11-16 19:44:51.000000000 +0000
++++ agent/mibgroup/mibII/ipv6.c
+@@ -11,7 +11,7 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ # if HAVE_SYS_SOCKETVAR_H
+ # include <sys/socketvar.h>
+ # endif
+@@ -80,7 +80,7 @@
+ # include <netinet6/ip6_var.h>
+ #endif
+ #include <net/route.h>
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ # if HAVE_NETINET_IN_PCB_H
+ # include <netinet/in_pcb.h>
+ # endif
+@@ -575,7 +575,7 @@ if_getifnet(int idx, struct ifnet *resul
+ memcpy(result, &tmp, sizeof(tmp));
+ return 0;
+ }
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ q = (caddr_t) TAILQ_NEXT(&tmp, if_link);
+ #else
+ # if defined(__NetBSD__) || defined(__OpenBSD__)
+@@ -806,7 +806,7 @@ var_ifv6Entry(register struct variable *
+
+ if (if_getifnet(interface, &ifnet) < 0)
+ break;
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrhead);
+ #else
+ # if defined(__NetBSD__) || defined(__OpenBSD__)
+@@ -827,7 +827,7 @@ var_ifv6Entry(register struct variable *
+ *var_len = sdl.sdl_alen;
+ return (u_char *) (sdl.sdl_data + sdl.sdl_nlen);
+ }
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_link);
+ #else
+ # if defined(__NetBSD__) || defined(__OpenBSD__)
+@@ -1230,7 +1230,11 @@ var_udp6(register struct variable * vp,
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable udbtable;
+ caddr_t first;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(dragonfly)
++ char *sysctl_buf;
++ struct xinpcb *xig;
++ size_t sysctl_len;
++#elif defined(freebsd3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+ #else
+@@ -1245,10 +1249,31 @@ var_udp6(register struct variable * vp,
+ if (!auto_nlist("udbtable", (char *) &udbtable, sizeof(udbtable)))
+ return NULL;
+ first = p = (caddr_t)udbtable.inpt_queue.cqh_first;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
+ return NULL;
+ p = (caddr_t) udb6.in6p_next;
++#elif defined(dragonfly)
++ {
++ const char *udblist = "net.inet.udp.pcblist";
++ const char *pp = udblist;
++
++ if (sysctlbyname(udblist, 0, &sysctl_len, 0, 0) < 0)
++ return NULL;
++ if ((sysctl_buf = malloc(sysctl_len)) == NULL)
++ return NULL;
++ udblist = pp;
++ if (sysctlbyname(udblist, sysctl_buf, &sysctl_len, 0, 0) < 0) {
++ free(sysctl_buf);
++ return NULL;
++ }
++ xig = (struct xinpcb *) sysctl_buf;
++ if (xig->xi_len != sizeof(*xig)) {
++ free(sysctl_buf);
++ return NULL;
++ }
++ p = (caddr_t) ((char *) xig); /* silence compiler warning */
++ }
+ #else
+ {
+ const char *udblist = "net.inet.udp.pcblist";
+@@ -1276,15 +1301,17 @@ var_udp6(register struct variable * vp,
+ while (
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("udb6")
++#elif defined(dragonfly)
++ (char *)xig + xig->xi_len <= sysctl_buf + sysctl_len
+ #else
+ xig->xig_len > sizeof(struct xinpgen)
+ #endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#if !defined(freebsd3) && !defined(darwin)
+ if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for udb6 at %x\n",
+ p));
+@@ -1297,7 +1324,7 @@ var_udp6(register struct variable * vp,
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(freebsd3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+ #endif
+@@ -1340,13 +1367,15 @@ var_udp6(register struct variable * vp,
+ skip:
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
++#elif defined(__DragonFly__)
++ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
+ #else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ #endif
+ }
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ free(sysctl_buf);
+ #endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
+@@ -1405,7 +1434,7 @@ var_tcp6(register struct variable * vp,
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable tcbtable;
+ caddr_t first;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(freebsd3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+ #else
+@@ -1435,7 +1464,7 @@ var_tcp6(register struct variable * vp,
+ if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
+ return NULL;
+ first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+ return NULL;
+ p = (caddr_t) tcb6.in6p_next;
+@@ -1466,7 +1495,7 @@ var_tcp6(register struct variable * vp,
+ while (
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("tcb6")
+ #else
+ xig->xig_len > sizeof(struct xinpgen)
+@@ -1474,7 +1503,7 @@ var_tcp6(register struct variable * vp,
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#if !defined(freebsd3) && !defined(darwin)
+ if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
+ p));
+@@ -1487,7 +1516,7 @@ var_tcp6(register struct variable * vp,
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(freebsd3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+ #endif
+@@ -1546,13 +1575,13 @@ var_tcp6(register struct variable * vp,
+ skip:
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
+ #else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ #endif
+ }
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ free(sysctl_buf);
+ #endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
+@@ -1644,7 +1673,11 @@ var_tcp6(register struct variable * vp,
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable tcbtable;
+ caddr_t first;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(dragonfly)
++ char *sysctl_buf;
++ size_t sysctl_len;
++ struct xtcpcb *xtp;
++#elif defined(freebsd3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+ #else
+@@ -1659,10 +1692,31 @@ var_tcp6(register struct variable * vp,
+ if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
+ return NULL;
+ first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+ return NULL;
+ p = (caddr_t) tcb6.in6p_next;
++#elif defined(dragonfly)
++ {
++ const char *tcblist = "net.inet.tcp.pcblist";
++ const char *pp = tcblist;
++
++ if (sysctlbyname(tcblist, 0, &sysctl_len, 0, 0) < 0)
++ return NULL;
++ if ((sysctl_buf = malloc(sysctl_len)) == NULL)
++ return NULL;
++ tcblist = pp;
++ if (sysctlbyname(tcblist, sysctl_buf, &sysctl_len, 0, 0) < 0) {
++ free(sysctl_buf);
++ return NULL;
++ }
++ xtp = (struct xtcpcb *) sysctl_buf;
++ if (xtp->xt_len != sizeof(*xtp)) {
++ free(sysctl_buf);
++ return NULL;
++ }
++ p = (caddr_t) ((char *) xtp); /* silence compiler warning */
++ }
+ #else
+ {
+ const char *tcblist = "net.inet.tcp.pcblist";
+@@ -1679,7 +1733,8 @@ var_tcp6(register struct variable * vp,
+ return NULL;
+ }
+ oxig = (struct xinpgen *) sysctl_buf;
+- xig = (struct xinpgen *) ((char *) oxig + oxig->xig_len);
++ xig = (struct xinpgen *) ((char *) oxtp + oxtp->xt_len);
++ if (oxig
+ p = (caddr_t) ((char *) xig); /* silence compiler warning */
+ }
+ #endif
+@@ -1690,28 +1745,32 @@ var_tcp6(register struct variable * vp,
+ while (
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("tcb6")
++#elif defined(dragonfly)
++ (char *)xtp + xtp->xt_len < sysctl_buf + sysctl_len
+ #else
+ xig->xig_len > sizeof(struct xinpgen)
+ #endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+-#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#if !defined(freebsd3) && !defined(darwin)
+ if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
+ p));
+ found = 0;
+ break;
+ }
++#elif defined(dragonfly)
++ in6pcb = xtp->xt_inp;
+ #else
+ in6pcb = ((struct xinpcb *) xig)->xi_inp;
+ #endif
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+-#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#elif defined(freebsd3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+ #endif
+@@ -1769,13 +1828,15 @@ var_tcp6(register struct variable * vp,
+ skip:
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+-#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
++#elif !defined(freebsd3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
++#elif defined(dragonfly)
++ xtp = (struct xtcpcb *) ((char *)xtp + xtp->xt_len);
+ #else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ #endif
+ }
+-#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
++#if defined(freebsd3) || defined(darwin)
+ free(sysctl_buf);
+ #endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
diff --git a/net/net-snmp/patches/patch-df b/net/net-snmp/patches/patch-df
new file mode 100644
index 00000000000..6efb2d21791
--- /dev/null
+++ b/net/net-snmp/patches/patch-df
@@ -0,0 +1,13 @@
+$NetBSD: patch-df,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd_snmp.h.orig 2006-03-19 19:01:01.000000000 +0000
++++ agent/mibgroup/ucd_snmp.h
+@@ -41,6 +41,8 @@ config_arch_require(freebsd5, ucd-snmp/v
+ config_arch_require(freebsd5, ucd-snmp/memory_freebsd2)
+ config_arch_require(freebsd6, ucd-snmp/vmstat_freebsd2)
+ config_arch_require(freebsd6, ucd-snmp/memory_freebsd2)
++config_arch_require(dragonfly, ucd-snmp/vmstat_freebsd2)
++config_arch_require(dragonfly, ucd-snmp/memory_freebsd2)
+ config_arch_require(netbsd1, ucd-snmp/vmstat_netbsd1)
+ config_arch_require(netbsd1, ucd-snmp/memory_netbsd1)
+ config_arch_require(netbsd, ucd-snmp/vmstat_netbsd1)
diff --git a/net/net-snmp/patches/patch-dg b/net/net-snmp/patches/patch-dg
new file mode 100644
index 00000000000..1c26e219f6a
--- /dev/null
+++ b/net/net-snmp/patches/patch-dg
@@ -0,0 +1,12 @@
+$NetBSD: patch-dg,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- mibs/NET-SNMP-TC.txt.orig 2006-03-19 19:01:33.000000000 +0000
++++ mibs/NET-SNMP-TC.txt
+@@ -93,6 +93,7 @@ win32 OBJECT IDENTIFIER ::= { netSnmp
+ hpux11 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 14 }
+ aix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 15 }
+ macosx OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 16 }
++dragonfly OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 17 }
+ unknown OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 255 }
+
+
diff --git a/net/net-snmp/patches/patch-dh b/net/net-snmp/patches/patch-dh
new file mode 100644
index 00000000000..acd1e9ed739
--- /dev/null
+++ b/net/net-snmp/patches/patch-dh
@@ -0,0 +1,14 @@
+$NetBSD: patch-dh,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- mibs/UCD-SNMP-MIB.txt.orig 2006-03-19 19:02:22.000000000 +0000
++++ mibs/UCD-SNMP-MIB.txt
+@@ -122,6 +122,9 @@ bsdi OBJECT IDENTIFIER ::=
+ openbsd OBJECT IDENTIFIER ::= { ucdSnmpAgent 12 }
+ win32 OBJECT IDENTIFIER ::= { ucdSnmpAgent 13 } -- unlucky
+ hpux11 OBJECT IDENTIFIER ::= { ucdSnmpAgent 14 }
++aix OBJECT IDENTIFIER ::= { ucdSnmpAgent 15 }
++macosx OBJECT IDENTIFIER ::= { ucdSnmpAgent 16 }
++dragonfly OBJECT IDENTIFIER ::= { ucdSnmpAgent 17 }
+ unknown OBJECT IDENTIFIER ::= { ucdSnmpAgent 255 }
+
+
diff --git a/net/net-snmp/patches/patch-di b/net/net-snmp/patches/patch-di
new file mode 100644
index 00000000000..b1dbc6b03ed
--- /dev/null
+++ b/net/net-snmp/patches/patch-di
@@ -0,0 +1,10 @@
+$NetBSD: patch-di,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- ov/oid_to_sym.in.orig 2006-03-19 19:03:39.000000000 +0000
++++ ov/oid_to_sym.in
+@@ -14,4 +14,5 @@ EXTENSIBLEDOTMIB.AGENTID.WIN32ID:Compute
+ EXTENSIBLEDOTMIB.AGENTID.HPUX11ID:Computer:UCD # UCD HP-UX 11
+ EXTENSIBLEDOTMIB.AGENTID.AIXID:Computer:UCD # UCD AIX
+ EXTENSIBLEDOTMIB.AGENTID.MACOSXID:Computer:UCD # UCD Mac OS X
++EXTENSIBLEDOTMIB.AGENTID.DRAGONFLYID:Computer:UCD # UCD DragonFly
+ EXTENSIBLEDOTMIB.AGENTID.UNKNOWNID:Computer:UCD # UCD Unknown
diff --git a/net/net-snmp/patches/patch-dj b/net/net-snmp/patches/patch-dj
new file mode 100644
index 00000000000..85a1ffb045c
--- /dev/null
+++ b/net/net-snmp/patches/patch-dj
@@ -0,0 +1,13 @@
+$NetBSD: patch-dj,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- Makefile.in.orig 2006-03-19 19:14:48.000000000 +0000
++++ Makefile.in
+@@ -20,7 +20,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.
+ dynix.h freebsd2.h freebsd3.h freebsd4.h freebsd.h generic.h hpux.h \
+ irix.h linux.h mingw32.h mips.h netbsd.h openbsd.h osf5.h \
+ solaris2.6.h solaris2.7.h solaris2.8.h solaris2.9.h solaris2.10.h \
+- solaris.h sunos.h svr5.h sysv.h ultrix4.h
++ solaris.h sunos.h svr5.h sysv.h ultrix4.h dragonfly.h
+ INCLUDESUBDIR2=machine
+ INCLUDESUBDIRHEADERS2=generic.h
+ INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h
diff --git a/net/net-snmp/patches/patch-dk b/net/net-snmp/patches/patch-dk
new file mode 100644
index 00000000000..2f314a43e3d
--- /dev/null
+++ b/net/net-snmp/patches/patch-dk
@@ -0,0 +1,16 @@
+$NetBSD: patch-dk,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/ip.c.orig 2006-03-19 19:56:46.000000000 +0000
++++ agent/mibgroup/mibII/ip.c
+@@ -201,6 +201,11 @@ long ipTTL, oldipTTL;
+ #define USES_TRADITIONAL_IPSTAT
+ #endif
+
++#ifdef dragonfly
++#define IP_STAT_STRUCTURE struct ip_stats
++#define USES_TRADITIONAL_IPSTAT
++#endif
++
+ #if !defined(IP_STAT_STRUCTURE)
+ #define IP_STAT_STRUCTURE struct ipstat
+ #define USES_TRADITIONAL_IPSTAT
diff --git a/net/net-snmp/patches/patch-dl b/net/net-snmp/patches/patch-dl
new file mode 100644
index 00000000000..4796fd9d55d
--- /dev/null
+++ b/net/net-snmp/patches/patch-dl
@@ -0,0 +1,16 @@
+$NetBSD: patch-dl,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/tcp.c.orig 2006-03-19 20:03:42.000000000 +0000
++++ agent/mibgroup/mibII/tcp.c
+@@ -169,6 +169,11 @@ init_tcp(void)
+ #define USES_TRADITIONAL_TCPSTAT
+ #endif
+
++#ifdef dragonfly
++#define TCP_STAT_STRUCTURE struct tcp_stats
++#define USES_TRADITIONAL_TCPSTAT
++#endif
++
+ #if !defined(TCP_STAT_STRUCTURE)
+ #define TCP_STAT_STRUCTURE struct tcpstat
+ #define USES_TRADITIONAL_TCPSTAT
diff --git a/net/net-snmp/patches/patch-dm b/net/net-snmp/patches/patch-dm
new file mode 100644
index 00000000000..bb2dd87ec9e
--- /dev/null
+++ b/net/net-snmp/patches/patch-dm
@@ -0,0 +1,167 @@
+$NetBSD: patch-dm,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig 2004-06-29 12:14:32.000000000 +0000
++++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c
+@@ -9,9 +9,15 @@
+ */
+ #include <sys/param.h>
+ #include <sys/time.h>
++#if defined(dragonfly)
++#include <sys/user.h>
++#else
+ #include <sys/proc.h>
++#endif
+ #if defined(freebsd5) && __FreeBSD_version >= 500101
+ #include <sys/resource.h>
++#elif defined(dragonfly)
++#include <kinfo.h>
+ #else
+ #include <sys/dkstat.h>
+ #endif
+@@ -168,11 +174,18 @@ var_extensible_vmstat(struct variable *v
+ static time_t time_old;
+ static time_t time_diff;
+
++#if defined(dragonfly)
++ static struct kinfo_cputime cpu_old, cpu_new, cpu_diff;
++ static uint64_t cpu_total;
++ uint64_t cpu_sum;
++ static int pagesize;
++#else
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+ long cpu_sum;
++#endif
+ double cpu_prc;
+
+ static struct vmmeter mem_old, mem_new;
+@@ -180,6 +193,11 @@ var_extensible_vmstat(struct variable *v
+ static long long_ret;
+ static char errmsg[300];
+
++#if defined(dragonfly)
++ if (pagesize == 0)
++ pagesize = getpagesize() >> 10;
++#endif
++
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+@@ -195,15 +213,27 @@ var_extensible_vmstat(struct variable *v
+ /*
+ * CPU usage
+ */
+- auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
++ cpu_total = 0;
+
+- cpu_total = 0;
++#if defined(dragonfly)
++ kinfo_get_sched_cputime(&cpu_new);
++#define CP_UPDATE(field) cpu_diff.field = cpu_new.field - cpu_old.field; cpu_total += cpu_diff.field;
++ CP_UPDATE(cp_user);
++ CP_UPDATE(cp_nice);
++ CP_UPDATE(cp_sys);
++ CP_UPDATE(cp_intr);
++ CP_UPDATE(cp_idle);
++ cpu_old = cpu_new;
++#undef CP_UPDATE
++#else
++ auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
+
+ for (loop = 0; loop < CPUSTATES; loop++) {
+ cpu_diff[loop] = cpu_new[loop] - cpu_old[loop];
+ cpu_old[loop] = cpu_new[loop];
+ cpu_total += cpu_diff[loop];
+ }
++#endif
+
+ if (cpu_total == 0)
+ cpu_total = 1;
+@@ -223,7 +253,11 @@ var_extensible_vmstat(struct variable *v
+ /*
+ * Page-to-kb macro
+ */
++#if defined(dragonfly)
++#define ptok(p) ((p) * pagesize)
++#else
+ #define ptok(p) ((p) * (mem_new.v_page_size >> 10))
++#endif
+
+ switch (vp->magic) {
+ case MIBINDEX:
+@@ -270,37 +304,73 @@ var_extensible_vmstat(struct variable *v
+ long_ret = rate(mem_new.v_swtch - mem_old.v_swtch);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
++#if defined(dragonfly)
++ cpu_sum = cpu_diff.cp_user + cpu_diff.cp_nice;
++#else
+ cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
++#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
++#if defined(dragonfly)
++ cpu_sum = cpu_diff.cp_sys + cpu_diff.cp_intr;
++#else
+ cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
++#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
++#if defined(dragonfly)
++ cpu_sum = cpu_diff.cp_idle;
++#else
+ cpu_sum = cpu_diff[CP_IDLE];
++#endif
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_user;
++#else
+ long_ret = cpu_new[CP_USER];
++#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_nice;
++#else
+ long_ret = cpu_new[CP_NICE];
++#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_sys + cpu_new.cp_intr;
++#else
+ long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR];
++#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_idle;
++#else
+ long_ret = cpu_new[CP_IDLE];
++#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_sys;
++#else
+ long_ret = cpu_new[CP_SYS];
++#endif
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
++#if defined(dragonfly)
++ cpu_sum = cpu_new.cp_intr;
++#else
+ long_ret = cpu_new[CP_INTR];
++#endif
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = mem_new.v_intr;
diff --git a/net/net-snmp/patches/patch-dn b/net/net-snmp/patches/patch-dn
new file mode 100644
index 00000000000..81646d4a422
--- /dev/null
+++ b/net/net-snmp/patches/patch-dn
@@ -0,0 +1,70 @@
+$NetBSD: patch-dn,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig 2006-03-19 20:27:45.000000000 +0000
++++ agent/mibgroup/ucd-snmp/memory_freebsd2.c
+@@ -10,8 +10,12 @@
+ */
+ #include <sys/param.h>
+ #include <sys/time.h>
++#ifdef dragonfly
++#include <sys/user.h>
++#else
+ #include <sys/proc.h>
+ #include <sys/dkstat.h>
++#endif
+ #ifdef freebsd5
+ #include <sys/bio.h>
+ #endif
+@@ -251,6 +255,10 @@ var_extensible_mem(struct variable *vp,
+
+ static struct vmmeter mem;
+ static struct vmtotal total;
++#ifdef dragonfly
++ static struct vmstats vmstats;
++ size_t vmstats_size = sizeof(vmstats);
++#endif
+ size_t total_size = sizeof(total);
+ int total_mib[] = { CTL_VM, VM_METER };
+
+@@ -284,6 +292,8 @@ var_extensible_mem(struct variable *vp,
+ */
+ sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
+
++ sysctlbyname("vm.vmstats", &vmstats, &vmstats_size, NULL, 0);
++
+ #ifdef BUFSPACE_SYMBOL
+ /*
+ * Buffer space
+@@ -296,7 +306,11 @@ var_extensible_mem(struct variable *vp,
+ /*
+ * Page-to-kb macro
+ */
++#ifdef dragonfly
++#define ptok(p) ((p) * (vmstats.v_page_size >> 10))
++#else
+ #define ptok(p) ((p) * (mem.v_page_size >> 10))
++#endif
+
+ switch (vp->magic) {
+ case MIBINDEX:
+@@ -316,7 +330,11 @@ var_extensible_mem(struct variable *vp,
+ long_ret = phys_mem >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL: /* FREE real memory */
++#ifdef dragonfly
++ long_ret = ptok(vmstats.v_free_count);
++#else
+ long_ret = ptok(mem.v_free_count);
++#endif
+ return ((u_char *) (&long_ret));
+
+ /*
+@@ -351,6 +369,8 @@ var_extensible_mem(struct variable *vp,
+ case MEMCACHED:
+ #ifdef darwin
+ long_ret = ptok(mem.v_lookups);
++#elif defined(dragonfly)
++ long_ret = ptok(vmstats.v_cache_count);
+ #else
+ long_ret = ptok(mem.v_cache_count);
+ #endif
diff --git a/net/net-snmp/patches/patch-do b/net/net-snmp/patches/patch-do
new file mode 100644
index 00000000000..ceba480c9d3
--- /dev/null
+++ b/net/net-snmp/patches/patch-do
@@ -0,0 +1,16 @@
+$NetBSD: patch-do,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd-snmp/disk.c.orig 2004-10-05 07:50:38.000000000 +0000
++++ agent/mibgroup/ucd-snmp/disk.c
+@@ -45,9 +45,11 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#if !defined(dragonfly)
+ #ifdef HAVE_SYS_VNODE_H
+ #include <sys/vnode.h>
+ #endif
++#endif
+ #ifdef HAVE_UFS_UFS_QUOTA_H
+ #include <ufs/ufs/quota.h>
+ #endif
diff --git a/net/net-snmp/patches/patch-dp b/net/net-snmp/patches/patch-dp
new file mode 100644
index 00000000000..6dc498000b6
--- /dev/null
+++ b/net/net-snmp/patches/patch-dp
@@ -0,0 +1,16 @@
+$NetBSD: patch-dp,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd-snmp/loadave.c.orig 2006-03-19 20:40:02.000000000 +0000
++++ agent/mibgroup/ucd-snmp/loadave.c
+@@ -39,9 +39,11 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#if !defined(dragonfly)
+ #ifdef HAVE_SYS_VNODE_H
+ #include <sys/vnode.h>
+ #endif
++#endif
+ #ifdef HAVE_UFS_UFS_QUOTA_H
+ #include <ufs/ufs/quota.h>
+ #endif
diff --git a/net/net-snmp/patches/patch-dq b/net/net-snmp/patches/patch-dq
new file mode 100644
index 00000000000..48581b778f5
--- /dev/null
+++ b/net/net-snmp/patches/patch-dq
@@ -0,0 +1,16 @@
+$NetBSD: patch-dq,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/ucd-snmp/errormib.c.orig 2006-03-19 20:41:58.000000000 +0000
++++ agent/mibgroup/ucd-snmp/errormib.c
+@@ -53,9 +53,11 @@
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
++#if !defined(dragonfly)
+ #ifdef HAVE_SYS_VNODE_H
+ #include <sys/vnode.h>
+ #endif
++#endif
+ #ifdef HAVE_UFS_UFS_QUOTA_H
+ #include <ufs/ufs/quota.h>
+ #endif
diff --git a/net/net-snmp/patches/patch-dr b/net/net-snmp/patches/patch-dr
new file mode 100644
index 00000000000..e6a9a2c1e03
--- /dev/null
+++ b/net/net-snmp/patches/patch-dr
@@ -0,0 +1,47 @@
+$NetBSD: patch-dr,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/tcpTable.c.orig 2006-03-19 21:24:04.000000000 +0000
++++ agent/mibgroup/mibII/tcpTable.c
+@@ -711,7 +711,11 @@ tcpTable_load(netsnmp_cache *cache, void
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_PCBLIST };
+ char *tcpcb_buf = NULL;
++#if defined(dragonfly)
++ struct xtcpcb *xig = NULL;
++#else
+ struct xinpgen *xig = NULL;
++#endif
+ netsnmp_inpcb *nnew;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+
+@@ -733,10 +737,18 @@ tcpTable_load(netsnmp_cache *cache, void
+ * Unpick this into the constituent 'xinpgen' structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
++#if defined(dragonfly)
++ xig = (struct xtcpcb *) tcpcb_buf;
++#else
+ xig = (struct xinpgen *) tcpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+
++#if defined(dragonfly)
++ while (xig && ((char *)xig + xig->xt_len < tcpcb_buf + len)) {
++#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
++#endif
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
+@@ -749,7 +761,11 @@ tcpTable_load(netsnmp_cache *cache, void
+
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
++#if defined(dragonfly)
++ xig = (struct xtcpcb *) ((char *) xig + xig->xt_len);
++#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+ }
+
+ free(tcpcb_buf);
diff --git a/net/net-snmp/patches/patch-ds b/net/net-snmp/patches/patch-ds
new file mode 100644
index 00000000000..75fe334eea9
--- /dev/null
+++ b/net/net-snmp/patches/patch-ds
@@ -0,0 +1,47 @@
+$NetBSD: patch-ds,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/udpTable.c.orig 2006-03-19 21:28:31.000000000 +0000
++++ agent/mibgroup/mibII/udpTable.c
+@@ -599,7 +599,11 @@ udpTable_load(netsnmp_cache *cache, void
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_PCBLIST };
+ char *udpcb_buf = NULL;
++#if defined(dragonfly)
++ struct xinpcb *xig = NULL;
++#else
+ struct xinpgen *xig = NULL;
++#endif
+ UDPTABLE_ENTRY_TYPE *nnew;
+
+ udpTable_free(NULL, NULL);
+@@ -620,10 +624,18 @@ udpTable_load(netsnmp_cache *cache, void
+ * Unpick this into the constituent 'xinpgen' structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
++#if defined(dragonfly)
++ xig = (struct xinpcb *) udpcb_buf;
++#else
+ xig = (struct xinpgen *) udpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+
++#if defined(dragonfly)
++ while (xig && ((char *)xig + xig->xi_len < udpcb_buf + len)) {
++#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
++#endif
+ nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
+ if (!nnew)
+ break;
+@@ -636,7 +648,11 @@ udpTable_load(netsnmp_cache *cache, void
+ #endif
+
+ udp_head = nnew;
++#if defined(dragonfly)
++ xig = (struct xinpcb *) ((char *) xig + xig->xi_len);
++#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+ }
+
+ free(udpcb_buf);
diff --git a/net/net-snmp/patches/patch-dt b/net/net-snmp/patches/patch-dt
new file mode 100644
index 00000000000..f6e4bc96cb6
--- /dev/null
+++ b/net/net-snmp/patches/patch-dt
@@ -0,0 +1,18 @@
+$NetBSD: patch-dt,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/Makefile.in.orig 2006-03-19 21:34:14.000000000 +0000
++++ agent/Makefile.in
+@@ -136,8 +136,12 @@ libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VE
+ $(LIB_LD_CMD) libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION) ${LLIBAGENTOBJS} $(LIB_LD_LIBS)
+ $(RANLIB) libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+
++.if ${OPSYS} == "DragonFly"
++MIB_SYSTEM_LIBS= -lkinfo
++.endif
++
+ libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS}
+- $(LIB_LD_CMD) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) ${LMIBOBJS} $(LIB_LD_LIBS)
++ $(LIB_LD_CMD) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) ${LMIBOBJS} $(LIB_LD_LIBS) $(MIB_SYSTEM_LIBS)
+ $(RANLIB) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+
+ agentlib: libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)