Home | History | Annotate | Download | only in cil
      1 #ifndef _SEPOL_ANDROID_H_
      2 #define _SEPOL_ANDROID_H_
      3 #include <cil/cil.h>
      4 
      5 #define PLAT_VERS "curr"
      6 #define PLAT_ID "p"
      7 #define NON_PLAT_ID "n"
      8 
      9 /*
     10  * cil_android_attrib_mapping - extract attributizable elements of the policy in
     11  * srcdb and create the mapping file necessary to link the platform and
     12  * non-platform policy files after non-platform policy attributization.
     13  *   mdb - uninitialized cil_db reference to the resulting policy. Caller
     14  *         responsibility to destroy.
     15  *   srcdb - initialized and parsed cil_db reference to source public policy.
     16  *   num - the version string to append types when converted to attributes.
     17  * returns SEPOL_OK if successful, otherwise passes on the encountered error.
     18  */
     19 int cil_android_attrib_mapping(struct cil_db **mdb, struct cil_db *srcdb, const char *num);
     20 
     21 /*
     22  * cil_android_attributize - extract attributizable elements of the policy in
     23  * srcdb and convert all usage of those elements in tgtdb to versioned attributes.
     24  * Keep the attributes and type definitions so that tgtdb policy is more robust
     25  * against future changes to the public policy.
     26  *   tgtdb - initialized and parsed cil_db reference to modify.
     27  *   srcdb - initialized and parsed cil_db reference to source public policy
     28  *           from which to extract attributizable elements.
     29  *   num - the version string to append types when converted to attributes.
     30  * returns SEPOL_OK if successful, otherwise passes on the encountered error.
     31  */
     32 int cil_android_attributize(struct cil_db *tgtdb, struct cil_db *srcdb, const char *num);
     33 
     34 #endif /* _SEPOL_ANDROID_H_ */
     35