Update.
[glibc.git] / nscd / nscd-client.h
blob97b0baf629c4c91661674bd20150a880eeba0e68
1 /* Copyright (c) 1998, 1999, 2000 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@suse.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. */
20 /* This file defines everything that client code should need to
21 know to talk to the nscd daemon. */
23 #ifndef _NSCD_CLIENT_H
24 #define _NSCD_CLIENT_H 1
26 /* Version number of the daemon interface */
27 #define NSCD_VERSION 3
29 /* Path of the file where the PID of the running system is stored. */
30 #define _PATH_NSCDPID "/var/run/nscd.pid"
32 /* Path for the Unix domain socket. */
33 #define _PATH_NSCDSOCKET "/var/run/.nscd_socket"
35 /* Path for the configuration file. */
36 #define _PATH_NSCDCONF "/etc/nscd.conf"
39 /* Available services. */
40 typedef enum
42 GETPWBYNAME,
43 GETPWBYUID,
44 GETGRBYNAME,
45 GETGRBYGID,
46 GETHOSTBYNAME,
47 GETHOSTBYNAMEv6,
48 GETHOSTBYADDR,
49 GETHOSTBYADDRv6,
50 LASTDBREQ = GETHOSTBYADDRv6,
51 SHUTDOWN, /* Shut the server down. */
52 GETSTAT, /* Get the server statistic. */
53 INVALIDATE, /* Invalidate one special cache. */
54 LASTREQ
55 } request_type;
58 /* Header common to all requests */
59 typedef struct
61 int version; /* Version number of the daemon interface. */
62 request_type type; /* Service requested. */
63 int32_t key_len; /* Key length. */
64 } request_header;
67 /* Structure sent in reply to password query. Note that this struct is
68 sent also if the service is disabled or there is no record found. */
69 typedef struct
71 int32_t version;
72 int32_t found;
73 int32_t pw_name_len;
74 int32_t pw_passwd_len;
75 uid_t pw_uid;
76 gid_t pw_gid;
77 int32_t pw_gecos_len;
78 int32_t pw_dir_len;
79 int32_t pw_shell_len;
80 } pw_response_header;
83 /* Structure sent in reply to group query. Note that this struct is
84 sent also if the service is disabled or there is no record found. */
85 typedef struct
87 int32_t version;
88 int32_t found;
89 int32_t gr_name_len;
90 int32_t gr_passwd_len;
91 gid_t gr_gid;
92 int32_t gr_mem_cnt;
93 } gr_response_header;
96 /* Structure sent in reply to host query. Note that this struct is
97 sent also if the service is disabled or there is no record found. */
98 typedef struct
100 int32_t version;
101 int32_t found;
102 int32_t h_name_len;
103 int32_t h_aliases_cnt;
104 int32_t h_addrtype;
105 int32_t h_length;
106 int32_t h_addr_list_cnt;
107 int32_t error;
108 } hst_response_header;
111 #endif /* nscd.h */