00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __RSBAC_HELPER_H
00009 #define __RSBAC_HELPER_H
00010
00011 #include <linux/types.h>
00012 #include <rsbac/types.h>
00013
00014 char * inttostr(char[], int);
00015
00016 char * ulongtostr(char[], u_long);
00017
00018
00019 char * u64tostrmac(char[], __u64);
00020
00021 #ifndef __KERNEL__
00022 char * get_user_name(rsbac_uid_t user, char * name);
00023
00024 int rsbac_get_uid_name(rsbac_uid_t * uid, char * name, char * sourcename);
00025
00026 int rsbac_get_fullname(char * fullname, rsbac_uid_t uid);
00027
00028 static inline int rsbac_get_uid(rsbac_uid_t * uid, char * sourcename)
00029 {
00030 return rsbac_get_uid_name(uid, NULL, sourcename);
00031 }
00032
00033 int rsbac_get_gid_name(rsbac_gid_t * gid, char * name, char * sourcename);
00034
00035 static inline int rsbac_get_gid(rsbac_gid_t * gid, char * sourcename)
00036 {
00037 return rsbac_get_gid_name(gid, NULL, sourcename);
00038 }
00039
00040
00041 char * u64tostrlog(char[], __u64);
00042
00043 __u64 strtou64log(char[], __u64 *);
00044
00045
00046
00047 __u64 strtou64mac(char[], __u64 *);
00048
00049
00050 char * u64tostrrc(char[], __u64);
00051
00052 __u64 strtou64rc(char[], __u64 *);
00053
00054
00055 char * u64tostrrcr(char[], __u64);
00056
00057 __u64 strtou64rcr(char[], __u64 *);
00058
00059
00060 __u64 strtou64acl(char[], __u64 *);
00061 #endif
00062
00063
00064 char * u64tostracl(char[], __u64);
00065
00066 char * longtostr(char[], long);
00067
00068 #ifdef __KERNEL__
00069 int rsbac_get_owner(rsbac_uid_t * user_p);
00070
00071 int rsbac_put_user(unsigned char *, unsigned char *, int);
00072
00073 int rsbac_get_user(unsigned char *, unsigned char *, int);
00074
00075 extern inline int clear_user_buf(char * ubuf, int len);
00076
00077 char * rsbac_getname(const char *);
00078
00079 void rsbac_putname(const char *);
00080
00081 void rsbac_get_attr_error(char * , enum rsbac_adf_request_t);
00082
00083 void rsbac_ds_get_error(char * function, enum rsbac_attribute_t attr);
00084 void rsbac_ds_set_error(char * function, enum rsbac_attribute_t attr);
00085
00086 #ifdef CONFIG_RSBAC_RC
00087 void rsbac_rc_ds_get_error(char * function, enum rsbac_rc_item_t item);
00088 void rsbac_rc_ds_set_error(char * function, enum rsbac_rc_item_t item);
00089 #endif
00090
00091 #endif
00092
00093 #endif