Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / openldap / dist / servers / slapd / slapcommon.h
blob207ad129cf80f4b1d35b8a61fa03b824ea74ebf5
1 /* slapcommon.h - common definitions for the slap tools */
2 /* $OpenLDAP: pkg/ldap/servers/slapd/slapcommon.h,v 1.14.2.4 2008/02/11 23:26:44 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
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.
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>.
17 #ifndef SLAPCOMMON_H_
18 #define SLAPCOMMON_H_ 1
20 #define SLAPD_TOOLS 1
21 #include "slap.h"
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
35 typedef struct tool_vars {
36 Backend *tv_be;
37 int tv_verbose;
38 int tv_quiet;
39 int tv_update_ctxcsn;
40 int tv_continuemode;
41 int tv_nosubordinates;
42 int tv_dryrun;
43 int tv_jumpline;
44 Filter *tv_filter;
45 struct berval tv_sub_ndn;
46 struct LDIFFP *tv_ldiffp;
47 struct berval tv_baseDN;
48 struct berval tv_authcDN;
49 struct berval tv_authzDN;
50 struct berval tv_authcID;
51 struct berval tv_authzID;
52 struct berval tv_mech;
53 char *tv_realm;
54 struct berval tv_listener_url;
55 struct berval tv_peer_domain;
56 struct berval tv_peer_name;
57 struct berval tv_sock_name;
58 slap_ssf_t tv_ssf;
59 slap_ssf_t tv_transport_ssf;
60 slap_ssf_t tv_tls_ssf;
61 slap_ssf_t tv_sasl_ssf;
62 unsigned tv_dn_mode;
63 unsigned int tv_csnsid;
64 } tool_vars;
66 extern tool_vars tool_globals;
68 #define be tool_globals.tv_be
69 #define verbose tool_globals.tv_verbose
70 #define quiet tool_globals.tv_quiet
71 #define jumpline tool_globals.tv_jumpline
72 #define update_ctxcsn tool_globals.tv_update_ctxcsn
73 #define continuemode tool_globals.tv_continuemode
74 #define nosubordinates tool_globals.tv_nosubordinates
75 #define dryrun tool_globals.tv_dryrun
76 #define filter tool_globals.tv_filter
77 #define sub_ndn tool_globals.tv_sub_ndn
78 #define ldiffp tool_globals.tv_ldiffp
79 #define baseDN tool_globals.tv_baseDN
80 #define authcDN tool_globals.tv_authcDN
81 #define authzDN tool_globals.tv_authzDN
82 #define authcID tool_globals.tv_authcID
83 #define authzID tool_globals.tv_authzID
84 #define mech tool_globals.tv_mech
85 #define realm tool_globals.tv_realm
86 #define listener_url tool_globals.tv_listener_url
87 #define peer_domain tool_globals.tv_peer_domain
88 #define peer_name tool_globals.tv_peer_name
89 #define sock_name tool_globals.tv_sock_name
90 #define ssf tool_globals.tv_ssf
91 #define transport_ssf tool_globals.tv_transport_ssf
92 #define tls_ssf tool_globals.tv_tls_ssf
93 #define sasl_ssf tool_globals.tv_sasl_ssf
94 #define dn_mode tool_globals.tv_dn_mode
95 #define csnsid tool_globals.tv_csnsid
96 #define SLAP_TOOL_LDAPDN_PRETTY SLAP_LDAPDN_PRETTY
97 #define SLAP_TOOL_LDAPDN_NORMAL (SLAP_LDAPDN_PRETTY << 1)
99 void slap_tool_init LDAP_P((
100 const char* name,
101 int tool,
102 int argc, char **argv ));
104 void slap_tool_destroy LDAP_P((void));
106 #endif /* SLAPCOMMON_H_ */