123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $XConsortium: cmxdr.c /main/1 1996/04/21 19:22:14 drk $ */
- /*
- * (c) Copyright 1993, 1994 Hewlett-Packard Company
- * (c) Copyright 1993, 1994 International Business Machines Corp.
- * (c) Copyright 1993, 1994 Novell, Inc.
- * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
- */
- /*
- * xdr routines for xapia csa data structures
- */
- #ifdef HAVE_CONFIG_H
- #include <cde_config.h>
- #endif
- #include <EUSCompat.h>
- #include "cm.h"
- #include "csa.h"
- #include "cmxdr.h"
- bool_t xdr_cms_attribute_value(XDR *xdrs, cms_attribute_value *objp);
- bool_t xdr_time_t(XDR *xdrs, time_t *objp);
- /* Functions generated by rtable4.x */
- /*
- * time_t is a typedef which is system dependent
- */
- #ifndef _xdr_time_t
- # if SIZEOF_INT == SIZEOF_TIME_T
- # define _xdr_time_t xdr_int
- # elif SIZEOF_LONG == SIZEOF_TIME_T
- # define _xdr_time_t xdr_long
- # elif SIZEOF_LONG_LONG == SIZEOF_TIME_T
- # define _xdr_time_t xdr_hyper
- # else
- # error "Unknown time_t size"
- # endif
- #endif
- bool_t
- xdr_time_t(XDR *xdrs, time_t *objp)
- {
- if (!_xdr_time_t(xdrs, objp))
- return (FALSE);
- return (TRUE);
- }
-
- /*
- * cms_name - a user name or calendar name which is
- * variable length character string
- */
- bool_t
- xdr_cms_name(XDR *xdrs, cms_name *objp)
- {
- if (!xdr_string(xdrs, objp, ~0))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_access_entry - data structure for the access list attribute
- */
- bool_t
- xdr_cms_access_entry(XDR *xdrs, cms_access_entry *objp)
- {
- if (!xdr_string(xdrs, &objp->user, ~0))
- return (FALSE);
- if (!xdr_u_int(xdrs, &objp->rights))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_access_entry),
- (xdrproc_t) xdr_cms_access_entry))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_key consists of the time and the unique
- * identifier of the entry.
- */
- bool_t
- xdr_cms_key(XDR *xdrs, cms_key *objp)
- {
- if (!xdr_time_t(xdrs, &objp->time))
- return (FALSE);
- if (!xdr_long(xdrs, &objp->id))
- return (FALSE);
- return (TRUE);
- }
- bool_t
- xdr_CSA_opaque_data(XDR *xdrs, CSA_opaque_data *objp)
- {
- if (!xdr_bytes(xdrs, (char **)&objp->data, (u_int *) &objp->size, ~0))
- return (FALSE);
- return (TRUE);
- }
- bool_t
- xdr_CSA_reminder(XDR *xdrs, CSA_reminder *objp)
- {
- if (!xdr_string(xdrs, &objp->lead_time, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->snooze_time, ~0))
- return (FALSE);
- if (!xdr_u_long(xdrs, &objp->repeat_count))
- return (FALSE);
- if (!xdr_CSA_opaque_data(xdrs, &objp->reminder_data))
- return (FALSE);
- return (TRUE);
- }
- bool_t
- xdr_CSA_date_time_entry(XDR *xdrs, CSA_date_time_entry *objp)
- {
- if (!xdr_string(xdrs, &objp->date_time, ~0))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->next,
- sizeof (CSA_date_time_entry), (xdrproc_t) xdr_CSA_date_time_entry))
- return (FALSE);
- return (TRUE);
- }
- bool_t
- xdr_cms_attribute_value(XDR *xdrs, cms_attribute_value *objp)
- {
- if (!xdr_int(xdrs, &objp->type))
- return (FALSE);
- switch (objp->type) {
- case CSA_VALUE_SINT32:
- case CSA_VALUE_ENUMERATED:
- if (!xdr_long(xdrs, &objp->item.sint32_value))
- return (FALSE);
- break;
- case CSA_VALUE_BOOLEAN:
- case CSA_VALUE_FLAGS:
- case CSA_VALUE_UINT32:
- if (!xdr_u_long(xdrs, &objp->item.uint32_value))
- return (FALSE);
- break;
- case CSA_VALUE_STRING:
- case CSA_VALUE_CALENDAR_USER:
- case CSA_VALUE_DATE_TIME:
- case CSA_VALUE_DATE_TIME_RANGE:
- case CSA_VALUE_TIME_DURATION:
- if (!xdr_string(xdrs, &objp->item.string_value, ~0))
- return (FALSE);
- break;
- case CSA_VALUE_ACCESS_LIST:
- if (!xdr_pointer(xdrs, (char **)&objp->item.access_list_value,
- sizeof (cms_access_entry),
- (xdrproc_t) xdr_cms_access_entry))
- return (FALSE);
- break;
- case CSA_VALUE_DATE_TIME_LIST:
- if (!xdr_pointer(xdrs,
- (char **)&objp->item.date_time_list_value,
- sizeof (CSA_date_time_entry),
- (xdrproc_t) xdr_CSA_date_time_entry))
- return (FALSE);
- break;
- case CSA_VALUE_REMINDER:
- if (!xdr_pointer(xdrs,
- (char **)&objp->item.reminder_value,
- sizeof (CSA_reminder), (xdrproc_t) xdr_CSA_reminder))
- return (FALSE);
- break;
- case CSA_VALUE_OPAQUE_DATA:
- if (!xdr_pointer(xdrs, (char **)&objp->item.opaque_data_value,
- sizeof (CSA_opaque_data), (xdrproc_t) xdr_CSA_opaque_data))
- return (FALSE);
- break;
- }
- return (TRUE);
- }
- /*
- * num contains the hashed number for the associated name assigned
- * by the server. Client should not change its value.
- * If it's zero, name is not hashed yet.
- */
- bool_t
- xdr_cms_attr_name(XDR *xdrs, cms_attr_name *objp)
- {
- if (!xdr_short(xdrs, &objp->num))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->name, ~0))
- return (FALSE);
- return (TRUE);
- }
- /*
- *
- */
- bool_t
- xdr_cms_attribute(XDR *xdrs, cms_attribute *objp)
- {
- if (!xdr_cms_attr_name(xdrs, &objp->name))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->value,
- sizeof (CSA_attribute_value), (xdrproc_t) xdr_cms_attribute_value))
- return (FALSE);
- return (TRUE);
- }
- /*
- * An entry is identified by an identifier unique within the calendar
- * and has a variable number of attributes associated with it.
- */
- bool_t
- xdr_cms_entry(XDR *xdrs, cms_entry *objp)
- {
- if (!xdr_cms_key(xdrs, &objp->key))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_entry),
- (xdrproc_t) xdr_cms_entry))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_enumerate_calendar_attr_res
- *
- * If stat is CSA_SUCCESS, names contains an array of names.
- */
- bool_t
- xdr_cms_enumerate_calendar_attr_res(XDR *xdrs, cms_enumerate_calendar_attr_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
- ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_list_calendars_res
- *
- * If stat is CSA_SUCCESS, names contains an array of names.
- */
- bool_t
- xdr_cms_list_calendars_res(XDR *xdrs, cms_list_calendars_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
- ~0, sizeof (cms_name), (xdrproc_t) xdr_cms_name))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_open_args - used by CMS_OPEN_CALENDAR
- */
- bool_t
- xdr_cms_open_args(XDR *xdrs, cms_open_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_open_res - returned by CMS_OPEN_CALENDAR
- *
- * If stat is DtCm_OK,
- * svr_vers contains the version number of the server,
- * file_vers contains the version number of the callog file,
- * user_access is the calling user's access right to the calendar
- * num_attrs indicates the size of the array pointed to by attrs,
- * and attrs contains an array of calendar attributes.
- */
- bool_t
- xdr_cms_open_res(XDR *xdrs, cms_open_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->svr_vers))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->file_vers))
- return (FALSE);
- if (!xdr_u_int(xdrs, &objp->user_access))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_create_args - used by CMS_CREATE_CALENDAR
- */
- bool_t
- xdr_cms_create_args(XDR *xdrs, cms_create_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->char_set, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_remove_args - used by CMS_REMOVE_CALENDAR
- */
- bool_t
- xdr_cms_remove_args(XDR *xdrs, cms_remove_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_register_args - used by CMS_REGISTER and CMS_UNREGISTER
- */
- bool_t
- xdr_cms_register_args(XDR *xdrs, cms_register_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_u_int(xdrs, &objp->update_type))
- return (FALSE);
- if (!xdr_u_long(xdrs, &objp->prognum))
- return (FALSE);
- if (!xdr_u_long(xdrs, &objp->versnum))
- return (FALSE);
- if (!xdr_u_long(xdrs, &objp->procnum))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_get_cal_attr_res - used by CMS_GET_CALENDAR_ATTR
- *
- * If stat is CSA_SUCCESS, attrs contains an array of attributes.
- */
- bool_t
- xdr_cms_get_cal_attr_res(XDR *xdrs, cms_get_cal_attr_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_get_cal_attr_args - used by CMS_GET_CALENDAR_ATTR
- */
- bool_t
- xdr_cms_get_cal_attr_args(XDR *xdrs, cms_get_cal_attr_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
- ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_set_cal_attr_args - used by CMS_SET_CALENDAR_ATTR
- */
- bool_t
- xdr_cms_set_cal_attr_args(XDR *xdrs, cms_set_cal_attr_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_archive_res - used by CMS_ARCHIVE
- *
- * If stat is CSA_SUCCESS, data contains the data to be archived
- */
- bool_t
- xdr_cms_archive_res(XDR *xdrs, cms_archive_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->data, ~0))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_archive_args - used by CMS_ARCHIVE
- */
- bool_t
- xdr_cms_archive_args(XDR *xdrs, cms_archive_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_bool(xdrs, &objp->delete))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->char_set, ~0))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
- ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_restore_args - used by CMS_RESTORE
- */
- bool_t
- xdr_cms_restore_args(XDR *xdrs, cms_restore_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->data, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->char_set, ~0))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
- ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_reminder
- */
- bool_t
- xdr_cms_reminder_ref(XDR *xdrs, cms_reminder_ref *objp)
- {
- if (!xdr_string(xdrs, &objp->reminder_name, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->entryid, ~0))
- return (FALSE);
- if (!xdr_cms_key(xdrs, &objp->key))
- return (FALSE);
- if (!xdr_time_t(xdrs, &objp->runtime))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_reminder_ref),
- (xdrproc_t) xdr_cms_reminder_ref))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_reminder_res - used by CMS_LOOKUP_REMINDER
- *
- * If stat is CSA_SUCCESS, rems contains an array of reminders.
- */
- bool_t
- xdr_cms_reminder_res(XDR *xdrs, cms_reminder_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->rems, sizeof (cms_reminder_ref),
- (xdrproc_t) xdr_cms_reminder_ref))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_reminder_args - used by CMS_LOOKUP_REMINDER
- */
- bool_t
- xdr_cms_reminder_args(XDR *xdrs, cms_reminder_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_time_t(xdrs, &objp->tick))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
- ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_entries_res
- *
- * If stat is CSA_SUCCESS, entries contains an array of entries.
- */
- bool_t
- xdr_cms_entries_res(XDR *xdrs, cms_entries_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (cms_entry),
- (xdrproc_t) xdr_cms_entry))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_lookup_entries_args - used by CMS_LOOKUP_ENTRIES
- */
- bool_t
- xdr_cms_lookup_entries_args(XDR *xdrs, cms_lookup_entries_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_string(xdrs, &objp->char_set, ~0))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
- ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_enumerate_args - used by CMS_ENUERATE_SEQUENCE
- */
- bool_t
- xdr_cms_enumerate_args(XDR *xdrs, cms_enumerate_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_long(xdrs, &objp->id))
- return (FALSE);
- if (!xdr_long(xdrs, &objp->start))
- return (FALSE);
- if (!xdr_long(xdrs, &objp->end))
- return (FALSE);
- return (TRUE);
- }
- /*
- * If stat is CSA_SUCCESS, attrs contains an array of
- * attributes.
- */
- bool_t
- xdr_cms_get_entry_attr_res_item(
- XDR *xdrs,
- cms_get_entry_attr_res_item *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_cms_key(xdrs, &objp->key))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->next,
- sizeof (cms_get_entry_attr_res_item),
- (xdrproc_t) xdr_cms_get_entry_attr_res_item))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_get_entry_attr_res - used by CMS_GET_ENTRY_ATTR
- *
- * If stat is CSA_SUCCESS, entries contains an array of
- * cms_get_entry_attr_res_item structures.
- */
- bool_t
- xdr_cms_get_entry_attr_res(XDR *xdrs, cms_get_entry_attr_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->entries,
- sizeof (cms_get_entry_attr_res_item),
- (xdrproc_t) xdr_cms_get_entry_attr_res_item))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_get_entry_attr_args - used by CMS_GET_ENTRY_ATTR
- */
- bool_t
- xdr_cms_get_entry_attr_args(XDR *xdrs, cms_get_entry_attr_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->keys, (u_int *) &objp->num_keys,
- ~0, sizeof (cms_key), (xdrproc_t) xdr_cms_key))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
- ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_entry_res
- *
- * If stat is CSA_SUCCESS, entry points to an entry.
- */
- bool_t
- xdr_cms_entry_res(XDR *xdrs, cms_entry_res *objp)
- {
- if (!xdr_u_long(xdrs, &objp->stat))
- return (FALSE);
- if (!xdr_pointer(xdrs, (char **)&objp->entry, sizeof (cms_entry),
- (xdrproc_t) xdr_cms_entry))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_insert_args - used by CMS_INSERT_ENTRY
- */
- bool_t
- xdr_cms_insert_args(XDR *xdrs, cms_insert_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_update_args - used by CMS_UPDATE_ENTRY
- */
- bool_t
- xdr_cms_update_args(XDR *xdrs, cms_update_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- if (!xdr_cms_key(xdrs, &objp->entry))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->scope))
- return (FALSE);
- if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
- ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
- return (FALSE);
- return (TRUE);
- }
- /*
- * cms_delete_args - used by CMS_DELETE_ENTRY
- */
- bool_t
- xdr_cms_delete_args(XDR *xdrs, cms_delete_args *objp)
- {
- if (!xdr_string(xdrs, &objp->cal, ~0))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->pid))
- return (FALSE);
- if (!xdr_cms_key(xdrs, &objp->entry))
- return (FALSE);
- if (!xdr_int(xdrs, &objp->scope))
- return (FALSE);
- return (TRUE);
- }
|