These routines are used to manage the low level I/O operations
performed by the Lightweight BER library. They are called implicitly
by the other libraries and usually do not need to be called directly
from applications. The I/O framework is modularized and new
transport layers can be supported by appropriately defining a
Sockbuf_IO structure and installing it onto an existing Sockbuf.
Sockbuf structures are allocated and freed by ber_sockbuf_alloc() and
ber_sockbuf_free(), respectively. The ber_sockbuf_ctrl() function is
used to get and set options related to a Sockbuf or to a specific I/O
layer of the Sockbuf. The ber_sockbuf_add_io() and
ber_sockbuf_remove_io() functions are used to add and remove specific
I/O layers on a Sockbuf.
Options for ber_sockbuf_ctrl() include:
Takes a Sockbuf_IO * argument and returns 1 if the given
handler is installed on the Sockbuf, otherwise returns 0.
Retrieves the file descriptor associated to the Sockbuf; arg
must be a ber_socket_t *. The return value will be 1 if a
valid descriptor was present, -1 otherwise.
Sets the file descriptor of the Sockbuf to the descriptor
pointed to by arg; arg must be a ber_socket_t *. The return
value will always be 1.
Toggles the non-blocking state of the file descriptor
associated to the Sockbuf. arg should be NULL to disable and
non-NULL to enable the non-blocking state. The return value
will be 1 for success, -1 otherwise.
Flush (read and discard) all available input on the Sockbuf.
The return value will be 1.
Returns non-zero if input is waiting to be read.
Returns non-zero if the Sockbuf is ready to be written.
Returns the maximum allowed size of an incoming message; arg
must be a ber_len_t *. The return value will be 1.
Sets the maximum allowed size of an incoming message; arg must
be a ber_len_t *. The return value will be 1.
Options not in this list will be passed down to each Sockbuf_IO
handler in turn until one of them processes it. If the option is not
handled ber_sockbuf_ctrl() will return 0.
Multiple Sockbuf_IO handlers can be stacked in multiple layers to
provide various functionality. Currently defined layers include
the lowest layer, talking directly to a network
an intermediate layer
a higher layer
Currently defined Sockbuf_IO handlers in liblber include
The default stream-oriented provider
A stream-oriented provider for local IPC sockets
A datagram-oriented provider. This handler is only present if
the liblber library was built with LDAP_CONNECTIONLESS
A buffering layer, usually used with a datagram provider to
hide the datagram semantics from upper layers.
A generic handler that outputs hex dumps of all traffic. This
handler may be inserted multiple times at arbitrary layers to
show the flow of data between other handlers.
Additional handlers may be present in libldap if support for them was
An application layer handler for SASL encoding/decoding.
A transport layer handler for SSL/TLS encoding/decoding. Note
that this handler is private to the library and is not exposed
in the API.
The provided handlers are all instantiated implicitly by libldap, and
applications generally will not need to directly manipulate them.
This page is part of the OpenLDAP (an open source implementation of
the Lightweight Directory Access Protocol) project. Information
about the project can be found at ⟨http://www.openldap.org/⟩. If you
have a bug report for this manual page, see
⟨http://www.openldap.org/its/⟩. This page was obtained from the
project's upstream Git repository
⟨git://git.openldap.org/openldap.git⟩ on 2017-03-13. If you discover
any rendering problems in this HTML version of the page, or you
believe there is a better or more up-to-date source for the page, or
you have corrections or improvements to the information in this
COLOPHON (which is not part of the original manual page), send a mail
OpenLDAP LDVERSION RELEASEDATE LBER_SOCKBUF(3)