~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/back-ldap/back-ldap.h

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* back-ldap.h - ldap backend header file */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/back-ldap.h,v 1.88.2.14 2009/06/11 21:48:11 quanah Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/back-ldap.h,v 1.88.2.15 2009/08/26 00:50:19 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 1999-2009 The OpenLDAP Foundation.
61
61
        LDAP_BACK_PCONN_LAST
62
62
};
63
63
 
64
 
typedef struct ldapconn_t {
65
 
        Connection              *lc_conn;
 
64
typedef struct ldapconn_base_t {
 
65
        Connection              *lcb_conn;
66
66
#define LDAP_BACK_CONN2PRIV(lc)         ((unsigned long)(lc)->lc_conn)
67
 
#define LDAP_BACK_PCONN_ISPRIV(lc)      ((void *)(lc)->lc_conn >= (void *)LDAP_BACK_PCONN_FIRST \
68
 
                                                && (void *)(lc)->lc_conn < (void *)LDAP_BACK_PCONN_LAST)
 
67
#define LDAP_BACK_PCONN_ISPRIV(lc)      (((void *)(lc)->lc_conn) >= ((void *)LDAP_BACK_PCONN_FIRST) \
 
68
                                                && ((void *)(lc)->lc_conn) < ((void *)LDAP_BACK_PCONN_LAST))
69
69
#define LDAP_BACK_PCONN_ISROOTDN(lc)    (LDAP_BACK_PCONN_ISPRIV((lc)) \
70
70
                                                && (LDAP_BACK_CONN2PRIV((lc)) < LDAP_BACK_PCONN_ANON))
71
71
#define LDAP_BACK_PCONN_ISANON(lc)      (LDAP_BACK_PCONN_ISPRIV((lc)) \
75
75
                                                && (LDAP_BACK_CONN2PRIV((lc)) >= LDAP_BACK_PCONN_BIND))
76
76
#define LDAP_BACK_PCONN_ISTLS(lc)       (LDAP_BACK_PCONN_ISPRIV((lc)) \
77
77
                                                && (LDAP_BACK_CONN2PRIV((lc)) & LDAP_BACK_PCONN_TLS))
78
 
#define LDAP_BACK_PCONN_ID(lc)          (LDAP_BACK_PCONN_ISPRIV((lc)) ? \
79
 
                                                ( -1 - (long)(lc)->lc_conn ) : (lc)->lc_conn->c_connid )
80
78
#ifdef HAVE_TLS
81
79
#define LDAP_BACK_PCONN_ROOTDN_SET(lc, op) \
82
80
        ((lc)->lc_conn = (void *)((op)->o_conn->c_is_tls ? (void *) LDAP_BACK_PCONN_ROOTDN_TLS : (void *) LDAP_BACK_PCONN_ROOTDN))
96
94
        (BER_BVISEMPTY(&(op)->o_ndn) ? \
97
95
                LDAP_BACK_PCONN_ANON_SET((lc), (op)) : LDAP_BACK_PCONN_ROOTDN_SET((lc), (op)))
98
96
 
99
 
        LDAP                    *lc_ld;
100
 
        struct berval           lc_cred;
101
 
        struct berval           lc_bound_ndn;
102
 
        struct berval           lc_local_ndn;
 
97
        struct berval           lcb_local_ndn;
 
98
        unsigned                lcb_refcnt;
 
99
        time_t                  lcb_create_time;
 
100
        time_t                  lcb_time;
 
101
} ldapconn_base_t;
 
102
 
 
103
typedef struct ldapconn_t {
 
104
        ldapconn_base_t         lc_base;
 
105
#define lc_conn                 lc_base.lcb_conn
 
106
#define lc_local_ndn            lc_base.lcb_local_ndn
 
107
#define lc_refcnt               lc_base.lcb_refcnt
 
108
#define lc_create_time          lc_base.lcb_create_time
 
109
#define lc_time                 lc_base.lcb_time
 
110
 
 
111
        LDAP_TAILQ_ENTRY(ldapconn_t)    lc_q;
 
112
 
103
113
        unsigned                lc_lcflags;
104
114
#define LDAP_BACK_CONN_ISSET_F(fp,f)    (*(fp) & (f))
105
115
#define LDAP_BACK_CONN_SET_F(fp,f)      (*(fp) |= (f))
164
174
#define LDAP_BACK_CONN_CACHED_SET(lc)           LDAP_BACK_CONN_SET((lc), LDAP_BACK_FCONN_CACHED)
165
175
#define LDAP_BACK_CONN_CACHED_CLEAR(lc)         LDAP_BACK_CONN_CLEAR((lc), LDAP_BACK_FCONN_CACHED)
166
176
 
167
 
        unsigned                lc_refcnt;
 
177
        LDAP                    *lc_ld;
 
178
        struct berval           lc_cred;
 
179
        struct berval           lc_bound_ndn;
168
180
        unsigned                lc_flags;
169
 
        time_t                  lc_create_time;
170
 
        time_t                  lc_time;
171
 
 
172
 
        LDAP_TAILQ_ENTRY(ldapconn_t)    lc_q;
173
181
} ldapconn_t;
174
182
 
175
183
typedef struct ldap_avl_info_t {
444
452
        void (*retry_info_destroy)( slap_retry_info_t *ri );
445
453
        int (*retry_info_parse)( char *in, slap_retry_info_t *ri, char *buf, ber_len_t buflen );
446
454
        int (*retry_info_unparse)( slap_retry_info_t *ri, struct berval *bvout );
 
455
        int (*connid2str)( const ldapconn_base_t *lc, char *buf, ber_len_t buflen );
447
456
} ldap_extra_t;
448
457
 
449
458
LDAP_END_DECL