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;
57 return(NULL); /* for RPC reply */
62 _DtCm_rtable_lookup_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_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_larger_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_larger_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_next_smaller_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_next_smaller_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_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_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_abbreviated_lookup_range_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_abbreviated_lookup_range_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_insert_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_tableargs3_to_tableargs4(args);
178 newres = _DtCm_rtable_insert_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_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_all_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_delete_instance_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_tabledelargs3_to_tabledelargs4(args, do_one_4);
220 newres = _DtCm_rtable_delete_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);
230 _DtCm_rtable_change_3_svc(args, svcrq)
232 struct svc_req *svcrq;
234 static Table_Res_3 *res = NULL;
235 Table_Args_4 *newargs;
238 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
240 newargs = _DtCm_tableargs3_to_tableargs4(args);
241 newres = _DtCm_rtable_change_4_svc(newargs, svcrq);
242 res = _DtCm_tableres4_to_tableres3(newres);
244 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
252 _DtCm_rtable_change_instance_3_svc(args, svcrq)
254 struct svc_req *svcrq;
256 static Table_Res_3 *res = NULL;
257 Table_Args_4 *newargs;
260 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
262 newargs = _DtCm_tableargs3_to_tableargs4(args);
263 newargs->args.Args_4_u.apptid.option = do_one_4;
264 newres = _DtCm_rtable_change_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);
274 _DtCm_rtable_lookup_next_reminder_3_svc(args, svcrq)
276 struct svc_req *svcrq;
278 static Table_Res_3 *res = NULL;
279 Table_Args_4 *newargs;
282 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
284 newargs = _DtCm_tableargs3_to_tableargs4(args);
285 newres = _DtCm_rtable_lookup_next_reminder_4_svc(newargs, svcrq);
286 res = _DtCm_tableres4_to_tableres3(newres);
288 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
294 extern Table_Status_3 *
295 _DtCm_rtable_check_3_svc(args, svcrq)
297 struct svc_req *svcrq;
299 static Table_Status_3 res;
300 Table_Args_4 *newargs;
301 Table_Status_4 *newres;
303 newargs = _DtCm_tableargs3_to_tableargs4(args);
304 newres = _DtCm_rtable_check_4_svc(newargs, svcrq);
305 res = _DtCm_tablestat4_to_tablestat3(*newres);
307 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
313 extern Table_Status_3 *
314 _DtCm_rtable_flush_table_3_svc(args, svcrq)
316 struct svc_req *svcrq;
318 static Table_Status_3 res;
319 Table_Args_4 *newargs;
320 Table_Status_4 *newres;
322 newargs = _DtCm_tableargs3_to_tableargs4(args);
323 newres = _DtCm_rtable_flush_table_4_svc(newargs, svcrq);
324 res = _DtCm_tablestat4_to_tablestat3(*newres);
326 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
333 _DtCm_rtable_size_3_svc(args, svcrq)
335 struct svc_req *svcrq;
338 Table_Args_4 *newargs;
340 newargs = _DtCm_tableargs3_to_tableargs4(args);
341 size = (*(_DtCm_rtable_size_4_svc(newargs, svcrq)));
343 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
349 Registration_Status_3 *
350 _DtCm_register_callback_3_svc(r, svcrq)
352 struct svc_req *svcrq;
354 static Registration_Status_3 stat;
355 Registration_4 *newreg;
356 Registration_Status_4 *newstat;
358 newreg = _DtCm_reg3_to_reg4(r);
359 newstat = _DtCm_register_callback_4_svc(newreg, svcrq);
360 stat = _DtCm_regstat4_to_regstat3(*newstat);
362 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
367 Registration_Status_3 *
368 _DtCm_deregister_callback_3_svc(r, svcrq)
370 struct svc_req *svcrq;
372 static Registration_Status_3 stat;
373 Registration_4 *newreg;
374 Registration_Status_4 *newstat;
376 newreg = _DtCm_reg3_to_reg4(r);
377 newstat = _DtCm_deregister_callback_4_svc(newreg, svcrq);
378 stat = _DtCm_regstat4_to_regstat3(*newstat);
380 if (newreg!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Registration_4, (char*)newreg);
385 extern Access_Status_3 *
386 _DtCm_rtable_set_access_3_svc(args, svcrq)
388 struct svc_req *svcrq;
390 static Access_Status_3 stat;
391 Access_Args_4 *newargs;
392 Access_Status_4 *newstat;
394 newargs = _DtCm_accargs3_to_accargs4(args);
395 newstat = _DtCm_rtable_set_access_4_svc(newargs, svcrq);
396 stat = _DtCm_accstat4_to_accstat3(*newstat);
398 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
403 extern Access_Args_3 *
404 _DtCm_rtable_get_access_3_svc(args, svcrq)
406 struct svc_req *svcrq;
408 static Access_Args_3 *res = NULL;
409 Access_Args_4 *newargs;
410 Access_Args_4 *newres;
412 if (res!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_3, (char*)res);
414 newargs = _DtCm_accargs3_to_accargs4(args);
415 newres = _DtCm_rtable_get_access_4_svc(newargs, svcrq);
416 res = _DtCm_accargs4_to_accargs3(newres);
418 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Access_Args_4, (char*)newargs);
424 _DtCm_rtable_abbreviated_lookup_key_range_3_svc(args, svcrq)
426 struct svc_req *svcrq;
428 static Table_Res_3 *res = NULL;
429 Table_Args_4 *newargs;
432 if (res!=NULL) xdr_free ((xdrproc_t)_DtCm_xdr_Table_Res_3, (char*)res);
434 newargs = _DtCm_tableargs3_to_tableargs4(args);
435 newres = _DtCm_rtable_abbreviated_lookup_key_range_4_svc(newargs, svcrq);
436 res = _DtCm_tableres4_to_tableres3(newres);
438 if (newargs!=NULL) xdr_free((xdrproc_t)_DtCm_xdr_Table_Args_4, (char*)newargs);
444 _DtCm_rtable_gmtoff_3_svc(args, svcrq)
446 struct svc_req *svcrq;
450 gmtoff = (*(_DtCm_rtable_gmtoff_4_svc(NULL, svcrq)));
458 ph->program_num = TABLEPROG;
459 ph->prog[TABLEVERS_3].vers = &tableprog_3_table[0];
460 ph->prog[TABLEVERS_3].nproc = sizeof(tableprog_3_table)/sizeof(tableprog_3_table[0]);