xref: /onnv-gate/usr/src/cmd/fs.d/nfs/lib/nfs_tbind.h (revision 12648:61bf50c7467b)
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
52712Snn35248  * Common Development and Distribution License (the "License").
62712Snn35248  * 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*12648SSurya.Prakki@Sun.COM  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate /*
260Sstevel@tonic-gate  * nfs_tbind.h, common code for nfsd and lockd
270Sstevel@tonic-gate  */
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifndef	_NFS_TBIND_H
300Sstevel@tonic-gate #define	_NFS_TBIND_H
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <netconfig.h>
330Sstevel@tonic-gate #include <netdir.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef __cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * Globals which should be initialised by daemon main().
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate extern  size_t  end_listen_fds;
430Sstevel@tonic-gate extern  size_t  num_fds;
440Sstevel@tonic-gate extern	int	listen_backlog;
450Sstevel@tonic-gate extern	int	(*Mysvc)(int, struct netbuf, struct netconfig *);
460Sstevel@tonic-gate extern	int	(*Mysvc4)(int, struct netbuf *, struct netconfig *,
470Sstevel@tonic-gate 		int, struct netbuf *);
480Sstevel@tonic-gate extern  int	max_conns_allowed;
490Sstevel@tonic-gate 
500Sstevel@tonic-gate /*
510Sstevel@tonic-gate  * RPC protocol block.  Useful for passing registration information.
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate struct protob {
540Sstevel@tonic-gate 	char *serv;		/* ASCII service name, e.g. "NFS" */
550Sstevel@tonic-gate 	int versmin;		/* minimum version no. to be registered */
560Sstevel@tonic-gate 	int versmax;		/* maximum version no. to be registered */
570Sstevel@tonic-gate 	int program;		/* program no. to be registered */
580Sstevel@tonic-gate 	struct protob *next;	/* next entry on list */
590Sstevel@tonic-gate };
600Sstevel@tonic-gate 
610Sstevel@tonic-gate /*
620Sstevel@tonic-gate  * Declarations for protocol types and comparison.
630Sstevel@tonic-gate  */
640Sstevel@tonic-gate #define	NETSELDECL(x)	char *x
650Sstevel@tonic-gate #define	NETSELPDECL(x)	char **x
660Sstevel@tonic-gate #define	NETSELEQ(x, y)	(strcmp((x), (y)) == 0)
670Sstevel@tonic-gate 
680Sstevel@tonic-gate /*
690Sstevel@tonic-gate  * nfs library routines
700Sstevel@tonic-gate  */
710Sstevel@tonic-gate extern int	nfslib_transport_open(struct netconfig *);
720Sstevel@tonic-gate extern int	nfslib_bindit(struct netconfig *, struct netbuf **,
730Sstevel@tonic-gate 			struct nd_hostserv *, int);
740Sstevel@tonic-gate extern void	nfslib_log_tli_error(char *, int, struct netconfig *);
750Sstevel@tonic-gate extern int	do_all(struct protob *,
76*12648SSurya.Prakki@Sun.COM 			int (*)(int, struct netbuf, struct netconfig *));
770Sstevel@tonic-gate extern void	do_one(char *, char *, struct protob *,
78*12648SSurya.Prakki@Sun.COM 			int (*)(int, struct netbuf, struct netconfig *));
790Sstevel@tonic-gate extern void	poll_for_action(void);
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #ifdef __cplusplus
820Sstevel@tonic-gate }
830Sstevel@tonic-gate #endif
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #endif	/* _NFS_TBIND_H */
86