rpcbind.h revision 74462
1/* $NetBSD: rpcbind.h,v 1.1 2000/06/03 00:47:21 fvdl Exp $ */ 2/* $FreeBSD: head/usr.sbin/rpcbind/rpcbind.h 74462 2001-03-19 12:50:13Z alfred $ */ 3 4/* 5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 6 * unrestricted use provided that this legend is included on all tape 7 * media and as a part of the software program in whole or part. Users 8 * may copy or modify Sun RPC without charge, but are not authorized 9 * to license or distribute it to anyone else except as part of a product or 10 * program developed by the user. 11 * 12 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 13 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 14 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 15 * 16 * Sun RPC is provided with no support and without any obligation on the 17 * part of Sun Microsystems, Inc. to assist in its use, correction, 18 * modification or enhancement. 19 * 20 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 21 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 22 * OR ANY PART THEREOF. 23 * 24 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 25 * or profits or other special, indirect and consequential damages, even if 26 * Sun has been advised of the possibility of such damages. 27 * 28 * Sun Microsystems, Inc. 29 * 2550 Garcia Avenue 30 * Mountain View, California 94043 31 */ 32/* 33 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc. 34 */ 35 36/* #ident "@(#)rpcbind.h 1.4 90/04/12 SMI" */ 37 38/* 39 * rpcbind.h 40 * The common header declarations 41 */ 42 43#ifndef rpcbind_h 44#define rpcbind_h 45 46#ifdef PORTMAP 47#include <rpc/pmap_prot.h> 48#endif 49#include <rpc/rpcb_prot.h> 50 51/* 52 * Stuff for the rmtcall service 53 */ 54struct encap_parms { 55 u_int32_t arglen; 56 char *args; 57}; 58 59struct r_rmtcall_args { 60 u_int32_t rmt_prog; 61 u_int32_t rmt_vers; 62 u_int32_t rmt_proc; 63 int rmt_localvers; /* whether to send port # or uaddr */ 64 char *rmt_uaddr; 65 struct encap_parms rmt_args; 66}; 67 68extern int debugging; 69extern int doabort; 70extern int verboselog; 71extern int insecure; 72extern int oldstyle_local; 73extern rpcblist_ptr list_rbl; /* A list of version 3 & 4 rpcbind services */ 74 75#ifdef PORTMAP 76extern struct pmaplist *list_pml; /* A list of version 2 rpcbind services */ 77extern char *udptrans; /* Name of UDP transport */ 78extern char *tcptrans; /* Name of TCP transport */ 79extern char *udp_uaddr; /* Universal UDP address */ 80extern char *tcp_uaddr; /* Universal TCP address */ 81#endif 82 83int add_bndlist __P((struct netconfig *, struct netbuf *)); 84bool_t is_bound __P((char *, char *)); 85char *mergeaddr __P((SVCXPRT *, char *, char *, char *)); 86struct netconfig *rpcbind_get_conf __P((char *)); 87 88void rpcbs_init __P((void)); 89void rpcbs_procinfo __P((rpcvers_t, rpcproc_t)); 90void rpcbs_set __P((rpcvers_t, bool_t)); 91void rpcbs_unset __P((rpcvers_t, bool_t)); 92void rpcbs_getaddr __P((rpcvers_t, rpcprog_t, rpcvers_t, char *, char *)); 93void rpcbs_rmtcall __P((rpcvers_t, rpcproc_t, rpcprog_t, rpcvers_t, rpcproc_t, 94 char *, rpcblist_ptr)); 95void *rpcbproc_getstat __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); 96 97void rpcb_service_3 __P((struct svc_req *, SVCXPRT *)); 98void rpcb_service_4 __P((struct svc_req *, SVCXPRT *)); 99 100/* Common functions shared between versions */ 101void *rpcbproc_set_com __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); 102void *rpcbproc_unset_com __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t)); 103bool_t map_set __P((RPCB *, char *)); 104bool_t map_unset __P((RPCB *, char *)); 105void delete_prog __P((int)); 106void *rpcbproc_getaddr_com __P((RPCB *, struct svc_req *, SVCXPRT *, rpcvers_t, 107 rpcvers_t)); 108void *rpcbproc_gettime_com __P((void *, struct svc_req *, SVCXPRT *, 109 rpcvers_t)); 110void *rpcbproc_uaddr2taddr_com __P((void *, struct svc_req *, 111 SVCXPRT *, rpcvers_t)); 112void *rpcbproc_taddr2uaddr_com __P((void *, struct svc_req *, SVCXPRT *, 113 rpcvers_t)); 114int create_rmtcall_fd __P((struct netconfig *)); 115void rpcbproc_callit_com __P((struct svc_req *, SVCXPRT *, rpcvers_t, 116 rpcvers_t)); 117void my_svc_run __P((void)); 118 119void rpcbind_abort __P((void)); 120void reap __P((int)); 121void toggle_verboselog __P((int)); 122 123int check_access __P((SVCXPRT *, rpcproc_t, void *, int)); 124int check_callit __P((SVCXPRT *, struct r_rmtcall_args *, int)); 125void logit __P((int, struct sockaddr *, rpcproc_t, rpcprog_t, const char *)); 126int is_loopback __P((struct netbuf *)); 127 128#ifdef PORTMAP 129extern void pmap_service __P((struct svc_req *, SVCXPRT *)); 130#endif 131 132void write_warmstart __P((void)); 133void read_warmstart __P((void)); 134 135char *addrmerge __P((struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr, 136 char *netid)); 137void network_init __P((void)); 138struct sockaddr *local_sa __P((int)); 139 140/* For different getaddr semantics */ 141#define RPCB_ALLVERS 0 142#define RPCB_ONEVERS 1 143 144#endif /* rpcbind_h */ 145