From 52da49cd8116011a1b8a8a1b93f092db142a1920 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 8 Jul 2016 10:24:06 +0200 Subject: [PATCH] snmp: changed name (snmp_length_outbound_varbind -> snmp_varbind_length) --- src/apps/snmp/snmp_msg.c | 5 +++-- src/apps/snmp/snmp_msg.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/apps/snmp/snmp_msg.c b/src/apps/snmp/snmp_msg.c index e313c75e..6e4aa3b6 100644 --- a/src/apps/snmp/snmp_msg.c +++ b/src/apps/snmp/snmp_msg.c @@ -1167,8 +1167,9 @@ snmp_prepare_outbound_frame(struct snmp_request *request) return ERR_OK; } +/** Calculate the length of a varbind list */ err_t -snmp_length_outbound_varbind(struct snmp_varbind *varbind, struct snmp_varbind_len *len) +snmp_varbind_length(struct snmp_varbind *varbind, struct snmp_varbind_len *len) { /* calculate required lengths */ snmp_asn1_enc_oid_cnt(varbind->oid.id, varbind->oid.len, &len->oid_value_len); @@ -1239,7 +1240,7 @@ snmp_append_outbound_varbind(struct snmp_pbuf_stream *pbuf_stream, struct snmp_v struct snmp_varbind_len len; err_t err; - err = snmp_length_outbound_varbind(varbind, &len); + err = snmp_varbind_length(varbind, &len); if (err != ERR_OK) { return err; diff --git a/src/apps/snmp/snmp_msg.h b/src/apps/snmp/snmp_msg.h index 781dfd00..a14b05a6 100644 --- a/src/apps/snmp/snmp_msg.h +++ b/src/apps/snmp/snmp_msg.h @@ -160,6 +160,7 @@ struct snmp_request u8_t value_buffer[SNMP_MAX_VALUE_SIZE]; }; +/** A helper struct keeping length information about varbinds */ struct snmp_varbind_len { u8_t vb_len_len; @@ -180,7 +181,7 @@ extern void* snmp_traps_handle; void snmp_receive(void *handle, struct pbuf *p, const ip_addr_t *source_ip, u16_t port); err_t snmp_sendto(void *handle, struct pbuf *p, const ip_addr_t *dst, u16_t port); u8_t snmp_get_local_ip_for_dst(void* handle, const ip_addr_t *dst, ip_addr_t *result); -err_t snmp_length_outbound_varbind(struct snmp_varbind *varbind, struct snmp_varbind_len *len); +err_t snmp_varbind_length(struct snmp_varbind *varbind, struct snmp_varbind_len *len); err_t snmp_append_outbound_varbind(struct snmp_pbuf_stream *pbuf_stream, struct snmp_varbind* varbind); #ifdef __cplusplus