[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ber encoding



On Sat, 2006-02-11 at 12:13 +0530, Rahul S wrote:
> Hi,
>     I am writing a program using openldap client libraries. I want to
> send a server control in ldap_search. Since, the control is not
> supported by openldap,

Controls are a common means to extend LDAP that is fully supported by
OpenLDAP client libraries (I believe since OpenLDAP 2.0).

> the client library does not have a function for
> creating the control.

The API is not required to provide helpers for each control by
definition, as controls are designed to allow the definition of new
controls without the need to change the protocol specifications.

> I am trying to create the 'LDAPControl'
> structure myself. The 'ldctl_value' member is of type 'struct berval'.
> I want to populate this as per the specification in the control's
> internet draft. I can encode using 'ber_printf'. This puts the info in
> a 'BerElement' structure. How can I convert this to 'struct berval' ?

I suggest coding by example, as illustrated in the controls an API is
provided for, or by looking at OpenLDAP client tools which make an
extensive use of controls.

p.




Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
------------------------------------------
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it
------------------------------------------