LBER_SOCKBUF(3) | Library Functions Manual | LBER_SOCKBUF(3) |
ber_sockbuf_alloc, ber_sockbuf_free, ber_sockbuf_ctrl, ber_sockbuf_add_io, ber_sockbuf_remove_io, Sockbuf_IO - OpenLDAP LBER I/O infrastructure
OpenLDAP LBER (liblber, -llber)
#include <lber.h>
Sockbuf *ber_sockbuf_alloc( void );
void ber_sockbuf_free(Sockbuf *sb);
int ber_sockbuf_ctrl(Sockbuf *sb, int opt, void *arg);
int ber_sockbuf_add_io(Sockbuf *sb, Sockbuf_IO *sbio, int layer, void *arg);
int ber_sockbuf_remove_io(Sockbuf *sb, Sockbuf_IO *sbio, int layer);
typedef struct sockbuf_io_desc { int sbiod_level; Sockbuf *sbiod_sb; Sockbuf_IO *sbiod_io; void *sbiod_pvt; struct sockbuf_io_desc *sbiod_next; } Sockbuf_IO_Desc;
typedef struct sockbuf_io { int (*sbi_setup)(Sockbuf_IO_Desc *sbiod, void *arg); int (*sbi_remove)(Sockbuf_IO_Desc *sbiod); int (*sbi_ctrl)(Sockbuf_IO_Desc *sbiod, int opt, void *arg); ber_slen_t (*sbi_read)(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len); ber_slen_t (*sbi_write)(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len); int (*sbi_close)(Sockbuf_IO_Desc *sbiod); } Sockbuf_IO;
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:
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
Currently defined Sockbuf_IO handlers in liblber include
Additional handlers may be present in libldap if support for them was enabled:
The provided handlers are all instantiated implicitly by libldap, and applications generally will not need to directly manipulate them.
lber-decode(3), lber-encode(3), lber-types(3), ldap_get_option(3)
OpenLDAP Software is developed and maintained by The OpenLDAP Project <http://www.openldap.org/>. OpenLDAP Software is derived from University of Michigan LDAP 3.3 Release.
2011/11/24 | OpenLDAP 2.4.28 |