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