50 snmp_asn1_enc_length_cnt(
u16_t length,
u8_t *octets_needed)
56 else if (length < 0x100U)
77 snmp_asn1_enc_u32t_cnt(
u32_t value,
u16_t *octets_needed)
83 else if (value < 0x8000UL)
87 else if (value < 0x800000UL)
91 else if (value < 0x80000000UL)
110 snmp_asn1_enc_s32t_cnt(
s32_t value,
u16_t *octets_needed)
120 else if (value < 0x8000L)
124 else if (value < 0x800000L)
142 snmp_asn1_enc_oid_cnt(
u8_t ident_len,
s32_t *ident,
u16_t *octets_needed)
169 *octets_needed = cnt;
194 msg_ptr += ofs - base;
226 msg_ptr += ofs - base;
230 *msg_ptr = (
u8_t)length;
233 else if (length < 0x100)
249 *msg_ptr = (
u8_t)length;
279 *msg_ptr = (
u8_t)length;
284 *msg_ptr = (
u8_t)(length >> 8);
321 msg_ptr += ofs - base;
323 if (octets_needed == 5)
343 while (octets_needed > 1)
346 *msg_ptr = (
u8_t)(value >> (octets_needed << 3));
363 *msg_ptr = (
u8_t)value;
397 msg_ptr += ofs - base;
399 while (octets_needed > 1)
402 *msg_ptr = (
u8_t)(value >> (octets_needed << 3));
419 *msg_ptr = (
u8_t)value;
451 msg_ptr += ofs - base;
455 if ((ident[0] == 1) && (ident[1] == 3))
463 *msg_ptr = (
u8_t)((ident[0] * 40) + ident[1]);
488 while (ident_len > 0)
501 code = (
u8_t)(sub_id >> shift);
502 if ((code != 0) || (tail != 0))
505 *msg_ptr = code | 0x80;
523 *msg_ptr = (
u8_t)sub_id & 0x7F;
575 msg_ptr += ofs - base;