1 /* Copyright (c) 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
26 /* Version number of the daemon interface */
27 #define NSCD_VERSION 1
29 /* How many threads do we spawn maximal ? */
30 #define MAX_NUM_CONNECTIONS 16
32 /* Services provided */
41 SHUTDOWN
, /* Shut the server down */
42 GETSTAT
/* Get the server statistic */
45 /* Header common to all requests */
48 /* Version number of the daemon interface */
50 /* Service requested */
61 ssize_t pw_passwd_len
;
74 ssize_t gr_passwd_len
;
83 unsigned long pw_poshit
;
84 unsigned long pw_posmiss
;
85 unsigned long pw_neghit
;
86 unsigned long pw_negmiss
;
87 unsigned long pw_size
;
88 unsigned long pw_posttl
;
89 unsigned long pw_negttl
;
91 unsigned long gr_poshit
;
92 unsigned long gr_posmiss
;
93 unsigned long gr_neghit
;
94 unsigned long gr_negmiss
;
95 unsigned long gr_size
;
96 unsigned long gr_posttl
;
97 unsigned long gr_negttl
;
98 } stat_response_header
;
100 #define _PATH_NSCDPID "/var/run/nscd.pid"
101 #define _PATH_NSCDSOCKET "/var/run/.nscd_socket"
102 #define _PATH_NSCDCONF "/etc/nscd.conf"
110 extern int do_shutdown
; /* 1 if we should quit the programm. */
111 extern int disabled_passwd
;
112 extern int disabled_group
;
114 extern int nscd_parse_file
__P ((const char *fname
));
115 extern int set_logfile
__P ((const char *logfile
));
116 extern void set_pos_pwd_ttl
__P ((unsigned long));
117 extern void set_neg_pwd_ttl
__P ((unsigned long));
118 extern void set_pos_grp_ttl
__P ((unsigned long));
119 extern void set_neg_grp_ttl
__P ((unsigned long));
120 extern void set_pwd_modulo
__P ((unsigned long));
121 extern void set_grp_modulo
__P ((unsigned long));
123 extern void init_sockets
__P ((void));
124 extern void close_socket
__P ((int conn
));
125 extern void close_sockets
__P ((void));
126 extern void get_request
__P ((int *conn
, request_header
*req
, char **key
));
127 extern void pw_send_answer
__P ((int conn
, struct passwd
*pwd
));
128 extern void pw_send_disabled
__P ((int conn
));
129 extern void gr_send_answer
__P ((int conn
, struct group
*grp
));
130 extern void gr_send_disabled
__P ((int conn
));
132 extern int cache_pwdinit
__P ((void));
133 extern void *cache_getpwnam
__P ((void *param
));
134 extern void *cache_getpwuid
__P ((void *param
));
135 extern void *cache_pw_disabled
__P ((void *param
));
137 extern int cache_grpinit
__P ((void));
138 extern void *cache_getgrnam
__P ((void *param
));
139 extern void *cache_getgrgid
__P ((void *param
));
140 extern void *cache_gr_disabled
__P ((void *param
));
142 extern int __nscd_open_socket
__P ((void));
144 extern void get_pw_stat
__P ((stat_response_header
*resp
));
145 extern void get_gr_stat
__P ((stat_response_header
*resp
));
146 extern void print_stat
__P ((void));
147 extern void stat_send
__P ((int conn
, stat_response_header
*resp
));