Beispiel #1
0
            private void _parse()
            {
                _hdr = new AsnHdr(m_io, this, m_root);
                switch (Hdr.Tag)
                {
                case Snmp.AsnTypeTag.Set: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodySequence(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.OctetString: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodyPrintableString(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.Utf8string: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodyUtf8string(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.Sequence30: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodySequence(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.Integer: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodyInteger(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.Sequence10: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodySequence(io___raw_body, this, m_root);
                    break;
                }

                case Snmp.AsnTypeTag.PrintableString: {
                    __raw_body = m_io.ReadBytes(Hdr.Len.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new BodyPrintableString(io___raw_body, this, m_root);
                    break;
                }

                default: {
                    _body = m_io.ReadBytes(Hdr.Len.Value);
                    break;
                }
                }
            }
Beispiel #2
0
            private void _read()
            {
                _hdr      = new AsnHdr(m_io, this, m_root);
                __raw_val = m_io.ReadBytes(Hdr.Len.Value);
                var io___raw_val = new KaitaiStream(__raw_val);

                _val = new BodyInteger(io___raw_val, this, m_root);
            }
Beispiel #3
0
        private void _parse()
        {
            _hdr       = new AsnHdr(m_io, this, m_root);
            _version   = new AsnObj(m_io, this, m_root);
            _community = new AsnObj(m_io, this, m_root);
            _pduType   = new AsnHdr(m_io, this, m_root);
            switch (PduType.Tag)
            {
            case AsnTypeTag.SnmpPduTrapv1: {
                _data = new Trap1(m_io, this, m_root);
                break;
            }

            case AsnTypeTag.SnmpPduTrapv2: {
                _data = new Trap2(m_io, this, m_root);
                break;
            }

            case AsnTypeTag.SnmpPduSet: {
                _data = new SetRequest(m_io, this, m_root);
                break;
            }

            case AsnTypeTag.SnmpPduResponse: {
                _data = new Response(m_io, this, m_root);
                break;
            }

            case AsnTypeTag.SnmpPduGet: {
                _data = new GetRequest(m_io, this, m_root);
                break;
            }

            case AsnTypeTag.SnmpPduGetnext: {
                _data = new GetNextRequest(m_io, this, m_root);
                break;
            }
            }
        }