1 /* slapcommon.h - common definitions for the slap tools */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2011 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
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>.
18 #define SLAPCOMMON_H_ 1
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 SLAPSCHEMA, /* schema checking tool */
30 SLAPTEST, /* slapd.conf test tool */
31 SLAPAUTH, /* test authz-regexp and authc/authz stuff */
32 SLAPACL, /* test acl */
36 typedef struct tool_vars {
43 int tv_nosubordinates;
46 struct berval tv_sub_ndn;
49 struct LDIFFP *tv_ldiffp;
50 struct berval tv_baseDN;
51 struct berval tv_authcDN;
52 struct berval tv_authzDN;
53 struct berval tv_authcID;
54 struct berval tv_authzID;
55 struct berval tv_mech;
57 struct berval tv_listener_url;
58 struct berval tv_peer_domain;
59 struct berval tv_peer_name;
60 struct berval tv_sock_name;
62 slap_ssf_t tv_transport_ssf;
63 slap_ssf_t tv_tls_ssf;
64 slap_ssf_t tv_sasl_ssf;
66 unsigned int tv_csnsid;
67 ber_len_t tv_ldif_wrap;
68 char tv_maxcsnbuf[ LDAP_PVT_CSNSTR_BUFSIZE * ( SLAP_SYNC_SID_MAX + 1 ) ];
69 struct berval tv_maxcsn[ SLAP_SYNC_SID_MAX + 1 ];
72 extern tool_vars tool_globals;
74 #define be tool_globals.tv_be
75 #define dbnum tool_globals.tv_dbnum
76 #define verbose tool_globals.tv_verbose
77 #define quiet tool_globals.tv_quiet
78 #define jumpline tool_globals.tv_jumpline
79 #define update_ctxcsn tool_globals.tv_update_ctxcsn
80 #define continuemode tool_globals.tv_continuemode
81 #define nosubordinates tool_globals.tv_nosubordinates
82 #define dryrun tool_globals.tv_dryrun
83 #define sub_ndn tool_globals.tv_sub_ndn
84 #define scope tool_globals.tv_scope
85 #define filter tool_globals.tv_filter
86 #define ldiffp tool_globals.tv_ldiffp
87 #define baseDN tool_globals.tv_baseDN
88 #define authcDN tool_globals.tv_authcDN
89 #define authzDN tool_globals.tv_authzDN
90 #define authcID tool_globals.tv_authcID
91 #define authzID tool_globals.tv_authzID
92 #define mech tool_globals.tv_mech
93 #define realm tool_globals.tv_realm
94 #define listener_url tool_globals.tv_listener_url
95 #define peer_domain tool_globals.tv_peer_domain
96 #define peer_name tool_globals.tv_peer_name
97 #define sock_name tool_globals.tv_sock_name
98 #define ssf tool_globals.tv_ssf
99 #define transport_ssf tool_globals.tv_transport_ssf
100 #define tls_ssf tool_globals.tv_tls_ssf
101 #define sasl_ssf tool_globals.tv_sasl_ssf
102 #define dn_mode tool_globals.tv_dn_mode
103 #define csnsid tool_globals.tv_csnsid
104 #define ldif_wrap tool_globals.tv_ldif_wrap
105 #define maxcsn tool_globals.tv_maxcsn
106 #define maxcsnbuf tool_globals.tv_maxcsnbuf
108 #define SLAP_TOOL_LDAPDN_PRETTY SLAP_LDAPDN_PRETTY
109 #define SLAP_TOOL_LDAPDN_NORMAL (SLAP_LDAPDN_PRETTY << 1)
111 void slap_tool_init LDAP_P((
114 int argc, char **argv ));
116 int slap_tool_destroy LDAP_P((void));
118 int slap_tool_update_ctxcsn LDAP_P((
119 const char *progname,
121 struct berval *bvtext ));
123 unsigned long slap_tool_update_ctxcsn_check LDAP_P((
124 const char *progname,
127 int slap_tool_update_ctxcsn_init LDAP_P((void));
129 int slap_tool_entry_check LDAP_P((
130 const char *progname,
138 #endif /* SLAPCOMMON_H_ */