A few more SNMPv3 cleanups

This commit is contained in:
Dirk Ziegelmeier 2017-03-02 11:18:49 +01:00
parent 1b3aaef525
commit 593b211d1b
3 changed files with 8 additions and 6 deletions

View File

@ -198,11 +198,11 @@ const struct snmp_obj_id_const_ref snmp_zero_dot_zero = { LWIP_ARRAYSIZE(snmp_ze
#include "lwip/apps/snmp_snmpv2_framework.h"
#include "lwip/apps/snmp_snmpv2_usm.h"
static const struct snmp_mib* const default_mibs[] = { &mib2, &snmpframeworkmib, &snmpusmmib };
static u8_t snmp_num_mibs = 3;
static u8_t snmp_num_mibs = LWIP_ARRAYSIZE(default_mibs);
#elif SNMP_LWIP_MIB2
#include "lwip/apps/snmp_mib2.h"
static const struct snmp_mib* const default_mibs[] = { &mib2 };
static u8_t snmp_num_mibs = 1;
static u8_t snmp_num_mibs = LWIP_ARRAYSIZE(default_mibs);
#else
static const struct snmp_mib* const default_mibs[] = { NULL };
static u8_t snmp_num_mibs = 0;

View File

@ -48,8 +48,8 @@
#if LWIP_SNMP_V3
#include "lwip/apps/snmpv3.h"
#include "snmpv3_priv.h"
#ifdef LWIP_SNMPV3_INCLUDE_ENGINE
#include LWIP_SNMPV3_INCLUDE_ENGINE
#ifdef LWIP_HOOK_FILENAME
#include LWIP_HOOK_FILENAME
#endif
#endif
@ -294,6 +294,7 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por
err = snmp_process_set_request(&request);
}
}
#if LWIP_SNMP_V3
else {
struct snmp_varbind vb;
@ -356,10 +357,9 @@ snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t por
}
request.request_out_type = (SNMP_ASN1_CLASS_CONTEXT | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_CONTEXT_PDU_REPORT);
#if LWIP_SNMP_V3
request.request_id = request.msg_id;
#endif
}
#endif
if (err == ERR_OK) {
err = snmp_complete_outbound_frame(&request);

View File

@ -351,12 +351,14 @@ struct snmp_statistics
u32_t outsetrequests;
u32_t outgetresponses;
u32_t outtraps;
#if LWIP_SNMP_V3
u32_t unsupportedseclevels;
u32_t notintimewindows;
u32_t unknownusernames;
u32_t unknownengineids;
u32_t wrongdigests;
u32_t decryptionerrors;
#endif
};
extern struct snmp_statistics snmp_stats;