decode_pdu (SNMP::Message)

    # File lib/snmp/pdu.rb, line 57
            def decode_pdu(version, data)
                pdu_tag, pdu_data, remainder = decode_tlv(data)
                case pdu_tag
                when GetRequest_PDU_TAG
                    pdu = PDU.decode(GetRequest, pdu_data)
                when GetNextRequest_PDU_TAG
                    pdu = PDU.decode(GetNextRequest, pdu_data)
                when Response_PDU_TAG
                    pdu = PDU.decode(Response, pdu_data)
                when SetRequest_PDU_TAG
                    pdu = PDU.decode(SetRequest, pdu_data)
                when SNMPv1_Trap_PDU_TAG
                    raise InvalidPduTag, "SNMPv1-trap not valid for #{version.to_s}" if version != :SNMPv1
                    pdu = SNMPv1_Trap.decode(pdu_data)
                when GetBulkRequest_PDU_TAG
                    raise InvalidPduTag, "get-bulk not valid for #{version.to_s}" if version != :SNMPv2c
                    pdu = PDU.decode(GetBulkRequest, pdu_data)
                when InformRequest_PDU_TAG
                    raise InvalidPduTag, "inform not valid for #{version.to_s}" if version != :SNMPv2c
                    pdu = PDU.decode(InformRequest, pdu_data)
                when SNMPv2_Trap_PDU_TAG
                    raise InvalidPduTag, "SNMPv2c-trap not valid for #{version.to_s}" if version != :SNMPv2c
                    pdu = PDU.decode(SNMPv2_Trap, pdu_data)
                else
                    raise UnsupportedPduTag, pdu_tag.to_s
                end
                return pdu, remainder
            end