4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _NSCD_CFGDEF_H
26 #define _NSCD_CFGDEF_H
34 #include <nss_dbdefs.h>
35 #include "nscd_config.h"
40 * structure used for preliminary checking of an integer
46 } nscd_cfg_int_check_t
;
49 * structure used for preliminary checking of a bitmap
53 nscd_cfg_bitmap_t valid_bits
;
54 } nscd_cfg_bitmap_check_t
;
57 * structure used for preliminary checking of a string
61 nscd_bool_t must_not_null
;
63 } nscd_cfg_str_check_t
;
66 * Per nsswitch database config data
69 nscd_cfg_frontend_t fe
;
71 nscd_cfg_cache_t cache
;
72 } nscd_cfg_nsw_db_data_t
;
75 * Per nsswitch database statistics data
78 nscd_cfg_stat_switch_t sw
;
79 nscd_cfg_stat_cache_t cache
;
80 } nscd_cfg_stat_nsw_db_data_t
;
83 * global statistics data
86 nscd_cfg_stat_global_log_t log
;
87 nscd_cfg_stat_global_switch_t sw
;
88 nscd_cfg_stat_cache_t cache
;
89 } nscd_cfg_stat_global_data_t
;
95 nscd_cfg_global_log_t log
;
96 nscd_cfg_global_frontend_t fe
;
97 nscd_cfg_global_selfcred_t sc
;
98 nscd_cfg_global_switch_t sw
;
99 nscd_cfg_global_cache_t cache
;
100 } nscd_cfg_global_data_t
;
103 * structure for handling the switch database specific group
104 * or parameter default
106 typedef struct nscd_cfg_nsw_spc_default
{
110 void *data
; /* pointer or link to data */
112 } nscd_cfg_nsw_spc_default_t
;
115 * name service switch source (repository) table
117 nscd_cfg_id_t _nscd_cfg_nsw_src
[] = {
130 * name service related smf service table
131 * (the order of the services should match the order of the source
132 * listed above, 0: files, 1: ldap, 2: nis, 3: mdns.
135 nscd_cfg_id_t _nscd_cfg_smf_services
[] = {
136 { 0, "svc:/system/name-service-cache:default"},
137 { 1, "svc:/network/ldap/client:default" },
138 { 2, "svc:/network/nis/client:default" },
139 { 3, "svc:/network/dns/multicast:default" },
144 * default version for supported sources/backends
146 void *_nscd_be_version
= NULL
;
149 * name service database table
151 nscd_cfg_id_t _nscd_cfg_nsw_db
[] = {
152 { 0, NSS_DBNAM_PASSWD
},
153 { 1, NSS_DBNAM_GROUP
},
154 { 2, NSS_DBNAM_HOSTS
},
155 { 3, NSS_DBNAM_IPNODES
},
156 { 4, NSS_DBNAM_EXECATTR
},
157 { 5, NSS_DBNAM_PROFATTR
},
158 { 6, NSS_DBNAM_USERATTR
},
159 { 7, NSS_DBNAM_NETWORKS
},
160 { 8, NSS_DBNAM_PROTOCOLS
},
161 { 9, NSS_DBNAM_RPC
},
162 { 10, NSS_DBNAM_ETHERS
},
163 { 11, NSS_DBNAM_NETMASKS
},
164 { 12, NSS_DBNAM_BOOTPARAMS
},
165 { 13, NSS_DBNAM_PUBLICKEY
},
166 { 14, NSS_DBNAM_NETGROUP
},
167 { 15, NSS_DBNAM_SERVICES
},
168 { 16, NSS_DBNAM_PRINTERS
},
169 { 17, NSS_DBNAM_AUTHATTR
},
170 { 18, NSS_DBNAM_PROJECT
},
171 { 19, NSS_DBNAM_SHADOW
},
172 { 20, NSS_DBNAM_AUDITUSER
},
173 { 21, NSS_DBNAM_TSOL_TP
},
174 { 22, NSS_DBNAM_TSOL_RH
},
175 /* pseudo-databases for the compat backend */
176 { 23, NSS_DBNAM_PASSWD_COMPAT
},
177 { 24, NSS_DBNAM_GROUP_COMPAT
},
178 #define NSS_DBNAM_COMPAT_NUM_DB 5
180 * pseudo-databases that use the switch policy that is
181 * configured for NSS_DBNAM_PASSWD_COMPAT
183 { 25, NSS_DBNAM_PASSWD
},
184 { 26, NSS_DBNAM_SHADOW
},
185 { 27, NSS_DBNAM_AUDITUSER
},
186 { 28, NSS_DBNAM_USERATTR
},
188 * pseudo-database that uses the switch policy that is
189 * configured for NSS_DBNAM_GROUP_COMPAT
191 { 29, NSS_DBNAM_GROUP
},
196 * A special way to indicate all switch databases
198 static nscd_cfg_id_t _nscd_cfg_nsw_alldb
= {
199 NSCD_CFG_NSW_ALLDB_INDEX
,
204 * data for preliminary checking of the log configuration
206 static nscd_cfg_str_check_t NSCD_CFG_LOGFILE_PCHECK
=
207 {nscd_false
, PATH_MAX
};
208 static nscd_cfg_bitmap_check_t NSCD_CFG_LOGCOMP_PCHECK
=
210 static nscd_cfg_bitmap_check_t NSCD_CFG_LOGLEVEL_PCHECK
=
211 {NSCD_LOG_LEVEL_ALL
};
213 /* data for preliminary checking of the switch configuration */
214 static nscd_cfg_str_check_t NSCD_CFG_NSWCFGSTR_PCHECK
=
218 * macros for defining the static param table
220 #define NSCD_CFG_PGROUP_DESC(pn, type, pflag, gf, g_in_t, pcheck_p,\
221 nfunc_name, vfunc_name) \
223 {-1, pn}, type, (NSCD_CFG_PFLAG_GROUP | pflag), \
225 NSCD_SIZEOF(g_in_t, gf), offsetof(g_in_t, gf), -1, \
226 pcheck_p, nfunc_name, vfunc_name \
229 #define NSCD_CFG_PARAM_DESC(pn, type, pflag, pf, p_in_t, \
230 gf, g_in_t, pcheck_p, nfunc_name, vfunc_name) \
232 {-1, pn}, type, pflag, \
233 NSCD_SIZEOF(p_in_t, pf), offsetof(p_in_t, pf), -1, \
234 NSCD_SIZEOF(g_in_t, gf), offsetof(g_in_t, gf), -1, \
235 pcheck_p, nfunc_name, vfunc_name \
238 #define NSCD_CFG_PGROUP_DESC_NULL \
240 {-1, NULL}, -1, NSCD_CFG_PFLAG_GROUP, \
246 /* nscd internal cfg_*_notify() cfg_*_verify() and cfg_*_get_stat() */
247 extern nscd_rc_t
_nscd_cfg_log_notify();
248 extern nscd_rc_t
_nscd_cfg_log_verify();
249 extern nscd_rc_t
_nscd_cfg_frontend_notify();
250 extern nscd_rc_t
_nscd_cfg_frontend_verify();
251 extern nscd_rc_t
_nscd_cfg_selfcred_notify();
252 extern nscd_rc_t
_nscd_cfg_selfcred_verify();
253 extern nscd_rc_t
_nscd_cfg_switch_notify();
254 extern nscd_rc_t
_nscd_cfg_switch_verify();
255 extern nscd_rc_t
_nscd_cfg_cache_notify();
256 extern nscd_rc_t
_nscd_cfg_cache_verify();
257 extern nscd_rc_t
_nscd_cfg_log_get_stat();
258 extern nscd_rc_t
_nscd_cfg_switch_get_stat();
259 extern nscd_rc_t
_nscd_cfg_cache_get_stat();
262 * the following macros are used to indicate a parameter's
263 * notify/verify/get_stat functions are the same as those
266 #define NSCD_CFG_FUNC_NOTIFY_AS_GROUP ((nscd_cfg_func_notify_t)-1)
267 #define NSCD_CFG_FUNC_VERIFY_AS_GROUP ((nscd_cfg_func_verify_t)-1)
268 #define NSCD_CFG_FUNC_GET_STAT_AS_GROUP ((nscd_cfg_func_get_stat_t)-1)
271 * the static config parameter description table
273 static nscd_cfg_param_desc_t _nscd_cfg_param_desc
[] = {
275 NSCD_CFG_PGROUP_DESC(
276 "param-group-global-log",
278 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
279 NSCD_CFG_PFLAG_GLOBAL
,
281 nscd_cfg_global_data_t
,
283 _nscd_cfg_log_notify
,
284 _nscd_cfg_log_verify
),
288 NSCD_CFG_DATA_STRING
,
289 NSCD_CFG_PFLAG_GLOBAL
|
290 NSCD_CFG_PFLAG_VLEN_DATA
,
292 nscd_cfg_global_log_t
,
294 nscd_cfg_global_data_t
,
295 &NSCD_CFG_LOGFILE_PCHECK
,
296 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
297 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
301 NSCD_CFG_DATA_BITMAP
,
302 NSCD_CFG_PFLAG_GLOBAL
,
304 nscd_cfg_global_log_t
,
306 nscd_cfg_global_data_t
,
307 &NSCD_CFG_LOGLEVEL_PCHECK
,
308 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
309 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
313 NSCD_CFG_DATA_BITMAP
,
314 NSCD_CFG_PFLAG_GLOBAL
,
316 nscd_cfg_global_log_t
,
318 nscd_cfg_global_data_t
,
319 &NSCD_CFG_LOGCOMP_PCHECK
,
320 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
321 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
323 NSCD_CFG_PGROUP_DESC(
324 "param-group-global-frontend",
326 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
327 NSCD_CFG_PFLAG_GLOBAL
,
329 nscd_cfg_global_data_t
,
331 _nscd_cfg_frontend_notify
,
332 _nscd_cfg_frontend_verify
),
335 "common-worker-threads",
336 NSCD_CFG_DATA_INTEGER
,
337 NSCD_CFG_PFLAG_SEND_BIT_SELECTED
|
338 NSCD_CFG_PFLAG_GLOBAL
,
339 common_worker_threads
,
340 nscd_cfg_global_frontend_t
,
342 nscd_cfg_global_data_t
,
344 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
345 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
349 NSCD_CFG_DATA_INTEGER
,
350 NSCD_CFG_PFLAG_SEND_BIT_SELECTED
|
351 NSCD_CFG_PFLAG_GLOBAL
,
353 nscd_cfg_global_frontend_t
,
355 nscd_cfg_global_data_t
,
357 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
358 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
360 NSCD_CFG_PGROUP_DESC(
361 "param-group-global-selfcred",
363 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
364 NSCD_CFG_PFLAG_GLOBAL
,
366 nscd_cfg_global_data_t
,
368 _nscd_cfg_selfcred_notify
,
369 _nscd_cfg_selfcred_verify
),
373 NSCD_CFG_DATA_BOOLEAN
,
374 NSCD_CFG_PFLAG_GLOBAL
,
376 nscd_cfg_global_selfcred_t
,
378 nscd_cfg_global_data_t
,
380 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
381 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
385 NSCD_CFG_DATA_INTEGER
,
386 NSCD_CFG_PFLAG_GLOBAL
,
388 nscd_cfg_global_selfcred_t
,
390 nscd_cfg_global_data_t
,
392 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
393 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
395 NSCD_CFG_PGROUP_DESC(
396 "param-group-global-switch",
398 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
399 NSCD_CFG_PFLAG_GLOBAL
,
401 nscd_cfg_global_data_t
,
403 _nscd_cfg_switch_notify
,
404 _nscd_cfg_switch_verify
),
407 "global-enable-lookup",
408 NSCD_CFG_DATA_BOOLEAN
,
409 NSCD_CFG_PFLAG_GLOBAL
,
411 nscd_cfg_global_switch_t
,
413 nscd_cfg_global_data_t
,
415 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
416 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
419 "global-enable-loopback-checking",
420 NSCD_CFG_DATA_BOOLEAN
,
421 NSCD_CFG_PFLAG_GLOBAL
,
422 enable_loopback_checking_g
,
423 nscd_cfg_global_switch_t
,
425 nscd_cfg_global_data_t
,
427 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
428 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
431 "global-check-smf-state-interval",
432 NSCD_CFG_DATA_INTEGER
,
433 NSCD_CFG_PFLAG_GLOBAL
,
434 check_smf_state_interval_g
,
435 nscd_cfg_global_switch_t
,
437 nscd_cfg_global_data_t
,
439 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
440 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
442 NSCD_CFG_PGROUP_DESC(
443 "param-group-global-cache",
445 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
446 NSCD_CFG_PFLAG_INIT_SET_ALL_DB
|
447 NSCD_CFG_PFLAG_GLOBAL
,
449 nscd_cfg_global_data_t
,
451 _nscd_cfg_cache_notify
,
452 _nscd_cfg_cache_verify
),
455 "global-enable-cache",
456 NSCD_CFG_DATA_BOOLEAN
,
457 NSCD_CFG_PFLAG_GLOBAL
,
459 nscd_cfg_global_cache_t
,
461 nscd_cfg_global_data_t
,
463 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
464 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
466 /* non-global config param from this point on */
468 NSCD_CFG_PGROUP_DESC(
469 "param-group-frontend",
471 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
,
473 nscd_cfg_nsw_db_data_t
,
475 _nscd_cfg_frontend_notify
,
476 _nscd_cfg_frontend_verify
),
479 "worker-thread-per-nsw-db",
480 NSCD_CFG_DATA_INTEGER
,
482 worker_thread_per_nsw_db
,
485 nscd_cfg_nsw_db_data_t
,
487 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
488 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
490 NSCD_CFG_PGROUP_DESC(
491 "param-group-switch",
493 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
|
496 nscd_cfg_nsw_db_data_t
,
498 _nscd_cfg_switch_notify
,
499 _nscd_cfg_switch_verify
),
503 NSCD_CFG_DATA_STRING
,
504 NSCD_CFG_PFLAG_VLEN_DATA
|
505 NSCD_CFG_PFLAG_LINKED
,
509 nscd_cfg_nsw_db_data_t
,
510 &NSCD_CFG_NSWCFGSTR_PCHECK
,
511 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
512 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
515 "nsw-config-database",
516 NSCD_CFG_DATA_STRING
,
517 NSCD_CFG_PFLAG_VLEN_DATA
|
518 NSCD_CFG_PFLAG_HIDDEN
,
522 nscd_cfg_nsw_db_data_t
,
523 &NSCD_CFG_NSWCFGSTR_PCHECK
,
524 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
525 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
529 NSCD_CFG_DATA_BOOLEAN
,
534 nscd_cfg_nsw_db_data_t
,
536 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
537 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
540 "enable-loopback-checking",
541 NSCD_CFG_DATA_BOOLEAN
,
543 enable_loopback_checking
,
546 nscd_cfg_nsw_db_data_t
,
548 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
549 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
552 "max-nsw-state-per-db",
553 NSCD_CFG_DATA_INTEGER
,
555 max_nsw_state_per_db
,
558 nscd_cfg_nsw_db_data_t
,
560 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
561 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
564 "max-nsw-state-per-thread",
565 NSCD_CFG_DATA_INTEGER
,
567 max_nsw_state_per_thread
,
570 nscd_cfg_nsw_db_data_t
,
572 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
573 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
576 "max-getent-ctx-per-db",
577 NSCD_CFG_DATA_INTEGER
,
579 max_getent_ctx_per_db
,
582 nscd_cfg_nsw_db_data_t
,
584 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
585 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
587 NSCD_CFG_PGROUP_DESC(
590 NSCD_CFG_PFLAG_INIT_SEND_WHOLE_GROUP
,
592 nscd_cfg_nsw_db_data_t
,
594 _nscd_cfg_cache_notify
,
595 _nscd_cfg_cache_verify
),
599 NSCD_CFG_DATA_BOOLEAN
,
604 nscd_cfg_nsw_db_data_t
,
606 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
607 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
610 "enable-per-user-cache",
611 NSCD_CFG_DATA_BOOLEAN
,
616 nscd_cfg_nsw_db_data_t
,
618 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
619 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
623 NSCD_CFG_DATA_BOOLEAN
,
628 nscd_cfg_nsw_db_data_t
,
630 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
631 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
635 NSCD_CFG_DATA_BOOLEAN
,
640 nscd_cfg_nsw_db_data_t
,
642 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
643 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
646 "check-file-interval",
647 NSCD_CFG_DATA_INTEGER
,
652 nscd_cfg_nsw_db_data_t
,
654 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
655 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
658 "positive-time-to-live",
659 NSCD_CFG_DATA_INTEGER
,
664 nscd_cfg_nsw_db_data_t
,
666 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
667 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
670 "negative-time-to-live",
671 NSCD_CFG_DATA_INTEGER
,
676 nscd_cfg_nsw_db_data_t
,
678 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
679 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
683 NSCD_CFG_DATA_INTEGER
,
688 nscd_cfg_nsw_db_data_t
,
690 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
691 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
695 NSCD_CFG_DATA_INTEGER
,
700 nscd_cfg_nsw_db_data_t
,
702 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
703 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
706 "maximum-entries-allowed",
707 NSCD_CFG_DATA_INTEGER
,
712 nscd_cfg_nsw_db_data_t
,
714 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
715 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
719 NSCD_CFG_DATA_INTEGER
,
720 NSCD_CFG_PFLAG_OBSOLETE
,
724 nscd_cfg_nsw_db_data_t
,
726 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
727 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
731 NSCD_CFG_DATA_BOOLEAN
,
732 NSCD_CFG_PFLAG_OBSOLETE
,
736 nscd_cfg_nsw_db_data_t
,
738 NSCD_CFG_FUNC_NOTIFY_AS_GROUP
,
739 NSCD_CFG_FUNC_VERIFY_AS_GROUP
),
741 NSCD_CFG_PGROUP_DESC_NULL
745 * defaults for the global configuration
747 static nscd_cfg_global_data_t nscd_cfg_global_default
= {
750 * nscd_cfg_global_log_t
754 NSCD_CFG_GROUP_INFO_GLOBAL_LOG
,
756 NSCD_LOG_LEVEL_NONE
, /* debug_level */
757 NSCD_LOG_CACHE
, /* debug_comp */
762 * nscd_cfg_global_frontend_t
766 NSCD_CFG_GROUP_INFO_GLOBAL_FRONTEND
,
767 100, /* common_worker_threads */
768 100, /* cache_hit_threads */
773 * nscd_cfg_global_selfcred_t
777 NSCD_CFG_GROUP_INFO_GLOBAL_SELFCRED
,
778 nscd_true
, /* enable_selfcred */
779 120, /* per_user_nscd_ttl: 120 seconds */
784 * nscd_cfg_global_switch_t
788 NSCD_CFG_GROUP_INFO_GLOBAL_SWITCH
,
789 nscd_true
, /* enable_lookup_g */
790 nscd_false
, /* enable_loopback_checking_g */
791 120, /* check_smf_state_interval_g */
796 * nscd_cfg_global_cache_t
798 NSCD_CFG_GLOBAL_CACHE_DEFAULTS
802 * defaults for the per switch database configuration
804 static nscd_cfg_nsw_db_data_t nscd_cfg_nsw_db_data_default
= {
807 * nscd_cfg_frontend_t
811 NSCD_CFG_GROUP_INFO_FRONTEND
,
812 50, /* worker_thread_per_nsw_db */
821 NSCD_CFG_GROUP_INFO_SWITCH
,
822 "nis files", /* nsw_config_string */
823 NULL
, /* nsw_config_db */
824 nscd_true
, /* enable_lookup */
825 nscd_false
, /* enable_loopback_checking */
826 288, /* max_nsw_state_per_db */
827 32, /* max_nsw_state_per_thread */
828 256, /* max_getent_ctx_per_db */
835 NSCD_CFG_CACHE_DEFAULTS
839 * macros for defining the database specific defaults
841 #define NSCD_CFG_DB_DEFAULT_PARAM(db, gf, pf, gt, defaddr, deflen) \
843 db, offsetof(nscd_cfg_nsw_db_data_t, gf), \
844 offsetof(gt, pf), defaddr, deflen \
847 #define NSCD_CFG_DB_DEFAULT_GROUP(db, gf, defaddr, deflen) \
849 db, offsetof(nscd_cfg_nsw_db_data_t, gf), \
853 #define NSCD_CFG_DB_DEFAULT_NULL \
855 NULL, 0, 0, NULL, 0 \
859 * shadow, and user_attr use the same switch policy
860 * as that of passwd. exec_attr use that of prof_attr.
862 static char *nscd_cfg_shadow_cfg_db
= NSS_DBNAM_PASSWD
;
863 static char *nscd_cfg_userattr_cfg_db
= NSS_DBNAM_PASSWD
;
864 static char *nscd_cfg_execattr_cfg_db
= NSS_DBNAM_PROFATTR
;
867 * default switch policy for pseudo-databases passwd_compat and
868 * and group_compa is "nis"
870 static char *nscd_cfg_def_passwd_compat
= NSS_DEFCONF_PASSWD_COMPAT
;
871 static char *nscd_cfg_def_group_compat
= NSS_DEFCONF_GROUP_COMPAT
;
873 static nscd_cfg_nsw_spc_default_t nscd_cfg_passwd_cfg_link
=
874 NSCD_CFG_DB_DEFAULT_PARAM(
880 NSCD_SIZEOF(nscd_cfg_switch_t
, nsw_config_string
));
882 static nscd_cfg_nsw_spc_default_t nscd_cfg_profattr_cfg_link
=
883 NSCD_CFG_DB_DEFAULT_PARAM(
889 NSCD_SIZEOF(nscd_cfg_switch_t
, nsw_config_string
));
893 * switch database specific defaults
895 nscd_cfg_nsw_spc_default_t _nscd_cfg_nsw_spc_default
[] = {
897 NSCD_CFG_DB_DEFAULT_PARAM(
902 &nscd_cfg_shadow_cfg_db
,
903 sizeof (nscd_cfg_shadow_cfg_db
)),
905 NSCD_CFG_DB_DEFAULT_PARAM(
910 &nscd_cfg_userattr_cfg_db
,
911 sizeof (nscd_cfg_userattr_cfg_db
)),
913 NSCD_CFG_DB_DEFAULT_PARAM(
918 &nscd_cfg_execattr_cfg_db
,
919 sizeof (nscd_cfg_execattr_cfg_db
)),
921 NSCD_CFG_DB_DEFAULT_PARAM(
922 NSS_DBNAM_PASSWD_COMPAT
,
926 &nscd_cfg_def_passwd_compat
,
927 sizeof (nscd_cfg_def_passwd_compat
)),
929 NSCD_CFG_DB_DEFAULT_PARAM(
930 NSS_DBNAM_GROUP_COMPAT
,
934 &nscd_cfg_def_group_compat
,
935 sizeof (nscd_cfg_def_group_compat
)),
937 NSCD_CFG_DB_DEFAULT_NULL
941 * switch database specific defaults that are linked to
942 * those of other databases
944 nscd_cfg_nsw_spc_default_t _nscd_cfg_nsw_link_default
[] = {
946 NSCD_CFG_DB_DEFAULT_PARAM(
951 &nscd_cfg_passwd_cfg_link
,
954 NSCD_CFG_DB_DEFAULT_PARAM(
959 &nscd_cfg_passwd_cfg_link
,
962 NSCD_CFG_DB_DEFAULT_PARAM(
967 &nscd_cfg_passwd_cfg_link
,
970 NSCD_CFG_DB_DEFAULT_PARAM(
975 &nscd_cfg_profattr_cfg_link
,
978 NSCD_CFG_DB_DEFAULT_NULL
982 * macros for defining the static stats table
984 #define NSCD_CFG_SGROUP_DESC(sn, type, sflag, gi, \
985 gf, g_in_t, gsfunc_name) \
987 {-1, sn}, type, NSCD_CFG_SFLAG_GROUP | sflag, gi, \
989 NSCD_SIZEOF(g_in_t, gf), offsetof(g_in_t, gf), -1, \
993 #define NSCD_CFG_STAT_DESC(sn, type, sflag, sf, s_in_t, \
994 gf, g_in_t, gsfunc_name) \
996 {-1, sn}, type, sflag, NSCD_CFG_GROUP_INFO_NULL, \
997 NSCD_SIZEOF(s_in_t, sf), offsetof(s_in_t, sf), -1, \
998 NSCD_SIZEOF(g_in_t, gf), offsetof(g_in_t, gf), -1, \
1002 #define NSCD_CFG_SGROUP_DESC_NULL \
1004 {-1, NULL}, -1, NSCD_CFG_SFLAG_GROUP, NULL, \
1011 * the static statistics description table
1013 static nscd_cfg_stat_desc_t _nscd_cfg_stat_desc
[] = {
1015 NSCD_CFG_SGROUP_DESC(
1016 "stat-group-global-log",
1018 NSCD_CFG_SFLAG_GLOBAL
,
1019 NSCD_CFG_STAT_GROUP_INFO_GLOBAL_LOG
,
1021 nscd_cfg_stat_global_data_t
,
1022 _nscd_cfg_log_get_stat
),
1026 NSCD_CFG_DATA_INTEGER
,
1027 NSCD_CFG_SFLAG_GLOBAL
,
1029 nscd_cfg_stat_global_log_t
,
1031 nscd_cfg_stat_global_data_t
,
1032 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1034 NSCD_CFG_SGROUP_DESC(
1035 "stat-group-global-switch",
1037 NSCD_CFG_SFLAG_GLOBAL
,
1038 NSCD_CFG_STAT_GROUP_INFO_GLOBAL_SWITCH
,
1040 nscd_cfg_stat_global_data_t
,
1041 _nscd_cfg_switch_get_stat
),
1044 "global-lookup-request-received",
1045 NSCD_CFG_DATA_INTEGER
,
1046 NSCD_CFG_SFLAG_GLOBAL
,
1047 lookup_request_received_g
,
1048 nscd_cfg_stat_global_switch_t
,
1050 nscd_cfg_stat_global_data_t
,
1051 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1054 "global-lookup-request-queued",
1055 NSCD_CFG_DATA_INTEGER
,
1056 NSCD_CFG_SFLAG_GLOBAL
,
1057 lookup_request_queued_g
,
1058 nscd_cfg_stat_global_switch_t
,
1060 nscd_cfg_stat_global_data_t
,
1061 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1064 "global-lookup-request-in-progress",
1065 NSCD_CFG_DATA_INTEGER
,
1066 NSCD_CFG_SFLAG_GLOBAL
,
1067 lookup_request_in_progress_g
,
1068 nscd_cfg_stat_global_switch_t
,
1070 nscd_cfg_stat_global_data_t
,
1071 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1074 "global-lookup-request-succeeded",
1075 NSCD_CFG_DATA_INTEGER
,
1076 NSCD_CFG_SFLAG_GLOBAL
,
1077 lookup_request_succeeded_g
,
1078 nscd_cfg_stat_global_switch_t
,
1080 nscd_cfg_stat_global_data_t
,
1081 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1084 "global-lookup-request-failed",
1085 NSCD_CFG_DATA_INTEGER
,
1086 NSCD_CFG_SFLAG_GLOBAL
,
1087 lookup_request_failed_g
,
1088 nscd_cfg_stat_global_switch_t
,
1090 nscd_cfg_stat_global_data_t
,
1091 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1094 "global-loopback-nsw-db-skipped",
1095 NSCD_CFG_DATA_INTEGER
,
1096 NSCD_CFG_SFLAG_GLOBAL
,
1097 loopback_nsw_db_skipped_g
,
1098 nscd_cfg_stat_global_switch_t
,
1100 nscd_cfg_stat_global_data_t
,
1101 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1103 NSCD_CFG_SGROUP_DESC(
1104 "stat-group-global-cache",
1106 NSCD_CFG_SFLAG_GLOBAL
,
1107 NSCD_CFG_STAT_GROUP_INFO_CACHE
,
1109 nscd_cfg_stat_global_data_t
,
1110 _nscd_cfg_cache_get_stat
),
1113 "global-cache-hits-on-positive",
1114 NSCD_CFG_DATA_INTEGER
,
1115 NSCD_CFG_SFLAG_GLOBAL
,
1117 nscd_cfg_stat_cache_t
,
1119 nscd_cfg_stat_global_data_t
,
1120 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1123 "global-cache-hits-on-negative",
1124 NSCD_CFG_DATA_INTEGER
,
1125 NSCD_CFG_SFLAG_GLOBAL
,
1127 nscd_cfg_stat_cache_t
,
1129 nscd_cfg_stat_global_data_t
,
1130 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1133 "global-cache-misses-on-positive",
1134 NSCD_CFG_DATA_INTEGER
,
1135 NSCD_CFG_SFLAG_GLOBAL
,
1137 nscd_cfg_stat_cache_t
,
1139 nscd_cfg_stat_global_data_t
,
1140 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1143 "global-cache-misses-on-negative",
1144 NSCD_CFG_DATA_INTEGER
,
1145 NSCD_CFG_SFLAG_GLOBAL
,
1147 nscd_cfg_stat_cache_t
,
1149 nscd_cfg_stat_global_data_t
,
1150 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1153 "global-cache-queries-queued",
1154 NSCD_CFG_DATA_INTEGER
,
1155 NSCD_CFG_SFLAG_GLOBAL
,
1157 nscd_cfg_stat_cache_t
,
1159 nscd_cfg_stat_global_data_t
,
1160 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1163 "global-total-cache-entries",
1164 NSCD_CFG_DATA_INTEGER
,
1165 NSCD_CFG_SFLAG_GLOBAL
,
1167 nscd_cfg_stat_cache_t
,
1169 nscd_cfg_stat_global_data_t
,
1170 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1173 "global-complete-cache-invalidations",
1174 NSCD_CFG_DATA_INTEGER
,
1175 NSCD_CFG_SFLAG_GLOBAL
,
1177 nscd_cfg_stat_cache_t
,
1179 nscd_cfg_stat_global_data_t
,
1180 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1183 "global-cache-queries-dropped",
1184 NSCD_CFG_DATA_INTEGER
,
1185 NSCD_CFG_SFLAG_GLOBAL
,
1187 nscd_cfg_stat_cache_t
,
1189 nscd_cfg_stat_global_data_t
,
1190 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1193 "global-cache-hit-rate",
1194 NSCD_CFG_DATA_PERCENT
,
1195 NSCD_CFG_SFLAG_GLOBAL
,
1197 nscd_cfg_stat_cache_t
,
1199 nscd_cfg_stat_global_data_t
,
1200 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1202 /* non-global stat from this point on */
1204 NSCD_CFG_SGROUP_DESC(
1205 "stat-group-switch",
1207 NSCD_CFG_SFLAG_GROUP
,
1208 NSCD_CFG_STAT_GROUP_INFO_SWITCH
,
1210 nscd_cfg_stat_nsw_db_data_t
,
1211 _nscd_cfg_switch_get_stat
),
1214 "lookup-request-received",
1215 NSCD_CFG_DATA_INTEGER
,
1216 NSCD_CFG_SFLAG_NONE
,
1217 lookup_request_received
,
1218 nscd_cfg_stat_switch_t
,
1220 nscd_cfg_stat_nsw_db_data_t
,
1221 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1224 "lookup-request-queued",
1225 NSCD_CFG_DATA_INTEGER
,
1226 NSCD_CFG_SFLAG_NONE
,
1227 lookup_request_queued
,
1228 nscd_cfg_stat_switch_t
,
1230 nscd_cfg_stat_nsw_db_data_t
,
1231 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1234 "lookup-request-in-progress",
1235 NSCD_CFG_DATA_INTEGER
,
1236 NSCD_CFG_SFLAG_NONE
,
1237 lookup_request_in_progress
,
1238 nscd_cfg_stat_switch_t
,
1240 nscd_cfg_stat_nsw_db_data_t
,
1241 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1244 "lookup-request-succeeded",
1245 NSCD_CFG_DATA_INTEGER
,
1246 NSCD_CFG_SFLAG_NONE
,
1247 lookup_request_succeeded
,
1248 nscd_cfg_stat_switch_t
,
1250 nscd_cfg_stat_nsw_db_data_t
,
1251 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1254 "lookup-request-failed",
1255 NSCD_CFG_DATA_INTEGER
,
1256 NSCD_CFG_SFLAG_NONE
,
1257 lookup_request_failed
,
1258 nscd_cfg_stat_switch_t
,
1260 nscd_cfg_stat_nsw_db_data_t
,
1261 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1264 "loopback-nsw-db-skipped",
1265 NSCD_CFG_DATA_INTEGER
,
1266 NSCD_CFG_SFLAG_NONE
,
1267 loopback_nsw_db_skipped
,
1268 nscd_cfg_stat_switch_t
,
1270 nscd_cfg_stat_nsw_db_data_t
,
1271 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1273 NSCD_CFG_SGROUP_DESC(
1276 NSCD_CFG_SFLAG_GROUP
,
1277 NSCD_CFG_STAT_GROUP_INFO_CACHE
,
1279 nscd_cfg_stat_nsw_db_data_t
,
1280 _nscd_cfg_cache_get_stat
),
1283 "cache-hits-on-positive",
1284 NSCD_CFG_DATA_INTEGER
,
1285 NSCD_CFG_SFLAG_NONE
,
1287 nscd_cfg_stat_cache_t
,
1289 nscd_cfg_stat_nsw_db_data_t
,
1290 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1293 "cache-hits-on-negative",
1294 NSCD_CFG_DATA_INTEGER
,
1295 NSCD_CFG_SFLAG_NONE
,
1297 nscd_cfg_stat_cache_t
,
1299 nscd_cfg_stat_nsw_db_data_t
,
1300 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1303 "cache-misses-on-positive",
1304 NSCD_CFG_DATA_INTEGER
,
1305 NSCD_CFG_SFLAG_NONE
,
1307 nscd_cfg_stat_cache_t
,
1309 nscd_cfg_stat_nsw_db_data_t
,
1310 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1313 "cache-misses-on-negative",
1314 NSCD_CFG_DATA_INTEGER
,
1315 NSCD_CFG_SFLAG_NONE
,
1317 nscd_cfg_stat_cache_t
,
1319 nscd_cfg_stat_nsw_db_data_t
,
1320 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1323 "cache-queries-queued",
1324 NSCD_CFG_DATA_INTEGER
,
1325 NSCD_CFG_SFLAG_NONE
,
1327 nscd_cfg_stat_cache_t
,
1329 nscd_cfg_stat_nsw_db_data_t
,
1330 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1333 "total-cache-entries",
1334 NSCD_CFG_DATA_INTEGER
,
1335 NSCD_CFG_SFLAG_NONE
,
1337 nscd_cfg_stat_cache_t
,
1339 nscd_cfg_stat_nsw_db_data_t
,
1340 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1343 "complete-cache-invalidations",
1344 NSCD_CFG_DATA_INTEGER
,
1345 NSCD_CFG_SFLAG_NONE
,
1347 nscd_cfg_stat_cache_t
,
1349 nscd_cfg_stat_nsw_db_data_t
,
1350 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1354 NSCD_CFG_DATA_PERCENT
,
1355 NSCD_CFG_SFLAG_NONE
,
1357 nscd_cfg_stat_cache_t
,
1359 nscd_cfg_stat_nsw_db_data_t
,
1360 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1363 "cache-queries-dropped",
1364 NSCD_CFG_DATA_PERCENT
,
1365 NSCD_CFG_SFLAG_NONE
,
1367 nscd_cfg_stat_cache_t
,
1369 nscd_cfg_stat_nsw_db_data_t
,
1370 NSCD_CFG_FUNC_GET_STAT_AS_GROUP
),
1373 NSCD_CFG_SGROUP_DESC_NULL
1376 /* number of entries in the static tables */
1378 int _nscd_cfg_num_nsw_src
=
1379 (sizeof (_nscd_cfg_nsw_src
) /
1380 sizeof (_nscd_cfg_nsw_src
[0]) - 1);
1382 int _nscd_cfg_num_smf_services
=
1383 (sizeof (_nscd_cfg_smf_services
) /
1384 sizeof (_nscd_cfg_smf_services
[0]) - 1);
1386 /* number of supported nsw databases (including pseudo ones) */
1387 int _nscd_cfg_num_nsw_db_all
=
1388 (sizeof (_nscd_cfg_nsw_db
) /
1389 sizeof (_nscd_cfg_nsw_db
[0]) - 1);
1391 /* number of supported nsw databases (not including pseudo ones) */
1392 int _nscd_cfg_num_nsw_db
=
1393 (sizeof (_nscd_cfg_nsw_db
) /
1394 sizeof (_nscd_cfg_nsw_db
[0]) - 1) -
1395 NSS_DBNAM_COMPAT_NUM_DB
;
1397 static int _nscd_cfg_num_param
=
1398 (sizeof (_nscd_cfg_param_desc
) /
1399 sizeof (_nscd_cfg_param_desc
[0]) - 1);
1401 static int _nscd_cfg_num_stat
=
1402 (sizeof (_nscd_cfg_stat_desc
) /
1403 sizeof (_nscd_cfg_stat_desc
[0]) - 1);
1405 int _nscd_cfg_num_nsw_default
=
1406 (sizeof (_nscd_cfg_nsw_spc_default
) /
1407 sizeof (_nscd_cfg_nsw_spc_default
[0]) - 1);
1409 int _nscd_cfg_num_link_default
=
1410 (sizeof (_nscd_cfg_nsw_link_default
) /
1411 sizeof (_nscd_cfg_nsw_link_default
[0]) - 1);
1417 #endif /* _NSCD_CFGDEF_H */