lists.h

Go to the documentation of this file.
00001 /*************************************************** */
00002 /* Rule Set Based Access Control                     */
00003 /* Author and (c) 1999-2005: Amon Ott <ao@rsbac.org> */
00004 /* Generic List Management                           */
00005 /* Last modified: 09/Feb/2005                        */
00006 /*************************************************** */
00007 
00008 /* Note: lol = list of lists, a two-level list structure */
00009 
00010 #ifndef __RSBAC_LISTS_H
00011 #define __RSBAC_LISTS_H
00012 
00013 #include <linux/init.h>
00014 #include <linux/vmalloc.h>
00015 //#include <rsbac/types.h>
00016 #include <rsbac/rkmem.h>
00017 
00018 #define RSBAC_LIST_VERSION 3
00019 
00020 typedef void * rsbac_list_handle_t;
00021 typedef __u32 rsbac_list_key_t;
00022 
00023 /* Maximum length for list (file)names */
00024 #define RSBAC_LIST_MAX_FILENAME 15
00025 
00026 /* Limit for max_age_in_seconds: ca. 10 years */
00027 #define RSBAC_LIST_MAX_AGE_LIMIT (3600 * 24 * 366 * 10)
00028 
00029 /* Maximum desc_size + data_size: Max rkmalloc size - some space for metadata */
00030 #define RSBAC_LIST_MAX_ITEM_SIZE (RSBAC_MAX_KMALLOC - 64)
00031 
00032 /****************************/
00033 /* List Registration Flags: */
00034 
00035 /* Make persistent, i.e., save to and restore from disk */
00036 #define RSBAC_LIST_PERSIST 1
00037 
00038 /* Ignore old list contents (still checks key, if list exists on disk) */
00039 #define RSBAC_LIST_IGNORE_OLD 2
00040 
00041 /* Ignore old list contents, if version upconversion is not supported
00042  * (no get_conv, or get_conv returned NULL) - without this flag, registration fails, if
00043  * list cannot be converted.
00044  */
00045 #define RSBAC_LIST_IGNORE_UNSUPP_VERSION 4
00046 
00047 /* Temporarily disallow writing list to disk, e.g. for upgrade tests */
00048 #define RSBAC_LIST_NO_WRITE 8
00049 
00050 /* Provide a binary backup file as /proc/rsbac-info/backup/filename */
00051 #define RSBAC_LIST_BACKUP 16
00052 
00053 /* Use provided default data, return it for unexisting items and
00054    automatically create and cleanup items with default data as necessary.
00055    (only items with 0 ttl (unlimited) get removed)
00056    (lol items with default data only get removed, if they have no subitems) */
00057 #define RSBAC_LIST_DEF_DATA 32
00058 
00059 /* Use provided default subitem data, return it for unexisting subitems and
00060    automatically create and cleanup subitems with default data as necessary.
00061    (only subitems with 0 ttl (unlimited) get removed) */
00062 #define RSBAC_LIST_DEF_SUBDATA 64
00063 
00064 /****************************/
00065 /* Function prototypes */
00066 
00067 /* Function to compare two descriptors, returns 0, if equal, a negative value,
00068  * if desc1 < desc2 and a positive value, if desc1 > desc2 (like memcmp).
00069  * Used for lookup and list optimization.
00070  * Note: Non-0 values are only used for list optimization and do not necessarily
00071  * imply a real order of values.
00072  */
00073 typedef int rsbac_list_compare_function_t(void * desc1, void * desc2);
00074 
00075 /* Compare function for __u32 values */
00076 int rsbac_list_compare_u32(void * desc1, void * desc2);
00077 
00078 /* Function to compare two datas, returns 0, if equal, and another value,
00079  * if not.
00080  * Used for lookup by data.
00081  * Note: list optimization is based on descriptors, so data lookup is always
00082  * linear search from first to last element in list order.
00083  */
00084 typedef int rsbac_list_data_compare_function_t(void * data1, void * data2);
00085 
00086 /* conversion function to upconvert old on-disk descs and datas to actual version */
00087 /* must return 0 on success or error otherwise */
00088 /* Attention: if old or new data_size is 0, the respective data pointer is NULL! */
00089 typedef int rsbac_list_conv_function_t(
00090         void * old_desc,
00091         void * old_data,
00092         void * new_desc,
00093         void * new_data);
00094 
00095 /* callback function to return an upconvert function for on-disk-version, if versions differ */
00096 /* Note: Lists implementation does not assume anything about your version number apart
00097    from being of type rsbac_version_t. Use it as you like. */
00098 typedef rsbac_list_conv_function_t * rsbac_list_get_conv_t(rsbac_version_t old_version);
00099 
00100 /* get generic list registration version */
00101 rsbac_version_t rsbac_list_version(void);
00102 
00103 
00104 /* List info: This struct will be written to disk */
00105 /*
00106  * list_version: a simple __u32 version number for the list. If old on-disk version is
00107    different, conversion is tried (depending on flags and get_conv function)
00108  * key: secret __u32 key, which must be the same as in on-disk version, if persistent
00109  * desc_size: size of the descriptor (error is returned, if list exists and value differs)
00110               internally reset to sizeof(__u32) for u32 call variants
00111  * data_size: size of data (error is returned, if list exists and value differs)
00112               set to 0 for sets without data
00113  * subdesc_size: size of the descriptor of the sublist (error is returned, if list exists
00114               and value differs), internally reset to sizeof(__u32) for u32 call variants
00115  * subdata_size: size of sublist data (error is returned, if list exists and value differs)
00116               set to 0 for sets without data
00117  * max_age: seconds until unchanged list file (no add or remove) will be purged.
00118    Maximum value is RSBAC_LIST_MAX_AGE_LIMIT (s.a.), use 0 for unlimited lifetime.
00119    (purging not yet implemented - only reused without key, please cleanup by hand)
00120  */
00121 struct rsbac_list_info_t
00122   {
00123     rsbac_version_t version;
00124     rsbac_list_key_t key;
00125     __u32 desc_size;
00126     __u32 data_size;
00127     rsbac_time_t max_age; 
00128   };
00129 
00130 struct rsbac_list_lol_info_t
00131   {
00132     rsbac_version_t version;
00133     rsbac_list_key_t key;
00134     __u32 desc_size;
00135     __u32 data_size;
00136     __u32 subdesc_size;
00137     __u32 subdata_size;
00138     rsbac_time_t max_age; 
00139   };
00140 
00141 
00142 /* register a new list */
00143 /*
00144  * If list with same name exists in memory, error -RSBAC_EEXISTS is returned.
00145  * If list with same name and key exists on device, it is restored depending on
00146    the flags.
00147  * If list with same name, but different key exists on disk, access is denied
00148    (error -EPERM).
00149  *
00150  * ds_version: for binary modules, must be RSBAC_LIST_VERSION. If version
00151    differs, return error.
00152  * handle_p: for all list accesses, an opaque handle is put into *handle_p.
00153  * flags: see flag values
00154  * compare: for lookup and list optimization, can be NULL, then
00155    memcmp(desc1, desc2, desc_size) is used
00156  * subcompare: for item lookup and optimization of sublist, can be NULL, then
00157    memcmp(desc1, desc2, desc_size) is used
00158  * get_conv: function to deliver conversion function for given version
00159  * get_subconv: function to deliver sublist item conversion function for given
00160    version
00161  * def_data: default data value for flag RSBAC_LIST_DEF_DATA
00162    (if NULL, flag is cleared)
00163  * def_subdata: default subdata value for flag RSBAC_LIST_DEF_SUBDATA
00164    (if NULL, flag is cleared)
00165  * name: the on-disk name, should be distinct and max. 7 or 8.2 chars
00166    (maxlen of RSBAC_LIST_MAX_FILENAME supported) (only used for statistics, if
00167    non-persistent)
00168  * device: the device to read list from or to save list to - use 0 for root dev
00169    (ignored, if non-persistent)
00170  */
00171 
00172 int rsbac_list_register(
00173   rsbac_version_t ds_version,
00174   rsbac_list_handle_t *handle_p,
00175   struct rsbac_list_info_t * info_p,
00176   u_int flags,
00177   rsbac_list_compare_function_t * compare,
00178   rsbac_list_get_conv_t * get_conv,
00179   void * def_data,
00180   char * name,
00181   kdev_t device);
00182 
00183 int rsbac_list_lol_register(
00184   rsbac_version_t ds_version,
00185   rsbac_list_handle_t *handle_p,
00186   struct rsbac_list_lol_info_t * info_p,
00187   u_int flags,
00188   rsbac_list_compare_function_t * compare,
00189   rsbac_list_compare_function_t * subcompare,
00190   rsbac_list_get_conv_t * get_conv,
00191   rsbac_list_get_conv_t * get_subconv,
00192   void * def_data,
00193   void * def_subdata,
00194   char * name,
00195   kdev_t device);
00196 
00197 /* destroy list */
00198 /* list is destroyed, disk file is deleted */
00199 /* list must have been opened with register */
00200 int rsbac_list_destroy(rsbac_list_handle_t * handle_p, rsbac_list_key_t key);
00201 
00202 int rsbac_list_lol_destroy(rsbac_list_handle_t * handle_p, rsbac_list_key_t key);
00203 
00204 /* detach from list */
00205 /* list is saved (if persistent) and removed from memory. Call register for new access. */
00206 int rsbac_list_detach(rsbac_list_handle_t * handle_p, rsbac_list_key_t key);
00207 
00208 int rsbac_list_lol_detach(rsbac_list_handle_t * handle_p, rsbac_list_key_t key);
00209 
00210 /* set list's no_write flag */
00211 /* TRUE: do not write to disk, FALSE: writing allowed */
00212 int rsbac_list_no_write
00213   (rsbac_list_handle_t handle, rsbac_list_key_t key, rsbac_boolean_t no_write);
00214 
00215 int rsbac_list_lol_no_write
00216   (rsbac_list_handle_t handle, rsbac_list_key_t key, rsbac_boolean_t no_write);
00217 
00218 /* Single list checking, good for cleanup of items with ttl in the past. */
00219 /* This functionality is also included in the big rsbac_check(). */
00220 
00221 int rsbac_list_check(
00222   rsbac_list_handle_t handle,
00223   int correct);
00224 
00225 int rsbac_list_lol_check(
00226   rsbac_list_handle_t handle,
00227   int correct);
00228 
00229 /* Transaction Support */
00230 #ifdef CONFIG_RSBAC_LIST_TRANS
00231 int rsbac_list_ta_begin(
00232   rsbac_time_t ttl,
00233   rsbac_list_ta_number_t * ta_number_p,
00234   rsbac_uid_t commit_uid,
00235   char * password);
00236 
00237 int rsbac_list_ta_refresh(
00238   rsbac_time_t ttl,
00239   rsbac_list_ta_number_t ta_number,
00240   char * password);
00241 
00242 int rsbac_list_ta_commit(rsbac_list_ta_number_t ta_number,
00243                          char * password);
00244 
00245 int rsbac_list_ta_forget(rsbac_list_ta_number_t ta_number,
00246                          char * password);
00247 #endif
00248 
00249 /* add item */
00250 /* if item for desc exists, the data is updated */
00251 /* data can be NULL, if list is registered with data_size 0 (used as set) */
00252 int rsbac_list_add(rsbac_list_handle_t handle, void * desc, void * data);
00253 
00254 /* add with time-to-live - after this time in seconds the item gets automatically removed */
00255 /* set to 0 for unlimited (default), RSBAC_LIST_TTL_KEEP to keep previous setting */
00256 int rsbac_ta_list_add_ttl(
00257   rsbac_list_ta_number_t ta_number,
00258   rsbac_list_handle_t handle,
00259   rsbac_time_t ttl,
00260   void * desc,
00261   void * data);
00262 
00263 int rsbac_list_add_ttl(
00264   rsbac_list_handle_t handle,
00265   rsbac_time_t ttl,
00266   void * desc,
00267   void * data);
00268 
00269 /* Add list of lists sublist item, item for desc must exist */
00270 int rsbac_ta_list_lol_subadd_ttl(
00271   rsbac_list_ta_number_t ta_number,
00272   rsbac_list_handle_t handle,
00273   rsbac_time_t ttl,
00274   void * desc,
00275   void * subdesc,
00276   void * subdata);
00277 
00278 int rsbac_list_lol_subadd(
00279   rsbac_list_handle_t handle,
00280   void * desc,
00281   void * subdesc,
00282   void * subdata);
00283 
00284 /* add with time-to-live - after this time in seconds the item gets automatically removed */
00285 int rsbac_list_lol_subadd_ttl(
00286   rsbac_list_handle_t handle,
00287   rsbac_time_t ttl,
00288   void * desc,
00289   void * subdesc,
00290   void * subdata);
00291 
00292 /* Add list of lists top level item */
00293 int rsbac_list_lol_add(
00294   rsbac_list_handle_t handle,
00295   void * desc,
00296   void * data);
00297 
00298 /* add with time-to-live - after this time in seconds the item gets automatically removed */
00299 int rsbac_ta_list_lol_add_ttl(
00300   rsbac_list_ta_number_t ta_number,
00301   rsbac_list_handle_t handle,
00302   rsbac_time_t ttl,
00303   void * desc,
00304   void * data);
00305 
00306 int rsbac_list_lol_add_ttl(
00307   rsbac_list_handle_t handle,
00308   rsbac_time_t ttl,
00309   void * desc,
00310   void * data);
00311 
00312 /* remove item */
00313 int rsbac_ta_list_remove(
00314   rsbac_list_ta_number_t ta_number,
00315   rsbac_list_handle_t handle,
00316   void * desc);
00317 
00318 int rsbac_list_remove(rsbac_list_handle_t handle, void * desc);
00319 
00320 /* remove all items */
00321 int rsbac_ta_list_remove_all(rsbac_list_ta_number_t ta_number, rsbac_list_handle_t handle);
00322 
00323 int rsbac_list_remove_all(rsbac_list_handle_t handle);
00324 
00325 /* remove item from sublist - also succeeds, if item for desc or subdesc does not exist */
00326 int rsbac_ta_list_lol_subremove(
00327   rsbac_list_ta_number_t ta_number,
00328   rsbac_list_handle_t handle,
00329   void * desc,
00330   void * subdesc);
00331 
00332 int rsbac_list_lol_subremove(
00333   rsbac_list_handle_t handle,
00334   void * desc,
00335   void * subdesc);
00336 
00337 /* remove same subitem from all sublists */
00338 int rsbac_ta_list_lol_subremove_from_all(
00339   rsbac_list_ta_number_t ta_number,
00340   rsbac_list_handle_t handle,
00341   void * subdesc);
00342 
00343 int rsbac_list_lol_subremove_from_all(
00344   rsbac_list_handle_t handle,
00345   void * subdesc);
00346 
00347 /* remove all subitems from list */
00348 int rsbac_ta_list_lol_subremove_all(
00349   rsbac_list_ta_number_t ta_number,
00350   rsbac_list_handle_t handle,
00351   void * desc);
00352 
00353 int rsbac_list_lol_subremove_all(rsbac_list_handle_t handle, void * desc);
00354 
00355 int rsbac_ta_list_lol_remove(
00356   rsbac_list_ta_number_t ta_number,
00357   rsbac_list_handle_t handle,
00358   void * desc);
00359 
00360 int rsbac_list_lol_remove(
00361   rsbac_list_handle_t handle,
00362   void * desc);
00363 
00364 int rsbac_ta_list_lol_remove_all(
00365   rsbac_list_ta_number_t ta_number,
00366   rsbac_list_handle_t handle);
00367 
00368 int rsbac_list_lol_remove_all(rsbac_list_handle_t handle);
00369 
00370 
00371 /* get item data */
00372 /* Item data is copied - we cannot give a pointer, because item could be
00373  * removed */
00374 int rsbac_list_get_data(rsbac_list_handle_t handle, void * desc, void * data);
00375 
00376 /* also get time-to-live - after this time in seconds the item gets automatically removed */
00377 /* both ttl_p and data can be NULL, they are then simply not returned */
00378 int rsbac_ta_list_get_data_ttl(
00379   rsbac_list_ta_number_t ta_number,
00380   rsbac_list_handle_t handle,
00381   rsbac_time_t * ttl_p,
00382   void * desc,
00383   void * data);
00384 
00385 int rsbac_list_get_data_ttl(rsbac_list_handle_t handle,
00386                             rsbac_time_t * ttl_p,
00387                             void * desc,
00388                             void * data);
00389 
00390 /* get data from a subitem */
00391 int rsbac_list_lol_get_subdata(
00392   rsbac_list_handle_t handle,
00393   void * desc,
00394   void * subdesc,
00395   void * subdata);
00396 
00397 /* also get time-to-live - after this time in seconds the item gets automatically removed */
00398 /* both ttl_p and data can be NULL, they are then simply not returned */
00399 int rsbac_ta_list_lol_get_subdata_ttl(
00400   rsbac_list_ta_number_t ta_number,
00401   rsbac_list_handle_t handle,
00402   rsbac_time_t * ttl_p,
00403   void * desc,
00404   void * subdesc,
00405   void * subdata);
00406 
00407 int rsbac_list_lol_get_subdata_ttl(
00408   rsbac_list_handle_t handle,
00409   rsbac_time_t * ttl_p,
00410   void * desc,
00411   void * subdesc,
00412   void * subdata);
00413 
00414 int rsbac_list_lol_get_data(rsbac_list_handle_t handle, void * desc, void * data);
00415 
00416 /* also get time-to-live - after this time in seconds the item gets automatically removed */
00417 /* both ttl_p and data can be NULL, they are then simply not returned */
00418 int rsbac_ta_list_lol_get_data_ttl(
00419   rsbac_list_ta_number_t ta_number,
00420   rsbac_list_handle_t handle,
00421   rsbac_time_t * ttl_p,
00422   void * desc,
00423   void * data);
00424 
00425 int rsbac_list_lol_get_data_ttl(rsbac_list_handle_t handle,
00426                                 rsbac_time_t * ttl_p,
00427                                 void * desc,
00428                                 void * data);
00429 
00430 /* get item desc by data */
00431 /* Item desc is copied - we cannot give a pointer, because item could be
00432  * removed.
00433  * If no compare function is provided (NULL value), memcmp is used.
00434  * Note: The data value given here is always used as second parameter to the
00435  *       compare function, so you can use different types for storage and
00436  *       lookup.
00437  */
00438 int rsbac_ta_list_get_desc(
00439   rsbac_list_ta_number_t ta_number,
00440   rsbac_list_handle_t handle,
00441   void * desc,
00442   void * data,
00443   rsbac_list_data_compare_function_t compare);
00444 
00445 int rsbac_list_get_desc(rsbac_list_handle_t handle,
00446                         void * desc,
00447                         void * data,
00448                         rsbac_list_data_compare_function_t compare);
00449 
00450 int rsbac_ta_list_lol_get_desc(
00451   rsbac_list_ta_number_t ta_number,
00452   rsbac_list_handle_t handle,
00453   void * desc,
00454   void * data,
00455   rsbac_list_data_compare_function_t compare);
00456 
00457 int rsbac_list_lol_get_desc(rsbac_list_handle_t handle,
00458                             void * desc,
00459                             void * data,
00460                             rsbac_list_data_compare_function_t compare);
00461 
00462 /* get maximum desc (uses compare function) */
00463 int rsbac_ta_list_get_max_desc(
00464   rsbac_list_ta_number_t ta_number,
00465   rsbac_list_handle_t handle,
00466   void * desc);
00467 
00468 int rsbac_list_get_max_desc(rsbac_list_handle_t handle, void * desc);
00469 
00470 /* get next desc (uses compare function) */
00471 int rsbac_ta_list_get_next_desc(
00472   rsbac_list_ta_number_t ta_number,
00473   rsbac_list_handle_t handle,
00474   void * old_desc,
00475   void * next_desc);
00476 
00477 int rsbac_list_get_next_desc(rsbac_list_handle_t handle, void * old_desc, void * next_desc);
00478 
00479 int rsbac_ta_list_lol_get_next_desc(
00480   rsbac_list_ta_number_t ta_number,
00481   rsbac_list_handle_t handle,
00482   void * old_desc,
00483   void * next_desc);
00484 
00485 int rsbac_list_lol_get_next_desc(rsbac_list_handle_t handle, void * old_desc, void * next_desc);
00486 
00487 /* does item exist? */
00488 /* returns TRUE, if item exists, FALSE, if not or error */
00489 int rsbac_ta_list_exist(
00490   rsbac_list_ta_number_t ta_number,
00491   rsbac_list_handle_t handle,
00492   void * desc);
00493 
00494 int rsbac_list_exist(rsbac_list_handle_t handle, void * desc);
00495 
00496 int rsbac_ta_list_lol_subexist(
00497   rsbac_list_ta_number_t ta_number,
00498   rsbac_list_handle_t handle,
00499   void * desc,
00500   void * subdesc);
00501 
00502 int rsbac_list_lol_subexist(
00503   rsbac_list_handle_t handle,
00504   void * desc,
00505   void * subdesc);
00506 
00507 int rsbac_ta_list_lol_exist(
00508   rsbac_list_ta_number_t ta_number,
00509   rsbac_list_handle_t handle,
00510   void * desc);
00511 
00512 int rsbac_list_lol_exist(
00513   rsbac_list_handle_t handle,
00514   void * desc);
00515 
00516 /*
00517  * Note: The subdesc/data value given here is always used as second parameter to the
00518  *       given subdesc compare function, so you can use different types for storage and
00519  *       lookup. If compare is NULL, call is forwarded to rsbac_list_lol_subexist.
00520  * Warning: This function does not use the list optimization when searching the sublist!
00521  */
00522 int rsbac_ta_list_lol_subexist_compare(
00523   rsbac_list_ta_number_t ta_number,
00524   rsbac_list_handle_t handle,
00525   void * desc,
00526   void * subdesc,
00527   rsbac_list_compare_function_t compare);
00528 
00529 int rsbac_list_lol_subexist_compare(
00530   rsbac_list_handle_t handle,
00531   void * desc,
00532   void * subdesc,
00533   rsbac_list_compare_function_t compare);
00534 
00535 /* count number of elements */
00536 /* returns number of elements or negative error code */
00537 long rsbac_ta_list_count(
00538   rsbac_list_ta_number_t ta_number,
00539   rsbac_list_handle_t handle);
00540 
00541 long rsbac_list_count(rsbac_list_handle_t handle);
00542 
00543 long rsbac_ta_list_lol_subcount(
00544   rsbac_list_ta_number_t ta_number,
00545   rsbac_list_handle_t handle,
00546   void * desc);
00547 
00548 long rsbac_list_lol_subcount(rsbac_list_handle_t handle, void * desc);
00549 
00550 long rsbac_ta_list_lol_all_subcount(
00551   rsbac_list_ta_number_t ta_number,
00552   rsbac_list_handle_t handle);
00553 
00554 long rsbac_list_lol_all_subcount(rsbac_list_handle_t handle);
00555 
00556 long rsbac_ta_list_lol_count(
00557   rsbac_list_ta_number_t ta_number,
00558   rsbac_list_handle_t handle);
00559 
00560 long rsbac_list_lol_count(rsbac_list_handle_t handle);
00561 
00562 
00563 /* Get array of all descriptors */
00564 /* Returns number of elements or negative error code */
00565 /* If return value > 0, *array_p contains a pointer to a vmalloc'd array of descs,
00566    otherwise *array_p is set to NULL. If *array_p has been set, caller must call
00567    vfree(*array_p) after use! */
00568 
00569 long rsbac_ta_list_get_all_desc(
00570   rsbac_list_ta_number_t ta_number,
00571   rsbac_list_handle_t handle,
00572   void ** array_p);
00573 
00574 long rsbac_list_get_all_desc(rsbac_list_handle_t handle, void ** array_p);
00575 
00576 long rsbac_list_lol_get_all_subdesc(rsbac_list_handle_t handle, void * desc, void ** array_p);
00577 
00578 long rsbac_ta_list_lol_get_all_subdesc_ttl(
00579   rsbac_list_ta_number_t ta_number,
00580   rsbac_list_handle_t handle,
00581   void * desc,
00582   void ** array_p,
00583   rsbac_time_t ** ttl_array_p);
00584 
00585 long rsbac_list_lol_get_all_subdesc_ttl(rsbac_list_handle_t handle,
00586                                         void * desc,
00587                                         void ** array_p,
00588                                         rsbac_time_t ** ttl_array_p);
00589 
00590 long rsbac_ta_list_lol_get_all_desc(
00591   rsbac_list_ta_number_t ta_number,
00592   rsbac_list_handle_t handle,
00593   void ** array_p);
00594 
00595 long rsbac_list_lol_get_all_desc(rsbac_list_handle_t handle, void ** array_p);
00596 
00597 
00598 /* Get array of all datas */
00599 /* Returns number of elements or negative error code */
00600 /* If return value > 0, *array_p contains a pointer to a vmalloc'd array of datas,
00601    otherwise *array_p is set to NULL. If *array_p has been set, caller must call
00602    vfree(*array_p) after use! */
00603 
00604 long rsbac_ta_list_get_all_data(
00605   rsbac_list_ta_number_t ta_number,
00606   rsbac_list_handle_t handle,
00607   void ** array_p);
00608 
00609 long rsbac_list_get_all_data(rsbac_list_handle_t handle, void ** array_p);
00610 
00611 long rsbac_ta_list_lol_get_all_subdata(
00612   rsbac_list_ta_number_t ta_number,
00613   rsbac_list_handle_t handle,
00614   void * desc,
00615   void ** array_p);
00616 
00617 long rsbac_list_lol_get_all_subdata(rsbac_list_handle_t handle, void * desc, void ** array_p);
00618 
00619 long rsbac_ta_list_lol_get_all_data(
00620   rsbac_list_ta_number_t ta_number,
00621   rsbac_list_handle_t handle,
00622   void ** array_p);
00623 
00624 long rsbac_list_lol_get_all_data(rsbac_list_handle_t handle, void ** array_p);
00625 
00626 
00627 /* Get item size */
00628 
00629 int rsbac_list_get_item_size(rsbac_list_handle_t handle);
00630 
00631 int rsbac_list_lol_get_subitem_size(rsbac_list_handle_t handle);
00632 
00633 int rsbac_list_lol_get_item_size(rsbac_list_handle_t handle);
00634 
00635 /* Get array of all items */
00636 /* Returns number of items or negative error code */
00637 /* If return value > 0, *array_p contains a pointer to a vmalloc'd array of items,
00638    where desc and data are placed directly behind each other.
00639    If *array_p has been set, caller must call vfree(*array_p) after use! */
00640 
00641 long rsbac_list_get_all_items(rsbac_list_handle_t handle, void ** array_p);
00642 
00643 long rsbac_ta_list_get_all_items_ttl(
00644   rsbac_list_ta_number_t ta_number,
00645   rsbac_list_handle_t handle,
00646   void ** array_p,
00647   rsbac_time_t ** ttl_array_p);
00648 
00649 long rsbac_list_get_all_items_ttl(rsbac_list_handle_t handle,
00650                                   void ** array_p,
00651                                   rsbac_time_t ** ttl_array_p);
00652 
00653 long rsbac_list_lol_get_all_subitems(rsbac_list_handle_t handle, void * desc, void ** array_p);
00654 
00655 long rsbac_ta_list_lol_get_all_subitems_ttl(
00656   rsbac_list_ta_number_t ta_number,
00657   rsbac_list_handle_t handle,
00658   void * desc,
00659   void ** array_p,
00660   rsbac_time_t ** ttl_array_p);
00661 
00662 long rsbac_list_lol_get_all_subitems_ttl(rsbac_list_handle_t handle,
00663                                          void * desc,
00664                                          void ** array_p,
00665                                          rsbac_time_t ** ttl_array_p);
00666 
00667 long rsbac_ta_list_lol_get_all_items(
00668   rsbac_list_ta_number_t ta_number,
00669   rsbac_list_handle_t handle,
00670   void ** array_p);
00671 
00672 long rsbac_list_lol_get_all_items(rsbac_list_handle_t handle, void ** array_p);
00673 
00674 
00675 #endif
00676 /* end of lists.h */

Generated on Fri Jun 17 09:45:18 2005 for RSBAC by  doxygen 1.4.2