summaryrefslogtreecommitdiff
path: root/net/net-snmp/patches/patch-et
blob: 873194fe4e4e6160ad1368259ee3c02a5923b683 (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-et,v 1.6 2011/05/27 10:55:26 adam Exp $

--- agent/mibgroup/mibII/icmp.c.orig	2011-02-01 14:16:23.000000000 +0000
+++ agent/mibgroup/mibII/icmp.c
@@ -567,6 +567,12 @@ init_icmp(void)
 	 *
 	 *********************/
 
+#ifdef NETBSD_STATS_VIA_SYSCTL
+#define ICMP_STAT_STRUCTURE     struct icmp_mib
+#define USES_SNMP_DESIGNED_ICMPSTAT
+#undef ICMP_NSTATS
+#endif
+
 #ifdef hpux11
 #define ICMP_STAT_STRUCTURE	int
 #endif
@@ -1289,6 +1295,21 @@ icmp_load(netsnmp_cache *cache, void *vm
     }
     return ret_value;
 }
+#elif defined(NETBSD_STATS_VIA_SYSCTL)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+    long            ret_value =- -1;
+
+    ret_value = netbsd_read_icmp_stat(&icmpstat);
+
+    if ( ret_value < 0 ) {
+	DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (netbsd)\n"));
+    } else {
+	DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (netbsd)\n"));
+    }
+    return ret_value;
+}
 #elif defined (WIN32) || defined (cygwin)
 int
 icmp_load(netsnmp_cache *cache, void *vmagic)