cmxdr.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  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)
  10. * any later version.
  11. *
  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
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: cmxdr.c /main/1 1996/04/21 19:22:14 drk $ */
  24. /*
  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.
  29. */
  30. /*
  31. * xdr routines for xapia csa data structures
  32. */
  33. #include <EUSCompat.h>
  34. #include "cm.h"
  35. #include "csa.h"
  36. #include "cmxdr.h"
  37. /* Functions generated by rtable4.x */
  38. /*
  39. * time_t is a typedef which is system dependent
  40. */
  41. bool_t
  42. xdr_time_t(XDR *xdrs, time_t *objp)
  43. {
  44. if (!xdr_long(xdrs, objp))
  45. return (FALSE);
  46. return (TRUE);
  47. }
  48. /*
  49. * cms_name - a user name or calendar name which is
  50. * variable length character string
  51. */
  52. bool_t
  53. xdr_cms_name(XDR *xdrs, cms_name *objp)
  54. {
  55. if (!xdr_string(xdrs, objp, ~0))
  56. return (FALSE);
  57. return (TRUE);
  58. }
  59. /*
  60. * cms_access_entry - data structure for the access list attribute
  61. */
  62. bool_t
  63. xdr_cms_access_entry(XDR *xdrs, cms_access_entry *objp)
  64. {
  65. if (!xdr_string(xdrs, &objp->user, ~0))
  66. return (FALSE);
  67. if (!xdr_u_int(xdrs, &objp->rights))
  68. return (FALSE);
  69. if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_access_entry),
  70. (xdrproc_t) xdr_cms_access_entry))
  71. return (FALSE);
  72. return (TRUE);
  73. }
  74. /*
  75. * cms_key consists of the time and the unique
  76. * identifier of the entry.
  77. */
  78. bool_t
  79. xdr_cms_key(XDR *xdrs, cms_key *objp)
  80. {
  81. if (!xdr_time_t(xdrs, &objp->time))
  82. return (FALSE);
  83. if (!xdr_long(xdrs, &objp->id))
  84. return (FALSE);
  85. return (TRUE);
  86. }
  87. bool_t
  88. xdr_CSA_opaque_data(XDR *xdrs, CSA_opaque_data *objp)
  89. {
  90. if (!xdr_bytes(xdrs, (char **)&objp->data, (u_int *) &objp->size, ~0))
  91. return (FALSE);
  92. return (TRUE);
  93. }
  94. bool_t
  95. xdr_CSA_reminder(XDR *xdrs, CSA_reminder *objp)
  96. {
  97. if (!xdr_string(xdrs, &objp->lead_time, ~0))
  98. return (FALSE);
  99. if (!xdr_string(xdrs, &objp->snooze_time, ~0))
  100. return (FALSE);
  101. if (!xdr_u_long(xdrs, &objp->repeat_count))
  102. return (FALSE);
  103. if (!xdr_CSA_opaque_data(xdrs, &objp->reminder_data))
  104. return (FALSE);
  105. return (TRUE);
  106. }
  107. bool_t
  108. xdr_CSA_date_time_entry(XDR *xdrs, CSA_date_time_entry *objp)
  109. {
  110. if (!xdr_string(xdrs, &objp->date_time, ~0))
  111. return (FALSE);
  112. if (!xdr_pointer(xdrs, (char **)&objp->next,
  113. sizeof (CSA_date_time_entry), (xdrproc_t) xdr_CSA_date_time_entry))
  114. return (FALSE);
  115. return (TRUE);
  116. }
  117. bool_t
  118. xdr_cms_attribute_value(XDR *xdrs, cms_attribute_value *objp)
  119. {
  120. if (!xdr_int(xdrs, &objp->type))
  121. return (FALSE);
  122. switch (objp->type) {
  123. case CSA_VALUE_SINT32:
  124. case CSA_VALUE_ENUMERATED:
  125. if (!xdr_long(xdrs, &objp->item.sint32_value))
  126. return (FALSE);
  127. break;
  128. case CSA_VALUE_BOOLEAN:
  129. case CSA_VALUE_FLAGS:
  130. case CSA_VALUE_UINT32:
  131. if (!xdr_u_long(xdrs, &objp->item.uint32_value))
  132. return (FALSE);
  133. break;
  134. case CSA_VALUE_STRING:
  135. case CSA_VALUE_CALENDAR_USER:
  136. case CSA_VALUE_DATE_TIME:
  137. case CSA_VALUE_DATE_TIME_RANGE:
  138. case CSA_VALUE_TIME_DURATION:
  139. if (!xdr_string(xdrs, &objp->item.string_value, ~0))
  140. return (FALSE);
  141. break;
  142. case CSA_VALUE_ACCESS_LIST:
  143. if (!xdr_pointer(xdrs, (char **)&objp->item.access_list_value,
  144. sizeof (cms_access_entry),
  145. (xdrproc_t) xdr_cms_access_entry))
  146. return (FALSE);
  147. break;
  148. case CSA_VALUE_DATE_TIME_LIST:
  149. if (!xdr_pointer(xdrs,
  150. (char **)&objp->item.date_time_list_value,
  151. sizeof (CSA_date_time_entry),
  152. (xdrproc_t) xdr_CSA_date_time_entry))
  153. return (FALSE);
  154. break;
  155. case CSA_VALUE_REMINDER:
  156. if (!xdr_pointer(xdrs,
  157. (char **)&objp->item.reminder_value,
  158. sizeof (CSA_reminder), (xdrproc_t) xdr_CSA_reminder))
  159. return (FALSE);
  160. break;
  161. case CSA_VALUE_OPAQUE_DATA:
  162. if (!xdr_pointer(xdrs, (char **)&objp->item.opaque_data_value,
  163. sizeof (CSA_opaque_data), (xdrproc_t) xdr_CSA_opaque_data))
  164. return (FALSE);
  165. break;
  166. }
  167. return (TRUE);
  168. }
  169. /*
  170. * num contains the hashed number for the associated name assigned
  171. * by the server. Client should not change its value.
  172. * If it's zero, name is not hashed yet.
  173. */
  174. bool_t
  175. xdr_cms_attr_name(XDR *xdrs, cms_attr_name *objp)
  176. {
  177. if (!xdr_short(xdrs, &objp->num))
  178. return (FALSE);
  179. if (!xdr_string(xdrs, &objp->name, ~0))
  180. return (FALSE);
  181. return (TRUE);
  182. }
  183. /*
  184. *
  185. */
  186. bool_t
  187. xdr_cms_attribute(XDR *xdrs, cms_attribute *objp)
  188. {
  189. if (!xdr_cms_attr_name(xdrs, &objp->name))
  190. return (FALSE);
  191. if (!xdr_pointer(xdrs, (char **)&objp->value,
  192. sizeof (CSA_attribute_value), (xdrproc_t) xdr_cms_attribute_value))
  193. return (FALSE);
  194. return (TRUE);
  195. }
  196. /*
  197. * An entry is identified by an identifier unique within the calendar
  198. * and has a variable number of attributes associated with it.
  199. */
  200. bool_t
  201. xdr_cms_entry(XDR *xdrs, cms_entry *objp)
  202. {
  203. if (!xdr_cms_key(xdrs, &objp->key))
  204. return (FALSE);
  205. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  206. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  207. return (FALSE);
  208. if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_entry),
  209. (xdrproc_t) xdr_cms_entry))
  210. return (FALSE);
  211. return (TRUE);
  212. }
  213. /*
  214. * cms_enumerate_calendar_attr_res
  215. *
  216. * If stat is CSA_SUCCESS, names contains an array of names.
  217. */
  218. bool_t
  219. xdr_cms_enumerate_calendar_attr_res(XDR *xdrs, cms_enumerate_calendar_attr_res *objp)
  220. {
  221. if (!xdr_u_long(xdrs, &objp->stat))
  222. return (FALSE);
  223. if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
  224. ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
  225. return (FALSE);
  226. return (TRUE);
  227. }
  228. /*
  229. * cms_list_calendars_res
  230. *
  231. * If stat is CSA_SUCCESS, names contains an array of names.
  232. */
  233. bool_t
  234. xdr_cms_list_calendars_res(XDR *xdrs, cms_list_calendars_res *objp)
  235. {
  236. if (!xdr_u_long(xdrs, &objp->stat))
  237. return (FALSE);
  238. if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
  239. ~0, sizeof (cms_name), (xdrproc_t) xdr_cms_name))
  240. return (FALSE);
  241. return (TRUE);
  242. }
  243. /*
  244. * cms_open_args - used by CMS_OPEN_CALENDAR
  245. */
  246. bool_t
  247. xdr_cms_open_args(XDR *xdrs, cms_open_args *objp)
  248. {
  249. if (!xdr_string(xdrs, &objp->cal, ~0))
  250. return (FALSE);
  251. if (!xdr_int(xdrs, &objp->pid))
  252. return (FALSE);
  253. return (TRUE);
  254. }
  255. /*
  256. * cms_open_res - returned by CMS_OPEN_CALENDAR
  257. *
  258. * If stat is DtCm_OK,
  259. * svr_vers contains the version number of the server,
  260. * file_vers contains the version number of the callog file,
  261. * user_access is the calling user's access right to the calendar
  262. * num_attrs indicates the size of the array pointed to by attrs,
  263. * and attrs contains an array of calendar attributes.
  264. */
  265. bool_t
  266. xdr_cms_open_res(XDR *xdrs, cms_open_res *objp)
  267. {
  268. if (!xdr_u_long(xdrs, &objp->stat))
  269. return (FALSE);
  270. if (!xdr_int(xdrs, &objp->svr_vers))
  271. return (FALSE);
  272. if (!xdr_int(xdrs, &objp->file_vers))
  273. return (FALSE);
  274. if (!xdr_u_int(xdrs, &objp->user_access))
  275. return (FALSE);
  276. if (!xdr_array(xdrs, (char **)&objp->attrs, &objp->num_attrs,
  277. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  278. return (FALSE);
  279. return (TRUE);
  280. }
  281. /*
  282. * cms_create_args - used by CMS_CREATE_CALENDAR
  283. */
  284. bool_t
  285. xdr_cms_create_args(XDR *xdrs, cms_create_args *objp)
  286. {
  287. if (!xdr_string(xdrs, &objp->cal, ~0))
  288. return (FALSE);
  289. if (!xdr_string(xdrs, &objp->char_set, ~0))
  290. return (FALSE);
  291. if (!xdr_int(xdrs, &objp->pid))
  292. return (FALSE);
  293. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  294. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  295. return (FALSE);
  296. return (TRUE);
  297. }
  298. /*
  299. * cms_remove_args - used by CMS_REMOVE_CALENDAR
  300. */
  301. bool_t
  302. xdr_cms_remove_args(XDR *xdrs, cms_remove_args *objp)
  303. {
  304. if (!xdr_string(xdrs, &objp->cal, ~0))
  305. return (FALSE);
  306. if (!xdr_int(xdrs, &objp->pid))
  307. return (FALSE);
  308. return (TRUE);
  309. }
  310. /*
  311. * cms_register_args - used by CMS_REGISTER and CMS_UNREGISTER
  312. */
  313. bool_t
  314. xdr_cms_register_args(XDR *xdrs, cms_register_args *objp)
  315. {
  316. if (!xdr_string(xdrs, &objp->cal, ~0))
  317. return (FALSE);
  318. if (!xdr_u_int(xdrs, &objp->update_type))
  319. return (FALSE);
  320. if (!xdr_u_long(xdrs, &objp->prognum))
  321. return (FALSE);
  322. if (!xdr_u_long(xdrs, &objp->versnum))
  323. return (FALSE);
  324. if (!xdr_u_long(xdrs, &objp->procnum))
  325. return (FALSE);
  326. if (!xdr_int(xdrs, &objp->pid))
  327. return (FALSE);
  328. return (TRUE);
  329. }
  330. /*
  331. * cms_get_cal_attr_res - used by CMS_GET_CALENDAR_ATTR
  332. *
  333. * If stat is CSA_SUCCESS, attrs contains an array of attributes.
  334. */
  335. bool_t
  336. xdr_cms_get_cal_attr_res(XDR *xdrs, cms_get_cal_attr_res *objp)
  337. {
  338. if (!xdr_u_long(xdrs, &objp->stat))
  339. return (FALSE);
  340. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  341. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  342. return (FALSE);
  343. return (TRUE);
  344. }
  345. /*
  346. * cms_get_cal_attr_args - used by CMS_GET_CALENDAR_ATTR
  347. */
  348. bool_t
  349. xdr_cms_get_cal_attr_args(XDR *xdrs, cms_get_cal_attr_args *objp)
  350. {
  351. if (!xdr_string(xdrs, &objp->cal, ~0))
  352. return (FALSE);
  353. if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
  354. ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
  355. return (FALSE);
  356. return (TRUE);
  357. }
  358. /*
  359. * cms_set_cal_attr_args - used by CMS_SET_CALENDAR_ATTR
  360. */
  361. bool_t
  362. xdr_cms_set_cal_attr_args(XDR *xdrs, cms_set_cal_attr_args *objp)
  363. {
  364. if (!xdr_string(xdrs, &objp->cal, ~0))
  365. return (FALSE);
  366. if (!xdr_int(xdrs, &objp->pid))
  367. return (FALSE);
  368. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  369. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  370. return (FALSE);
  371. return (TRUE);
  372. }
  373. /*
  374. * cms_archive_res - used by CMS_ARCHIVE
  375. *
  376. * If stat is CSA_SUCCESS, data contains the data to be archived
  377. */
  378. bool_t
  379. xdr_cms_archive_res(XDR *xdrs, cms_archive_res *objp)
  380. {
  381. if (!xdr_u_long(xdrs, &objp->stat))
  382. return (FALSE);
  383. if (!xdr_string(xdrs, &objp->data, ~0))
  384. return (FALSE);
  385. return (TRUE);
  386. }
  387. /*
  388. * cms_archive_args - used by CMS_ARCHIVE
  389. */
  390. bool_t
  391. xdr_cms_archive_args(XDR *xdrs, cms_archive_args *objp)
  392. {
  393. if (!xdr_string(xdrs, &objp->cal, ~0))
  394. return (FALSE);
  395. if (!xdr_bool(xdrs, &objp->delete))
  396. return (FALSE);
  397. if (!xdr_string(xdrs, &objp->char_set, ~0))
  398. return (FALSE);
  399. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  400. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  401. return (FALSE);
  402. if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
  403. ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
  404. return (FALSE);
  405. return (TRUE);
  406. }
  407. /*
  408. * cms_restore_args - used by CMS_RESTORE
  409. */
  410. bool_t
  411. xdr_cms_restore_args(XDR *xdrs, cms_restore_args *objp)
  412. {
  413. if (!xdr_string(xdrs, &objp->cal, ~0))
  414. return (FALSE);
  415. if (!xdr_string(xdrs, &objp->data, ~0))
  416. return (FALSE);
  417. if (!xdr_string(xdrs, &objp->char_set, ~0))
  418. return (FALSE);
  419. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  420. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  421. return (FALSE);
  422. if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
  423. ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
  424. return (FALSE);
  425. return (TRUE);
  426. }
  427. /*
  428. * cms_reminder
  429. */
  430. bool_t
  431. xdr_cms_reminder_ref(XDR *xdrs, cms_reminder_ref *objp)
  432. {
  433. if (!xdr_string(xdrs, &objp->reminder_name, ~0))
  434. return (FALSE);
  435. if (!xdr_string(xdrs, &objp->entryid, ~0))
  436. return (FALSE);
  437. if (!xdr_cms_key(xdrs, &objp->key))
  438. return (FALSE);
  439. if (!xdr_time_t(xdrs, &objp->runtime))
  440. return (FALSE);
  441. if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof (cms_reminder_ref),
  442. (xdrproc_t) xdr_cms_reminder_ref))
  443. return (FALSE);
  444. return (TRUE);
  445. }
  446. /*
  447. * cms_reminder_res - used by CMS_LOOKUP_REMINDER
  448. *
  449. * If stat is CSA_SUCCESS, rems contains an array of reminders.
  450. */
  451. bool_t
  452. xdr_cms_reminder_res(XDR *xdrs, cms_reminder_res *objp)
  453. {
  454. if (!xdr_u_long(xdrs, &objp->stat))
  455. return (FALSE);
  456. if (!xdr_pointer(xdrs, (char **)&objp->rems, sizeof (cms_reminder_ref),
  457. (xdrproc_t) xdr_cms_reminder_ref))
  458. return (FALSE);
  459. return (TRUE);
  460. }
  461. /*
  462. * cms_reminder_args - used by CMS_LOOKUP_REMINDER
  463. */
  464. bool_t
  465. xdr_cms_reminder_args(XDR *xdrs, cms_reminder_args *objp)
  466. {
  467. if (!xdr_string(xdrs, &objp->cal, ~0))
  468. return (FALSE);
  469. if (!xdr_time_t(xdrs, &objp->tick))
  470. return (FALSE);
  471. if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
  472. ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
  473. return (FALSE);
  474. return (TRUE);
  475. }
  476. /*
  477. * cms_entries_res
  478. *
  479. * If stat is CSA_SUCCESS, entries contains an array of entries.
  480. */
  481. bool_t
  482. xdr_cms_entries_res(XDR *xdrs, cms_entries_res *objp)
  483. {
  484. if (!xdr_u_long(xdrs, &objp->stat))
  485. return (FALSE);
  486. if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (cms_entry),
  487. (xdrproc_t) xdr_cms_entry))
  488. return (FALSE);
  489. return (TRUE);
  490. }
  491. /*
  492. * cms_lookup_entries_args - used by CMS_LOOKUP_ENTRIES
  493. */
  494. bool_t
  495. xdr_cms_lookup_entries_args(XDR *xdrs, cms_lookup_entries_args *objp)
  496. {
  497. if (!xdr_string(xdrs, &objp->cal, ~0))
  498. return (FALSE);
  499. if (!xdr_string(xdrs, &objp->char_set, ~0))
  500. return (FALSE);
  501. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  502. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  503. return (FALSE);
  504. if (!xdr_array(xdrs, (char **)&objp->ops, (u_int *) &objp->num_attrs,
  505. ~0, sizeof (CSA_enum), (xdrproc_t) xdr_long))
  506. return (FALSE);
  507. return (TRUE);
  508. }
  509. /*
  510. * cms_enumerate_args - used by CMS_ENUERATE_SEQUENCE
  511. */
  512. bool_t
  513. xdr_cms_enumerate_args(XDR *xdrs, cms_enumerate_args *objp)
  514. {
  515. if (!xdr_string(xdrs, &objp->cal, ~0))
  516. return (FALSE);
  517. if (!xdr_long(xdrs, &objp->id))
  518. return (FALSE);
  519. if (!xdr_long(xdrs, &objp->start))
  520. return (FALSE);
  521. if (!xdr_long(xdrs, &objp->end))
  522. return (FALSE);
  523. return (TRUE);
  524. }
  525. /*
  526. * If stat is CSA_SUCCESS, attrs contains an array of
  527. * attributes.
  528. */
  529. bool_t
  530. xdr_cms_get_entry_attr_res_item(
  531. XDR *xdrs,
  532. cms_get_entry_attr_res_item *objp)
  533. {
  534. if (!xdr_u_long(xdrs, &objp->stat))
  535. return (FALSE);
  536. if (!xdr_cms_key(xdrs, &objp->key))
  537. return (FALSE);
  538. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  539. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  540. return (FALSE);
  541. if (!xdr_pointer(xdrs, (char **)&objp->next,
  542. sizeof (cms_get_entry_attr_res_item),
  543. (xdrproc_t) xdr_cms_get_entry_attr_res_item))
  544. return (FALSE);
  545. return (TRUE);
  546. }
  547. /*
  548. * cms_get_entry_attr_res - used by CMS_GET_ENTRY_ATTR
  549. *
  550. * If stat is CSA_SUCCESS, entries contains an array of
  551. * cms_get_entry_attr_res_item structures.
  552. */
  553. bool_t
  554. xdr_cms_get_entry_attr_res(XDR *xdrs, cms_get_entry_attr_res *objp)
  555. {
  556. if (!xdr_u_long(xdrs, &objp->stat))
  557. return (FALSE);
  558. if (!xdr_pointer(xdrs, (char **)&objp->entries,
  559. sizeof (cms_get_entry_attr_res_item),
  560. (xdrproc_t) xdr_cms_get_entry_attr_res_item))
  561. return (FALSE);
  562. return (TRUE);
  563. }
  564. /*
  565. * cms_get_entry_attr_args - used by CMS_GET_ENTRY_ATTR
  566. */
  567. bool_t
  568. xdr_cms_get_entry_attr_args(XDR *xdrs, cms_get_entry_attr_args *objp)
  569. {
  570. if (!xdr_string(xdrs, &objp->cal, ~0))
  571. return (FALSE);
  572. if (!xdr_array(xdrs, (char **)&objp->keys, (u_int *) &objp->num_keys,
  573. ~0, sizeof (cms_key), (xdrproc_t) xdr_cms_key))
  574. return (FALSE);
  575. if (!xdr_array(xdrs, (char **)&objp->names, (u_int *) &objp->num_names,
  576. ~0, sizeof (cms_attr_name), (xdrproc_t) xdr_cms_attr_name))
  577. return (FALSE);
  578. return (TRUE);
  579. }
  580. /*
  581. * cms_entry_res
  582. *
  583. * If stat is CSA_SUCCESS, entry points to an entry.
  584. */
  585. bool_t
  586. xdr_cms_entry_res(XDR *xdrs, cms_entry_res *objp)
  587. {
  588. if (!xdr_u_long(xdrs, &objp->stat))
  589. return (FALSE);
  590. if (!xdr_pointer(xdrs, (char **)&objp->entry, sizeof (cms_entry),
  591. (xdrproc_t) xdr_cms_entry))
  592. return (FALSE);
  593. return (TRUE);
  594. }
  595. /*
  596. * cms_insert_args - used by CMS_INSERT_ENTRY
  597. */
  598. bool_t
  599. xdr_cms_insert_args(XDR *xdrs, cms_insert_args *objp)
  600. {
  601. if (!xdr_string(xdrs, &objp->cal, ~0))
  602. return (FALSE);
  603. if (!xdr_int(xdrs, &objp->pid))
  604. return (FALSE);
  605. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  606. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  607. return (FALSE);
  608. return (TRUE);
  609. }
  610. /*
  611. * cms_update_args - used by CMS_UPDATE_ENTRY
  612. */
  613. bool_t
  614. xdr_cms_update_args(XDR *xdrs, cms_update_args *objp)
  615. {
  616. if (!xdr_string(xdrs, &objp->cal, ~0))
  617. return (FALSE);
  618. if (!xdr_int(xdrs, &objp->pid))
  619. return (FALSE);
  620. if (!xdr_cms_key(xdrs, &objp->entry))
  621. return (FALSE);
  622. if (!xdr_int(xdrs, &objp->scope))
  623. return (FALSE);
  624. if (!xdr_array(xdrs, (char **)&objp->attrs, (u_int *) &objp->num_attrs,
  625. ~0, sizeof (cms_attribute), (xdrproc_t) xdr_cms_attribute))
  626. return (FALSE);
  627. return (TRUE);
  628. }
  629. /*
  630. * cms_delete_args - used by CMS_DELETE_ENTRY
  631. */
  632. bool_t
  633. xdr_cms_delete_args(XDR *xdrs, cms_delete_args *objp)
  634. {
  635. if (!xdr_string(xdrs, &objp->cal, ~0))
  636. return (FALSE);
  637. if (!xdr_int(xdrs, &objp->pid))
  638. return (FALSE);
  639. if (!xdr_cms_key(xdrs, &objp->entry))
  640. return (FALSE);
  641. if (!xdr_int(xdrs, &objp->scope))
  642. return (FALSE);
  643. return (TRUE);
  644. }