Update.
[glibc.git] / nscd / nscd-client.h
blob8e00df56376a9d1a7a9d25f1e7d16533f28768e0
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 Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 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 #include <nscd-types.h>
28 /* Version number of the daemon interface */
29 #define NSCD_VERSION 2
31 /* Path of the file where the PID of the running system is stored. */
32 #define _PATH_NSCDPID "/var/run/nscd.pid"
34 /* Path for the Unix domain socket. */
35 #define _PATH_NSCDSOCKET "/var/run/.nscd_socket"
37 /* Path for the configuration file. */
38 #define _PATH_NSCDCONF "/etc/nscd.conf"
41 /* Available services. */
42 typedef enum
44 GETPWBYNAME,
45 GETPWBYUID,
46 GETGRBYNAME,
47 GETGRBYGID,
48 GETHOSTBYNAME,
49 GETHOSTBYNAMEv6,
50 GETHOSTBYADDR,
51 GETHOSTBYADDRv6,
52 LASTDBREQ = GETHOSTBYADDRv6,
53 SHUTDOWN, /* Shut the server down. */
54 GETSTAT, /* Get the server statistic. */
55 INVALIDATE, /* Invalidate one special cache. */
56 LASTREQ
57 } request_type;
60 /* Header common to all requests */
61 typedef struct
63 int32_t version; /* Version number of the daemon interface. */
64 request_type type; /* Service requested. */
65 int32_t key_len; /* Key length. */
66 } request_header;
69 /* Structure sent in reply to password query. Note that this struct is
70 sent also if the service is disabled or there is no record found. */
71 typedef struct
73 int32_t version;
74 int32_t found;
75 nscd_ssize_t pw_name_len;
76 nscd_ssize_t pw_passwd_len;
77 uid_t pw_uid;
78 gid_t pw_gid;
79 nscd_ssize_t pw_gecos_len;
80 nscd_ssize_t pw_dir_len;
81 nscd_ssize_t pw_shell_len;
82 } pw_response_header;
85 /* Structure sent in reply to group query. Note that this struct is
86 sent also if the service is disabled or there is no record found. */
87 typedef struct
89 int32_t version;
90 int32_t found;
91 nscd_ssize_t gr_name_len;
92 nscd_ssize_t gr_passwd_len;
93 gid_t gr_gid;
94 nscd_ssize_t gr_mem_cnt;
95 } gr_response_header;
98 /* Structure sent in reply to host query. Note that this struct is
99 sent also if the service is disabled or there is no record found. */
100 typedef struct
102 int32_t version;
103 int32_t found;
104 nscd_ssize_t h_name_len;
105 nscd_ssize_t h_aliases_cnt;
106 int32_t h_addrtype;
107 int32_t h_length;
108 nscd_ssize_t h_addr_list_cnt;
109 int32_t error;
110 } hst_response_header;
113 #endif /* nscd.h */