1 /* $XConsortium: rtable3.c /main/4 1995/11/09 12:51:59 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company
4 * (c) Copyright 1993, 1994 International Business Machines Corp.
5 * (c) Copyright 1993, 1994 Novell, Inc.
6 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
10 veneer layered on top of the real data structures for abstraction.
11 implements Version 3 in terms of Version 4 types
16 #include <EUSCompat.h>
20 #include <sys/param.h>
23 #include "rpcextras.h"
24 #include "convert3-4.h"
25 #include "convert4-3.h"
26 #include "rtable3_tbl.i"
29 /*************** V3 PROTOCOL IMPLEMENTATION PROCS *****************/
31 _DtCm_rtable_ping_3_svc(args, svcrq)
33 struct svc_req *svcrq;
36 return((void *)&dummy); /* for RPC reply */
41 _DtCm_rtable_lookup_3_svc (args, svcrq)
43 struct svc_req *svcrq;
45 static Table_Res_3 *res = NULL;
46 Table_Args_4 *newargs;
49 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
51 newargs = _DtCm_tableargs3_to_tableargs4(args);
52 newres = _DtCm_rtable_lookup_4_svc(newargs, svcrq);
53 res = _DtCm_tableres4_to_tableres3(newres);
55 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
62 _DtCm_rtable_lookup_next_larger_3_svc(args, svcrq)
64 struct svc_req *svcrq;
66 static Table_Res_3 *res = NULL;
67 Table_Args_4 *newargs;
70 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
72 newargs = _DtCm_tableargs3_to_tableargs4(args);
73 newres = _DtCm_rtable_lookup_next_larger_4_svc(newargs, svcrq);
74 res = _DtCm_tableres4_to_tableres3(newres);
76 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
83 _DtCm_rtable_lookup_next_smaller_3_svc(args, svcrq)
85 struct svc_req *svcrq;
87 static Table_Res_3 *res = NULL;
88 Table_Args_4 *newargs;
91 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
93 newargs = _DtCm_tableargs3_to_tableargs4(args);
94 newres = _DtCm_rtable_lookup_next_smaller_4_svc(newargs, svcrq);
95 res = _DtCm_tableres4_to_tableres3(newres);
97 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
104 _DtCm_rtable_lookup_range_3_svc(args, svcrq)
106 struct svc_req *svcrq;
108 static Table_Res_3 *res = NULL;
109 Table_Args_4 *newargs;
112 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
114 newargs = _DtCm_tableargs3_to_tableargs4(args);
115 newres = _DtCm_rtable_lookup_range_4_svc(newargs, svcrq);
116 res = _DtCm_tableres4_to_tableres3(newres);
118 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
125 _DtCm_rtable_abbreviated_lookup_range_3_svc(args, svcrq)
127 struct svc_req *svcrq;
129 static Table_Res_3 *res = NULL;
130 Table_Args_4 *newargs;
133 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
135 newargs = _DtCm_tableargs3_to_tableargs4(args);
136 newres = _DtCm_rtable_abbreviated_lookup_range_4_svc(newargs, svcrq);
137 res = _DtCm_tableres4_to_tableres3(newres);
139 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
146 _DtCm_rtable_insert_3_svc(args, svcrq)
148 struct svc_req *svcrq;
150 static Table_Res_3 *res = NULL;
151 Table_Args_4 *newargs;
154 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
156 newargs = _DtCm_tableargs3_to_tableargs4(args);
157 newres = _DtCm_rtable_insert_4_svc(newargs, svcrq);
158 res = _DtCm_tableres4_to_tableres3(newres);
160 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
167 _DtCm_rtable_delete_3_svc(args, svcrq)
169 struct svc_req *svcrq;
171 static Table_Res_3 *res = NULL;
172 Table_Args_4 *newargs;
175 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
177 newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_all_4);
178 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
179 res = _DtCm_tableres4_to_tableres3(newres);
181 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
188 _DtCm_rtable_delete_instance_3_svc(args, svcrq)
190 struct svc_req *svcrq;
192 static Table_Res_3 *res = NULL;
193 Table_Args_4 *newargs;
196 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
198 newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_one_4);
199 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
200 res = _DtCm_tableres4_to_tableres3(newres);
202 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
209 _DtCm_rtable_change_3_svc(args, svcrq)
211 struct svc_req *svcrq;
213 static Table_Res_3 *res = NULL;
214 Table_Args_4 *newargs;
217 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
219 newargs = _DtCm_tableargs3_to_tableargs4(args);
220 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
221 res = _DtCm_tableres4_to_tableres3(newres);
223 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
231 _DtCm_rtable_change_instance_3_svc(args, svcrq)
233 struct svc_req *svcrq;
235 static Table_Res_3 *res = NULL;
236 Table_Args_4 *newargs;
239 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
241 newargs = _DtCm_tableargs3_to_tableargs4(args);
242 newargs->args.Args_4_u.apptid.option = do_one_4;
243 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
244 res = _DtCm_tableres4_to_tableres3(newres);
246 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
253 _DtCm_rtable_lookup_next_reminder_3_svc(args, svcrq)
255 struct svc_req *svcrq;
257 static Table_Res_3 *res = NULL;
258 Table_Args_4 *newargs;
261 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
263 newargs = _DtCm_tableargs3_to_tableargs4(args);
264 newres = _DtCm_rtable_lookup_next_reminder_4_svc(newargs, svcrq);
265 res = _DtCm_tableres4_to_tableres3(newres);
267 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
273 extern Table_Status_3 *
274 _DtCm_rtable_check_3_svc(args, svcrq)
276 struct svc_req *svcrq;
278 static Table_Status_3 res;
279 Table_Args_4 *newargs;
280 Table_Status_4 *newres;
282 newargs = _DtCm_tableargs3_to_tableargs4(args);
283 newres = _DtCm_rtable_check_4_svc(newargs, svcrq);
284 res = _DtCm_tablestat4_to_tablestat3(*newres);
286 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
292 extern Table_Status_3 *
293 _DtCm_rtable_flush_table_3_svc(args, svcrq)
295 struct svc_req *svcrq;
297 static Table_Status_3 res;
298 Table_Args_4 *newargs;
299 Table_Status_4 *newres;
301 newargs = _DtCm_tableargs3_to_tableargs4(args);
302 newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq);
303 res = _DtCm_tablestat4_to_tablestat3(*newres);
305 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
312 _DtCm_rtable_size_3_svc(args, svcrq)
314 struct svc_req *svcrq;
317 Table_Args_4 *newargs;
319 newargs = _DtCm_tableargs3_to_tableargs4(args);
320 size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq)));
322 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
328 Registration_Status_3 *
329 _DtCm_register_callback_3_svc(r, svcrq)
331 struct svc_req *svcrq;
333 static Registration_Status_3 stat;
334 Registration_4 *newreg;
335 Registration_Status_4 *newstat;
337 newreg = _DtCm_reg3_to_reg4(r);
338 newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
339 stat = _DtCm_regstat4_to_regstat3(*newstat);
341 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
346 Registration_Status_3 *
347 _DtCm_deregister_callback_3_svc(r, svcrq)
349 struct svc_req *svcrq;
351 static Registration_Status_3 stat;
352 Registration_4 *newreg;
353 Registration_Status_4 *newstat;
355 newreg = _DtCm_reg3_to_reg4(r);
356 newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq);
357 stat = _DtCm_regstat4_to_regstat3(*newstat);
359 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
364 extern Access_Status_3 *
365 _DtCm_rtable_set_access_3_svc(args, svcrq)
367 struct svc_req *svcrq;
369 static Access_Status_3 stat;
370 Access_Args_4 *newargs;
371 Access_Status_4 *newstat;
373 newargs = _DtCm_accargs3_to_accargs4(args);
374 newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq);
375 stat = _DtCm_accstat4_to_accstat3(*newstat);
377 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
382 extern Access_Args_3 *
383 _DtCm_rtable_get_access_3_svc(args, svcrq)
385 struct svc_req *svcrq;
387 static Access_Args_3 *res = NULL;
388 Access_Args_4 *newargs;
389 Access_Args_4 *newres;
391 if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_3, (char*)res);
393 newargs = _DtCm_accargs3_to_accargs4(args);
394 newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);
395 res = _DtCm_accargs4_to_accargs3(newres);
397 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
403 _DtCm_rtable_abbreviated_lookup_key_range_3_svc(args, svcrq)
405 struct svc_req *svcrq;
407 static Table_Res_3 *res = NULL;
408 Table_Args_4 *newargs;
411 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
413 newargs = _DtCm_tableargs3_to_tableargs4(args);
414 newres = _DtCm_rtable_abbreviated_lookup_key_range_4_svc(newargs, svcrq);
415 res = _DtCm_tableres4_to_tableres3(newres);
417 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
423 _DtCm_rtable_gmtoff_3_svc(args, svcrq)
425 struct svc_req *svcrq;
429 gmtoff = (*(_DtCm_rtable_gmtoff_4_svc(NULL, svcrq)));
437 ph->program_num = TABLEPROG;
438 ph->prog[TABLEVERS_3].vers = &tableprog_3_table[0];
439 ph->prog[TABLEVERS_3].nproc = sizeof(tableprog_3_table)/sizeof(tableprog_3_table[0]);