diff --git a/CHANGELOG b/CHANGELOG index 7807d902..af4263f7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -179,6 +179,9 @@ HISTORY ++ Bugfixes: + 2015-02-15: patches by Freddie Chopin + * snmp*: made community writable, fixed some const pointers + 2015-02-13: Simon Goldschmidt * msg_in.c: fixed bug #22070 "MIB_OBJECT_WRITE_ONLY not implemented in SNMP" diff --git a/src/core/snmp/asn1_enc.c b/src/core/snmp/asn1_enc.c index d24a5c45..c1667e79 100644 --- a/src/core/snmp/asn1_enc.c +++ b/src/core/snmp/asn1_enc.c @@ -139,7 +139,7 @@ snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed) * @param octets_needed points to the return value */ void -snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed) +snmp_asn1_enc_oid_cnt(u8_t ident_len, const s32_t *ident, u16_t *octets_needed) { s32_t sub_id; u8_t cnt; @@ -435,7 +435,7 @@ snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value) * @return ERR_OK if successful, ERR_ARG if we can't (or won't) encode */ err_t -snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident) +snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, const s32_t *ident) { u16_t plen, base; u8_t *msg_ptr; diff --git a/src/core/snmp/mib2.c b/src/core/snmp/mib2.c index 553b4de2..43cc631f 100644 --- a/src/core/snmp/mib2.c +++ b/src/core/snmp/mib2.c @@ -2022,7 +2022,7 @@ void snmp_inc_snmpouttraps(void) snmpouttraps++; } -void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid) +void snmp_get_snmpgrpid_ptr(const struct snmp_obj_id **oid) { *oid = &snmpgrp_id; } diff --git a/src/core/snmp/msg_out.c b/src/core/snmp/msg_out.c index 3de9d154..358cf6b7 100644 --- a/src/core/snmp/msg_out.c +++ b/src/core/snmp/msg_out.c @@ -218,7 +218,7 @@ snmp_send_response(struct snmp_msg_pstat *m_stat) * (sysObjectID) for specific traps. */ err_t -snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap) +snmp_send_trap(s8_t generic_trap, const struct snmp_obj_id *eoid, s32_t specific_trap) { struct snmp_trap_dst *td; struct netif *dst_if; diff --git a/src/include/lwip/snmp.h b/src/include/lwip/snmp.h index 6f1a3f0f..f9a52e2f 100644 --- a/src/include/lwip/snmp.h +++ b/src/include/lwip/snmp.h @@ -225,7 +225,7 @@ void snmp_inc_snmpoutgetnexts(void); void snmp_inc_snmpoutsetrequests(void); void snmp_inc_snmpoutgetresponses(void); void snmp_inc_snmpouttraps(void); -void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid); +void snmp_get_snmpgrpid_ptr(const struct snmp_obj_id **oid); void snmp_set_snmpenableauthentraps(u8_t *value); void snmp_get_snmpenableauthentraps(u8_t *value); diff --git a/src/include/lwip/snmp_asn1.h b/src/include/lwip/snmp_asn1.h index 9ef92288..b05c8e72 100644 --- a/src/include/lwip/snmp_asn1.h +++ b/src/include/lwip/snmp_asn1.h @@ -84,12 +84,12 @@ err_t snmp_asn1_dec_raw(struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_ void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed); void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed); 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); +void snmp_asn1_enc_oid_cnt(u8_t ident_len, const 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, 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_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, const s32_t *ident); err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw); #ifdef __cplusplus diff --git a/src/include/lwip/snmp_msg.h b/src/include/lwip/snmp_msg.h index 01ae5807..01d45ac8 100644 --- a/src/include/lwip/snmp_msg.h +++ b/src/include/lwip/snmp_msg.h @@ -265,7 +265,7 @@ struct snmp_msg_trap ip_addr_t dip; /* source enterprise ID (sysObjectID) */ - struct snmp_obj_id *enterprise; + const struct snmp_obj_id *enterprise; /* source IP address, raw network order format */ u8_t sip_raw[4]; /* generic trap code */ @@ -302,7 +302,7 @@ struct snmp_varbind* snmp_varbind_tail_remove(struct snmp_varbind_root *root); /** Handle an internal (recv) or external (private response) event. */ void snmp_msg_event(u8_t request_id); err_t snmp_send_response(struct snmp_msg_pstat *m_stat); -err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap); +err_t snmp_send_trap(s8_t generic_trap, const struct snmp_obj_id *eoid, s32_t specific_trap); void snmp_coldstart_trap(void); void snmp_authfail_trap(void);