Lines Matching refs:fp

46 		       FILE * fp)
49 fprintf(fp, "{");
52 fprintf(fp, "%s ", perm);
53 fprintf(fp, "}");
57 static int render_type(uint32_t type, policydb_t * p, FILE * fp)
59 fprintf(fp, "%s", p->p_type_val_to_name[type - 1]);
63 static int render_key(avtab_key_t * key, policydb_t * p, FILE * fp)
70 fprintf(fp, "%s %s : %s ", stype, ttype, tclass);
72 fprintf(fp, "%s %u : %s ", stype, key->target_type, tclass);
74 fprintf(fp, "%u %s : %s ", key->source_type, ttype, tclass);
76 fprintf(fp, "%u %u : %s ", key->source_type, key->target_type,
88 policydb_t * p, FILE * fp)
105 fprintf(fp, "[enabled] ");
107 fprintf(fp, "[disabled] ");
112 fprintf(fp, "allow ");
113 render_key(key, p, fp);
114 render_access_mask(datum->data, key, p, fp);
115 fprintf(fp, ";\n");
118 fprintf(fp, "auditallow ");
119 render_key(key, p, fp);
120 render_access_mask(datum->data, key, p, fp);
121 fprintf(fp, ";\n");
124 fprintf(fp, "dontaudit ");
125 render_key(key, p, fp);
128 render_access_mask(~datum->data, key, p, fp);
129 fprintf(fp, ";\n");
133 fprintf(fp, "type_transition ");
134 render_key(key, p, fp);
135 render_type(datum->data, p, fp);
136 fprintf(fp, ";\n");
139 fprintf(fp, "type_member ");
140 render_key(key, p, fp);
141 render_type(datum->data, p, fp);
142 fprintf(fp, ";\n");
145 fprintf(fp, "type_change ");
146 render_key(key, p, fp);
147 render_type(datum->data, p, fp);
148 fprintf(fp, ";\n");
152 fprintf(fp, "allowxperm ");
154 fprintf(fp, "auditallowxperm ");
156 fprintf(fp, "dontauditxperm ");
157 render_key(key, p, fp);
158 fprintf(fp, "%s;\n", sepol_extended_perms_to_string(datum->xperms));
160 fprintf(fp, " ERROR: no valid rule type specified\n");
166 static int display_avtab(avtab_t * a, uint32_t what, policydb_t * p, FILE * fp)
174 render_av_rule(&cur->key, &cur->datum, what, p, fp);
177 fprintf(fp, "\n");
181 static int display_bools(policydb_t * p, FILE * fp)
186 fprintf(fp, "%s : %d\n", p->p_bool_val_to_name[i],
192 static void display_expr(policydb_t * p, cond_expr_t * exp, FILE * fp)
199 fprintf(fp, "%s ",
203 fprintf(fp, "! ");
206 fprintf(fp, "|| ");
209 fprintf(fp, "&& ");
212 fprintf(fp, "^ ");
215 fprintf(fp, "== ");
218 fprintf(fp, "!= ");
221 fprintf(fp, "error!");
227 static int display_cond_expressions(policydb_t * p, FILE * fp)
233 fprintf(fp, "expression: ");
234 display_expr(p, cur->expr, fp);
235 fprintf(fp, "current state: %d\n", cur->cur_state);
236 fprintf(fp, "True list:\n");
238 fprintf(fp, "\t");
240 RENDER_CONDITIONAL, p, fp);
242 fprintf(fp, "False list:\n");
244 fprintf(fp, "\t");
246 RENDER_CONDITIONAL, p, fp);
263 static int change_bool(char *name, int state, policydb_t * p, FILE * fp)
269 fprintf(fp, "Could not find bool %s\n", name);
277 static void display_policycaps(policydb_t * p, FILE * fp)
284 fprintf(fp, "policy capabilities:\n");
291 fprintf(fp, "\t%s\n", capname);
295 static void display_id(policydb_t *p, FILE *fp, uint32_t symbol_type,
299 fprintf(fp, " %s%s", prefix, id);
302 static void display_permissive(policydb_t *p, FILE *fp)
307 fprintf(fp, "permissive sids:\n");
309 fprintf(fp, "\t");
310 display_id(p, fp, SYM_TYPES, i - 1, "");
311 fprintf(fp, "\n");
315 static void display_role_trans(policydb_t *p, FILE *fp)
319 fprintf(fp, "role_trans rules:\n");
321 display_id(p, fp, SYM_ROLES, rt->role - 1, "");
322 display_id(p, fp, SYM_TYPES, rt->type - 1, "");
323 display_id(p, fp, SYM_CLASSES, rt->tclass - 1, ":");
324 display_id(p, fp, SYM_ROLES, rt->new_role - 1, "");
325 fprintf(fp, "\n");
331 FILE *fp;
342 FILE *fp = args->fp;
348 display_id(p, fp, SYM_TYPES, bit, "");
349 display_id(p, fp, SYM_TYPES, ft->ttype - 1, "");
350 display_id(p, fp, SYM_CLASSES, ft->tclass - 1, ":");
351 display_id(p, fp, SYM_TYPES, ftdatum->otype - 1, "");
352 fprintf(fp, " %s\n", ft->name);
361 static void display_filename_trans(policydb_t *p, FILE *fp)
365 fprintf(fp, "filename_trans rules:\n");
367 args.fp = fp;