1 /* Copyright (c) 1997-2022 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3 
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8 
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13 
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, see
16    <https://www.gnu.org/licenses/>.  */
17 
18 #ifndef __NIS_INTERN_H
19 
20 #define __NIS_INTERN_H
21 #include <features.h>
22 
23 /* Configurable parameters for pinging NIS servers:  */
24 
25 /* Number of retries.  */
26 #ifndef __NIS_PING_RETRY
27 # define __NIS_PING_RETRY 2
28 #endif
29 /* Initial timeout in seconds.  */
30 #ifndef __NIS_PING_TIMEOUT_START
31 # define __NIS_PING_TIMEOUT_START 3
32 #endif
33 /* Timeout increment for retries in seconds.  */
34 #ifndef __NIS_PING_TIMEOUT_INCREMENT
35 # define __NIS_PING_TIMEOUT_INCREMENT 3
36 #endif
37 
38 
39 __BEGIN_DECLS
40 
41 struct nis_cb
42   {
43     nis_server *serv;
44     SVCXPRT *xprt;
45     int sock;
46     int nomore;
47     nis_error result;
48     int (*callback) (const_nis_name, const nis_object *, const void *);
49     const void *userdata;
50   };
51 typedef struct nis_cb nis_cb;
52 
53 extern unsigned long int inetstr2int (const char *str);
54 extern long int __nis_findfastest (dir_binding *bind);
55 extern nis_error __do_niscall2 (const nis_server *serv, u_int serv_len,
56 				u_long prog, xdrproc_t xargs, caddr_t req,
57 				xdrproc_t xres, caddr_t resp,
58 				unsigned int flags, nis_cb *cb);
59 extern nis_error __do_niscall (const_nis_name name, u_long prog,
60 			       xdrproc_t xargs, caddr_t req,
61 			       xdrproc_t xres, caddr_t resp,
62 			       unsigned int flags, nis_cb *cb);
63 extern nis_error __do_niscall3 (dir_binding *dbp, u_long prog,
64 				xdrproc_t xargs, caddr_t req,
65 				xdrproc_t xres, caddr_t resp,
66 				unsigned int flags, nis_cb *cb);
67 libnsl_hidden_proto (__do_niscall3)
68 
69 extern u_short __pmap_getnisport (struct sockaddr_in *address, u_long program,
70 				  u_long version, u_int protocol);
71 
72 /* NIS+ callback */
73 extern nis_error __nis_do_callback (struct dir_binding *bptr,
74 				    netobj *cookie, struct nis_cb *cb);
75 extern struct nis_cb *__nis_create_callback
76       (int (*callback)(const_nis_name, const nis_object *, const void *),
77        const void *userdata, unsigned int flags);
78 extern nis_error __nis_destroy_callback (struct nis_cb *cb);
79 
80 __END_DECLS
81 
82 #endif
83