2 |
7u83 |
1 |
# Crown Copyright (c) 1997
|
|
|
2 |
#
|
|
|
3 |
# This TenDRA(r) Computer Program is subject to Copyright
|
|
|
4 |
# owned by the United Kingdom Secretary of State for Defence
|
|
|
5 |
# acting through the Defence Evaluation and Research Agency
|
|
|
6 |
# (DERA). It is made available to Recipients with a
|
|
|
7 |
# royalty-free licence for its use, reproduction, transfer
|
|
|
8 |
# to other parties and amendment for any purpose not excluding
|
|
|
9 |
# product development provided that any such use et cetera
|
|
|
10 |
# shall be deemed to be acceptance of the following conditions:-
|
|
|
11 |
#
|
|
|
12 |
# (1) Its Recipients shall ensure that this Notice is
|
|
|
13 |
# reproduced upon any copies or amended versions of it;
|
|
|
14 |
#
|
|
|
15 |
# (2) Any amended version of it shall be clearly marked to
|
|
|
16 |
# show both the nature of and the organisation responsible
|
|
|
17 |
# for the relevant amendment or amendments;
|
|
|
18 |
#
|
|
|
19 |
# (3) Its onward transfer from a recipient to another
|
|
|
20 |
# party shall be deemed to be that party's acceptance of
|
|
|
21 |
# these conditions;
|
|
|
22 |
#
|
|
|
23 |
# (4) DERA gives no warranty or assurance as to its
|
|
|
24 |
# quality or suitability for any purpose and DERA accepts
|
|
|
25 |
# no liability whatsoever in relation to any use to which
|
|
|
26 |
# it may be put.
|
|
|
27 |
#
|
|
|
28 |
+USE "svid3", "", "config" ;
|
|
|
29 |
+IF %% __SYSV_REMOTE_SERVICES %%
|
|
|
30 |
|
|
|
31 |
+USE "svid3", "sys/types.h" ;
|
|
|
32 |
+USE "svid3", "rpc/types.h" ;
|
|
|
33 |
+USE "svid3", "tiuser.h" ;
|
|
|
34 |
+USE "svid3", "rpc/key_prot.h" ;
|
|
|
35 |
+USE "svid3", "rpc/xdr.h" ;
|
|
|
36 |
+USE "svid3", "sys/time.h" ;
|
|
|
37 |
+USE "svid3", "netconfig.h" (!?) ;
|
|
|
38 |
|
|
|
39 |
+ENUM enum clnt_stat := {
|
|
|
40 |
RPC_SUCCESS = 0,
|
|
|
41 |
RPC_CANTENCODEARGS = 1,
|
|
|
42 |
RPC_CANTENCODERES = 2,
|
|
|
43 |
RPC_CANTSEND = 3,
|
|
|
44 |
RPC_CANTRECV = 4,
|
|
|
45 |
RPC_TIMEDOUT = 5,
|
|
|
46 |
RPC_INTR = 18,
|
|
|
47 |
RPC_VERSMISMATCH = 6,
|
|
|
48 |
RPC_AUTHERROR = 7,
|
|
|
49 |
RPC_PROGUNAVAIL = 8,
|
|
|
50 |
RPC_PROGVERSMISMATCH = 9,
|
|
|
51 |
RPC_PROCUNAVAIL = 10,
|
|
|
52 |
RPC_CANTDECODEARGS = 11,
|
|
|
53 |
RPC_SYSTEMERROR = 12,
|
|
|
54 |
RPC_UNKNOWNHOST = 13,
|
|
|
55 |
RPC_UNKNOWNPROTO = 17,
|
|
|
56 |
RPC_UNKNOWNADDR = 19,
|
|
|
57 |
RPC_NOBROADCAST = 21,
|
|
|
58 |
RPC_RPCBFAILURE = 14,
|
|
|
59 |
RPC_PROGNOTREGISTERED = 15,
|
|
|
60 |
RPC_N2AXLATEFAILURE = 22,
|
|
|
61 |
RPC_TLIERROR = 20,
|
|
|
62 |
RPC_FAILED = 16
|
|
|
63 |
} ;
|
|
|
64 |
|
|
|
65 |
+ENUM enum auth_stat := {
|
|
|
66 |
AUTH_OK = 0,
|
|
|
67 |
AUTH_BADCRED = 1,
|
|
|
68 |
AUTH_REJECTEDCRED = 2,
|
|
|
69 |
AUTH_BADVERF = 3,
|
|
|
70 |
AUTH_REJECTEDVERF = 4,
|
|
|
71 |
AUTH_TOOWEAK = 5,
|
|
|
72 |
AUTH_INVALIDRESP = 6,
|
|
|
73 |
AUTH_FAILED = 7
|
|
|
74 |
} ;
|
|
|
75 |
|
|
|
76 |
+ENUM enum xprt_stat := {
|
|
|
77 |
XPRT_DIED,
|
|
|
78 |
XPRT_MOREREQS,
|
|
|
79 |
XPRT_IDLE
|
|
|
80 |
} ;
|
|
|
81 |
|
|
|
82 |
+TYPE fd_set, des_block ;
|
|
|
83 |
|
|
|
84 |
+FIELD struct opaque_auth {
|
|
|
85 |
enum_t oa_flavor ;
|
|
|
86 |
caddr_t oa_base ;
|
|
|
87 |
unsigned int oa_length ;
|
|
|
88 |
} ;
|
|
|
89 |
|
|
|
90 |
+FIELD struct auth_ops {
|
|
|
91 |
void ( *ah_nextverf ) () ;
|
|
|
92 |
int ( *ah_marshal ) () ;
|
|
|
93 |
int ( *ah_validate ) () ;
|
|
|
94 |
int ( *ah_refresh ) () ;
|
|
|
95 |
void ( *ah_destroy ) () ;
|
|
|
96 |
} ;
|
|
|
97 |
|
|
|
98 |
+FIELD ( struct ) AUTH {
|
|
|
99 |
struct opaque_auth ah_cred ;
|
|
|
100 |
struct opaque_auth ah_verf ;
|
|
|
101 |
des_block ah_key ;
|
|
|
102 |
struct auth_ops *ah_ops ;
|
|
|
103 |
caddr_t ah_private ;
|
|
|
104 |
} ;
|
|
|
105 |
|
|
|
106 |
+FIELD struct clnt_ops {
|
|
|
107 |
enum clnt_stat ( *cl_call ) () ;
|
|
|
108 |
void ( *cl_abort ) () ;
|
|
|
109 |
void ( *cl_geterr ) () ;
|
|
|
110 |
bool_t ( *cl_freeres ) () ;
|
|
|
111 |
void ( *cl_destroy ) () ;
|
|
|
112 |
bool_t ( *cl_control ) () ;
|
|
|
113 |
} ;
|
|
|
114 |
|
|
|
115 |
+FIELD ( struct ) CLIENT {
|
|
|
116 |
AUTH *cl_auth ;
|
|
|
117 |
struct clnt_ops *cl_ops ;
|
|
|
118 |
caddr_t cl_private ;
|
|
|
119 |
char *cl_netid ;
|
|
|
120 |
char *cl_tp ;
|
|
|
121 |
} ;
|
|
|
122 |
|
|
|
123 |
+FIELD struct xp_ops {
|
|
|
124 |
bool_t ( *xp_recv ) () ;
|
|
|
125 |
enum xprt_stat ( *xp_stat ) () ;
|
|
|
126 |
bool_t ( *xp_getargs ) () ;
|
|
|
127 |
bool_t ( *xp_reply ) () ;
|
|
|
128 |
bool_t ( *xp_freeargs ) () ;
|
|
|
129 |
void ( *xp_destroy ) () ;
|
|
|
130 |
} ;
|
|
|
131 |
|
|
|
132 |
+FIELD ( struct ) SVCXPRT {
|
|
|
133 |
int xp_fd ;
|
|
|
134 |
struct xp_ops *xp_ops ;
|
|
|
135 |
char *xp_tp ;
|
|
|
136 |
char *xp_netid ;
|
|
|
137 |
struct netbuf xp_ltaddr ;
|
|
|
138 |
struct netbuf xp_rtaddr ;
|
|
|
139 |
struct opaque_auth xp_verf ;
|
|
|
140 |
caddr_t xp_p1 ;
|
|
|
141 |
caddr_t xp_p2 ;
|
|
|
142 |
caddr_t xp_p3 ;
|
|
|
143 |
} ;
|
|
|
144 |
|
|
|
145 |
/* I have no idea about these */
|
|
|
146 |
+TYPE struct accepted_reply, struct authsys_parms ;
|
|
|
147 |
+TYPE struct rpc_msg, struct rejected_reply, struct rpcblist ;
|
|
|
148 |
+TYPE struct authdes_cred, struct rpc_err ;
|
|
|
149 |
|
|
|
150 |
/* USL addendum */
|
|
|
151 |
+TYPEDEF bool_t ( *resultproc_t ) () ;
|
|
|
152 |
|
|
|
153 |
+CONST int CLSET_TIMEOUT, CLGET_TIMEOUT, CLGET_FD, CLGET_SVC_ADDR ;
|
|
|
154 |
+CONST int CLSET_FD_CLOSE, CLSET_FD_NCLOSE, CLSET_RETRY_TIMEOUT ;
|
|
|
155 |
+CONST int CLGET_RETRY_TIMEOUT ;
|
|
|
156 |
|
|
|
157 |
+FUNC void auth_destroy ( AUTH * ) ;
|
|
|
158 |
+FUNC AUTH *authnone_create ( void ) ;
|
|
|
159 |
+FUNC AUTH *authsys_create ( const char *, const uid_t, const gid_t,
|
|
|
160 |
const int, const gid_t * ) ;
|
|
|
161 |
+FUNC AUTH *authsys_create_default ( void ) ;
|
|
|
162 |
|
|
|
163 |
+FUNC enum clnt_stat clnt_call ( CLIENT *, const unsigned long,
|
|
|
164 |
const xdrproc_t, caddr_t, const xdrproc_t, caddr_t,
|
|
|
165 |
const struct timeval ) ;
|
|
|
166 |
+FUNC int clnt_freeres ( CLIENT *, const xdrproc_t, caddr_t ) ;
|
|
|
167 |
+FUNC void clnt_geterr ( const CLIENT *, struct rpc_err * ) ;
|
|
|
168 |
+FUNC void clnt_perrno ( const enum clnt_stat ) ;
|
|
|
169 |
+FUNC void clnt_perror ( const CLIENT *, const char * ) ;
|
|
|
170 |
+FUNC char *clnt_sperrno ( const enum clnt_stat ) ;
|
|
|
171 |
+FUNC char *clnt_sperror ( const CLIENT *, const char * ) ;
|
|
|
172 |
+FUNC enum clnt_stat rpc_broadcast ( const unsigned long, const unsigned long,
|
|
|
173 |
const unsigned long, const xdrproc_t, caddr_t, const xdrproc_t, caddr_t,
|
|
|
174 |
const resultproc_t, const char * ) ;
|
|
|
175 |
+FUNC enum clnt_stat rpc_call ( const char *, const unsigned long,
|
|
|
176 |
const unsigned long, const xdrproc_t, const xdrproc_t, const char *,
|
|
|
177 |
char *, const char * ) ;
|
|
|
178 |
|
|
|
179 |
+FUNC bool_t clnt_control ( CLIENT *, const unsigned int, char * ) ;
|
|
|
180 |
+FUNC CLIENT *clnt_create ( const char *, const unsigned long,
|
|
|
181 |
const unsigned long, const char * ) ;
|
|
|
182 |
+FUNC void clnt_destroy ( CLIENT * ) ;
|
|
|
183 |
+FUNC CLIENT *clnt_dg_create ( const int, const struct netbuf *,
|
|
|
184 |
const unsigned long, const unsigned long, const unsigned int,
|
|
|
185 |
const unsigned int ) ;
|
|
|
186 |
+FUNC void clnt_pcreateerror ( const char * ) ;
|
|
|
187 |
+FUNC CLIENT *clnt_raw_create ( const unsigned long, const unsigned long ) ;
|
|
|
188 |
+FUNC char *clnt_spcreateerror ( const char * ) ;
|
|
|
189 |
+FUNC CLIENT *clnt_tli_create ( const int, const struct netconfig *,
|
|
|
190 |
const struct netbuf *, const unsigned long, const unsigned long,
|
|
|
191 |
const unsigned int, const unsigned int ) ;
|
|
|
192 |
+FUNC CLIENT *clnt_tp_create ( const char *, const unsigned long,
|
|
|
193 |
const unsigned long, const struct netconfig * ) ;
|
|
|
194 |
+FUNC CLIENT *clnt_vc_create ( const int, const struct netbuf *,
|
|
|
195 |
const unsigned long, const unsigned long, const unsigned int,
|
|
|
196 |
const unsigned int ) ;
|
|
|
197 |
|
|
|
198 |
+FUNC int rpc_reg ( const unsigned long, const unsigned long,
|
|
|
199 |
const unsigned long, const char *(*) (), const xdrproc_t,
|
|
|
200 |
const xdrproc_t, const char * ) ;
|
|
|
201 |
+FUNC int svc_reg ( const SVCXPRT *, const unsigned long,
|
|
|
202 |
const unsigned long, void (*) (), const struct netconfig * ) ;
|
|
|
203 |
+FUNC void svc_unreg ( const unsigned long, const unsigned long ) ;
|
|
|
204 |
+FUNC void xprt_register ( const SVCXPRT * ) ;
|
|
|
205 |
+FUNC void xprt_unregister ( const SVCXPRT * ) ;
|
|
|
206 |
|
|
|
207 |
+FUNC int svc_create ( void (*) (), const unsigned long,
|
|
|
208 |
const unsigned long, const char * ) ;
|
|
|
209 |
+FUNC void svc_destroy ( SVCXPRT * ) ;
|
|
|
210 |
+FUNC SVCXPRT *svc_dg_create ( const int, const unsigned int,
|
|
|
211 |
const unsigned int ) ;
|
|
|
212 |
+FUNC SVCXPRT *svc_fd_create ( const int, const unsigned int,
|
|
|
213 |
const unsigned int ) ;
|
|
|
214 |
+FUNC SVCXPRT *svc_raw_create ( void ) ;
|
|
|
215 |
+FUNC SVCXPRT *svc_tli_create ( int, const struct netconfig *,
|
|
|
216 |
const struct t_bind *, const unsigned int, const unsigned int ) ;
|
|
|
217 |
+FUNC SVCXPRT *svc_tp_create ( void (*) (), const unsigned long,
|
|
|
218 |
const unsigned long, const struct netconfig * ) ;
|
|
|
219 |
+FUNC SVCXPRT *svc_vc_create ( int, const unsigned int, const unsigned int ) ;
|
|
|
220 |
|
|
|
221 |
+FUNC void svcerr_auth ( const SVCXPRT *, const enum auth_stat ) ;
|
|
|
222 |
+FUNC void svcerr_decode ( const SVCXPRT * ) ;
|
|
|
223 |
+FUNC void svcerr_noproc ( const SVCXPRT * ) ;
|
|
|
224 |
+FUNC void svcerr_noprog ( const SVCXPRT * ) ;
|
|
|
225 |
+FUNC void svcerr_progvers ( const SVCXPRT * ) ;
|
|
|
226 |
+FUNC void svcerr_systemerr ( const SVCXPRT * ) ;
|
|
|
227 |
+FUNC void svcerr_weakauth ( const SVCXPRT * ) ;
|
|
|
228 |
|
|
|
229 |
+FUNC int svc_freeargs ( const SVCXPRT *, const xdrproc_t, char * ) ;
|
|
|
230 |
+FUNC int svc_getargs ( const SVCXPRT *, const xdrproc_t, caddr_t * ) ;
|
|
|
231 |
+FUNC void svc_getreqset ( fd_set * ) ;
|
|
|
232 |
+FUNC struct netbuf *svc_getrpccaller ( const SVCXPRT * ) ;
|
|
|
233 |
+FUNC void svc_run ( void ) ;
|
|
|
234 |
+FUNC int svc_sendreply ( const SVCXPRT *, const xdrproc_t, const caddr_t * ) ;
|
|
|
235 |
|
|
|
236 |
+FUNC bool_t xdr_accepted_reply ( XDR *, const struct accepted_reply * ) ;
|
|
|
237 |
+FUNC bool_t xdr_authsys_parms ( XDR *, const struct authsys_parms * ) ;
|
|
|
238 |
/* Error in book? */
|
|
|
239 |
+FUNC bool_t xdr_callhdr ( XDR *, const struct rpc_msg * ) ;
|
|
|
240 |
+FUNC bool_t xdr_callmsg ( XDR *, const struct rpc_msg * ) ;
|
|
|
241 |
+FUNC bool_t xdr_opaque_auth ( XDR *, const struct opaque_auth * ) ;
|
|
|
242 |
+FUNC bool_t xdr_rejected_reply ( XDR *, const struct rejected_reply * ) ;
|
|
|
243 |
+FUNC bool_t xdr_replymsg ( XDR *, const struct rpc_msg * ) ;
|
|
|
244 |
|
|
|
245 |
+FUNC struct rpcblist *rpcb_getmaps ( const struct netconfig *, const char * ) ;
|
|
|
246 |
+FUNC bool_t rpcb_getaddr ( const unsigned long, const unsigned long,
|
|
|
247 |
const struct netconfig *, const struct netbuf *, const char * ) ;
|
|
|
248 |
+FUNC bool_t rpcb_gettime ( const char *, time_t * ) ;
|
|
|
249 |
/* Errata */
|
|
|
250 |
+FUNC enum clnt_stat rpcb_rmtcall ( const struct netconfig *, const char *,
|
|
|
251 |
const unsigned long, const unsigned long, const unsigned long,
|
|
|
252 |
xdrproc_t, caddr_t, const xdrproc_t, caddr_t, const struct timeval,
|
|
|
253 |
const struct netbuf * ) ;
|
|
|
254 |
+FUNC bool_t rpcb_set ( const unsigned long, const unsigned long,
|
|
|
255 |
const struct netconfig *, const struct netbuf * ) ;
|
|
|
256 |
+FUNC bool_t rpcb_unset ( const unsigned long, const unsigned long,
|
|
|
257 |
const struct netconfig * ) ;
|
|
|
258 |
|
|
|
259 |
+FUNC int authdes_getucred ( const struct authdes_cred *, uid_t *,
|
|
|
260 |
gid_t *, short *, int * ) ;
|
|
|
261 |
+FUNC AUTH *authdes_seccreate ( const char *, const unsigned int,
|
|
|
262 |
struct netbuf *, const des_block * ) ;
|
|
|
263 |
+FUNC int getnetname ( char [] ) ;
|
|
|
264 |
+FUNC int host2netname ( char [], const char *, const char * ) ;
|
|
|
265 |
+FUNC int key_decryptsession ( const char *, des_block * ) ;
|
|
|
266 |
+FUNC int key_encryptsession ( const char *, des_block * ) ;
|
|
|
267 |
+FUNC int key_gendes ( des_block * ) ;
|
|
|
268 |
+FUNC int key_setsecret ( const char * ) ;
|
|
|
269 |
+FUNC int netname2host ( const char *, char *, const int ) ;
|
|
|
270 |
+FUNC int netname2user ( const char *, uid_t *, gid_t *, int *, gid_t [] ) ;
|
|
|
271 |
+FUNC int user2netname ( char [], const uid_t, const char * ) ;
|
|
|
272 |
|
|
|
273 |
+ENDIF
|