xref: /illumos-gate/usr/src/cmd/fs.d/nfs/lib/nfs_tbind.h (revision c65ebfc7045424bd04a6c7719a27b0ad3399ad54)
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 (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 /*
26  * nfs_tbind.h, common code for nfsd and lockd
27  */
28 
29 #ifndef	_NFS_TBIND_H
30 #define	_NFS_TBIND_H
31 
32 #include <netconfig.h>
33 #include <netdir.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Globals which should be initialised by daemon main().
41  */
42 extern  size_t  end_listen_fds;
43 extern  size_t  num_fds;
44 extern	int	listen_backlog;
45 extern	int	(*Mysvc)(int, struct netbuf, struct netconfig *);
46 extern	int	(*Mysvc4)(int, struct netbuf *, struct netconfig *,
47 		int, struct netbuf *);
48 extern  int	max_conns_allowed;
49 
50 /*
51  * RPC protocol block.  Useful for passing registration information.
52  */
53 struct protob {
54 	char *serv;		/* ASCII service name, e.g. "NFS" */
55 	int versmin;		/* minimum version no. to be registered */
56 	int versmax;		/* maximum version no. to be registered */
57 	int program;		/* program no. to be registered */
58 	struct protob *next;	/* next entry on list */
59 };
60 
61 /*
62  * Declarations for protocol types and comparison.
63  */
64 #define	NETSELDECL(x)	char *x
65 #define	NETSELPDECL(x)	char **x
66 #define	NETSELEQ(x, y)	(strcmp((x), (y)) == 0)
67 
68 /*
69  * nfs library routines
70  */
71 extern int	nfslib_transport_open(struct netconfig *);
72 extern int	nfslib_bindit(struct netconfig *, struct netbuf **,
73 			struct nd_hostserv *, int);
74 extern void	nfslib_log_tli_error(char *, int, struct netconfig *);
75 extern int	do_all(struct protob *,
76 			int (*)(int, struct netbuf, struct netconfig *));
77 extern void	do_one(char *, char *, struct protob *,
78 			int (*)(int, struct netbuf, struct netconfig *));
79 extern void	poll_for_action(void);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif	/* _NFS_TBIND_H */
86