From ecb38678039622e67438529d7f9f544da6a0677b Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 3 Mar 2017 12:32:22 +0100 Subject: [PATCH] SNMPv3: Rename tcpip_enginetime_timer to snmpv3_enginetime_timer --- src/apps/snmp/snmp_netconn.c | 2 +- src/apps/snmp/snmpv3_dummy.c | 14 +++++++++----- src/apps/snmp/snmpv3_mbedtls.c | 4 ++-- src/apps/snmp/snmpv3_priv.h | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/apps/snmp/snmp_netconn.c b/src/apps/snmp/snmp_netconn.c index ba1f7e99..cc5cb59d 100644 --- a/src/apps/snmp/snmp_netconn.c +++ b/src/apps/snmp/snmp_netconn.c @@ -66,7 +66,7 @@ snmp_netconn_thread(void *arg) #if LWIP_SNMP_V3 /* Start the engine time timer */ - tcpip_enginetime_timer(NULL); + snmpv3_enginetime_timer(NULL); #endif do { diff --git a/src/apps/snmp/snmpv3_dummy.c b/src/apps/snmp/snmpv3_dummy.c index e3582834..8a2ebe96 100644 --- a/src/apps/snmp/snmpv3_dummy.c +++ b/src/apps/snmp/snmpv3_dummy.c @@ -71,7 +71,8 @@ static u32_t engineboots = 0; * * @return pointer to the user table entry or NULL if not found. */ -static struct user_table_entry *get_user(const char *username) +static struct user_table_entry* +get_user(const char *username) { size_t i; @@ -88,7 +89,8 @@ static struct user_table_entry *get_user(const char *username) return NULL; } -u8_t snmpv3_get_amount_of_users(void) +u8_t +snmpv3_get_amount_of_users(void) { return LWIP_ARRAYSIZE(user_table); } @@ -99,7 +101,8 @@ u8_t snmpv3_get_amount_of_users(void) * @param index is the user index. * @return ERR_OK if user is found, ERR_VAL is user is not found. */ -err_t snmpv3_get_username(char *username, u8_t index) +err_t +snmpv3_get_username(char *username, u8_t index) { if (index < LWIP_ARRAYSIZE(user_table)) { MEMCPY(username, user_table[index].username, sizeof(user_table[0].username)); @@ -114,7 +117,8 @@ err_t snmpv3_get_username(char *username, u8_t index) * * @param arg unused argument */ -void tcpip_enginetime_timer(void *arg) +void +snmpv3_enginetime_timer(void *arg) { LWIP_UNUSED_ARG(arg); @@ -124,7 +128,7 @@ void tcpip_enginetime_timer(void *arg) snmpv3_get_engine_time_internal(); /* restart timer */ - sys_timeout(1000, tcpip_enginetime_timer, NULL); + sys_timeout(1000, snmpv3_enginetime_timer, NULL); } err_t diff --git a/src/apps/snmp/snmpv3_mbedtls.c b/src/apps/snmp/snmpv3_mbedtls.c index d2fddc2a..2a016106 100644 --- a/src/apps/snmp/snmpv3_mbedtls.c +++ b/src/apps/snmp/snmpv3_mbedtls.c @@ -161,14 +161,14 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, goto error; } - snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); + snmp_pbuf_stream_writebuf(&write_stream, out_bytes, (u16_t)out_len); } out_len = LWIP_ARRAYSIZE(out_bytes); if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) { goto error; } - snmp_pbuf_stream_writebuf(&write_stream, out_bytes, out_len); + snmp_pbuf_stream_writebuf(&write_stream, out_bytes, (u16_t)out_len); } else if (algo == SNMP_V3_PRIV_ALGO_AES) { u8_t iv_local[16]; diff --git a/src/apps/snmp/snmpv3_priv.h b/src/apps/snmp/snmpv3_priv.h index b97ac8d1..ccf0e3ab 100644 --- a/src/apps/snmp/snmpv3_priv.h +++ b/src/apps/snmp/snmpv3_priv.h @@ -65,7 +65,7 @@ err_t snmpv3_auth(struct snmp_pbuf_stream* stream, u16_t length, const u8_t* key err_t snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length, const u8_t* key, const u8_t* priv_param, const u32_t engine_boots, const u32_t engine_time, u8_t algo, u8_t mode); err_t snmpv3_build_priv_param(u8_t* priv_param); -void tcpip_enginetime_timer(void *arg); +void snmpv3_enginetime_timer(void *arg); #endif