ber_flush man page on aLinux

Man page or keyword search:  
man Server   7435 pages
apropos Keyword Search (all sections)
Output format
aLinux logo
[printable version]


       ber_alloc_t,    ber_flush,   ber_printf,	  ber_put_int,	 ber_put_enum,
       ber_put_ostring,	  ber_put_string,    ber_put_null,    ber_put_boolean,
       ber_put_bitstring,     ber_start_seq,	ber_start_set,	  ber_put_seq,
       ber_put_set - LBER simplified Basic Encoding Rules library routines for

       OpenLDAP LBER (liblber, -llber)

       #include <lber.h>

       BerElement *ber_alloc_t(int options);

       int ber_flush(Sockbuf *sb, BerElement *ber, int freeit);

       int ber_printf(BerElement *ber, const char *fmt, ...);

       int ber_put_int(BerElement *ber, ber_int_t num, ber_tag_t tag);

       int ber_put_enum(BerElement *ber, ber_int_t num, ber_tag_t tag);

       int  ber_put_ostring(BerElement	*ber,  const char *str, ber_len_t len,
       ber_tag_t tag);

       int ber_put_string(BerElement *ber, const char *str, ber_tag_t tag);

       int ber_put_null(BerElement *ber, ber_tag_t tag);

       int ber_put_boolean(BerElement *ber, ber_int_t bool, ber_tag_t tag);

       int ber_put_bitstring(BerElement *ber, const char *str, ber_len_t blen,
       ber_tag_t tag);

       int ber_start_seq(BerElement *ber, ber_tag_t tag);

       int ber_start_set(BerElement *ber, ber_tag_t tag);

       int ber_put_seq(BerElement *ber);

       int ber_put_set(BerElement *ber);

       These routines provide a subroutine interface to a simplified implemen‐
       tation of the Basic Encoding Rules of ASN.1.  The version of BER	 these
       routines	 support is the one defined for the LDAP protocol.  The encod‐
       ing rules are the same as BER, except that only definite	 form  lengths
       are used, and bitstrings and octet strings are always encoded in primi‐
       tive form.  This man page describes the encoding routines in  the  lber
       library.	  See lber-decode(3) for details on the corresponding decoding
       routines.  Consult lber-types(3) for information about  types,  alloca‐
       tors, and deallocators.

       Normally,  the  only  routines that need to be called by an application
       are ber_alloc_t() to allocate a BER element for encoding,  ber_printf()
       to  do  the actual encoding, and ber_flush() to actually write the ele‐
       ment.  The other routines are provided for those applications that need
       more  control  than  ber_printf() provides.  In general, these routines
       return the length of the element encoded, or -1 if an error occurred.

       The ber_alloc_t() routine is used to allocate a new  BER	 element.   It
       should be called with an argument of LBER_USE_DER.

       The  ber_flush()	 routine  is  used  to actually write the element to a
       socket (or file) descriptor, once it  has  been	fully  encoded	(using
       ber_printf() and friends).  See lber-sockbuf(3) for more details on the
       Sockbuf implementation of the sb parameter.  If the freeit parameter is
       non-zero,  the  supplied ber will be freed after its contents have been

       The ber_printf() routine is used to encode a BER element	 in  much  the
       same  way  that sprintf(3) works.  One important difference, though, is
       that some state information is kept with the ber parameter so that mul‐
       tiple  calls can be made to ber_printf() to append things to the end of
       the BER element.	 Ber_printf() writes to ber, a pointer to a BerElement
       such as returned by ber_alloc_t().  It interprets and formats its argu‐
       ments according to the format string fmt.  The