]> git.sur5r.net Git - openldap/blob - servers/slapd/slapcommon.h
ITS#6024 Don't send cookies without csn.
[openldap] / servers / slapd / slapcommon.h
1 /* slapcommon.h - common definitions for the slap tools */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 1998-2009 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16
17 #ifndef SLAPCOMMON_H_
18 #define SLAPCOMMON_H_ 1
19
20 #define SLAPD_TOOLS 1
21 #include "slap.h"
22
23 enum slaptool {
24         SLAPADD=1,      /* LDIF -> database tool */
25         SLAPCAT,        /* database -> LDIF tool */
26         SLAPDN,         /* DN check w/ syntax tool */
27         SLAPINDEX,      /* database index tool */
28         SLAPPASSWD,     /* password generation tool */
29         SLAPTEST,       /* slapd.conf test tool */
30         SLAPAUTH,       /* test authz-regexp and authc/authz stuff */
31         SLAPACL,        /* test acl */
32         SLAPLAST
33 };
34
35 typedef struct tool_vars {
36         Backend *tv_be;
37         int tv_dbnum;
38         int tv_verbose;
39         int tv_quiet;
40         int tv_update_ctxcsn;
41         int tv_continuemode;
42         int tv_nosubordinates;
43         int tv_dryrun;
44         int tv_jumpline;
45         Filter *tv_filter;
46         struct berval tv_sub_ndn;
47         struct LDIFFP   *tv_ldiffp;
48         struct berval tv_baseDN;
49         struct berval tv_authcDN;
50         struct berval tv_authzDN;
51         struct berval tv_authcID;
52         struct berval tv_authzID;
53         struct berval tv_mech;
54         char    *tv_realm;
55         struct berval tv_listener_url;
56         struct berval tv_peer_domain;
57         struct berval tv_peer_name;
58         struct berval tv_sock_name;
59         slap_ssf_t tv_ssf;
60         slap_ssf_t tv_transport_ssf;
61         slap_ssf_t tv_tls_ssf;
62         slap_ssf_t tv_sasl_ssf;
63         unsigned tv_dn_mode;
64         unsigned int tv_csnsid;
65 } tool_vars;
66
67 extern tool_vars tool_globals;
68
69 #define be tool_globals.tv_be
70 #define dbnum tool_globals.tv_dbnum
71 #define verbose tool_globals.tv_verbose
72 #define quiet tool_globals.tv_quiet
73 #define jumpline tool_globals.tv_jumpline
74 #define update_ctxcsn tool_globals.tv_update_ctxcsn
75 #define continuemode tool_globals.tv_continuemode
76 #define nosubordinates tool_globals.tv_nosubordinates
77 #define dryrun tool_globals.tv_dryrun
78 #define filter tool_globals.tv_filter
79 #define sub_ndn tool_globals.tv_sub_ndn
80 #define ldiffp tool_globals.tv_ldiffp
81 #define baseDN tool_globals.tv_baseDN
82 #define authcDN tool_globals.tv_authcDN
83 #define authzDN tool_globals.tv_authzDN
84 #define authcID tool_globals.tv_authcID
85 #define authzID tool_globals.tv_authzID
86 #define mech tool_globals.tv_mech
87 #define realm tool_globals.tv_realm
88 #define listener_url tool_globals.tv_listener_url
89 #define peer_domain tool_globals.tv_peer_domain
90 #define peer_name tool_globals.tv_peer_name
91 #define sock_name tool_globals.tv_sock_name
92 #define ssf tool_globals.tv_ssf
93 #define transport_ssf tool_globals.tv_transport_ssf
94 #define tls_ssf tool_globals.tv_tls_ssf
95 #define sasl_ssf tool_globals.tv_sasl_ssf
96 #define dn_mode tool_globals.tv_dn_mode
97 #define csnsid tool_globals.tv_csnsid
98 #define SLAP_TOOL_LDAPDN_PRETTY         SLAP_LDAPDN_PRETTY
99 #define SLAP_TOOL_LDAPDN_NORMAL         (SLAP_LDAPDN_PRETTY << 1)
100
101 void slap_tool_init LDAP_P((
102         const char* name,
103         int tool,
104         int argc, char **argv ));
105
106 int slap_tool_destroy LDAP_P((void));
107
108 #endif /* SLAPCOMMON_H_ */