/linux-2.6.21.1-rsbac-1.3.4/include/rsbac/rc_getname.h File Reference

#include <rsbac/rc_types.h>

Go to the source code of this file.

Defines

#define NULL   ((void *) 0)

Functions

char * get_rc_target_name (char *name, enum rsbac_rc_target_t value)
enum rsbac_rc_target_t get_rc_target_nr (const char *name)
char * get_rc_admin_name (char *name, enum rsbac_rc_admin_type_t value)
enum rsbac_rc_admin_type_t get_rc_admin_nr (const char *name)
char * get_rc_scd_type_name (char *name, enum rsbac_rc_scd_type_t value)
enum rsbac_rc_scd_type_t get_rc_scd_type_nr (const char *name)
char * get_rc_item_name (char *name, enum rsbac_rc_item_t value)
enum rsbac_rc_item_t get_rc_item_nr (const char *name)
char * get_rc_item_param (char *name, enum rsbac_rc_item_t value)
char * get_rc_special_right_name (char *name, enum rsbac_rc_special_rights_t value)
enum rsbac_rc_special_rights_t get_rc_special_right_nr (const char *name)


Define Documentation

#define NULL   ((void *) 0)

Definition at line 14 of file rc_getname.h.


Function Documentation

char* get_rc_admin_name ( char *  name,
enum rsbac_rc_admin_type_t  value 
)

Definition at line 181 of file rc_getname.c.

References NULL, rc_admin_list, and RC_none.

00182 {
00183         if (!name)
00184                 return (NULL);
00185         if (value > RC_none)
00186                 strcpy(name, "ERROR!");
00187         else
00188                 strcpy(name, rc_admin_list[value]);
00189         return (name);
00190 };

enum rsbac_rc_admin_type_t get_rc_admin_nr ( const char *  name  ) 

Definition at line 192 of file rc_getname.c.

References rc_admin_list, and RC_none.

00193 {
00194         enum rsbac_rc_admin_type_t i;
00195 
00196         if (!name)
00197                 return (RC_none);
00198         for (i = 0; i < RC_none; i++) {
00199                 if (!strcmp(name, rc_admin_list[i])) {
00200                         return (i);
00201                 }
00202         }
00203         return (RC_none);
00204 };

char* get_rc_item_name ( char *  name,
enum rsbac_rc_item_t  value 
)

Definition at line 236 of file rc_getname.c.

References NULL, rc_item_list, and RI_none.

Referenced by rsbac_rc_sys_set_item().

00237 {
00238         if (!name)
00239                 return (NULL);
00240         if (value > RI_none)
00241                 strcpy(name, "ERROR!");
00242         else
00243                 strcpy(name, rc_item_list[value]);
00244         return (name);
00245 };

enum rsbac_rc_item_t get_rc_item_nr ( const char *  name  ) 

Definition at line 247 of file rc_getname.c.

References rc_item_list, and RI_none.

00248 {
00249         enum rsbac_rc_item_t i;
00250 
00251         if (!name)
00252                 return (RI_none);
00253         for (i = 0; i < RI_none; i++) {
00254                 if (!strcmp(name, rc_item_list[i])) {
00255                         return (i);
00256                 }
00257         }
00258         return (RI_none);
00259 };

char* get_rc_item_param ( char *  name,
enum rsbac_rc_item_t  value 
)

Definition at line 262 of file rc_getname.c.

References NULL, rc_item_param_list, and RI_none.

00263 {
00264         if (!name)
00265                 return (NULL);
00266         if (value > RI_none)
00267                 strcpy(name, "ERROR!");
00268         else
00269                 strcpy(name, rc_item_param_list[value]);
00270         return (name);
00271 };

char* get_rc_scd_type_name ( char *  name,
enum rsbac_rc_scd_type_t  value 
)

Definition at line 206 of file rc_getname.c.

References get_scd_type_name(), NULL, rc_scd_type_list, RST_min, and RST_none.

Referenced by rsbac_rc_get_item().

00207 {
00208         if (!name)
00209                 return (NULL);
00210         if (value < RST_min) {
00211                 return (get_scd_type_name(name, value));
00212         }
00213         value -= RST_min;
00214         if (value > RST_none) {
00215                 strcpy(name, "ERROR!");
00216                 return (name);
00217         }
00218         strcpy(name, rc_scd_type_list[value]);
00219         return (name);
00220 };

enum rsbac_rc_scd_type_t get_rc_scd_type_nr ( const char *  name  ) 

Definition at line 222 of file rc_getname.c.

References get_scd_type_nr(), RC_none, rc_scd_type_list, and RST_min.

00223 {
00224         enum rsbac_rc_scd_type_t i;
00225 
00226         if (!name)
00227                 return (RC_none);
00228         for (i = 0; i < RC_none - RST_min; i++) {
00229                 if (!strcmp(name, rc_scd_type_list[i])) {
00230                         return (i + RST_min);
00231                 }
00232         }
00233         return (get_scd_type_nr(name));
00234 };

char* get_rc_special_right_name ( char *  name,
enum rsbac_rc_special_rights_t  value 
)

Definition at line 274 of file rc_getname.c.

References get_request_name(), NULL, rc_special_right_list, RCR_NONE, and RSBAC_RC_SPECIAL_RIGHT_BASE.

Referenced by check_comp_rc(), and rsbac_rc_check_type_comp().

00276 {
00277         if (!name)
00278                 return (NULL);
00279         if (value < RSBAC_RC_SPECIAL_RIGHT_BASE) {
00280                 return (get_request_name(name, value));
00281         }
00282         value -= RSBAC_RC_SPECIAL_RIGHT_BASE;
00283         if (value > RCR_NONE) {
00284                 strcpy(name, "ERROR!");
00285                 return (name);
00286         }
00287         strcpy(name, rc_special_right_list[value]);
00288         return (name);
00289 };

enum rsbac_rc_special_rights_t get_rc_special_right_nr ( const char *  name  ) 

Definition at line 292 of file rc_getname.c.

References get_request_nr(), rc_special_right_list, RCR_NONE, and RSBAC_RC_SPECIAL_RIGHT_BASE.

00293 {
00294         enum rsbac_rc_special_rights_t i;
00295 
00296         if (!name)
00297                 return (RCR_NONE);
00298         for (i = 0; i < (RCR_NONE - RSBAC_RC_SPECIAL_RIGHT_BASE); i++) {
00299                 if (!strcmp(name, rc_special_right_list[i])) {
00300                         return (i + RSBAC_RC_SPECIAL_RIGHT_BASE);
00301                 }
00302         }
00303         return (get_request_nr(name));
00304 }

char* get_rc_target_name ( char *  name,
enum rsbac_rc_target_t  value 
)

Definition at line 156 of file rc_getname.c.

References NULL, rc_target_list, and RT_NONE.

00157 {
00158         if (!name)
00159                 return (NULL);
00160         if (value > RT_NONE)
00161                 strcpy(name, "ERROR!");
00162         else
00163                 strcpy(name, rc_target_list[value]);
00164         return (name);
00165 };

enum rsbac_rc_target_t get_rc_target_nr ( const char *  name  ) 

Definition at line 167 of file rc_getname.c.

References rc_target_list, and RT_NONE.

00168 {
00169         enum rsbac_rc_target_t i;
00170 
00171         if (!name)
00172                 return (RT_NONE);
00173         for (i = 0; i < RT_NONE; i++) {
00174                 if (!strcmp(name, rc_target_list[i])) {
00175                         return (i);
00176                 }
00177         }
00178         return (RT_NONE);
00179 };


Generated on Wed May 16 11:54:02 2007 for RSBAC by  doxygen 1.5.1