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: rtable2.c /main/4 1995/11/09 12:51:38 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 2 in terms of Version 4 types
38 #include <EUSCompat.h>
42 #include <sys/param.h>
45 #include "rpcextras.h"
46 #include "convert2-4.h"
47 #include "convert4-2.h"
48 #include "rtable2_tbl.i"
51 /*************** V2 PROTOCOL IMPLEMENTATION PROCS *****************/
53 _DtCm_rtable_ping_2_svc(args, svcrq)
55 struct svc_req *svcrq;
57 return(NULL); /* for RPC reply */
62 _DtCm_rtable_lookup_2_svc (args, svcrq)
64 struct svc_req *svcrq;
66 static Table_Res_2 *res = NULL;
67 Table_Args_4 *newargs;
70 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
72 newargs = _DtCm_tableargs2_to_tableargs4(args);
73 newres = _DtCm_rtable_lookup_4_svc(newargs, svcrq);
75 res = _DtCm_tableres4_to_tableres2(newres);
77 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
84 _DtCm_rtable_lookup_next_larger_2_svc(args, svcrq)
86 struct svc_req *svcrq;
88 static Table_Res_2 *res = NULL;
89 Table_Args_4 *newargs;
92 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
94 newargs = _DtCm_tableargs2_to_tableargs4(args);
95 newres = _DtCm_rtable_lookup_next_larger_4_svc(newargs, svcrq);
97 res = _DtCm_tableres4_to_tableres2(newres);
99 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
107 _DtCm_rtable_lookup_next_smaller_2_svc(args, svcrq)
109 struct svc_req *svcrq;
111 static Table_Res_2 *res = NULL;
112 Table_Args_4 *newargs;
115 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
117 newargs = _DtCm_tableargs2_to_tableargs4(args);
118 newres = _DtCm_rtable_lookup_next_smaller_4_svc(newargs, svcrq);
120 res = _DtCm_tableres4_to_tableres2(newres);
122 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
130 _DtCm_rtable_lookup_range_2_svc(args, svcrq)
132 struct svc_req *svcrq;
134 static Table_Res_2 *res = NULL;
135 Table_Args_4 *newargs;
138 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
140 newargs = _DtCm_tableargs2_to_tableargs4(args);
141 newres = _DtCm_rtable_lookup_range_4_svc(newargs, svcrq);
143 res = _DtCm_tableres4_to_tableres2(newres);
145 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
152 _DtCm_rtable_abbreviated_lookup_range_2_svc(args, svcrq)
154 struct svc_req *svcrq;
156 static Table_Res_2 *res = NULL;
157 Table_Args_4 *newargs;
160 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
162 newargs = _DtCm_tableargs2_to_tableargs4(args);
163 newres = _DtCm_rtable_abbreviated_lookup_range_4_svc(newargs, svcrq);
165 res = _DtCm_tableres4_to_tableres2(newres);
167 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
174 _DtCm_rtable_insert_2_svc(args, svcrq)
176 struct svc_req *svcrq;
178 static Table_Res_2 *res = NULL;
179 Table_Args_4 *newargs;
182 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
184 newargs = _DtCm_tableargs2_to_tableargs4(args);
185 newres = _DtCm_rtable_insert_4_svc(newargs, svcrq);
187 res = _DtCm_tableres4_to_tableres2(newres);
189 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
196 _DtCm_rtable_delete_2_svc(args, svcrq)
198 struct svc_req *svcrq;
200 static Table_Res_2 *res = NULL;
201 Table_Args_4 *newargs;
204 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
206 newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_all_4);
207 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
208 res = _DtCm_tableres4_to_tableres2(newres);
210 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
217 _DtCm_rtable_delete_instance_2_svc(args, svcrq)
219 struct svc_req *svcrq;
221 static Table_Res_2 *res = NULL;
222 Table_Args_4 *newargs;
225 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
227 newargs = _DtCm_tabledelargs2_to_tabledelargs4(args, do_one_4);
228 newres = _DtCm_rtable_delete_4_svc(newargs, svcrq);
229 res = _DtCm_tableres4_to_tableres2(newres);
231 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
238 _DtCm_rtable_change_2_svc(args, svcrq)
240 struct svc_req *svcrq;
242 static Table_Res_2 *res = NULL;
243 Table_Args_4 *newargs;
246 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
248 newargs = _DtCm_tableargs2_to_tableargs4(args);
249 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
250 res = _DtCm_tableres4_to_tableres2(newres);
252 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
260 _DtCm_rtable_change_instance_2_svc(args, svcrq)
262 struct svc_req *svcrq;
264 static Table_Res_2 *res = NULL;
265 Table_Args_4 *newargs;
268 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
270 newargs = _DtCm_tableargs2_to_tableargs4(args);
271 newargs->args.Args_4_u.apptid.option = do_one_4;
272 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
273 res = _DtCm_tableres4_to_tableres2(newres);
275 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
282 _DtCm_rtable_lookup_next_reminder_2_svc(args, svcrq)
284 struct svc_req *svcrq;
286 static Table_Res_2 *res = NULL;
287 Table_Args_4 *newargs;
290 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_2, (char*)res);
292 newargs = _DtCm_tableargs2_to_tableargs4(args);
293 newres = _DtCm_rtable_lookup_next_reminder_4_svc(newargs, svcrq);
295 res = _DtCm_tableres4_to_tableres2(newres);
297 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
303 extern Table_Status_2 *
304 _DtCm_rtable_check_2_svc(args, svcrq)
306 struct svc_req *svcrq;
308 static Table_Status_2 res;
309 Table_Args_4 *newargs;
310 Table_Status_4 *newres;
312 newargs = _DtCm_tableargs2_to_tableargs4(args);
313 newres = _DtCm_rtable_check_4_svc(newargs, svcrq);
315 res = _DtCm_tablestat4_to_tablestat2(*newres);
317 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
323 extern Table_Status_2 *
324 _DtCm_rtable_flush_table_2_svc(args, svcrq)
326 struct svc_req *svcrq;
328 static Table_Status_2 res;
329 Table_Args_4 *newargs;
330 Table_Status_4 *newres;
332 newargs = _DtCm_tableargs2_to_tableargs4(args);
333 newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq);
335 res = _DtCm_tablestat4_to_tablestat2(*newres);
337 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
344 _DtCm_rtable_size_2_svc(args, svcrq)
346 struct svc_req *svcrq;
349 Table_Args_4 *newargs;
351 newargs = _DtCm_tableargs2_to_tableargs4(args);
352 size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq)));
354 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
360 Registration_Status_2 *
361 _DtCm_register_callback_2_svc(r, svcrq)
363 struct svc_req *svcrq;
365 static Registration_Status_2 stat;
366 Registration_4 *newreg;
367 Registration_Status_4 *newstat;
369 newreg = _DtCm_reg2_to_reg4(r);
370 newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
372 stat = _DtCm_regstat4_to_regstat2(*newstat);
374 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
379 Registration_Status_2 *
380 _DtCm_deregister_callback_2_svc(r, svcrq)
382 struct svc_req *svcrq;
384 static Registration_Status_2 stat;
385 Registration_4 *newreg;
386 Registration_Status_4 *newstat;
388 newreg = _DtCm_reg2_to_reg4(r);
389 newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq);
391 stat = _DtCm_regstat4_to_regstat2(*newstat);
393 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
398 extern Access_Status_2 *
399 _DtCm_rtable_set_access_2_svc(args, svcrq)
401 struct svc_req *svcrq;
403 static Access_Status_2 stat;
404 Access_Args_4 *newargs;
405 Access_Status_4 *newstat;
407 newargs = _DtCm_accargs2_to_accargs4(args);
408 newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq);
410 stat = _DtCm_accstat4_to_accstat2(*newstat);
412 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
417 extern Access_Args_2 *
418 _DtCm_rtable_get_access_2_svc(args, svcrq)
420 struct svc_req *svcrq;
422 static Access_Args_2 *res = NULL;
423 Access_Args_4 *newargs;
424 Access_Args_4 *newres;
426 if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_2, (char*)res);
428 newargs = _DtCm_accargs2_to_accargs4(args);
429 newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);
431 res = _DtCm_accargs4_to_accargs2(newres);
433 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
441 int ver = TABLEVERS_2;
442 ph->program_num = TABLEPROG;
443 ph->prog[TABLEVERS_2].vers = &tableprog_2_table[0];
444 ph->prog[TABLEVERS_2].nproc = sizeof(tableprog_2_table)/sizeof(tableprog_2_table[0]);