mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 07:33:11 +00:00
msg_in.c, msg_out.c, snmp_msg.h: rename snmp_publiccommunity to snmp_community, update descriptions
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com>
This commit is contained in:
parent
9469bdc93e
commit
c289872ab7
@ -50,8 +50,8 @@
|
|||||||
/* public (non-static) constants */
|
/* public (non-static) constants */
|
||||||
/** SNMP v1 == 0 */
|
/** SNMP v1 == 0 */
|
||||||
const s32_t snmp_version = 0;
|
const s32_t snmp_version = 0;
|
||||||
/** default SNMP community string */
|
/** SNMP community string */
|
||||||
const char snmp_publiccommunity[] = "public";
|
const char snmp_community[] = "public";
|
||||||
|
|
||||||
/* statically allocated buffers for SNMP_CONCURRENT_REQUESTS */
|
/* statically allocated buffers for SNMP_CONCURRENT_REQUESTS */
|
||||||
struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS];
|
struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS];
|
||||||
@ -974,7 +974,7 @@ snmp_pdu_header_check(struct pbuf *p, u16_t ofs, u16_t pdu_len, u16_t *ofs_ret,
|
|||||||
len = ((len < (SNMP_COMMUNITY_STR_LEN))?(len):(SNMP_COMMUNITY_STR_LEN));
|
len = ((len < (SNMP_COMMUNITY_STR_LEN))?(len):(SNMP_COMMUNITY_STR_LEN));
|
||||||
m_stat->community[len] = 0;
|
m_stat->community[len] = 0;
|
||||||
m_stat->com_strlen = (u8_t)len;
|
m_stat->com_strlen = (u8_t)len;
|
||||||
if (strncmp(snmp_publiccommunity, (const char*)m_stat->community, SNMP_COMMUNITY_STR_LEN) != 0)
|
if (strncmp(snmp_community, (const char*)m_stat->community, SNMP_COMMUNITY_STR_LEN) != 0)
|
||||||
{
|
{
|
||||||
/** @todo: move this if we need to check more names */
|
/** @todo: move this if we need to check more names */
|
||||||
snmp_inc_snmpinbadcommunitynames();
|
snmp_inc_snmpinbadcommunitynames();
|
||||||
|
@ -400,7 +400,7 @@ snmp_trap_header_sum(struct snmp_msg_trap *m_trap, u16_t vb_len)
|
|||||||
snmp_asn1_enc_length_cnt(thl->pdulen, &thl->pdulenlen);
|
snmp_asn1_enc_length_cnt(thl->pdulen, &thl->pdulenlen);
|
||||||
tot_len += 1 + thl->pdulenlen;
|
tot_len += 1 + thl->pdulenlen;
|
||||||
|
|
||||||
thl->comlen = strlen(snmp_publiccommunity);
|
thl->comlen = strlen(snmp_community);
|
||||||
snmp_asn1_enc_length_cnt(thl->comlen, &thl->comlenlen);
|
snmp_asn1_enc_length_cnt(thl->comlen, &thl->comlenlen);
|
||||||
tot_len += 1 + thl->comlenlen + thl->comlen;
|
tot_len += 1 + thl->comlenlen + thl->comlen;
|
||||||
|
|
||||||
@ -567,7 +567,7 @@ snmp_trap_header_enc(struct snmp_msg_trap *m_trap, struct pbuf *p)
|
|||||||
ofs += 1;
|
ofs += 1;
|
||||||
snmp_asn1_enc_length(p, ofs, m_trap->thl.comlen);
|
snmp_asn1_enc_length(p, ofs, m_trap->thl.comlen);
|
||||||
ofs += m_trap->thl.comlenlen;
|
ofs += m_trap->thl.comlenlen;
|
||||||
snmp_asn1_enc_raw(p, ofs, m_trap->thl.comlen, (u8_t *)&snmp_publiccommunity[0]);
|
snmp_asn1_enc_raw(p, ofs, m_trap->thl.comlen, (u8_t *)&snmp_community[0]);
|
||||||
ofs += m_trap->thl.comlen;
|
ofs += m_trap->thl.comlen;
|
||||||
|
|
||||||
snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_CONTXT | SNMP_ASN1_CONSTR | SNMP_ASN1_PDU_TRAP));
|
snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_CONTXT | SNMP_ASN1_CONSTR | SNMP_ASN1_PDU_TRAP));
|
||||||
|
@ -282,8 +282,8 @@ struct snmp_msg_trap
|
|||||||
|
|
||||||
/** Agent Version constant, 0 = v1 oddity */
|
/** Agent Version constant, 0 = v1 oddity */
|
||||||
extern const s32_t snmp_version;
|
extern const s32_t snmp_version;
|
||||||
/** Agent default "public" community string */
|
/** Agent community string */
|
||||||
extern const char snmp_publiccommunity[];
|
extern const char snmp_community[];
|
||||||
|
|
||||||
extern struct snmp_msg_trap trap_msg;
|
extern struct snmp_msg_trap trap_msg;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user