cm.x 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. /* $XConsortium: cm.x /main/1 1996/04/21 19:21:56 drk $ */
  2. /*
  3. * (c) Copyright 1996 Digital Equipment Corporation.
  4. * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
  5. * (c) Copyright 1993,1994,1996 International Business Machines Corp.
  6. * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
  7. * (c) Copyright 1993,1994,1996 Novell, Inc.
  8. * (c) Copyright 1996 FUJITSU LIMITED.
  9. * (c) Copyright 1996 Hitachi.
  10. */
  11. /*
  12. * Calendar manager service RPC protocol.
  13. */
  14. #if defined(RPC_HDR) || defined(RPC_XDR)
  15. %
  16. %#include "csa.h"
  17. %#include "connection.h"
  18. #ifdef RPC_XDR
  19. %#include "cmxdr.h"
  20. #endif
  21. %
  22. %
  23. %/*
  24. % * cms_name - a user name or calendar name which is
  25. % * variable length character string
  26. % */
  27. typedef string cms_name<>;
  28. %
  29. %/*
  30. % * buffer - a variable length character string
  31. % */
  32. typedef string buffer<>;
  33. %
  34. %/*
  35. % * cms_access_entry - data structure for the access list attribute
  36. % */
  37. struct cms_access_entry {
  38. cms_name user;
  39. u_int rights;
  40. cms_access_entry *next;
  41. };
  42. %
  43. %/*
  44. % * cms_attribute_value - data structure for attribute value
  45. % */
  46. %struct cms_attribute_value {
  47. % int type;
  48. % union {
  49. % CSA_boolean boolean_value;
  50. % CSA_enum enumerated_value;
  51. % CSA_flags flags_value;
  52. % int sint32_value;
  53. % uint uint32_value;
  54. % char *string_value;
  55. % char *calendar_user_value;
  56. % char *date_time_value;
  57. % char *date_time_range_value;
  58. % char *time_duration_value;
  59. % cms_access_entry *access_list_value;
  60. % CSA_date_time_entry *date_time_list_value;
  61. % CSA_reminder *reminder_value;
  62. % CSA_opaque_data *opaque_data_value;
  63. % } item;
  64. %};
  65. %typedef struct cms_attribute_value cms_attribute_value;
  66. %
  67. %
  68. %/*
  69. % * cms_key consists of the time and the unique
  70. % * identifier of the entry.
  71. % */
  72. struct cms_key {
  73. time_t time;
  74. long id;
  75. };
  76. %
  77. %/*
  78. % * num contains the hashed number for the associated name assigned
  79. % * by the server. Client should not change its value.
  80. % * If it's zero, name is not hashed yet.
  81. % */
  82. struct cms_attr_name {
  83. short num;
  84. cms_name name;
  85. };
  86. %
  87. %/*
  88. % *
  89. % */
  90. struct cms_attribute {
  91. cms_attr_name name;
  92. cms_attribute_value *value;
  93. };
  94. %
  95. %
  96. %/*
  97. % * An entry is identified by an identifier unique within the calendar
  98. % * and has a variable number of attributes associated with it.
  99. % */
  100. struct cms_entry {
  101. cms_key key;
  102. u_int num_attrs;
  103. cms_attribute *attrs;
  104. struct cms_entry *next;
  105. };
  106. %
  107. %
  108. %/*
  109. % * cms_enumerate_calendar_attr_res
  110. % *
  111. % * If stat is CSA_SUCCESS, names contains an array of names.
  112. % */
  113. struct cms_enumerate_calendar_attr_res {
  114. CSA_return_code stat;
  115. CSA_uint32 num_names;
  116. cms_attr_name *names;
  117. };
  118. %
  119. %
  120. %/*
  121. % * cms_list_calendars_res
  122. % *
  123. % * If stat is CSA_SUCCESS, names contains an array of names.
  124. % */
  125. struct cms_list_calendars_res {
  126. CSA_return_code stat;
  127. CSA_uint32 num_names;
  128. cms_name *names;
  129. };
  130. %
  131. %
  132. %/*
  133. % * cms_open_args - used by CMS_OPEN_CALENDAR
  134. % */
  135. struct cms_open_args {
  136. cms_name cal;
  137. int pid;
  138. };
  139. %
  140. %
  141. %/*
  142. % * cms_open_res - returned by CMS_OPEN_CALENDAR
  143. % *
  144. % * If stat is DtCm_OK,
  145. % * svr_vers contains the version number of the server,
  146. % * file_vers contains the version number of the callog file,
  147. % * user_access is the calling user's access right to the calendar
  148. % * num_attrs indicates the size of the array pointed to by attrs,
  149. % * and attrs contains an array of calendar attributes.
  150. % */
  151. struct cms_open_res {
  152. CSA_return_code stat;
  153. int svr_vers;
  154. int file_vers;
  155. u_int user_access;
  156. CSA_uint32 num_attrs;
  157. cms_attribute *attrs;
  158. };
  159. %
  160. %
  161. %/*
  162. % * cms_create_args - used by CMS_CREATE_CALENDAR
  163. % */
  164. struct cms_create_args {
  165. cms_name cal;
  166. buffer char_set;
  167. int pid;
  168. CSA_uint32 num_attrs;
  169. cms_attribute *attrs;
  170. };
  171. %
  172. %
  173. %/*
  174. % * cms_remove_args - used by CMS_REMOVE_CALENDAR
  175. % */
  176. struct cms_remove_args {
  177. cms_name cal;
  178. int pid;
  179. };
  180. %
  181. %
  182. %/*
  183. % * cms_register_args - used by CMS_REGISTER and CMS_UNREGISTER
  184. % */
  185. struct cms_register_args {
  186. cms_name cal;
  187. u_int update_type;
  188. u_long prognum;
  189. u_long versnum;
  190. u_long procnum;
  191. int pid;
  192. };
  193. %
  194. %
  195. %/*
  196. % * cms_get_cal_attr_res - used by CMS_GET_CALENDAR_ATTR
  197. % *
  198. % * If stat is CSA_SUCCESS, attrs contains an array of attributes.
  199. % */
  200. struct cms_get_cal_attr_res {
  201. CSA_return_code stat;
  202. CSA_uint32 num_attrs;
  203. cms_attribute *attrs;
  204. };
  205. %
  206. %
  207. %/*
  208. % * cms_get_cal_attr_args - used by CMS_GET_CALENDAR_ATTR
  209. % */
  210. struct cms_get_cal_attr_args {
  211. cms_name cal;
  212. CSA_uint32 num_names;
  213. cms_attr_name *names;
  214. };
  215. %
  216. %
  217. %/*
  218. % * cms_set_cal_attr_args - used by CMS_SET_CALENDAR_ATTR
  219. % */
  220. struct cms_set_cal_attr_args {
  221. cms_name cal;
  222. int pid;
  223. CSA_uint32 num_attrs;
  224. cms_attribute *attrs;
  225. };
  226. %
  227. %
  228. %/*
  229. % * cms_archive_res - used by CMS_ARCHIVE
  230. % *
  231. % * If stat is CSA_SUCCESS, data contains the data to be archived
  232. % */
  233. struct cms_archive_res {
  234. CSA_return_code stat;
  235. buffer data;
  236. };
  237. %
  238. %
  239. %/*
  240. % * cms_archive_args - used by CMS_ARCHIVE
  241. % */
  242. struct cms_archive_args {
  243. cms_name cal;
  244. bool delete;
  245. buffer char_set;
  246. CSA_uint32 num_attrs;
  247. cms_attribute *attrs;
  248. int *ops;
  249. };
  250. %
  251. %
  252. %/*
  253. % * cms_restore_args - used by CMS_RESTORE
  254. % */
  255. struct cms_restore_args {
  256. cms_name cal;
  257. buffer data;
  258. buffer char_set;
  259. CSA_uint32 num_attrs;
  260. cms_attribute *attrs;
  261. int *ops;
  262. };
  263. %
  264. %
  265. %/*
  266. % * cms_reminder
  267. % */
  268. struct cms_reminder_ref {
  269. buffer reminder_name;
  270. buffer entryid;
  271. cms_key key;
  272. long runtime;
  273. struct cms_reminder_ref *next;
  274. };
  275. %
  276. %
  277. %/*
  278. % * cms_reminder_res - used by CMS_LOOKUP_REMINDER
  279. % *
  280. % * If stat is CSA_SUCCESS, rems contains an array of reminders.
  281. % */
  282. struct cms_reminder_res {
  283. CSA_return_code stat;
  284. cms_reminder_ref *rems;
  285. };
  286. %
  287. %
  288. %/*
  289. % * cms_reminder_args - used by CMS_LOOKUP_REMINDER
  290. % */
  291. struct cms_reminder_args {
  292. cms_name cal;
  293. time_t tick;
  294. CSA_uint32 num_names;
  295. cms_attr_name *names;
  296. };
  297. %
  298. %
  299. %/*
  300. % * cms_entries_res
  301. % *
  302. % * If stat is CSA_SUCCESS, entries contains an array of entries.
  303. % */
  304. struct cms_entries_res {
  305. CSA_return_code stat;
  306. cms_entry *entries;
  307. };
  308. %
  309. %
  310. %/*
  311. % * cms_lookup_entries_args - used by CMS_LOOKUP_ENTRIES
  312. % */
  313. struct cms_lookup_entries_args {
  314. cms_name cal;
  315. buffer char_set;
  316. CSA_uint32 num_attrs;
  317. cms_attribute *attrs;
  318. int *ops;
  319. };
  320. %
  321. %
  322. %/*
  323. % * cms_enumerate_args - used by CMS_ENUERATE_SEQUENCE
  324. % */
  325. struct cms_enumerate_args {
  326. cms_name cal;
  327. long id;
  328. long start;
  329. long end;
  330. };
  331. %
  332. %/*
  333. % * If stat is CSA_SUCCESS, attrs contains an array of
  334. % * attributes.
  335. % */
  336. struct cms_get_entry_attr_res_item {
  337. CSA_return_code stat;
  338. cms_key key;
  339. CSA_uint32 num_attrs;
  340. cms_attribute *attrs;
  341. struct cms_get_entry_attr_res_item *next;
  342. };
  343. %
  344. %
  345. %/*
  346. % * cms_get_entry_attr_res - used by CMS_GET_ENTRY_ATTR
  347. % *
  348. % * If stat is CSA_SUCCESS, entries contains an array of
  349. % * cms_get_entry_attr_res_item structures.
  350. % */
  351. struct cms_get_entry_attr_res {
  352. CSA_return_code stat;
  353. cms_get_entry_attr_res_item *entries;
  354. };
  355. %
  356. %
  357. %/*
  358. % * cms_get_entry_attr_args - used by CMS_GET_ENTRY_ATTR
  359. % */
  360. struct cms_get_entry_attr_args {
  361. cms_name cal;
  362. u_int num_keys;
  363. cms_key *keys;
  364. CSA_uint32 num_names;
  365. cms_attr_name *names;
  366. };
  367. %
  368. %
  369. %/*
  370. % * cms_entry_res
  371. % *
  372. % * If stat is CSA_SUCCESS, entry points to an entry.
  373. % */
  374. struct cms_entry_res {
  375. CSA_return_code stat;
  376. cms_entry *entry;
  377. };
  378. %
  379. %
  380. %/*
  381. % * cms_insert_args - used by CMS_INSERT_ENTRY
  382. % */
  383. struct cms_insert_args {
  384. cms_name cal;
  385. int pid;
  386. CSA_uint32 num_attrs;
  387. cms_attribute *attrs;
  388. };
  389. %
  390. %
  391. %/*
  392. % * cms_update_args - used by CMS_UPDATE_ENTRY
  393. % */
  394. struct cms_update_args {
  395. cms_name cal;
  396. int pid;
  397. cms_key entry;
  398. int scope;
  399. CSA_uint32 num_attrs;
  400. cms_attribute *attrs;
  401. };
  402. %
  403. %
  404. %/*
  405. % * cms_delete_args - used by CMS_DELETE_ENTRY
  406. % */
  407. struct cms_delete_args {
  408. cms_name cal;
  409. int pid;
  410. cms_key entry;
  411. int scope;
  412. };
  413. #endif /* RPC_HDR */
  414. program TABLEPROG {
  415. /* RPC Language description of the calendar protocol */
  416. version TABLEVERS {
  417. void
  418. CMS_PING(void) = 0;
  419. /*
  420. * List all calendars supported by the server.
  421. */
  422. cms_list_calendars_res
  423. CMS_LIST_CALENDARS(void) = 1;
  424. /*
  425. * Check existence of the calendar.
  426. * Names and tags of all calendar attribute
  427. * will be returned.
  428. */
  429. cms_open_res
  430. CMS_OPEN_CALENDAR(cms_open_args) = 2;
  431. /*
  432. * Create a calendar and initialize it with
  433. * the given attributes.
  434. */
  435. CSA_return_code
  436. CMS_CREATE_CALENDAR(cms_create_args) = 3;
  437. /*
  438. * Remove the calendar.
  439. */
  440. CSA_return_code
  441. CMS_REMOVE_CALENDAR(cms_remove_args) = 4;
  442. /*
  443. * Register client for callbacks.
  444. */
  445. CSA_return_code
  446. CMS_REGISTER(cms_register_args) = 5;
  447. /*
  448. * Unregister the client.
  449. */
  450. CSA_return_code
  451. CMS_UNREGISTER(cms_register_args) = 6;
  452. /*
  453. * Enumerate all calendar attributes.
  454. */
  455. cms_enumerate_calendar_attr_res
  456. CMS_ENUMERATE_CALENDAR_ATTR(cms_name) = 7;
  457. /*
  458. * Get calendar attribute values.
  459. */
  460. cms_get_cal_attr_res
  461. CMS_GET_CALENDAR_ATTR(cms_get_cal_attr_args) = 8;
  462. /*
  463. * Set calendar attribute values.
  464. */
  465. CSA_return_code
  466. CMS_SET_CALENDAR_ATTR(cms_set_cal_attr_args) = 9;
  467. /*
  468. * Get data to be archived.
  469. */
  470. cms_archive_res
  471. CMS_ARCHIVE(cms_archive_args) = 10;
  472. /*
  473. * Restore data to the calendar.
  474. */
  475. CSA_return_code
  476. CMS_RESTORE(cms_restore_args) = 11;
  477. /*
  478. * Lookup reminders relative to the given tick.
  479. */
  480. cms_reminder_res
  481. CMS_LOOKUP_REMINDER(cms_reminder_args) = 12;
  482. /*
  483. * Lookup entries that match the given criteria.
  484. * Attribute values of predefined attributes are returned.
  485. * For other attributes, only the names are
  486. * returned but not the values.
  487. */
  488. cms_entries_res
  489. CMS_LOOKUP_ENTRIES(cms_lookup_entries_args) = 13;
  490. /*
  491. * Lookup instances of a repeating entry
  492. * The attribute list specify the entry
  493. * id and a time range.
  494. * If the entry repeats indefinitely,
  495. * the time range is mandatory.
  496. */
  497. cms_entries_res
  498. CMS_ENUMERATE_SEQUENCE(cms_enumerate_args) = 14;
  499. /*
  500. * Get entry attribute values.
  501. */
  502. cms_get_entry_attr_res
  503. CMS_GET_ENTRY_ATTR(cms_get_entry_attr_args) = 15;
  504. /*
  505. * Insert an entry.
  506. */
  507. cms_entry_res
  508. CMS_INSERT_ENTRY(cms_insert_args) = 16;
  509. /*
  510. * Update an entry.
  511. */
  512. cms_entry_res
  513. CMS_UPDATE_ENTRY(cms_update_args) = 17;
  514. /*
  515. * Delete an entry.
  516. */
  517. CSA_return_code
  518. CMS_DELETE_ENTRY(cms_delete_args) = 18;
  519. } = 5;
  520. } = 100068;