29 #include <lber_types.h>
52 #define LBER_CLASS_UNIVERSAL ((ber_tag_t) 0x00U)
53 #define LBER_CLASS_APPLICATION ((ber_tag_t) 0x40U)
54 #define LBER_CLASS_CONTEXT ((ber_tag_t) 0x80U)
55 #define LBER_CLASS_PRIVATE ((ber_tag_t) 0xc0U)
56 #define LBER_CLASS_MASK ((ber_tag_t) 0xc0U)
59 #define LBER_PRIMITIVE ((ber_tag_t) 0x00U)
60 #define LBER_CONSTRUCTED ((ber_tag_t) 0x20U)
61 #define LBER_ENCODING_MASK ((ber_tag_t) 0x20U)
63 #define LBER_BIG_TAG_MASK ((ber_tag_t) 0x1fU)
64 #define LBER_MORE_TAG_MASK ((ber_tag_t) 0x80U)
71 #define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080UL) \
72 && (((t) & (ber_tag_t) ~ 0x0FF))
74 #define LBER_ERROR ((ber_tag_t) -1)
75 #define LBER_DEFAULT ((ber_tag_t) -1)
78 #define LBER_BOOLEAN ((ber_tag_t) 0x01UL)
79 #define LBER_INTEGER ((ber_tag_t) 0x02UL)
80 #define LBER_BITSTRING ((ber_tag_t) 0x03UL)
81 #define LBER_OCTETSTRING ((ber_tag_t) 0x04UL)
82 #define LBER_NULL ((ber_tag_t) 0x05UL)
83 #define LBER_ENUMERATED ((ber_tag_t) 0x0aUL)
84 #define LBER_SEQUENCE ((ber_tag_t) 0x30UL)
85 #define LBER_SET ((ber_tag_t) 0x31UL)
88 #define LBER_USE_DER 0x01
91 #define LBER_OPT_BER_OPTIONS 0x01
92 #define LBER_OPT_BER_DEBUG 0x02
93 #define LBER_OPT_BER_REMAINING_BYTES 0x03
94 #define LBER_OPT_BER_TOTAL_BYTES 0x04
95 #define LBER_OPT_BER_BYTES_TO_WRITE 0x05
96 #define LBER_OPT_BER_MEMCTX 0x06
98 #define LBER_OPT_DEBUG_LEVEL LBER_OPT_BER_DEBUG
99 #define LBER_OPT_REMAINING_BYTES LBER_OPT_BER_REMAINING_BYTES
100 #define LBER_OPT_TOTAL_BYTES LBER_OPT_BER_TOTAL_BYTES
101 #define LBER_OPT_BYTES_TO_WRITE LBER_OPT_BER_BYTES_TO_WRITE
103 #define LBER_OPT_LOG_PRINT_FN 0x8001
104 #define LBER_OPT_MEMORY_FNS 0x8002
105 #define LBER_OPT_ERROR_FN 0x8003
106 #define LBER_OPT_LOG_PRINT_FILE 0x8004
109 #define LBER_OPT_MEMORY_INUSE 0x8005
110 #define LBER_OPT_LOG_PROC 0x8006
112 typedef int* (*BER_ERRNO_FN) LDAP_P((
void ));
114 typedef void (*BER_LOG_PRINT_FN) LDAP_P(( LDAP_CONST
char *buf ));
116 typedef
void* (BER_MEMALLOC_FN) LDAP_P(( ber_len_t size,
void *ctx ));
117 typedef
void* (BER_MEMCALLOC_FN) LDAP_P(( ber_len_t n, ber_len_t size,
void *ctx ));
118 typedef
void* (BER_MEMREALLOC_FN) LDAP_P((
void *p, ber_len_t size,
void *ctx ));
119 typedef
void (BER_MEMFREE_FN) LDAP_P((
void *p,
void *ctx ));
122 BER_MEMALLOC_FN *bmf_malloc;
123 BER_MEMCALLOC_FN *bmf_calloc;
124 BER_MEMREALLOC_FN *bmf_realloc;
125 BER_MEMFREE_FN *bmf_free;
129 #define LBER_SB_OPT_GET_FD 1
130 #define LBER_SB_OPT_SET_FD 2
131 #define LBER_SB_OPT_HAS_IO 3
132 #define LBER_SB_OPT_SET_NONBLOCK 4
133 #define LBER_SB_OPT_GET_SSL 7
134 #define LBER_SB_OPT_DATA_READY 8
135 #define LBER_SB_OPT_SET_READAHEAD 9
136 #define LBER_SB_OPT_DRAIN 10
137 #define LBER_SB_OPT_NEEDS_READ 11
138 #define LBER_SB_OPT_NEEDS_WRITE 12
139 #define LBER_SB_OPT_GET_MAX_INCOMING 13
140 #define LBER_SB_OPT_SET_MAX_INCOMING 14
143 #define LBER_SB_OPT_UNGET_BUF 15
146 #define LBER_SB_OPT_OPT_MAX 15
149 #define LBER_SBIOD_LEVEL_PROVIDER 10
150 #define LBER_SBIOD_LEVEL_TRANSPORT 20
151 #define LBER_SBIOD_LEVEL_APPLICATION 30
154 #define LBER_OPT_SOCKBUF_DESC 0x1000
155 #define LBER_OPT_SOCKBUF_OPTIONS 0x1001
156 #define LBER_OPT_SOCKBUF_DEBUG 0x1002
159 LBER_V(
char ) ber_pvt_opt_on;
160 #define LBER_OPT_ON ((void *) &ber_pvt_opt_on)
161 #define LBER_OPT_OFF ((void *) 0)
163 #define LBER_OPT_SUCCESS (0)
164 #define LBER_OPT_ERROR (-1)
168 typedef struct lber_sockbuf
Sockbuf;
200 #define LBER_SBIOD_READ_NEXT( sbiod, buf, len ) \
201 ( (sbiod)->sbiod_next->sbiod_io->sbi_read( (sbiod)->sbiod_next, \
203 #define LBER_SBIOD_WRITE_NEXT( sbiod, buf, len ) \
204 ( (sbiod)->sbiod_next->sbiod_io->sbi_write( (sbiod)->sbiod_next, \
206 #define LBER_SBIOD_CTRL_NEXT( sbiod, opt, arg ) \
207 ( (sbiod)->sbiod_next ? \
208 ( (sbiod)->sbiod_next->sbiod_io->sbi_ctrl( \
209 (sbiod)->sbiod_next, opt, arg ) ) : 0 )
225 ber_error_print LDAP_P((
226 LDAP_CONST
char *data ));
230 LDAP_CONST
char *data, ber_len_t len ));
237 ber_sos_dump LDAP_P((
243 typedef
int (*BERDecodeCallback) LDAP_P((
253 ber_skip_tag LDAP_P((
258 ber_peek_tag LDAP_P((
268 ber_get_enum LDAP_P((
273 ber_get_stringb LDAP_P((
278 #define LBER_BV_ALLOC 0x01
279 #define LBER_BV_NOTERM 0x02
282 ber_get_stringbv LDAP_P((
288 ber_get_stringa LDAP_P((
293 ber_get_stringal LDAP_P((
298 ber_get_bitstringa LDAP_P((
304 ber_get_null LDAP_P((
308 ber_get_boolean LDAP_P((
310 ber_int_t *boolval ));
313 ber_first_element LDAP_P((
319 ber_next_element LDAP_P((
322 LDAP_CONST
char *last ));
327 LDAP_CONST
char *fmt,
331 ber_decode_oid LDAP_P((
339 ber_encode_oid LDAP_P((
343 typedef
int (*BEREncodeCallback) LDAP_P((
348 ber_put_enum LDAP_P((
360 ber_put_ostring LDAP_P((
362 LDAP_CONST
char *str,
367 ber_put_berval LDAP_P((
373 ber_put_string LDAP_P((
375 LDAP_CONST
char *str,
379 ber_put_bitstring LDAP_P((
381 LDAP_CONST
char *str,
386 ber_put_null LDAP_P((
391 ber_put_boolean LDAP_P((
397 ber_start_seq LDAP_P((
402 ber_start_set LDAP_P((
417 LDAP_CONST
char *fmt,
426 ber_skip_data LDAP_P((
439 LDAP_CONST
char *buf,
456 #define LBER_FLUSH_FREE_NEVER (0x0)
457 #define LBER_FLUSH_FREE_ON_SUCCESS (0x1)
458 #define LBER_FLUSH_FREE_ON_ERROR (0x2)
459 #define LBER_FLUSH_FREE_ALWAYS (LBER_FLUSH_FREE_ON_SUCCESS|LBER_FLUSH_FREE_ON_ERROR)
468 ber_alloc LDAP_P((
void ));
471 der_alloc LDAP_P((
void ));
482 ber_get_next LDAP_P((
494 ber_init_w_nullc LDAP_P((
513 ber_flatten2 LDAP_P((
519 ber_remaining LDAP_P((
527 ber_get_option LDAP_P((
533 ber_set_option LDAP_P((
536 LDAP_CONST
void *invalue));
543 ber_sockbuf_alloc LDAP_P((
547 ber_sockbuf_free LDAP_P((
551 ber_sockbuf_add_io LDAP_P((
558 ber_sockbuf_remove_io LDAP_P((
564 ber_sockbuf_ctrl LDAP_P((
570 LBER_V(
Sockbuf_IO ) ber_sockbuf_io_readahead;
579 ber_memalloc LDAP_P((
583 ber_memrealloc LDAP_P((
588 ber_memcalloc LDAP_P((
597 ber_memvfree LDAP_P((
605 ber_bvecfree LDAP_P((
623 LDAP_CONST
char *, ber_len_t len,
int duplicate, struct
berval *bv));
627 LDAP_CONST
char *, ber_len_t len,
int duplicate, struct
berval *bv));
629 #define ber_bvstr(a) ((ber_str2bv)((a), 0, 0, NULL))
630 #define ber_bvstrdup(a) ((ber_str2bv)((a), 0, 1, NULL))
634 LDAP_CONST
char * ));
637 ber_bvreplace LDAP_P((
641 ber_bvarray_free LDAP_P(( BerVarray p ));
644 ber_bvarray_add LDAP_P(( BerVarray *p,
BerValue *bv ));
646 #define ber_bvcmp(v1,v2) \
647 ((v1)->bv_len < (v2)->bv_len \
648 ? -1 : ((v1)->bv_len > (v2)->bv_len \
649 ? 1 : memcmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
654 LBER_F(
int * ) ber_errno_addr LDAP_P((
void));
655 #define ber_errno (*(ber_errno_addr)())
657 #define LBER_ERROR_NONE 0
658 #define LBER_ERROR_PARAM 0x1
659 #define LBER_ERROR_MEMORY 0x2
Definition: lber-int.h:104
Definition: lber-int.h:123
Definition: lber-int.h:75