rpcbind.h revision 1.3 1 1.3 christos /* $NetBSD: rpcbind.h,v 1.3 2007/05/16 14:42:08 christos 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.2 christos extern const char *udptrans; /* Name of UDP transport */
77 1.2 christos extern const char *tcptrans; /* Name of TCP transport */
78 1.2 christos extern const char *udp_uaddr; /* Universal UDP address */
79 1.2 christos extern const char *tcp_uaddr; /* Universal TCP address */
80 1.1 fvdl #endif
81 1.1 fvdl
82 1.3 christos extern const char rpcbind_superuser[];
83 1.3 christos extern const char rpcbind_unknown[];
84 1.1 fvdl
85 1.2 christos int add_bndlist(struct netconfig *, struct netbuf *);
86 1.2 christos bool_t is_bound(const char *, const char *);
87 1.2 christos char *mergeaddr(SVCXPRT *, char *, char *, char *);
88 1.2 christos struct netconfig *rpcbind_get_conf(const char *);
89 1.2 christos
90 1.2 christos void rpcbs_init(void);
91 1.2 christos void rpcbs_procinfo(rpcvers_t, rpcproc_t);
92 1.2 christos void rpcbs_set(rpcvers_t, bool_t);
93 1.2 christos void rpcbs_unset(rpcvers_t, bool_t);
94 1.2 christos void rpcbs_getaddr(rpcvers_t, rpcprog_t, rpcvers_t, const char *, const char *);
95 1.2 christos void rpcbs_rmtcall(rpcvers_t, rpcproc_t, rpcprog_t, rpcvers_t, rpcproc_t,
96 1.2 christos char *, rpcblist_ptr);
97 1.2 christos void *rpcbproc_getstat(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
98 1.2 christos
99 1.2 christos void rpcb_service_3(struct svc_req *, SVCXPRT *);
100 1.2 christos void rpcb_service_4(struct svc_req *, SVCXPRT *);
101 1.1 fvdl
102 1.1 fvdl /* Common functions shared between versions */
103 1.2 christos void *rpcbproc_set_com(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
104 1.2 christos void *rpcbproc_unset_com(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
105 1.2 christos bool_t map_set(RPCB *, char *);
106 1.2 christos bool_t map_unset(RPCB *, const char *);
107 1.2 christos void delete_prog(int);
108 1.2 christos void *rpcbproc_getaddr_com(RPCB *, struct svc_req *, SVCXPRT *, rpcvers_t,
109 1.2 christos rpcvers_t);
110 1.2 christos void *rpcbproc_gettime_com(void *, struct svc_req *, SVCXPRT *,
111 1.2 christos rpcvers_t);
112 1.2 christos void *rpcbproc_uaddr2taddr_com(void *, struct svc_req *,
113 1.2 christos SVCXPRT *, rpcvers_t);
114 1.2 christos void *rpcbproc_taddr2uaddr_com(void *, struct svc_req *, SVCXPRT *,
115 1.2 christos rpcvers_t);
116 1.2 christos int create_rmtcall_fd(struct netconfig *);
117 1.2 christos void rpcbproc_callit_com(struct svc_req *, SVCXPRT *, rpcvers_t,
118 1.2 christos rpcvers_t);
119 1.2 christos void my_svc_run(void);
120 1.2 christos
121 1.2 christos void rpcbind_abort(void);
122 1.2 christos void reap(int);
123 1.2 christos void toggle_verboselog(int);
124 1.2 christos
125 1.2 christos int check_access(SVCXPRT *, rpcproc_t, void *, int);
126 1.2 christos int check_callit(SVCXPRT *, struct r_rmtcall_args *, int);
127 1.2 christos void logit(int, struct sockaddr *, rpcproc_t, rpcprog_t, const char *);
128 1.2 christos int is_loopback(struct netbuf *);
129 1.1 fvdl
130 1.1 fvdl #ifdef PORTMAP
131 1.2 christos extern void pmap_service(struct svc_req *, SVCXPRT *);
132 1.1 fvdl #endif
133 1.1 fvdl
134 1.2 christos void write_warmstart(void);
135 1.2 christos void read_warmstart(void);
136 1.1 fvdl
137 1.2 christos char *addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
138 1.2 christos char *netid);
139 1.2 christos void network_init(void);
140 1.2 christos struct sockaddr *local_sa(int);
141 1.1 fvdl
142 1.1 fvdl /* For different getaddr semantics */
143 1.1 fvdl #define RPCB_ALLVERS 0
144 1.1 fvdl #define RPCB_ONEVERS 1
145 1.1 fvdl
146 1.1 fvdl #endif /* rpcbind_h */
147