summaryrefslogtreecommitdiff
path: root/net/net-snmp/patches/patch-eu
blob: 79fda4a294a2e5f531e9399ef37b969a2205152e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$NetBSD: patch-eu,v 1.1 2010/05/11 04:39:54 adam Exp $

--- agent/mibgroup/mibII/ip.c.orig	2010-03-12 00:31:27.000000000 +0000
+++ agent/mibgroup/mibII/ip.c	2010-03-12 00:33:50.000000000 +0000
@@ -199,6 +199,12 @@
 #define	USES_SNMP_DESIGNED_IPSTAT
 #endif
 
+#ifdef netbsd4
+#define IP_STAT_STRUCTURE	struct ip_mib
+#define USES_SNMP_DESIGNED_IPSTAT
+#undef IP_NSTATS
+#endif
+
 #if defined (WIN32) || defined (cygwin)
 #include <iphlpapi.h>
 #define IP_STAT_STRUCTURE MIB_IPSTATS
@@ -804,6 +810,21 @@
     }
     return ret_value;
 }
+#elif defined (netbsd4)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+    long ret_value = -1;
+
+    ret_value = netbsd_read_ip_stat(&ipstat);
+
+    if ( ret_value < 0) {
+	DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (netbsd)\n"));
+    } else {
+	DEBUGMSGTL(("mibII/ip", "Loaded IP Group (netbsd)\n"));
+    }
+    return ret_value;
+}
 #elif defined (WIN32) || defined (cygwin)
 int
 ip_load(netsnmp_cache *cache, void *vmagic)