mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 13:34:38 +08:00
SNMP: TABs -> spaces
This commit is contained in:
parent
05a595f745
commit
83de16678c
@ -77,9 +77,9 @@ snmp_version_enabled(u8_t version)
|
|||||||
{
|
{
|
||||||
LWIP_ASSERT("Invalid SNMP version", (version == SNMP_VERSION_1) || (version == SNMP_VERSION_2c)
|
LWIP_ASSERT("Invalid SNMP version", (version == SNMP_VERSION_1) || (version == SNMP_VERSION_2c)
|
||||||
#if LWIP_SNMP_V3
|
#if LWIP_SNMP_V3
|
||||||
|| (version == SNMP_VERSION_3)
|
|| (version == SNMP_VERSION_3)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (version == SNMP_VERSION_1) {
|
if (version == SNMP_VERSION_1) {
|
||||||
return v1_enabled;
|
return v1_enabled;
|
||||||
@ -117,19 +117,19 @@ snmp_version_enable(u8_t version, u8_t enable)
|
|||||||
{
|
{
|
||||||
LWIP_ASSERT("Invalid SNMP version", (version == SNMP_VERSION_1) || (version == SNMP_VERSION_2c)
|
LWIP_ASSERT("Invalid SNMP version", (version == SNMP_VERSION_1) || (version == SNMP_VERSION_2c)
|
||||||
#if LWIP_SNMP_V3
|
#if LWIP_SNMP_V3
|
||||||
|| (version == SNMP_VERSION_3)
|
|| (version == SNMP_VERSION_3)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
|
|
||||||
if (version == SNMP_VERSION_1) {
|
if (version == SNMP_VERSION_1) {
|
||||||
v1_enabled = enable;
|
v1_enabled = enable;
|
||||||
}
|
}
|
||||||
else if (version == SNMP_VERSION_2c) {
|
else if (version == SNMP_VERSION_2c) {
|
||||||
v2c_enabled = enable;
|
v2c_enabled = enable;
|
||||||
}
|
}
|
||||||
#if LWIP_SNMP_V3
|
#if LWIP_SNMP_V3
|
||||||
else { /* version == SNMP_VERSION_3 */
|
else { /* version == SNMP_VERSION_3 */
|
||||||
v3_enabled = enable;
|
v3_enabled = enable;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -917,7 +917,7 @@ snmp_parse_inbound_frame(struct snmp_request *request)
|
|||||||
IF_PARSE_ASSERT(parent_tlv_value_len > 0);
|
IF_PARSE_ASSERT(parent_tlv_value_len > 0);
|
||||||
/* Remember position */
|
/* Remember position */
|
||||||
inbound_msgAuthenticationParameters_offset = pbuf_stream.offset;
|
inbound_msgAuthenticationParameters_offset = pbuf_stream.offset;
|
||||||
LWIP_UNUSED_ARG(inbound_msgAuthenticationParameters_offset);
|
LWIP_UNUSED_ARG(inbound_msgAuthenticationParameters_offset);
|
||||||
/* Read auth parameters */
|
/* Read auth parameters */
|
||||||
/* IF_PARSE_ASSERT(tlv.value_len <= SNMP_V3_MAX_AUTH_PARAM_LENGTH); */
|
/* IF_PARSE_ASSERT(tlv.value_len <= SNMP_V3_MAX_AUTH_PARAM_LENGTH); */
|
||||||
IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_authentication_parameters,
|
IF_PARSE_EXEC(snmp_asn1_dec_raw(&pbuf_stream, tlv.value_len, request->msg_authentication_parameters,
|
||||||
|
@ -57,7 +57,7 @@ static u8_t snmp_name_to_oid(const char *name, u32_t *oid, u8_t len)
|
|||||||
u8_t i;
|
u8_t i;
|
||||||
|
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
oid[i] = name[i];
|
oid[i] = name[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@ -203,22 +203,22 @@ static snmp_err_t usmusertable_get_next_instance(const u32_t *column, struct snm
|
|||||||
engineid_start = 1;
|
engineid_start = 1;
|
||||||
|
|
||||||
if (engineid_len != eid_len) {
|
if (engineid_len != eid_len) {
|
||||||
/* EngineID length does not match! */
|
/* EngineID length does not match! */
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engineid_len > row_oid->len) {
|
if (engineid_len > row_oid->len) {
|
||||||
/* Verify partial EngineID */
|
/* Verify partial EngineID */
|
||||||
snmp_engineid_to_oid(engineid, engineid_oid, row_oid->len - 1);
|
snmp_engineid_to_oid(engineid, engineid_oid, row_oid->len - 1);
|
||||||
if (!snmp_oid_equal(&row_oid->id[engineid_start], row_oid->len - 1, engineid_oid, row_oid->len - 1)) {
|
if (!snmp_oid_equal(&row_oid->id[engineid_start], row_oid->len - 1, engineid_oid, row_oid->len - 1)) {
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Verify complete EngineID */
|
/* Verify complete EngineID */
|
||||||
snmp_engineid_to_oid(engineid, engineid_oid, engineid_len);
|
snmp_engineid_to_oid(engineid, engineid_oid, engineid_len);
|
||||||
if (!snmp_oid_equal(&row_oid->id[engineid_start], engineid_len, engineid_oid, engineid_len)) {
|
if (!snmp_oid_equal(&row_oid->id[engineid_start], engineid_len, engineid_oid, engineid_len)) {
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,8 +230,8 @@ static snmp_err_t usmusertable_get_next_instance(const u32_t *column, struct snm
|
|||||||
name_start = engineid_start + engineid_len + 1;
|
name_start = engineid_start + engineid_len + 1;
|
||||||
|
|
||||||
if (name_len > SNMP_V3_MAX_USER_LENGTH) {
|
if (name_len > SNMP_V3_MAX_USER_LENGTH) {
|
||||||
/* specified name is too long, max length is 32 according to mib file.*/
|
/* specified name is too long, max length is 32 according to mib file.*/
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_oid->len < engineid_len + name_len + 2) {
|
if (row_oid->len < engineid_len + name_len + 2) {
|
||||||
@ -245,7 +245,7 @@ static snmp_err_t usmusertable_get_next_instance(const u32_t *column, struct snm
|
|||||||
/* Full name given according to oid. Also test for too much data.*/
|
/* Full name given according to oid. Also test for too much data.*/
|
||||||
u8_t tmplen = row_oid->len - engineid_len - 2;
|
u8_t tmplen = row_oid->len - engineid_len - 2;
|
||||||
if (!snmp_oid_in_range(&row_oid->id[name_start], name_len, usmUserTable_oid_ranges, tmplen)) {
|
if (!snmp_oid_in_range(&row_oid->id[name_start], name_len, usmUserTable_oid_ranges, tmplen)) {
|
||||||
return SNMP_ERR_NOSUCHINSTANCE;
|
return SNMP_ERR_NOSUCHINSTANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@
|
|||||||
* THIS IS UNDER DEVELOPMENT AND SHOULD NOT BE ENABLED IN PRODUCTS.
|
* THIS IS UNDER DEVELOPMENT AND SHOULD NOT BE ENABLED IN PRODUCTS.
|
||||||
*/
|
*/
|
||||||
#ifndef LWIP_SNMP_V3
|
#ifndef LWIP_SNMP_V3
|
||||||
#define LWIP_SNMP_V3 0
|
#define LWIP_SNMP_V3 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LWIP_SNMP_V3_MBEDTLS
|
#ifndef LWIP_SNMP_V3_MBEDTLS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user