SNMP: mib-2.system.sysDescr is read-only, so add const qualifiers to functions and pointers

Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
This commit is contained in:
Freddie Chopin 2013-10-26 19:27:25 +02:00 committed by Simon Goldschmidt
parent e6202cfa97
commit 4e1320d480
2 changed files with 4 additions and 4 deletions

View File

@ -772,8 +772,8 @@ static const s32_t sysservices = SNMP_SYSSERVICES;
/** mib-2.system.sysDescr */ /** mib-2.system.sysDescr */
static const u8_t sysdescr_len_default = 4; static const u8_t sysdescr_len_default = 4;
static const u8_t sysdescr_default[] = "lwIP"; static const u8_t sysdescr_default[] = "lwIP";
static u8_t* sysdescr_len_ptr = (u8_t*)&sysdescr_len_default; static const u8_t* sysdescr_len_ptr = &sysdescr_len_default;
static u8_t* sysdescr_ptr = (u8_t*)&sysdescr_default[0]; static const u8_t* sysdescr_ptr = &sysdescr_default[0];
/** mib-2.system.sysContact */ /** mib-2.system.sysContact */
static const u8_t syscontact_len_default = 0; static const u8_t syscontact_len_default = 0;
static const u8_t syscontact_default[] = ""; static const u8_t syscontact_default[] = "";
@ -933,7 +933,7 @@ void objectidncpy(s32_t *dst, const s32_t *src, u8_t n)
* @param str if non-NULL then copy str pointer * @param str if non-NULL then copy str pointer
* @param len points to string length, excluding zero terminator * @param len points to string length, excluding zero terminator
*/ */
void snmp_set_sysdescr(u8_t *str, u8_t *len) void snmp_set_sysdescr(const u8_t *str, const u8_t *len)
{ {
if (str != NULL) if (str != NULL)
{ {

View File

@ -98,7 +98,7 @@ struct snmp_obj_id
}; };
/* system */ /* system */
void snmp_set_sysdescr(u8_t* str, u8_t* len); void snmp_set_sysdescr(const u8_t* str, const u8_t* len);
void snmp_set_sysobjid(struct snmp_obj_id *oid); void snmp_set_sysobjid(struct snmp_obj_id *oid);
void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid); void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid);
void snmp_inc_sysuptime(void); void snmp_inc_sysuptime(void);