xref: /titanic_44/usr/src/cmd/fs.d/nfs/lib/nfs_tbind.h (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1996, 1999, 2001-2003 Sun Microsystems, Inc.
24  * All rights reserved.  Use is subject to license terms.
25  */
26 
27 /*
28  * nfs_tbind.h, common code for nfsd and lockd
29  */
30 
31 #ifndef	_NFS_TBIND_H
32 #define	_NFS_TBIND_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #include <netconfig.h>
37 #include <netdir.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /*
44  * Globals which should be initialised by daemon main().
45  */
46 extern  size_t  end_listen_fds;
47 extern  size_t  num_fds;
48 extern	int	listen_backlog;
49 extern	int	(*Mysvc)(int, struct netbuf, struct netconfig *);
50 extern	int	(*Mysvc4)(int, struct netbuf *, struct netconfig *,
51 		int, struct netbuf *);
52 extern  int	max_conns_allowed;
53 
54 /*
55  * RPC protocol block.  Useful for passing registration information.
56  */
57 struct protob {
58 	char *serv;		/* ASCII service name, e.g. "NFS" */
59 	int versmin;		/* minimum version no. to be registered */
60 	int versmax;		/* maximum version no. to be registered */
61 	int program;		/* program no. to be registered */
62 	struct protob *next;	/* next entry on list */
63 };
64 
65 /*
66  * Declarations for protocol types and comparison.
67  */
68 #define	NETSELDECL(x)	char *x
69 #define	NETSELPDECL(x)	char **x
70 #define	NETSELEQ(x, y)	(strcmp((x), (y)) == 0)
71 
72 /*
73  * nfs library routines
74  */
75 extern int	nfslib_transport_open(struct netconfig *);
76 extern int	nfslib_bindit(struct netconfig *, struct netbuf **,
77 			struct nd_hostserv *, int);
78 extern void	nfslib_log_tli_error(char *, int, struct netconfig *);
79 extern int	do_all(struct protob *,
80 			int (*)(int, struct netbuf, struct netconfig *));
81 extern void	do_one(char *, char *, struct protob *,
82 			int (*)(int, struct netbuf, struct netconfig *));
83 extern void	poll_for_action(void);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif	/* _NFS_TBIND_H */
90