summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/ldbm_config.h
blob: bab153f5d02fae1a9d5e894c69399d99be5054fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/** BEGIN COPYRIGHT BLOCK
 * This Program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; version 2 of the License.
 * 
 * This Program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA.
 * 
 * In addition, as a special exception, Red Hat, Inc. gives You the additional
 * right to link the code of this Program with code not covered under the GNU
 * General Public License ("Non-GPL Code") and to distribute linked combinations
 * including the two, subject to the limitations in this paragraph. Non-GPL Code
 * permitted under this exception must only link to the code of this Program
 * through those well defined interfaces identified in the file named EXCEPTION
 * found in the source code files (the "Approved Interfaces"). The files of
 * Non-GPL Code may instantiate templates or use macros or inline functions from
 * the Approved Interfaces without causing the resulting work to be covered by
 * the GNU General Public License. Only Red Hat, Inc. may make changes or
 * additions to the list of Approved Interfaces. You must obey the GNU General
 * Public License in all respects for all of the Program code and other code used
 * in conjunction with the Program except the Non-GPL Code covered by this
 * exception. If you modify this file, you may extend this exception to your
 * version of the file, but you are not obligated to do so. If you do not wish to
 * provide this exception without modification, you must delete this exception
 * statement from your version and license this file solely under the GPL without
 * exception. 
 * 
 * 
 * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
 * Copyright (C) 2005 Red Hat, Inc.
 * All rights reserved.
 * END COPYRIGHT BLOCK **/

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#ifndef _LDBM_CONFIG_H_
#define _LDBM_CONFIG_H_

struct config_info;
typedef struct config_info config_info;

typedef int config_set_fn_t(void *arg, void *value, char *errorbuf, int phase, int apply);
typedef void *config_get_fn_t(void *arg);
								/* The value for these is passed around as a
								 * void *, the actual value should be gotten 
								 * by casting the void * as shown below. */ 
#define CONFIG_TYPE_ONOFF 1		/* val = (int) value */
#define CONFIG_TYPE_STRING 2	/* val = (char *) value - The get functions
								 * for this type must return alloced memory
								 * that should be freed by the caller. */
#define CONFIG_TYPE_INT 3		/* val = (int) value */
#define CONFIG_TYPE_LONG 4		/* val = (long) value */
#define CONFIG_TYPE_INT_OCTAL 5	/* Same as CONFIG_TYPE_INT, but shown in
								 * octal */
#define CONFIG_TYPE_SIZE_T 6    /* val = (size_t) value */

/* How changes to some config attributes are handled depends on what
 * "phase" the server is in.  Initialization, reading the config
 * information at startup, or actually running. */
#define CONFIG_PHASE_INITIALIZATION 1
#define CONFIG_PHASE_STARTUP 2
#define CONFIG_PHASE_RUNNING 3
#define CONFIG_PHASE_INTERNAL 4

#define CONFIG_FLAG_PREVIOUSLY_SET 1
#define CONFIG_FLAG_ALWAYS_SHOW 2
#define CONFIG_FLAG_ALLOW_RUNNING_CHANGE 4
#define CONFIG_FLAG_SKIP_DEFAULT_SETTING 8

struct config_info {
	char *config_name;
	int config_type;
	char *config_default_value;
	config_get_fn_t *config_get_fn;
	config_set_fn_t *config_set_fn;
	int config_flags;
};

#define CONFIG_INSTANCE "nsslapd-instance"
#define CONFIG_LOOKTHROUGHLIMIT "nsslapd-lookthroughlimit"
#define CONFIG_IDLISTSCANLIMIT "nsslapd-idlistscanlimit"
#define CONFIG_DIRECTORY "nsslapd-directory"
#define CONFIG_MODE "nsslapd-mode"
#define CONFIG_DBCACHESIZE "nsslapd-dbcachesize"
#define CONFIG_DBNCACHE "nsslapd-dbncache"
#define CONFIG_MAXPASSBEFOREMERGE "nsslapd-maxpassbeforemerge"
#define CONFIG_IMPORT_CACHE_AUTOSIZE	"nsslapd-import-cache-autosize"
#define CONFIG_CACHE_AUTOSIZE		"nsslapd-cache-autosize"
#define CONFIG_CACHE_AUTOSIZE_SPLIT	"nsslapd-cache-autosize-split"
#define CONFIG_IMPORT_CACHESIZE         "nsslapd-import-cachesize"
#define CONFIG_INDEX_BUFFER_SIZE         "nsslapd-index-buffer-size"
#define CONFIG_EXCLUDE_FROM_EXPORT		"nsslapd-exclude-from-export"
#define CONFIG_EXCLUDE_FROM_EXPORT_DEFAULT_VALUE \
	"entrydn entryid dncomp parentid numSubordinates entryusn"

/* dblayer config options - These are hidden from the user
 * and can't be updated on the fly. */
#define CONFIG_DB_LOGDIRECTORY "nsslapd-db-logdirectory"
#define CONFIG_DB_DURABLE_TRANSACTIONS "nsslapd-db-durable-transaction"
#define CONFIG_DB_CIRCULAR_LOGGING "nsslapd-db-circular-logging"
#define CONFIG_DB_TRANSACTION_LOGGING "nsslapd-db-transaction-logging"
#define CONFIG_DB_CHECKPOINT_INTERVAL "nsslapd-db-checkpoint-interval"
#define CONFIG_DB_TRANSACTION_BATCH  "nsslapd-db-transaction-batch-val"
#define CONFIG_DB_LOGBUF_SIZE "nsslapd-db-logbuf-size"
#define CONFIG_DB_PAGE_SIZE "nsslapd-db-page-size"
#define CONFIG_DB_INDEX_PAGE_SIZE "nsslapd-db-index-page-size" /* With the new 
   idl design, the large 8Kbyte pages we use are not
   optimal. The page pool churns very quickly as we add new IDs under a
   sustained add load. Smaller pages stop this happening so much and
   consequently make us spend less time flushing dirty pages on checkpoints.
   But 8K is still a good page size for id2entry. So we now allow different
   page sizes for the primary and secondary indices. */
#define CONFIG_DB_IDL_DIVISOR "nsslapd-db-idl-divisor"
#define CONFIG_DB_LOGFILE_SIZE "nsslapd-db-logfile-size"
#define CONFIG_DB_TRICKLE_PERCENTAGE "nsslapd-db-trickle-percentage"
#define CONFIG_DB_SPIN_COUNT "nsslapd-db-spin-count"
#define CONFIG_DB_VERBOSE "nsslapd-db-verbose"
#define CONFIG_DB_DEBUG "nsslapd-db-debug"
#define CONFIG_DB_LOCK "nsslapd-db-locks"
#define CONFIG_DB_NAMED_REGIONS "nsslapd-db-named-regions"
#define CONFIG_DB_PRIVATE_MEM "nsslapd-db-private-mem"
#define CONFIG_DB_PRIVATE_IMPORT_MEM "nsslapd-db-private-import-mem"
#define CONFIG_DB_SHM_KEY "nsslapd-db-shm-key"
#define CONFIG_DB_CACHE "nsslapd-db-cache"
#define CONFIG_DB_DEBUG_CHECKPOINTING "nsslapd-db-debug-checkpointing"
#define CONFIG_DB_HOME_DIRECTORY "nsslapd-db-home-directory"
#define CONFIG_DB_LOCKDOWN "nsslapd-db-lockdown"
#define CONFIG_DB_TX_MAX "nsslapd-db-tx-max"

#define CONFIG_IDL_SWITCH               "nsslapd-idl-switch"
#define CONFIG_BYPASS_FILTER_TEST       "nsslapd-search-bypass-filter-test"
#define CONFIG_USE_VLV_INDEX            "nsslapd-search-use-vlv-index"
#define CONFIG_SERIAL_LOCK              "nsslapd-serial-lock"

/* instance config options */
#define CONFIG_INSTANCE_CACHESIZE       "nsslapd-cachesize"
#define CONFIG_INSTANCE_CACHEMEMSIZE    "nsslapd-cachememsize"
#define CONFIG_INSTANCE_SUFFIX          "nsslapd-suffix"
#define CONFIG_INSTANCE_READONLY        "nsslapd-readonly"
#define CONFIG_INSTANCE_DIR      		"nsslapd-directory"

#define CONFIG_INSTANCE_REQUIRE_INDEX   "nsslapd-require-index"

#define CONFIG_USE_LEGACY_ERRORCODE     "nsslapd-do-not-use-vlv-error"

#define CONFIG_LDBM_DN "cn=config,cn=ldbm database,cn=plugins,cn=config"

#define LDBM_INSTANCE_CONFIG_DONT_WRITE 1

/* Some fuctions in ldbm_config.c used by ldbm_instance_config.c */
int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *string1, char *string2, char *string3, int flags);
int ldbm_config_add_dse_entry(struct ldbminfo *li, char *entry, int flags);
void ldbm_config_get(void *arg, config_info *config, char *buf);
int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod);
int ldbm_config_ignored_attr(char *attr_name);

/* Functions in ldbm_instance_config.c used in ldbm_config.c */
int ldbm_instance_config_load_dse_info(ldbm_instance *inst);
int ldbm_instance_config_add_index_entry(ldbm_instance *inst, int argc,
                                         char **argv, int flags);
int
ldbm_instance_index_config_enable_index(ldbm_instance *inst, Slapi_Entry* e);
int ldbm_instance_create_default_user_indexes(ldbm_instance *inst);


#endif /* _LDBM_CONFIG_H_ */