xref: /onnv-gate/usr/src/cmd/fs.d/nfs/lib/nfs_tbind.h (revision 2712:f74a135872bc)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*2712Snn35248  * Common Development and Distribution License (the "License").
6*2712Snn35248  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*2712Snn35248  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*2712Snn35248  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*
270Sstevel@tonic-gate  * nfs_tbind.h, common code for nfsd and lockd
280Sstevel@tonic-gate  */
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef	_NFS_TBIND_H
310Sstevel@tonic-gate #define	_NFS_TBIND_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #include <netconfig.h>
360Sstevel@tonic-gate #include <netdir.h>
370Sstevel@tonic-gate 
380Sstevel@tonic-gate #ifdef __cplusplus
390Sstevel@tonic-gate extern "C" {
400Sstevel@tonic-gate #endif
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /*
430Sstevel@tonic-gate  * Globals which should be initialised by daemon main().
440Sstevel@tonic-gate  */
450Sstevel@tonic-gate extern  size_t  end_listen_fds;
460Sstevel@tonic-gate extern  size_t  num_fds;
470Sstevel@tonic-gate extern	int	listen_backlog;
480Sstevel@tonic-gate extern	int	(*Mysvc)(int, struct netbuf, struct netconfig *);
490Sstevel@tonic-gate extern	int	(*Mysvc4)(int, struct netbuf *, struct netconfig *,
500Sstevel@tonic-gate 		int, struct netbuf *);
510Sstevel@tonic-gate extern  int	max_conns_allowed;
520Sstevel@tonic-gate 
530Sstevel@tonic-gate /*
540Sstevel@tonic-gate  * RPC protocol block.  Useful for passing registration information.
550Sstevel@tonic-gate  */
560Sstevel@tonic-gate struct protob {
570Sstevel@tonic-gate 	char *serv;		/* ASCII service name, e.g. "NFS" */
580Sstevel@tonic-gate 	int versmin;		/* minimum version no. to be registered */
590Sstevel@tonic-gate 	int versmax;		/* maximum version no. to be registered */
600Sstevel@tonic-gate 	int program;		/* program no. to be registered */
610Sstevel@tonic-gate 	struct protob *next;	/* next entry on list */
620Sstevel@tonic-gate };
630Sstevel@tonic-gate 
640Sstevel@tonic-gate /*
650Sstevel@tonic-gate  * Declarations for protocol types and comparison.
660Sstevel@tonic-gate  */
670Sstevel@tonic-gate #define	NETSELDECL(x)	char *x
680Sstevel@tonic-gate #define	NETSELPDECL(x)	char **x
690Sstevel@tonic-gate #define	NETSELEQ(x, y)	(strcmp((x), (y)) == 0)
700Sstevel@tonic-gate 
710Sstevel@tonic-gate /*
720Sstevel@tonic-gate  * nfs library routines
730Sstevel@tonic-gate  */
740Sstevel@tonic-gate extern int	nfslib_transport_open(struct netconfig *);
750Sstevel@tonic-gate extern int	nfslib_bindit(struct netconfig *, struct netbuf **,
760Sstevel@tonic-gate 			struct nd_hostserv *, int);
770Sstevel@tonic-gate extern void	nfslib_log_tli_error(char *, int, struct netconfig *);
780Sstevel@tonic-gate extern int	do_all(struct protob *,
79*2712Snn35248 			int (*)(int, struct netbuf, struct netconfig *),
80*2712Snn35248 			int use_pmap);
810Sstevel@tonic-gate extern void	do_one(char *, char *, struct protob *,
82*2712Snn35248 			int (*)(int, struct netbuf, struct netconfig *),
83*2712Snn35248 			int use_pmap);
840Sstevel@tonic-gate extern void	poll_for_action(void);
850Sstevel@tonic-gate 
860Sstevel@tonic-gate #ifdef __cplusplus
870Sstevel@tonic-gate }
880Sstevel@tonic-gate #endif
890Sstevel@tonic-gate 
900Sstevel@tonic-gate #endif	/* _NFS_TBIND_H */
91