2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: rtable3.c /main/4 1995/11/09 12:51:59 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company
26 * (c) Copyright 1993, 1994 International Business Machines Corp.
27 * (c) Copyright 1993, 1994 Novell, Inc.
28 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
32 veneer layered on top of the real data structures for abstraction.
33 implements Version 3 in terms of Version 4 types
38 #include <EUSCompat.h>
42 #include <sys/param.h>
45 #include "rpcextras.h"
46 #include "convert3-4.h"
47 #include "convert4-3.h"
48 #include "rtable3_tbl.i"
51 /*************** V3 PROTOCOL IMPLEMENTATION PROCS *****************/
53 _DtCm_rtable_ping_3_svc(args, svcrq)
55 struct svc_req *svcrq;
58 return((void *)&dummy); /* for RPC reply */
63 _DtCm_rtable_lookup_3_svc (args, svcrq)
65 struct svc_req *svcrq;
67 static Table_Res_3 *res = NULL;
68 Table_Args_4 *newargs;
71 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
73 newargs = _DtCm_tableargs3_to_tableargs4(args);
74 newres = _DtCm_rtable_lookup_4_svc(newargs, svcrq);
75 res = _DtCm_tableres4_to_tableres3(newres);
77 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
84 _DtCm_rtable_lookup_next_larger_3_svc(args, svcrq)
86 struct svc_req *svcrq;
88 static Table_Res_3 *res = NULL;
89 Table_Args_4 *newargs;
92 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
94 newargs = _DtCm_tableargs3_to_tableargs4(args);
95 newres = _DtCm_rtable_lookup_next_larger_4_svc(newargs, svcrq);
96 res = _DtCm_tableres4_to_tableres3(newres);
98 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
105 _DtCm_rtable_lookup_next_smaller_3_svc(args, svcrq)
107 struct svc_req *svcrq;
109 static Table_Res_3 *res = NULL;
110 Table_Args_4 *newargs;
113 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
115 newargs = _DtCm_tableargs3_to_tableargs4(args);
116 newres = _DtCm_rtable_lookup_next_smaller_4_svc(newargs, svcrq);
117 res = _DtCm_tableres4_to_tableres3(newres);
119 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
126 _DtCm_rtable_lookup_range_3_svc(args, svcrq)
128 struct svc_req *svcrq;
130 static Table_Res_3 *res = NULL;
131 Table_Args_4 *newargs;
134 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
136 newargs = _DtCm_tableargs3_to_tableargs4(args);
137 newres = _DtCm_rtable_lookup_range_4_svc(newargs, svcrq);
138 res = _DtCm_tableres4_to_tableres3(newres);
140 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
147 _DtCm_rtable_abbreviated_lookup_range_3_svc(args, svcrq)
149 struct svc_req *svcrq;
151 static Table_Res_3 *res = NULL;
152 Table_Args_4 *newargs;
155 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
157 newargs = _DtCm_tableargs3_to_tableargs4(args);
158 newres = _DtCm_rtable_abbreviated_lookup_range_4_svc(newargs, svcrq);
159 res = _DtCm_tableres4_to_tableres3(newres);
161 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
168 _DtCm_rtable_insert_3_svc(args, svcrq)
170 struct svc_req *svcrq;
172 static Table_Res_3 *res = NULL;
173 Table_Args_4 *newargs;
176 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
178 newargs = _DtCm_tableargs3_to_tableargs4(args);
179 newres = _DtCm_rtable_insert_4_svc(newargs, svcrq);
180 res = _DtCm_tableres4_to_tableres3(newres);
182 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
189 _DtCm_rtable_delete_3_svc(args, svcrq)
191 struct svc_req *svcrq;
193 static Table_Res_3 *res = NULL;
194 Table_Args_4 *newargs;
197 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
199 newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_all_4);
200 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
201 res = _DtCm_tableres4_to_tableres3(newres);
203 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
210 _DtCm_rtable_delete_instance_3_svc(args, svcrq)
212 struct svc_req *svcrq;
214 static Table_Res_3 *res = NULL;
215 Table_Args_4 *newargs;
218 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
220 newargs = _DtCm_tabledelargs3_to_tabledelargs4(args, do_one_4);
221 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
222 res = _DtCm_tableres4_to_tableres3(newres);
224 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
231 _DtCm_rtable_change_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 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
243 res = _DtCm_tableres4_to_tableres3(newres);
245 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
253 _DtCm_rtable_change_instance_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 newargs->args.Args_4_u.apptid.option = do_one_4;
265 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
266 res = _DtCm_tableres4_to_tableres3(newres);
268 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
275 _DtCm_rtable_lookup_next_reminder_3_svc(args, svcrq)
277 struct svc_req *svcrq;
279 static Table_Res_3 *res = NULL;
280 Table_Args_4 *newargs;
283 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
285 newargs = _DtCm_tableargs3_to_tableargs4(args);
286 newres = _DtCm_rtable_lookup_next_reminder_4_svc(newargs, svcrq);
287 res = _DtCm_tableres4_to_tableres3(newres);
289 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
295 extern Table_Status_3 *
296 _DtCm_rtable_check_3_svc(args, svcrq)
298 struct svc_req *svcrq;
300 static Table_Status_3 res;
301 Table_Args_4 *newargs;
302 Table_Status_4 *newres;
304 newargs = _DtCm_tableargs3_to_tableargs4(args);
305 newres = _DtCm_rtable_check_4_svc(newargs, svcrq);
306 res = _DtCm_tablestat4_to_tablestat3(*newres);
308 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
314 extern Table_Status_3 *
315 _DtCm_rtable_flush_table_3_svc(args, svcrq)
317 struct svc_req *svcrq;
319 static Table_Status_3 res;
320 Table_Args_4 *newargs;
321 Table_Status_4 *newres;
323 newargs = _DtCm_tableargs3_to_tableargs4(args);
324 newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq);
325 res = _DtCm_tablestat4_to_tablestat3(*newres);
327 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
334 _DtCm_rtable_size_3_svc(args, svcrq)
336 struct svc_req *svcrq;
339 Table_Args_4 *newargs;
341 newargs = _DtCm_tableargs3_to_tableargs4(args);
342 size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq)));
344 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
350 Registration_Status_3 *
351 _DtCm_register_callback_3_svc(r, svcrq)
353 struct svc_req *svcrq;
355 static Registration_Status_3 stat;
356 Registration_4 *newreg;
357 Registration_Status_4 *newstat;
359 newreg = _DtCm_reg3_to_reg4(r);
360 newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
361 stat = _DtCm_regstat4_to_regstat3(*newstat);
363 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
368 Registration_Status_3 *
369 _DtCm_deregister_callback_3_svc(r, svcrq)
371 struct svc_req *svcrq;
373 static Registration_Status_3 stat;
374 Registration_4 *newreg;
375 Registration_Status_4 *newstat;
377 newreg = _DtCm_reg3_to_reg4(r);
378 newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq);
379 stat = _DtCm_regstat4_to_regstat3(*newstat);
381 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
386 extern Access_Status_3 *
387 _DtCm_rtable_set_access_3_svc(args, svcrq)
389 struct svc_req *svcrq;
391 static Access_Status_3 stat;
392 Access_Args_4 *newargs;
393 Access_Status_4 *newstat;
395 newargs = _DtCm_accargs3_to_accargs4(args);
396 newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq);
397 stat = _DtCm_accstat4_to_accstat3(*newstat);
399 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
404 extern Access_Args_3 *
405 _DtCm_rtable_get_access_3_svc(args, svcrq)
407 struct svc_req *svcrq;
409 static Access_Args_3 *res = NULL;
410 Access_Args_4 *newargs;
411 Access_Args_4 *newres;
413 if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_3, (char*)res);
415 newargs = _DtCm_accargs3_to_accargs4(args);
416 newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);
417 res = _DtCm_accargs4_to_accargs3(newres);
419 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
425 _DtCm_rtable_abbreviated_lookup_key_range_3_svc(args, svcrq)
427 struct svc_req *svcrq;
429 static Table_Res_3 *res = NULL;
430 Table_Args_4 *newargs;
433 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
435 newargs = _DtCm_tableargs3_to_tableargs4(args);
436 newres = _DtCm_rtable_abbreviated_lookup_key_range_4_svc(newargs, svcrq);
437 res = _DtCm_tableres4_to_tableres3(newres);
439 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
445 _DtCm_rtable_gmtoff_3_svc(args, svcrq)
447 struct svc_req *svcrq;
451 gmtoff = (*(_DtCm_rtable_gmtoff_4_svc(NULL, svcrq)));
459 ph->program_num = TABLEPROG;
460 ph->prog[TABLEVERS_3].vers = &tableprog_3_table[0];
461 ph->prog[TABLEVERS_3].nproc = sizeof(tableprog_3_table)/sizeof(tableprog_3_table[0]);