]> git.sur5r.net Git - openldap/blob - libraries/liblber/lber-int.h
update ldap/lber headers towards ldapext-ldap-c-api-01
[openldap] / libraries / liblber / lber-int.h
1 /*
2  * Copyright (c) 1990 Regents of the University of Michigan.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of Michigan at Ann Arbor. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  */
12
13 #ifndef _LBER_INT_H
14 #define _LBER_INT_H
15
16 #include "lber.h"
17
18 LDAP_BEGIN_DECL
19
20 typedef struct berelement {
21         char            *ber_buf;
22         char            *ber_ptr;
23         char            *ber_end;
24         struct seqorset *ber_sos;
25         unsigned long   ber_tag;
26         unsigned long   ber_len;
27         int             ber_usertag;
28         char            ber_options;
29 #define LBER_USE_DER            0x01
30 #define LBER_USE_INDEFINITE_LEN 0x02
31 #define LBER_TRANSLATE_STRINGS  0x04
32         char            *ber_rwptr;
33         BERTranslateProc ber_encode_translate_proc;
34         BERTranslateProc ber_decode_translate_proc;
35 } BerElement;
36 #define NULLBER ((BerElement *) 0)
37
38 typedef struct sockbuf {
39 #ifndef MACOS
40         int             sb_sd;
41 #else /* MACOS */
42         void            *sb_sd;
43 #endif /* MACOS */
44         BerElement      sb_ber;
45
46         int             sb_naddr;       /* > 0 implies using CLDAP (UDP) */
47         void            *sb_useaddr;    /* pointer to sockaddr to use next */
48         void            *sb_fromaddr;   /* pointer to message source sockaddr */
49         void            **sb_addrs;     /* actually an array of pointers to
50                                                 sockaddrs */
51
52         int             sb_options;     /* to support copying ber elements */
53 #define LBER_TO_FILE            0x01    /* to a file referenced by sb_fd   */
54 #define LBER_TO_FILE_ONLY       0x02    /* only write to file, not network */
55 #define LBER_MAX_INCOMING_SIZE  0x04    /* impose limit on incoming stuff  */
56 #define LBER_NO_READ_AHEAD      0x08    /* read only as much as requested  */
57         int             sb_fd;
58         long            sb_max_incoming;
59 } Sockbuf;
60 #define READBUFSIZ      8192
61
62 typedef struct seqorset {
63         BerElement      *sos_ber;
64         unsigned long   sos_clen;
65         unsigned long   sos_tag;
66         char            *sos_first;
67         char            *sos_ptr;
68         struct seqorset *sos_next;
69 } Seqorset;
70 #define NULLSEQORSET    ((Seqorset *) 0)
71
72 #endif /* _LBER_INT_H */