Home | History | Annotate | Download | only in snmp

Lines Matching defs:ofs

73 static u16_t snmp_varbind_list_enc(struct snmp_varbind_root *root, struct pbuf *p, u16_t ofs);
142 u16_t ofs;
147 ofs = snmp_resp_header_enc(m_stat, p);
150 snmp_varbind_list_enc(&emptyvb, p, ofs);
154 snmp_varbind_list_enc(&m_stat->outvb, p, ofs);
264 u16_t ofs;
267 ofs = snmp_trap_header_enc(&trap_msg, p);
268 snmp_varbind_list_enc(&trap_msg.outvb, p, ofs);
489 u16_t ofs;
491 ofs = 0;
492 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_CONSTR | SNMP_ASN1_SEQ));
493 ofs += 1;
494 snmp_asn1_enc_length(p, ofs, m_stat->rhl.seqlen);
495 ofs += m_stat->rhl.seqlenlen;
497 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
498 ofs += 1;
499 snmp_asn1_enc_length(p, ofs, m_stat->rhl.verlen);
500 ofs += m_stat->rhl.verlenlen;
501 snmp_asn1_enc_s32t(p, ofs, m_stat->rhl.verlen, snmp_version);
502 ofs += m_stat->rhl.verlen;
504 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR));
505 ofs += 1;
506 snmp_asn1_enc_length(p, ofs, m_stat->rhl.comlen);
507 ofs += m_stat->rhl.comlenlen;
508 snmp_asn1_enc_raw(p, ofs, m_stat->rhl.comlen, m_stat->community);
509 ofs += m_stat->rhl.comlen;
511 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_CONTXT | SNMP_ASN1_CONSTR | SNMP_ASN1_PDU_GET_RESP));
512 ofs += 1;
513 snmp_asn1_enc_length(p, ofs, m_stat->rhl.pdulen);
514 ofs += m_stat->rhl.pdulenlen;
516 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
517 ofs
518 snmp_asn1_enc_length(p, ofs, m_stat->rhl.ridlen);
519 ofs += m_stat->rhl.ridlenlen;
520 snmp_asn1_enc_s32t(p, ofs, m_stat->rhl.ridlen, m_stat->rid);
521 ofs += m_stat->rhl.ridlen;
523 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
524 ofs += 1;
525 snmp_asn1_enc_length(p, ofs, m_stat->rhl.errstatlen);
526 ofs += m_stat->rhl.errstatlenlen;
527 snmp_asn1_enc_s32t(p, ofs, m_stat->rhl.errstatlen, m_stat->error_status);
528 ofs += m_stat->rhl.errstatlen;
530 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
531 ofs += 1;
532 snmp_asn1_enc_length(p, ofs, m_stat->rhl.erridxlen);
533 ofs += m_stat->rhl.erridxlenlen;
534 snmp_asn1_enc_s32t(p, ofs, m_stat->rhl.erridxlen, m_stat->error_index);
535 ofs += m_stat->rhl.erridxlen;
537 return ofs;
546 u16_t ofs;
548 ofs = 0;
549 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_CONSTR | SNMP_ASN1_SEQ));
550 ofs += 1;
551 snmp_asn1_enc_length(p, ofs, m_trap->thl.seqlen);
552 ofs += m_trap->thl.seqlenlen;
554 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
555 ofs += 1;
556 snmp_asn1_enc_length(p, ofs, m_trap->thl.verlen);
557 ofs += m_trap->thl.verlenlen;
558 snmp_asn1_enc_s32t(p, ofs, m_trap->thl.verlen, snmp_version);
559 ofs += m_trap->thl.verlen;
561 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR));
562 ofs += 1;
563 snmp_asn1_enc_length(p, ofs, m_trap->thl.comlen);
564 ofs += m_trap->thl.comlenlen;
565 snmp_asn1_enc_raw(p, ofs, m_trap->thl.comlen, (u8_t *)&snmp_publiccommunity[0]);
566 ofs += m_trap->thl.comlen;
568 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_CONTXT | SNMP_ASN1_CONSTR | SNMP_ASN1_PDU_TRAP));
569 ofs += 1;
570 snmp_asn1_enc_length(p, ofs, m_trap->thl.pdulen);
571 ofs += m_trap->thl.pdulenlen;
573 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OBJ_ID));
574 ofs += 1;
575 snmp_asn1_enc_length(p, ofs, m_trap->thl.eidlen);
576 ofs += m_trap->thl.eidlenlen;
577 snmp_asn1_enc_oid(p, ofs, m_trap->enterprise->len, &m_trap->enterprise->id[0]);
578 ofs += m_trap->thl.eidlen;
580 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_APPLIC | SNMP_ASN1_PRIMIT | SNMP_ASN1_IPADDR));
581 ofs += 1;
582 snmp_asn1_enc_length(p, ofs, m_trap->thl.aaddrlen);
583 ofs += m_trap->thl.aaddrlenlen;
584 snmp_asn1_enc_raw(p, ofs, m_trap->thl.aaddrlen, &m_trap->sip_raw[0]);
585 ofs += m_trap->thl.aaddrlen;
587 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
588 ofs += 1;
589 snmp_asn1_enc_length(p, ofs, m_trap->thl.gtrplen);
590 ofs += m_trap->thl.gtrplenlen;
591 snmp_asn1_enc_u32t(p, ofs, m_trap->thl.gtrplen, m_trap->gen_trap);
592 ofs += m_trap->thl.gtrplen;
594 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_INTEG));
595 ofs += 1;
596 snmp_asn1_enc_length(p, ofs, m_trap->thl.strplen);
597 ofs += m_trap->thl.strplenlen;
598 snmp_asn1_enc_u32t(p, ofs, m_trap->thl.strplen, m_trap->spc_trap);
599 ofs += m_trap->thl.strplen;
601 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_APPLIC | SNMP_ASN1_PRIMIT | SNMP_ASN1_TIMETICKS));
602 ofs += 1;
603 snmp_asn1_enc_length(p, ofs, m_trap->thl.tslen);
604 ofs += m_trap->thl.tslenlen;
605 snmp_asn1_enc_u32t(p, ofs, m_trap->thl.tslen, m_trap->ts);
606 ofs += m_trap->thl.tslen;
608 return ofs;
615 snmp_varbind_list_enc(struct snmp_varbind_root *root, struct pbuf *p, u16_t ofs)
622 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_CONSTR | SNMP_ASN1_SEQ));
623 ofs += 1;
624 snmp_asn1_enc_length(p, ofs, root->seqlen);
625 ofs += root->seqlenlen;
630 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_CONSTR | SNMP_ASN1_SEQ));
631 ofs += 1;
632 snmp_asn1_enc_length(p, ofs, vb->seqlen);
633 ofs += vb->seqlenlen;
635 snmp_asn1_enc_type(p, ofs, (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OBJ_ID));
636 ofs += 1;
637 snmp_asn1_enc_length(p, ofs, vb->olen);
638 ofs += vb->olenlen;
639 snmp_asn1_enc_oid(p, ofs, vb->ident_len, &vb->ident[0]);
640 ofs += vb->olen;
642 snmp_asn1_enc_type(p, ofs, vb->value_type);
643 ofs += 1;
644 snmp_asn1_enc_length(p, ofs, vb->vlen);
645 ofs += vb->vlenlen;
651 snmp_asn1_enc_s32t(p, ofs, vb->vlen, *sint_ptr);
657 snmp_asn1_enc_u32t(p, ofs, vb->vlen, *uint_ptr);
663 snmp_asn1_enc_raw(p, ofs, vb->vlen, raw_ptr);
669 snmp_asn1_enc_oid(p, ofs, vb->value_len / sizeof(s32_t), sint_ptr);
675 ofs += vb->vlen;
678 return ofs;