ber_alloc_t

Constructs and returns an empty BerElement.

Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h> or <lber.h>
  
  BerElement *ber_alloc_t (
     int   options);
  

Parameters

options

(IN) Specifies the options used to create a BerElement.

Return Values

Returns a newly created BerElement on success; otherwise, returns a NULL pointer on failure.

Remarks

The options parameter specifies a bitwise OR of options to be used when encoding a new BerElement. You should always supply the following option:

LBER_USE_DER 0x01

Specifies that lengths will always be encoded in the minimum number of octets. However, this option does not cause values of sets to be rearranged in tag and byte order or for default values to be removed, so these options are not sufficient for generating DER output as defined in the X.509 and X.680 specifications. If you order set values and remove default values correctly, you can produce output according to the defined specifications.

Unrecognized option bits are ignored.

Calls to the ber_printf function append bytes to the end of the BerElement.

Each BerElement structure allocated by the ber_alloc_t function should be freed by a call to the function.

See Also

ber_free