]> git.sur5r.net Git - openldap/blob - servers/slapd/slapcommon.h
cosmetic changes (the problem was not there)
[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-2005 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 #define SLAP_TOOL_CTXCSN_KEEP   0
36 #define SLAP_TOOL_CTXCSN_ENTRY  1
37 #define SLAP_TOOL_CTXCSN_BATCH  2
38
39 typedef struct tool_vars {
40         Backend *tv_be;
41         int tv_verbose;
42         int tv_update_ctxcsn;
43         int tv_retrieve_ctxcsn;
44         int tv_retrieve_synccookie;
45         int tv_replica_promotion;
46         int tv_replica_demotion;
47         char    *tv_replica_id_string;
48         char    **tv_replica_id_strlist;
49         int     *tv_replica_id_list;
50         int tv_continuemode;
51         int tv_nosubordinates;
52         int tv_dryrun;
53         Filter *tv_filter;
54         struct berval tv_sub_ndn;
55         FILE    *tv_ldiffp;
56         struct berval tv_authcDN;
57         struct berval tv_baseDN;
58         struct berval tv_authcID;
59         struct berval tv_authzID;
60         struct berval tv_mech;
61         char    *tv_realm;
62 } tool_vars;
63
64 extern tool_vars tool_globals;
65
66 #define be tool_globals.tv_be
67 #define verbose tool_globals.tv_verbose
68 #define update_ctxcsn tool_globals.tv_update_ctxcsn
69 #define retrieve_ctxcsn tool_globals.tv_retrieve_ctxcsn
70 #define retrieve_synccookie tool_globals.tv_retrieve_synccookie
71 #define replica_promotion tool_globals.tv_replica_promotion
72 #define replica_demotion tool_globals.tv_replica_demotion
73 #define replica_id_string tool_globals.tv_replica_id_string
74 #define replica_id_strlist tool_globals.tv_replica_id_strlist
75 #define replica_id_list tool_globals.tv_replica_id_list
76 #define continuemode tool_globals.tv_continuemode
77 #define nosubordinates tool_globals.tv_nosubordinates
78 #define dryrun tool_globals.tv_dryrun
79 #define filter tool_globals.tv_filter
80 #define sub_ndn tool_globals.tv_sub_ndn
81 #define ldiffp tool_globals.tv_ldiffp
82 #define authcDN tool_globals.tv_authcDN
83 #define baseDN tool_globals.tv_baseDN
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
89 void slap_tool_init LDAP_P((
90         const char* name,
91         int tool,
92         int argc, char **argv ));
93
94 void slap_tool_destroy LDAP_P((void));
95
96 #endif /* SLAPCOMMON_H_ */