Update.
[platform/upstream/glibc.git] / nscd / nscd-client.h
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.
4
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.
9
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.
14
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. */
19
20 /* This file defines everything that client code should need to
21    know to talk to the nscd daemon.  */
22
23 #ifndef _NSCD_CLIENT_H
24 #define _NSCD_CLIENT_H  1
25
26 #include <nscd-types.h>
27
28 /* Version number of the daemon interface */
29 #define NSCD_VERSION 2
30
31 /* Path of the file where the PID of the running system is stored.  */
32 #define _PATH_NSCDPID    "/var/run/nscd.pid"
33
34 /* Path for the Unix domain socket.  */
35 #define _PATH_NSCDSOCKET "/var/run/.nscd_socket"
36
37 /* Path for the configuration file.  */
38 #define _PATH_NSCDCONF   "/etc/nscd.conf"
39
40
41 /* Available services.  */
42 typedef enum
43 {
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;
58
59
60 /* Header common to all requests */
61 typedef struct
62 {
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;
67
68
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
72 {
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;
83
84
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
88 {
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;
96
97
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
101 {
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;
111
112
113 #endif /* nscd.h */