Cache network interface information
[platform/upstream/glibc.git] / nscd / nscd_proto.h
1 /* Copyright (C) 1998-2000,2002,2004,2007,2011 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 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.
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    Lesser General Public License for more details.
14
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.  */
19
20 #ifndef _NSCD_PROTO_H
21 #define _NSCD_PROTO_H 1
22
23 #include <grp.h>
24 #include <netdb.h>
25 #include <pwd.h>
26
27 /* Interval in which we transfer retry to contact the NSCD.  */
28 #define NSS_NSCD_RETRY  100
29
30 /* Type needed in the interfaces.  */
31 struct nscd_ai_result;
32
33
34 /* Variables for communication between NSCD handler functions and NSS.  */
35 extern int __nss_not_use_nscd_passwd attribute_hidden;
36 extern int __nss_not_use_nscd_group attribute_hidden;
37 extern int __nss_not_use_nscd_hosts attribute_hidden;
38 extern int __nss_not_use_nscd_services attribute_hidden;
39 extern int __nss_not_use_nscd_netgroup attribute_hidden;
40
41 extern int __nscd_getpwnam_r (const char *name, struct passwd *resultbuf,
42                               char *buffer, size_t buflen,
43                               struct passwd **result);
44 extern int __nscd_getpwuid_r (uid_t uid, struct passwd *resultbuf,
45                               char *buffer,  size_t buflen,
46                               struct passwd **result);
47 extern int __nscd_getgrnam_r (const char *name, struct group *resultbuf,
48                               char *buffer, size_t buflen,
49                               struct group **result);
50 extern int __nscd_getgrgid_r (gid_t gid, struct group *resultbuf,
51                               char *buffer,  size_t buflen,
52                               struct group **result);
53 extern int __nscd_gethostbyname_r (const char *name,
54                                    struct hostent *resultbuf,
55                                    char *buffer, size_t buflen,
56                                    struct hostent **result, int *h_errnop);
57 extern int __nscd_gethostbyname2_r (const char *name, int af,
58                                     struct hostent *resultbuf,
59                                     char *buffer, size_t buflen,
60                                     struct hostent **result, int *h_errnop);
61 extern int __nscd_gethostbyaddr_r (const void *addr, socklen_t len, int type,
62                                    struct hostent *resultbuf,
63                                    char *buffer, size_t buflen,
64                                    struct hostent **result, int *h_errnop);
65 extern int __nscd_getai (const char *key, struct nscd_ai_result **result,
66                          int *h_errnop);
67 extern int __nscd_getgrouplist (const char *user, gid_t group, long int *size,
68                                 gid_t **groupsp, long int limit);
69 extern int __nscd_getservbyname_r (const char *name, const char *proto,
70                                    struct servent *result_buf, char *buf,
71                                    size_t buflen, struct servent **result);
72 extern int __nscd_getservbyport_r (int port, const char *proto,
73                                    struct servent *result_buf, char *buf,
74                                    size_t buflen, struct servent **result);
75 extern int __nscd_innetgr (const char *netgroup, const char *host,
76                            const char *user, const char *domain);
77 extern int __nscd_setnetgrent (const char *group, struct __netgrent *datap);
78
79
80 #endif /* _NSCD_PROTO_H */