1 /* $NetBSD: rpcbind.h,v 1.3 2007/05/16 14:42:08 christos Exp $ */
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or
9 * program developed by the user.
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15 * Sun RPC is provided with no support and without any obligation on the
16 * part of Sun Microsystems, Inc. to assist in its use, correction,
17 * modification or enhancement.
19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21 * OR ANY PART THEREOF.
23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24 * or profits or other special, indirect and consequential damages, even if
25 * Sun has been advised of the possibility of such damages.
27 * Sun Microsystems, Inc.
29 * Mountain View, California 94043
32 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
35 /* #ident "@(#)rpcbind.h 1.4 90/04/12 SMI" */
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 const char *udptrans
; /* Name of UDP transport */
77 extern const char *tcptrans
; /* Name of TCP transport */
78 extern const char *udp_uaddr
; /* Universal UDP address */
79 extern const char *tcp_uaddr
; /* Universal TCP address */
82 extern const char rpcbind_superuser
[];
83 extern const char rpcbind_unknown
[];
85 int add_bndlist(struct netconfig
*, struct netbuf
*);
86 bool_t
is_bound(const char *, const char *);
87 char *mergeaddr(SVCXPRT
*, char *, char *, char *);
88 struct netconfig
*rpcbind_get_conf(const char *);
90 void rpcbs_init(void);
91 void rpcbs_procinfo(rpcvers_t
, rpcproc_t
);
92 void rpcbs_set(rpcvers_t
, bool_t
);
93 void rpcbs_unset(rpcvers_t
, bool_t
);
94 void rpcbs_getaddr(rpcvers_t
, rpcprog_t
, rpcvers_t
, const char *, const char *);
95 void rpcbs_rmtcall(rpcvers_t
, rpcproc_t
, rpcprog_t
, rpcvers_t
, rpcproc_t
,
96 char *, rpcblist_ptr
);
97 void *rpcbproc_getstat(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
99 void rpcb_service_3(struct svc_req
*, SVCXPRT
*);
100 void rpcb_service_4(struct svc_req
*, SVCXPRT
*);
102 /* Common functions shared between versions */
103 void *rpcbproc_set_com(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
104 void *rpcbproc_unset_com(void *, struct svc_req
*, SVCXPRT
*, rpcvers_t
);
105 bool_t
map_set(RPCB
*, char *);
106 bool_t
map_unset(RPCB
*, const char *);
107 void delete_prog(rpcprog_t
);
108 void *rpcbproc_getaddr_com(RPCB
*, struct svc_req
*, SVCXPRT
*, rpcvers_t
,
110 void *rpcbproc_gettime_com(void *, struct svc_req
*, SVCXPRT
*,
112 void *rpcbproc_uaddr2taddr_com(void *, struct svc_req
*,
113 SVCXPRT
*, rpcvers_t
);
114 void *rpcbproc_taddr2uaddr_com(void *, struct svc_req
*, SVCXPRT
*,
116 int create_rmtcall_fd(struct netconfig
*);
117 void rpcbproc_callit_com(struct svc_req
*, SVCXPRT
*, rpcvers_t
,
119 void my_svc_run(void);
121 void rpcbind_abort(void);
123 void toggle_verboselog(int);
125 int check_access(SVCXPRT
*, rpcproc_t
, void *, unsigned long);
126 int check_callit(SVCXPRT
*, struct r_rmtcall_args
*, int);
127 void logit(int, struct sockaddr
*, rpcproc_t
, rpcprog_t
, const char *);
128 int is_loopback(struct netbuf
*);
131 extern void pmap_service(struct svc_req
*, SVCXPRT
*);
134 void write_warmstart(void);
135 void read_warmstart(void);
137 char *addrmerge(struct netbuf
*caller
, char *serv_uaddr
, char *clnt_uaddr
,
139 void network_init(void);
140 struct sockaddr
*local_sa(int);
142 /* For different getaddr semantics */
143 #define RPCB_ALLVERS 0
144 #define RPCB_ONEVERS 1
146 #endif /* rpcbind_h */