2 * snmpMPDStats.c: tallies errors for SNMPv3 message processing.
5 #include <net-snmp/net-snmp-config.h>
11 #include <net-snmp/net-snmp-includes.h>
12 #include <net-snmp/agent/net-snmp-agent-includes.h>
14 #include "mibII/sysORTable.h"
15 #include "snmpMPDStats.h"
16 #include "util_funcs.h"
19 struct variable2 snmpMPDStats_variables[] = {
20 {SNMPUNKNOWNSECURITYMODELS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1,
22 {SNMPINVALIDMSGS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1, {2}},
23 {SNMPUNKNOWNPDUHANDLERS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1, {3}},
27 * now load this mib into the agents mib table
29 oid snmpMPDStats_variables_oid[] =
30 { 1, 3, 6, 1, 6, 3, 11, 2, 1 };
33 init_snmpMPDStats(void)
35 #ifdef USING_MIBII_SYSORTABLE_MODULE
36 static oid reg[] = { 1, 3, 6, 1, 6, 3, 11, 3, 1, 1 };
37 register_sysORTable(reg, 10,
38 "The MIB for Message Processing and Dispatching.");
41 REGISTER_MIB("snmpv3/snmpMPDStats", snmpMPDStats_variables, variable2,
42 snmpMPDStats_variables_oid);
46 var_snmpMPDStats(struct variable *vp,
49 int exact, size_t * var_len, WriteMethod ** write_method)
53 * variables we may use later
59 *write_method = 0; /* assume it isnt writable for the time being */
60 *var_len = sizeof(long_ret); /* assume an integer and change later if not */
62 if (header_generic(vp, name, length, exact, var_len, write_method))
66 * this is where we do the value assignments for the mib results.
70 && (tmagic <= (STAT_MPD_STATS_END - STAT_MPD_STATS_START))) {
71 long_ret = snmp_get_statistic(tmagic + STAT_MPD_STATS_START);
72 return (unsigned char *) &long_ret;