17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
59acbbeann * Common Development and Distribution License (the "License").
69acbbeann * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate/*
229ff75adSurya Prakki * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bdstevel@tonic-gate */
247c478bdstevel@tonic-gate
257c478bdstevel@tonic-gate/*
267c478bdstevel@tonic-gate * nfs_tbind.h, common code for nfsd and lockd
277c478bdstevel@tonic-gate */
287c478bdstevel@tonic-gate
297c478bdstevel@tonic-gate#ifndef	_NFS_TBIND_H
307c478bdstevel@tonic-gate#define	_NFS_TBIND_H
317c478bdstevel@tonic-gate
327c478bdstevel@tonic-gate#include <netconfig.h>
337c478bdstevel@tonic-gate#include <netdir.h>
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate#ifdef __cplusplus
367c478bdstevel@tonic-gateextern "C" {
377c478bdstevel@tonic-gate#endif
387c478bdstevel@tonic-gate
397c478bdstevel@tonic-gate/*
407c478bdstevel@tonic-gate * Globals which should be initialised by daemon main().
417c478bdstevel@tonic-gate */
427c478bdstevel@tonic-gateextern  size_t  end_listen_fds;
437c478bdstevel@tonic-gateextern  size_t  num_fds;
447c478bdstevel@tonic-gateextern	int	listen_backlog;
457c478bdstevel@tonic-gateextern	int	(*Mysvc)(int, struct netbuf, struct netconfig *);
467c478bdstevel@tonic-gateextern	int	(*Mysvc4)(int, struct netbuf *, struct netconfig *,
477c478bdstevel@tonic-gate		int, struct netbuf *);
487c478bdstevel@tonic-gateextern  int	max_conns_allowed;
497c478bdstevel@tonic-gate
507c478bdstevel@tonic-gate/*
517c478bdstevel@tonic-gate * RPC protocol block.  Useful for passing registration information.
527c478bdstevel@tonic-gate */
537c478bdstevel@tonic-gatestruct protob {
547c478bdstevel@tonic-gate	char *serv;		/* ASCII service name, e.g. "NFS" */
557c478bdstevel@tonic-gate	int versmin;		/* minimum version no. to be registered */
567c478bdstevel@tonic-gate	int versmax;		/* maximum version no. to be registered */
577c478bdstevel@tonic-gate	int program;		/* program no. to be registered */
587c478bdstevel@tonic-gate	struct protob *next;	/* next entry on list */
597c478bdstevel@tonic-gate};
607c478bdstevel@tonic-gate
617c478bdstevel@tonic-gate/*
627c478bdstevel@tonic-gate * Declarations for protocol types and comparison.
637c478bdstevel@tonic-gate */
647c478bdstevel@tonic-gate#define	NETSELDECL(x)	char *x
657c478bdstevel@tonic-gate#define	NETSELPDECL(x)	char **x
667c478bdstevel@tonic-gate#define	NETSELEQ(x, y)	(strcmp((x), (y)) == 0)
677c478bdstevel@tonic-gate
687c478bdstevel@tonic-gate/*
697c478bdstevel@tonic-gate * nfs library routines
707c478bdstevel@tonic-gate */
717c478bdstevel@tonic-gateextern int	nfslib_transport_open(struct netconfig *);
727c478bdstevel@tonic-gateextern int	nfslib_bindit(struct netconfig *, struct netbuf **,
737c478bdstevel@tonic-gate			struct nd_hostserv *, int);
747c478bdstevel@tonic-gateextern void	nfslib_log_tli_error(char *, int, struct netconfig *);
757c478bdstevel@tonic-gateextern int	do_all(struct protob *,
769ff75adSurya Prakki			int (*)(int, struct netbuf, struct netconfig *));
777c478bdstevel@tonic-gateextern void	do_one(char *, char *, struct protob *,
789ff75adSurya Prakki			int (*)(int, struct netbuf, struct netconfig *));
797c478bdstevel@tonic-gateextern void	poll_for_action(void);
807c478bdstevel@tonic-gate
817c478bdstevel@tonic-gate#ifdef __cplusplus
827c478bdstevel@tonic-gate}
837c478bdstevel@tonic-gate#endif
847c478bdstevel@tonic-gate
857c478bdstevel@tonic-gate#endif	/* _NFS_TBIND_H */
86