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