qpol_internal.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QPOL_INTERNAL_H
00026 #define QPOL_INTERNAL_H
00027
00028 #ifdef __cplusplus
00029 extern "C"
00030 {
00031 #endif
00032
00033 #include <sepol/handle.h>
00034 #include <qpol/policy.h>
00035 #include <stdio.h>
00036
00037 #define STATUS_SUCCESS 0
00038 #define STATUS_ERR -1
00039 #define STATUS_NODATA 1
00040
00041 #define QPOL_MSG_ERR 1
00042 #define QPOL_MSG_WARN 2
00043 #define QPOL_MSG_INFO 3
00044
00045 struct qpol_extended_image;
00046 struct qpol_policy;
00047
00048 struct qpol_module
00049 {
00050 char *name;
00051 char *path;
00052 char *version;
00053 int type;
00054 struct sepol_policydb *p;
00055 int enabled;
00056 struct qpol_policy *parent;
00057 };
00058
00059 struct qpol_policy
00060 {
00061 struct sepol_policydb *p;
00062 struct sepol_handle *sh;
00063 qpol_callback_fn_t fn;
00064 void *varg;
00065 int options;
00066 int type;
00067 int modified;
00068 struct qpol_extended_image *ext;
00069 struct qpol_module **modules;
00070 size_t num_modules;
00071 char *file_data;
00072 size_t file_data_sz;
00073 int file_data_type;
00074 };
00075
00076
00077
00078
00079
00080 #define QPOL_POLICY_FILE_DATA_TYPE_BIN 0
00081 #define QPOL_POLICY_FILE_DATA_TYPE_MMAP 1
00082 #define QPOL_POLICY_FILE_DATA_TYPE_MEM 2
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 int policy_extend(qpol_policy_t * policy);
00095
00096 extern void qpol_handle_msg(const qpol_policy_t * policy, int level, const char *fmt, ...);
00097 int qpol_is_file_binpol(FILE * fp);
00098 int qpol_is_file_mod_pkg(FILE * fp);
00099
00100
00101
00102
00103
00104
00105
00106 int qpol_binpol_version(FILE * fp);
00107
00108 #define ERR(policy, format, ...) qpol_handle_msg(policy, QPOL_MSG_ERR, format, __VA_ARGS__)
00109 #define WARN(policy, format, ...) qpol_handle_msg(policy, QPOL_MSG_WARN, format, __VA_ARGS__)
00110 #define INFO(policy, format, ...) qpol_handle_msg(policy, QPOL_MSG_INFO, format, __VA_ARGS__)
00111
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115
00116 #endif