ldbm_config.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. #ifndef _LDBM_CONFIG_H_
  42. #define _LDBM_CONFIG_H_
  43. struct config_info;
  44. typedef struct config_info config_info;
  45. typedef int config_set_fn_t(void *arg, void *value, char *errorbuf, int phase, int apply);
  46. typedef void *config_get_fn_t(void *arg);
  47. /* The value for these is passed around as a
  48. * void *, the actual value should be gotten
  49. * by casting the void * as shown below. */
  50. #define CONFIG_TYPE_ONOFF 1 /* val = (int) value */
  51. #define CONFIG_TYPE_STRING 2 /* val = (char *) value - The get functions
  52. * for this type must return alloced memory
  53. * that should be freed by the caller. */
  54. #define CONFIG_TYPE_INT 3 /* val = (int) value */
  55. #define CONFIG_TYPE_LONG 4 /* val = (long) value */
  56. #define CONFIG_TYPE_INT_OCTAL 5 /* Same as CONFIG_TYPE_INT, but shown in
  57. * octal */
  58. #define CONFIG_TYPE_SIZE_T 6 /* val = (size_t) value */
  59. /* How changes to some config attributes are handled depends on what
  60. * "phase" the server is in. Initialization, reading the config
  61. * information at startup, or actually running. */
  62. #define CONFIG_PHASE_INITIALIZATION 1
  63. #define CONFIG_PHASE_STARTUP 2
  64. #define CONFIG_PHASE_RUNNING 3
  65. #define CONFIG_PHASE_INTERNAL 4
  66. #define CONFIG_FLAG_PREVIOUSLY_SET 1
  67. #define CONFIG_FLAG_ALWAYS_SHOW 2
  68. #define CONFIG_FLAG_ALLOW_RUNNING_CHANGE 4
  69. #define CONFIG_FLAG_SKIP_DEFAULT_SETTING 8
  70. struct config_info {
  71. char *config_name;
  72. int config_type;
  73. char *config_default_value;
  74. config_get_fn_t *config_get_fn;
  75. config_set_fn_t *config_set_fn;
  76. int config_flags;
  77. };
  78. #define CONFIG_INSTANCE "nsslapd-instance"
  79. #define CONFIG_LOOKTHROUGHLIMIT "nsslapd-lookthroughlimit"
  80. #define CONFIG_IDLISTSCANLIMIT "nsslapd-idlistscanlimit"
  81. #define CONFIG_DIRECTORY "nsslapd-directory"
  82. #define CONFIG_MODE "nsslapd-mode"
  83. #define CONFIG_DBCACHESIZE "nsslapd-dbcachesize"
  84. #define CONFIG_DBNCACHE "nsslapd-dbncache"
  85. #define CONFIG_MAXPASSBEFOREMERGE "nsslapd-maxpassbeforemerge"
  86. #define CONFIG_IMPORT_CACHE_AUTOSIZE "nsslapd-import-cache-autosize"
  87. #define CONFIG_CACHE_AUTOSIZE "nsslapd-cache-autosize"
  88. #define CONFIG_CACHE_AUTOSIZE_SPLIT "nsslapd-cache-autosize-split"
  89. #define CONFIG_IMPORT_CACHESIZE "nsslapd-import-cachesize"
  90. #define CONFIG_INDEX_BUFFER_SIZE "nsslapd-index-buffer-size"
  91. #define CONFIG_EXCLUDE_FROM_EXPORT "nsslapd-exclude-from-export"
  92. #define CONFIG_EXCLUDE_FROM_EXPORT_DEFAULT_VALUE \
  93. "entrydn entryid dncomp parentid numSubordinates"
  94. /* dblayer config options - These are hidden from the user
  95. * and can't be updated on the fly. */
  96. #define CONFIG_DB_LOGDIRECTORY "nsslapd-db-logdirectory"
  97. #define CONFIG_DB_DURABLE_TRANSACTIONS "nsslapd-db-durable-transaction"
  98. #define CONFIG_DB_CIRCULAR_LOGGING "nsslapd-db-circular-logging"
  99. #define CONFIG_DB_TRANSACTION_LOGGING "nsslapd-db-transaction-logging"
  100. #define CONFIG_DB_CHECKPOINT_INTERVAL "nsslapd-db-checkpoint-interval"
  101. #define CONFIG_DB_TRANSACTION_BATCH "nsslapd-db-transaction-batch-val"
  102. #define CONFIG_DB_LOGBUF_SIZE "nsslapd-db-logbuf-size"
  103. #define CONFIG_DB_PAGE_SIZE "nsslapd-db-page-size"
  104. #define CONFIG_DB_INDEX_PAGE_SIZE "nsslapd-db-index-page-size" /* With the new
  105. idl design, the large 8Kbyte pages we use are not
  106. optimal. The page pool churns very quickly as we add new IDs under a
  107. sustained add load. Smaller pages stop this happening so much and
  108. consequently make us spend less time flushing dirty pages on checkpoints.
  109. But 8K is still a good page size for id2entry. So we now allow different
  110. page sizes for the primary and secondary indices. */
  111. #define CONFIG_DB_IDL_DIVISOR "nsslapd-db-idl-divisor"
  112. #define CONFIG_DB_LOGFILE_SIZE "nsslapd-db-logfile-size"
  113. #define CONFIG_DB_TRICKLE_PERCENTAGE "nsslapd-db-trickle-percentage"
  114. #define CONFIG_DB_SPIN_COUNT "nsslapd-db-spin-count"
  115. #define CONFIG_DB_VERBOSE "nsslapd-db-verbose"
  116. #define CONFIG_DB_DEBUG "nsslapd-db-debug"
  117. #define CONFIG_DB_LOCK "nsslapd-db-locks"
  118. #define CONFIG_DB_NAMED_REGIONS "nsslapd-db-named-regions"
  119. #define CONFIG_DB_PRIVATE_MEM "nsslapd-db-private-mem"
  120. #define CONFIG_DB_PRIVATE_IMPORT_MEM "nsslapd-db-private-import-mem"
  121. #define CONFIG_DB_SHM_KEY "nsslapd-db-shm-key"
  122. #define CONFIG_DB_CACHE "nsslapd-db-cache"
  123. #define CONFIG_DB_DEBUG_CHECKPOINTING "nsslapd-db-debug-checkpointing"
  124. #define CONFIG_DB_HOME_DIRECTORY "nsslapd-db-home-directory"
  125. #define CONFIG_DB_LOCKDOWN "nsslapd-db-lockdown"
  126. #define CONFIG_DB_TX_MAX "nsslapd-db-tx-max"
  127. #define CONFIG_IDL_SWITCH "nsslapd-idl-switch"
  128. #define CONFIG_BYPASS_FILTER_TEST "nsslapd-search-bypass-filter-test"
  129. #define CONFIG_USE_VLV_INDEX "nsslapd-search-use-vlv-index"
  130. #define CONFIG_SERIAL_LOCK "nsslapd-serial-lock"
  131. /* instance config options */
  132. #define CONFIG_INSTANCE_CACHESIZE "nsslapd-cachesize"
  133. #define CONFIG_INSTANCE_CACHEMEMSIZE "nsslapd-cachememsize"
  134. #define CONFIG_INSTANCE_SUFFIX "nsslapd-suffix"
  135. #define CONFIG_INSTANCE_READONLY "nsslapd-readonly"
  136. #define CONFIG_INSTANCE_DIR "nsslapd-directory"
  137. #define CONFIG_INSTANCE_REQUIRE_INDEX "nsslapd-require-index"
  138. #define CONFIG_USE_LEGACY_ERRORCODE "nsslapd-do-not-use-vlv-error"
  139. #define CONFIG_LDBM_DN "cn=config,cn=ldbm database,cn=plugins,cn=config"
  140. #define LDBM_INSTANCE_CONFIG_DONT_WRITE 1
  141. /* Some fuctions in ldbm_config.c used by ldbm_instance_config.c */
  142. int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *string1, char *string2, char *string3, int flags);
  143. int ldbm_config_add_dse_entry(struct ldbminfo *li, char *entry, int flags);
  144. void ldbm_config_get(void *arg, config_info *config, char *buf);
  145. int ldbm_config_set(void *arg, char *attr_name, config_info *config_array, struct berval *bval, char *err_buf, int phase, int apply_mod);
  146. int ldbm_config_ignored_attr(char *attr_name);
  147. /* Functions in ldbm_instance_config.c used in ldbm_config.c */
  148. int ldbm_instance_config_load_dse_info(ldbm_instance *inst);
  149. int ldbm_instance_config_add_index_entry(ldbm_instance *inst, int argc,
  150. char **argv, int flags);
  151. int
  152. ldbm_instance_index_config_enable_index(ldbm_instance *inst, Slapi_Entry* e);
  153. int ldbm_instance_create_default_user_indexes(ldbm_instance *inst);
  154. #endif /* _LDBM_CONFIG_H_ */