]> git.sur5r.net Git - openldap/blob - servers/ldapd/common.h
Round 2 of connection management changes.
[openldap] / servers / ldapd / common.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 _LDAPD_COMMON_H
14 #define _LDAPD_COMMON_H 1
15
16 /*
17  * This structure represents an association to a dsa.  There is one of
18  * these for each association open (a new association is made for each
19  * new dsa, and for each dn).
20  */
21
22 struct conn {
23         int             c_ad;           /* association descriptor */
24         char            *c_dn;          /* the dn this asoc is bound as */
25         char            *c_cred;        /* corresponding pw */
26         long            c_credlen;
27         unsigned long   c_method;
28         struct PSAPaddr *c_paddr;       /* the dsa address */
29         int             c_time;         /* time this association inited */
30         int             c_refcnt;       /* number of ops referencing this ad */
31         struct conn     *c_next;
32 };
33
34 /*
35  * This structure represents a sequence of LDAPMod elements.
36  */
37 typedef struct LDAPModList {
38         LDAPMod                 m;
39         struct LDAPModList      *mod_next;
40 } LDAPModList;
41
42
43 /*
44  * This structure represents an outstanding request.  There is one of
45  * these for each client request for which we have not yet received a
46  * response from a dsa.
47  */
48
49 struct msg {
50         int             m_msgid;        /* the message id */
51         int             m_uniqid;       /* unique id for this message */
52         int             m_msgtype;      /* the ldap operation type */
53         LDAPModList     *m_mods;        /* for modify operations only */
54         BerElement      *m_ber;         /* the unparsed ber for the op */
55         struct conn     *m_conn;        /* connection structure */
56 #ifdef LDAP_CONNECTIONLESS
57         int             m_cldap;        /* connectionless transport? (CLDAP) */
58         struct sockaddr m_clientaddr;   /* client address (if using CLDAP) */
59         DN              m_searchbase;   /* base used in search */
60 #endif /* LDAP_CONNECTIONLESS */
61         struct msg      *m_next;
62 };
63
64 #define DEFAULT_TIMEOUT                 3600    /* idle client connections */
65 #define DEFAULT_REFERRAL_TIMEOUT        900     /* DSA connections */
66
67 #include "proto-ldapd.h"
68 #include "ldap_log.h"
69
70 /* from ISODE */
71 extern char     *dsa_address;
72 extern char     *bound_dn, *bound_pw;
73 struct PSAPaddr *psap_cpy(struct PSAPaddr *);
74
75 /* in association.c */
76 extern struct conn      *conns;
77
78 /* in main.c */
79 #ifdef LDAP_DEBUG
80 extern int      ldap_debug;
81 #endif
82 extern int      version;
83 #ifdef LDAP_COMPAT
84 extern int      ldap_compat;
85 #endif
86 extern int      dosyslog;
87 extern int      do_tcp;
88 #ifdef LDAP_CONNECTIONLESS
89 extern int      do_udp;
90 #endif
91 extern int      idletime;
92 extern int      referral_connection_timeout;
93 extern struct timeval   conn_start_tv;
94 #ifdef HAVE_KERBEROS
95 extern char     *krb_ldap_service;
96 extern char     *krb_x500_service;
97 extern char     *krb_x500_instance;
98 extern char     *krb_x500_nonce;
99 extern char     *kerberos_keyfile;
100 #endif
101
102 /* syntax.c */
103 extern short    ldap_photo_syntax;
104 extern short    ldap_jpeg_syntax;
105 extern short    ldap_jpeg_nonfile_syntax;
106 extern short    ldap_audio_syntax;
107 extern short    ldap_dn_syntax;
108 extern short    ldap_postaladdress_syntax;
109 extern short    ldap_acl_syntax;
110 extern short    ldap_mtai_syntax;
111 extern short    ldap_rts_cred_syntax;
112 extern short    ldap_rtl_syntax;
113 extern short    ldap_mailbox_syntax;
114 extern short    ldap_caseignorelist_syntax;
115 extern short    ldap_caseexactstring_syntax;
116 extern short    ldap_certif_syntax;
117 extern short    ldap_iattr_syntax;
118 extern short    ldap_telex_syntax;
119 extern short    ldap_octetstring_syntax;
120 extern short    ldap_deliverymethod_syntax;
121 extern short    ldap_facsimileTelephoneNumber_syntax;
122 extern short    ldap_presentationAddress_syntax;
123 extern short    ldap_teletexTerminalIdentifier_syntax;
124 extern short    ldap_searchGuide_syntax;
125 extern short    ldap_dLSubmitPermission_syntax;
126
127 /* Version.c */
128 extern char     Versionstr[];
129
130 #endif