# File lib/net/ldap/pdu.rb, line 71
                def initialize ber_object
                        begin
                                @msg_id = ber_object[0].to_i
                                # Modified 25Nov06. We want to "un-decorate" the ber-identifier
                                # of the incoming packet. Originally we did this by subtracting 0x60,
                                # which ASSUMES the identifier is a constructed app-specific value.
                                # But at least one value (UnbindRequest) is app-specific primitive.
                                # So it makes more sense just to grab the bottom five bits.
                                #@app_tag = ber_object[1].ber_identifier - 0x60
                                @app_tag = ber_object[1].ber_identifier & 31
                                @ldap_controls = []
                        rescue
                                # any error becomes a data-format error
                                raise LdapPduError.new( "ldap-pdu format error" )
                        end

                        case @app_tag
                        when BindResult
                                parse_bind_response ber_object[1]
                        when SearchReturnedData
                                parse_search_return ber_object[1]
                        when SearchResultReferral
                                parse_search_referral ber_object[1]
                        when SearchResult
                                parse_ldap_result ber_object[1]
                                parse_controls(ber_object[2]) if ber_object[2]
                        when ModifyResponse
                                parse_ldap_result ber_object[1]
                        when AddResponse
                                parse_ldap_result ber_object[1]
                        when DeleteResponse
                                parse_ldap_result ber_object[1]
                        when ModifyRDNResponse
                                parse_ldap_result ber_object[1]
                        when SearchRequest
                                parse_ldap_search_request ber_object[1]
                        when BindRequest
                                parse_bind_request ber_object[1]
                        when UnbindRequest
                                parse_unbind_request ber_object[1]
                        when ExtendedResponse
                                parse_ldap_result ber_object[1]
                        else
                                raise LdapPduError.new( "unknown pdu-type: #{@app_tag}" )
                        end
                end