Update.
[glibc.git] / nscd / nscd-client.h
blob0c52f91c360edba5e33856d9818a487cfd9cc29d
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. */
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 2
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 LASTREQ,
54 } request_type;
57 /* Header common to all requests */
58 typedef struct
60 int version; /* Version number of the daemon interface. */
61 request_type type; /* Service requested. */
62 ssize_t key_len; /* Key length. */
63 } request_header;
66 /* Structure sent in reply to password query. Note that this struct is
67 sent also if the service is disabled or there is no record found. */
68 typedef struct
70 int version;
71 int found;
72 ssize_t pw_name_len;
73 ssize_t pw_passwd_len;
74 uid_t pw_uid;
75 gid_t pw_gid;
76 ssize_t pw_gecos_len;
77 ssize_t pw_dir_len;
78 ssize_t pw_shell_len;
79 } pw_response_header;
82 /* Structure sent in reply to group query. Note that this struct is
83 sent also if the service is disabled or there is no record found. */
84 typedef struct
86 int version;
87 int found;
88 ssize_t gr_name_len;
89 ssize_t gr_passwd_len;
90 gid_t gr_gid;
91 ssize_t gr_mem_cnt;
92 } gr_response_header;
95 /* Structure sent in reply to host query. Note that this struct is
96 sent also if the service is disabled or there is no record found. */
97 typedef struct
99 int version;
100 int found;
101 ssize_t h_name_len;
102 ssize_t h_aliases_cnt;
103 int h_addrtype;
104 int h_length;
105 ssize_t h_addr_list_cnt;
106 int error;
107 } hst_response_header;
110 #endif /* nscd.h */