From 9dd6c28523e60f5c5767036d686ffdc371632dcc Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 24 Jan 2010 14:35:28 +0000 Subject: [PATCH] bug #26523: Compiler Warnings --- src/core/snmp/asn1_enc.c | 28 +++++----- src/core/snmp/mib2.c | 104 ++++++++++++++++++++++------------- src/core/snmp/mib_structs.c | 8 ++- src/core/snmp/msg_in.c | 17 ++++-- src/include/lwip/snmp_asn1.h | 6 +- 5 files changed, 100 insertions(+), 63 deletions(-) diff --git a/src/core/snmp/asn1_enc.c b/src/core/snmp/asn1_enc.c index 77af6b4b..8f76bd9b 100644 --- a/src/core/snmp/asn1_enc.c +++ b/src/core/snmp/asn1_enc.c @@ -227,7 +227,7 @@ snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length) if (length < 0x80) { - *msg_ptr = length; + *msg_ptr = (u8_t)length; return ERR_OK; } else if (length < 0x100) @@ -246,7 +246,7 @@ snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length) /* next octet in same pbuf */ msg_ptr++; } - *msg_ptr = length; + *msg_ptr = (u8_t)length; return ERR_OK; } else @@ -276,12 +276,12 @@ snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length) if (i == 0) { /* least significant length octet */ - *msg_ptr = length; + *msg_ptr = (u8_t)length; } else { /* most significant length octet */ - *msg_ptr = length >> 8; + *msg_ptr = (u8_t)(length >> 8); } } return ERR_OK; @@ -305,7 +305,7 @@ snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length) * @see snmp_asn1_enc_u32t_cnt() */ err_t -snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, u32_t value) +snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value) { u16_t plen, base; u8_t *msg_ptr; @@ -343,7 +343,7 @@ snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, u32_t value) while (octets_needed > 1) { octets_needed--; - *msg_ptr = value >> (octets_needed << 3); + *msg_ptr = (u8_t)(value >> (octets_needed << 3)); ofs += 1; if (ofs >= plen) { @@ -360,7 +360,7 @@ snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, u32_t value) } } /* (only) one least significant octet */ - *msg_ptr = value; + *msg_ptr = (u8_t)value; return ERR_OK; } p = p->next; @@ -381,7 +381,7 @@ snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, u32_t value) * @see snmp_asn1_enc_s32t_cnt() */ err_t -snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, s32_t value) +snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value) { u16_t plen, base; u8_t *msg_ptr; @@ -399,7 +399,7 @@ snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, s32_t value) while (octets_needed > 1) { octets_needed--; - *msg_ptr = value >> (octets_needed << 3); + *msg_ptr = (u8_t)(value >> (octets_needed << 3)); ofs += 1; if (ofs >= plen) { @@ -416,7 +416,7 @@ snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, s32_t value) } } /* (only) one least significant octet */ - *msg_ptr = value; + *msg_ptr = (u8_t)value; return ERR_OK; } p = p->next; @@ -460,7 +460,7 @@ snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident) else { /* calculate prefix */ - *msg_ptr = (ident[0] * 40) + ident[1]; + *msg_ptr = (u8_t)((ident[0] * 40) + ident[1]); } ofs += 1; if (ofs >= plen) @@ -498,7 +498,7 @@ snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident) { u8_t code; - code = sub_id >> shift; + code = (u8_t)(sub_id >> shift); if ((code != 0) || (tail != 0)) { tail = 1; @@ -559,11 +559,13 @@ snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident) * @return ERR_OK if successfull, ERR_ARG if we can't (or won't) encode */ err_t -snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u8_t raw_len, u8_t *raw) +snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw) { u16_t plen, base; u8_t *msg_ptr; + LWIP_ASSERT("raw_len <= 0xffff", raw_len <= 0xffff); + plen = 0; while (p != NULL) { diff --git a/src/core/snmp/mib2.c b/src/core/snmp/mib2.c index bc5830d6..afb3c312 100644 --- a/src/core/snmp/mib2.c +++ b/src/core/snmp/mib2.c @@ -898,11 +898,11 @@ static u32_t snmpinpkts = 0, * @param src points to source * @param n number of octets to copy. */ -void ocstrncpy(u8_t *dst, u8_t *src, u8_t n) +static void ocstrncpy(u8_t *dst, u8_t *src, u16_t n) { - while (n > 0) - { - n--; + u16_t i = n; + while (i > 0) { + i--; *dst++ = *src++; } } @@ -916,9 +916,9 @@ void ocstrncpy(u8_t *dst, u8_t *src, u8_t n) */ void objectidncpy(s32_t *dst, s32_t *src, u8_t n) { - while(n > 0) - { - n--; + u8_t i = n; + while(i > 0) { + i--; *dst++ = *src++; } } @@ -2129,7 +2129,8 @@ system_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; LWIP_DEBUGF(SNMP_MIB_DEBUG,("get_object_def system.%"U16_F".0\n",(u16_t)id)); switch (id) { @@ -2201,7 +2202,8 @@ system_get_value(struct obj_def *od, u16_t len, void *value) { u8_t id; - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* sysDescr */ @@ -2240,7 +2242,8 @@ system_set_test(struct obj_def *od, u16_t len, void *value) LWIP_UNUSED_ARG(value); set_ok = 0; - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 4: /* sysContact */ @@ -2273,20 +2276,22 @@ system_set_value(struct obj_def *od, u16_t len, void *value) { u8_t id; - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid len", len <= 0xff); + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 4: /* sysContact */ ocstrncpy(syscontact_ptr,value,len); - *syscontact_len_ptr = len; + *syscontact_len_ptr = (u8_t)len; break; case 5: /* sysName */ ocstrncpy(sysname_ptr,value,len); - *sysname_len_ptr = len; + *sysname_len_ptr = (u8_t)len; break; case 6: /* sysLocation */ ocstrncpy(syslocation_ptr,value,len); - *syslocation_len_ptr = len; + *syslocation_len_ptr = (u8_t)len; break; }; } @@ -2360,7 +2365,8 @@ ifentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; LWIP_DEBUGF(SNMP_MIB_DEBUG,("get_object_def ifentry.%"U16_F"\n",(u16_t)id)); switch (id) { @@ -2461,7 +2467,8 @@ ifentry_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; snmp_ifindextonetif(od->id_inst_ptr[1], &netif); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* ifIndex */ @@ -2734,7 +2741,8 @@ atentry_get_value(struct obj_def *od, u16_t len, void *value) #if LWIP_ARP /** @todo implement a netif_find_addr */ if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1) { - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* atIfIndex */ @@ -2775,7 +2783,8 @@ ip_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; LWIP_DEBUGF(SNMP_MIB_DEBUG,("get_object_def ip.%"U16_F".0\n",(u16_t)id)); switch (id) { @@ -2833,7 +2842,8 @@ ip_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* ipForwarding */ @@ -2988,7 +2998,8 @@ ip_set_test(struct obj_def *od, u16_t len, void *value) LWIP_UNUSED_ARG(len); set_ok = 0; - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* ipForwarding */ @@ -3027,7 +3038,8 @@ ip_addrentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; switch (id) { case 1: /* ipAdEntAddr */ @@ -3078,7 +3090,8 @@ ip_addrentry_get_value(struct obj_def *od, u16_t len, void *value) if (netif != NULL) { - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* ipAdEntAddr */ @@ -3148,7 +3161,8 @@ ip_rteentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; switch (id) { case 1: /* ipRouteDest */ @@ -3227,7 +3241,8 @@ ip_rteentry_get_value(struct obj_def *od, u16_t len, void *value) } if (netif != NULL) { - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; switch (id) { case 1: /* ipRouteDest */ @@ -3363,7 +3378,8 @@ ip_ntomentry_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; switch (id) { case 1: /* ipNetToMediaIfIndex */ @@ -3419,7 +3435,8 @@ ip_ntomentry_get_value(struct obj_def *od, u16_t len, void *value) #if LWIP_ARP /** @todo implement a netif_find_addr */ if (etharp_find_addr(netif, &ip, ðaddr_ret, &ipaddr_ret) > -1) { - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* ipNetToMediaIfIndex */ @@ -3485,7 +3502,8 @@ icmp_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* icmpInMsgs */ @@ -3584,7 +3602,8 @@ tcp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; LWIP_DEBUGF(SNMP_MIB_DEBUG,("get_object_def tcp.%"U16_F".0\n",(u16_t)id)); switch (id) @@ -3639,7 +3658,8 @@ tcp_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* tcpRtoAlgorithm, vanj(4) */ @@ -3807,7 +3827,8 @@ udp_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* udpInDatagrams */ @@ -3875,7 +3896,8 @@ udpentry_get_value(struct obj_def *od, u16_t len, void *value) LWIP_UNUSED_ARG(len); snmp_oidtoip(&od->id_inst_ptr[1], &ip); ip.addr = htonl(ip.addr); - port = od->id_inst_ptr[5]; + LWIP_ASSERT("invalid port", (od->id_inst_ptr[5] >= 0) && (od->id_inst_ptr[5] <= 0xffff)); + port = (u16_t)od->id_inst_ptr[5]; pcb = udp_pcbs; while ((pcb != NULL) && @@ -3887,7 +3909,8 @@ udpentry_get_value(struct obj_def *od, u16_t len, void *value) if (pcb != NULL) { - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* udpLocalAddress */ @@ -3919,7 +3942,8 @@ snmp_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od) od->id_inst_len = ident_len; od->id_inst_ptr = ident; - id = ident[0]; + LWIP_ASSERT("invalid id", (ident[0] >= 0) && (ident[0] <= 0xff)); + id = (u8_t)ident[0]; switch (id) { case 1: /* snmpInPkts */ @@ -3980,7 +4004,8 @@ snmp_get_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; switch (id) { case 1: /* snmpInPkts */ @@ -4084,7 +4109,8 @@ snmp_set_test(struct obj_def *od, u16_t len, void *value) LWIP_UNUSED_ARG(len); set_ok = 0; - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; if (id == 30) { /* snmpEnableAuthenTraps */ @@ -4116,12 +4142,14 @@ snmp_set_value(struct obj_def *od, u16_t len, void *value) u8_t id; LWIP_UNUSED_ARG(len); - id = od->id_inst_ptr[0]; + LWIP_ASSERT("invalid id", (od->id_inst_ptr[0] >= 0) && (od->id_inst_ptr[0] <= 0xff)); + id = (u8_t)od->id_inst_ptr[0]; if (id == 30) { /* snmpEnableAuthenTraps */ - s32_t *sint_ptr = value; - *snmpenableauthentraps_ptr = *sint_ptr; + /* @todo @fixme: which kind of pointer is 'value'? s32_t or u8_t??? */ + u8_t *ptr = value; + *snmpenableauthentraps_ptr = *ptr; } } diff --git a/src/core/snmp/mib_structs.c b/src/core/snmp/mib_structs.c index 5f488b1e..f4dc2929 100644 --- a/src/core/snmp/mib_structs.c +++ b/src/core/snmp/mib_structs.c @@ -95,7 +95,7 @@ void snmp_ifindextonetif(s32_t ifindex, struct netif **netif) { struct netif *nif = netif_list; - u16_t i, ifidx; + s32_t i, ifidx; ifidx = ifindex - 1; i = 0; @@ -754,7 +754,8 @@ snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snm LWIP_DEBUGF(SNMP_MIB_DEBUG,("non-leaf node\n")); /* non-leaf, store right child ptr and id */ - j = i + 1; + LWIP_ASSERT("i < 0xff", i < 0xff); + j = (u8_t)i + 1; while ((j < an->maxlength) && (empty_table(an->nptr[j]))) { j++; @@ -996,7 +997,8 @@ snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snm LWIP_DEBUGF(SNMP_MIB_DEBUG,("non-leaf node\n")); /* non-leaf, store right child ptr and id */ - j = i + 1; + LWIP_ASSERT("i < 0xff", i < 0xff); + j = (u8_t)i + 1; if (j < len) { /* right node is the current external node */ diff --git a/src/core/snmp/msg_in.c b/src/core/snmp/msg_in.c index 49aaa2f4..194b67df 100644 --- a/src/core/snmp/msg_in.c +++ b/src/core/snmp/msg_in.c @@ -186,7 +186,8 @@ snmp_msg_get_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->vb_ptr->ident_len = 0; vb->value_type = msg_ps->ext_object_def.asn_type; - vb->value_len = msg_ps->ext_object_def.v_len; + LWIP_ASSERT("invalid length", msg_ps->ext_object_def.v_len <= 0xff); + vb->value_len = (u8_t)msg_ps->ext_object_def.v_len; if (vb->value_len > 0) { vb->value = mem_malloc(vb->value_len); @@ -298,7 +299,8 @@ snmp_msg_get_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->vb_ptr->ident_len = 0; vb->value_type = object_def.asn_type; - vb->value_len = object_def.v_len; + LWIP_ASSERT("invalid length", object_def.v_len <= 0xff); + vb->value_len = (u8_t)object_def.v_len; if (vb->value_len > 0) { vb->value = mem_malloc(vb->value_len); @@ -394,9 +396,10 @@ snmp_msg_getnext_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) /* get_value() answer */ en = msg_ps->ext_mib_node; + LWIP_ASSERT("invalid length", msg_ps->ext_object_def.v_len <= 0xff); vb = snmp_varbind_alloc(&msg_ps->ext_oid, msg_ps->ext_object_def.asn_type, - msg_ps->ext_object_def.v_len); + (u8_t)msg_ps->ext_object_def.v_len); if (vb != NULL) { en->get_value_a(request_id, &msg_ps->ext_object_def, vb->value_len, vb->value); @@ -468,7 +471,8 @@ snmp_msg_getnext_event(u8_t request_id, struct snmp_msg_pstat *msg_ps) msg_ps->state = SNMP_MSG_INTERNAL_GET_OBJDEF; mn->get_object_def(1, &oid.id[oid.len - 1], &object_def); - vb = snmp_varbind_alloc(&oid, object_def.asn_type, object_def.v_len); + LWIP_ASSERT("invalid length", object_def.v_len <= 0xff); + vb = snmp_varbind_alloc(&oid, object_def.asn_type, (u8_t)object_def.v_len); if (vb != NULL) { msg_ps->state = SNMP_MSG_INTERNAL_GET_VALUE; @@ -978,7 +982,7 @@ snmp_pdu_header_check(struct pbuf *p, u16_t ofs, u16_t pdu_len, u16_t *ofs_ret, /* add zero terminator */ len = ((len < (SNMP_COMMUNITY_STR_LEN))?(len):(SNMP_COMMUNITY_STR_LEN)); m_stat->community[len] = 0; - m_stat->com_strlen = len; + m_stat->com_strlen = (u8_t)len; if (strncmp(snmp_publiccommunity, (const char*)m_stat->community, SNMP_COMMUNITY_STR_LEN) != 0) { /** @todo: move this if we need to check more names */ @@ -1223,7 +1227,8 @@ snmp_pdu_dec_varbindlist(struct pbuf *p, u16_t ofs, u16_t *ofs_ret, struct snmp_ break; case (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR): case (SNMP_ASN1_APPLIC | SNMP_ASN1_PRIMIT | SNMP_ASN1_OPAQUE): - vb = snmp_varbind_alloc(&oid, type, len); + LWIP_ASSERT("invalid length", len <= 0xff); + vb = snmp_varbind_alloc(&oid, type, (u8_t)len); if (vb != NULL) { derr = snmp_asn1_dec_raw(p, ofs + 1 + len_octets, len, vb->value_len, vb->value); diff --git a/src/include/lwip/snmp_asn1.h b/src/include/lwip/snmp_asn1.h index 8a602881..b6996ca9 100644 --- a/src/include/lwip/snmp_asn1.h +++ b/src/include/lwip/snmp_asn1.h @@ -87,10 +87,10 @@ void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed); void snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed); err_t snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type); err_t snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length); -err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, u32_t value); -err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u8_t octets_needed, s32_t value); +err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value); +err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value); err_t snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident); -err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u8_t raw_len, u8_t *raw); +err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw); #ifdef __cplusplus }