Class Net::LDAP::PDU
In: lib/net/ldap/pdu.rb
Parent: Object

Defines the Protocol Data Unit (PDU) for LDAP. An LDAP PDU always looks like a BER SEQUENCE with at least two elements: an INTEGER message ID number and an application-specific SEQUENCE. Some LDAPv3 packets also include an optional third element, a sequence of "controls" (see RFC 2251 section 4.1.12 for more information).

The application-specific tag in the sequence tells us what kind of packet it is, and each kind has its own format, defined in RFC-1777.

Observe that many clients (such as ldapsearch) do not necessarily enforce the expected application tags on received protocol packets. This implementation does interpret the RFC strictly in this regard, and it remains to be seen whether there are servers out there that will not work well with our approach.

Currently, we only support controls on SearchResult.

Methods

Classes and Modules

Class Net::LDAP::PDU::Error

Constants

BindRequest = 0   This message packet is a bind request.
BindResult = 1
UnbindRequest = 2
SearchRequest = 3
SearchReturnedData = 4
SearchResult = 5
ModifyResponse = 7
AddResponse = 9
DeleteResponse = 11
ModifyRDNResponse = 13
SearchResultReferral = 19
ExtendedRequest = 23
ExtendedResponse = 24

External Aliases

message_id -> msg_id
ldap_controls -> result_controls

Attributes

app_tag  [R]  The application protocol format tag.
bind_parameters  [R] 
ldap_controls  [R]  Returns RFC-2251 Controls if any.
message_id  [R]  The LDAP packet message ID.
search_entry  [R] 
search_parameters  [R] 
search_referrals  [R] 

Public Class methods

Messy. Does this functionality belong somewhere else?

Public Instance methods

Returns a hash which (usually) defines the members :resultCode, :errorMessage, and :matchedDN. These values come directly from an LDAP response packet returned by the remote peer. Also see result_code.

This returns an LDAP result code taken from the PDU, but it will be nil if there wasn‘t a result code. That can easily happen depending on the type of packet.

Return serverSaslCreds, which are only present in BindResponse packets.

[Validate]