mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-13 02:05:43 +00:00
SNMPv3: Rename tcpip_enginetime_timer to snmpv3_enginetime_timer
This commit is contained in:
parent
927990d94e
commit
ecb3867803
@ -66,7 +66,7 @@ snmp_netconn_thread(void *arg)
|
|||||||
|
|
||||||
#if LWIP_SNMP_V3
|
#if LWIP_SNMP_V3
|
||||||
/* Start the engine time timer */
|
/* Start the engine time timer */
|
||||||
tcpip_enginetime_timer(NULL);
|
snmpv3_enginetime_timer(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -71,7 +71,8 @@ static u32_t engineboots = 0;
|
|||||||
*
|
*
|
||||||
* @return pointer to the user table entry or NULL if not found.
|
* @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;
|
size_t i;
|
||||||
|
|
||||||
@ -88,7 +89,8 @@ static struct user_table_entry *get_user(const char *username)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8_t snmpv3_get_amount_of_users(void)
|
u8_t
|
||||||
|
snmpv3_get_amount_of_users(void)
|
||||||
{
|
{
|
||||||
return LWIP_ARRAYSIZE(user_table);
|
return LWIP_ARRAYSIZE(user_table);
|
||||||
}
|
}
|
||||||
@ -99,7 +101,8 @@ u8_t snmpv3_get_amount_of_users(void)
|
|||||||
* @param index is the user index.
|
* @param index is the user index.
|
||||||
* @return ERR_OK if user is found, ERR_VAL is user is not found.
|
* @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)) {
|
if (index < LWIP_ARRAYSIZE(user_table)) {
|
||||||
MEMCPY(username, user_table[index].username, sizeof(user_table[0].username));
|
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
|
* @param arg unused argument
|
||||||
*/
|
*/
|
||||||
void tcpip_enginetime_timer(void *arg)
|
void
|
||||||
|
snmpv3_enginetime_timer(void *arg)
|
||||||
{
|
{
|
||||||
LWIP_UNUSED_ARG(arg);
|
LWIP_UNUSED_ARG(arg);
|
||||||
|
|
||||||
@ -124,7 +128,7 @@ void tcpip_enginetime_timer(void *arg)
|
|||||||
snmpv3_get_engine_time_internal();
|
snmpv3_get_engine_time_internal();
|
||||||
|
|
||||||
/* restart timer */
|
/* restart timer */
|
||||||
sys_timeout(1000, tcpip_enginetime_timer, NULL);
|
sys_timeout(1000, snmpv3_enginetime_timer, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t
|
err_t
|
||||||
|
@ -161,14 +161,14 @@ snmpv3_crypt(struct snmp_pbuf_stream* stream, u16_t length,
|
|||||||
goto error;
|
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);
|
out_len = LWIP_ARRAYSIZE(out_bytes);
|
||||||
if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) {
|
if(mbedtls_cipher_finish(&ctx, out_bytes, &out_len) != 0) {
|
||||||
goto error;
|
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) {
|
} else if (algo == SNMP_V3_PRIV_ALGO_AES) {
|
||||||
u8_t iv_local[16];
|
u8_t iv_local[16];
|
||||||
|
|
||||||
|
@ -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,
|
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);
|
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);
|
err_t snmpv3_build_priv_param(u8_t* priv_param);
|
||||||
void tcpip_enginetime_timer(void *arg);
|
void snmpv3_enginetime_timer(void *arg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user