2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
29 * @(#)rpcbind.h 1.4 90/04/12 SMI
30 * $NetBSD: rpcbind.h,v 1.1 2000/06/03 00:47:21 fvdl Exp $
31 * $FreeBSD: src/usr.sbin/rpcbind/rpcbind.h,v 1.3 2007/11/07 10:53:39 kevlo Exp $
34 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
39 * The common header declarations
46 #include <rpc/pmap_prot.h>
48 #include <rpc/rpcb_prot.h>
51 * Stuff for the rmtcall service
58 struct r_rmtcall_args
{
62 int rmt_localvers
; /* whether to send port # or uaddr */
64 struct encap_parms rmt_args
;
69 extern int verboselog
;
71 extern int oldstyle_local
;
72 extern rpcblist_ptr list_rbl
; /* A list of version 3 & 4 rpcbind services */
75 extern struct pmaplist
*list_pml
; /* A list of version 2 rpcbind services */
76 extern char *udptrans
; /* Name of UDP transport */
77 extern char *tcptrans
; /* Name of TCP transport */
78 extern char *udp_uaddr
; /* Universal UDP address */
79 extern char *tcp_uaddr
; /* Universal TCP address */
82 int add_bndlist(struct netconfig
*, struct netbuf
*);
83 bool_t
is_bound(char *, char *);
84 char *mergeaddr(SVCXPRT
*, char *, char *, char *);
85 struct netconfig
*rpcbind_get_conf(char *);
87 void rpcbs_init(void);
88 void rpcbs_procinfo(rpcvers_t
, rpcproc_t
);
89 void rpcbs_set(rpcvers_t
, bool_t
);
90 void rpcbs_unset(rpcvers_t
, bool_t
);
91 void rpcbs_getaddr(rpcvers_t
, rpcprog_t
, rpcvers_t
, char *, char *);
92 void rpcbs_rmtcall(rpcvers_t
, rpcproc_t
, rpcprog_t
, rpcvers_t
, rpcproc_t
,
93 char *, rpcblist_ptr
);
94 void *rpcbproc_getstat(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
96 void rpcb_service_3(struct svc_req
*, SVCXPRT
*);
97 void rpcb_service_4(struct svc_req
*, SVCXPRT
*);
99 /* Common functions shared between versions */
100 void *rpcbproc_set_com(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
101 void *rpcbproc_unset_com(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
102 bool_t
map_set(RPCB
*, char *);
103 bool_t
map_unset(RPCB
*, char *);
104 void delete_prog(unsigned int);
105 void *rpcbproc_getaddr_com(RPCB
*, struct svc_req
*, SVCXPRT
*, rpcvers_t
,
107 void *rpcbproc_gettime_com(void *, struct svc_req
*, SVCXPRT
*,
109 void *rpcbproc_uaddr2taddr_com(void *, struct svc_req
*,
110 SVCXPRT
*, rpcvers_t
);
111 void *rpcbproc_taddr2uaddr_com(void *, struct svc_req
*, SVCXPRT
*,
113 int create_rmtcall_fd(struct netconfig
*);
114 void rpcbproc_callit_com(struct svc_req
*, SVCXPRT
*, rpcvers_t
,
116 void my_svc_run(void);
118 void rpcbind_abort(void);
120 void toggle_verboselog(int);
122 int check_access(SVCXPRT
*, rpcproc_t
, void *, unsigned int);
123 int check_callit(SVCXPRT
*, struct r_rmtcall_args
*, int);
124 void logit(int, struct sockaddr
*, rpcproc_t
, rpcprog_t
, const char *);
125 int is_loopback(struct netbuf
*);
128 extern void pmap_service(struct svc_req
*, SVCXPRT
*);
131 void write_warmstart(void);
132 void read_warmstart(void);
134 char *addrmerge(struct netbuf
*, char *, char *, char *);
135 void network_init(void);
136 struct sockaddr
*local_sa(int);
138 /* For different getaddr semantics */
139 #define RPCB_ALLVERS 0
140 #define RPCB_ONEVERS 1
141 #endif /* _RPCBIND_H_ */