Lines Matching refs:fp
47 FILE * fp)
50 fprintf(fp, "{");
53 fprintf(fp, "%s ", perm);
54 fprintf(fp, "}");
58 int render_type(uint32_t type, policydb_t * p, FILE * fp)
60 fprintf(fp, "%s", p->p_type_val_to_name[type - 1]);
64 int render_key(avtab_key_t * key, policydb_t * p, FILE * fp)
71 fprintf(fp, "%s %s : %s ", stype, ttype, tclass);
73 fprintf(fp, "%s %u : %s ", stype, key->target_type, tclass);
75 fprintf(fp, "%u %s : %s ", key->source_type, ttype, tclass);
77 fprintf(fp, "%u %u : %s ", key->source_type, key->target_type,
89 policydb_t * p, FILE * fp)
106 fprintf(fp, "[enabled] ");
108 fprintf(fp, "[disabled] ");
113 fprintf(fp, "allow ");
114 render_key(key, p, fp);
115 render_access_mask(datum->data, key, p, fp);
116 fprintf(fp, ";\n");
119 fprintf(fp, "auditallow ");
120 render_key(key, p, fp);
121 render_access_mask(datum->data, key, p, fp);
122 fprintf(fp, ";\n");
125 fprintf(fp, "dontaudit ");
126 render_key(key, p, fp);
129 render_access_mask(~datum->data, key, p, fp);
130 fprintf(fp, ";\n");
134 fprintf(fp, "type_transition ");
135 render_key(key, p, fp);
136 render_type(datum->data, p, fp);
137 fprintf(fp, ";\n");
140 fprintf(fp, "type_member ");
141 render_key(key, p, fp);
142 render_type(datum->data, p, fp);
143 fprintf(fp, ";\n");
146 fprintf(fp, "type_change ");
147 render_key(key, p, fp);
148 render_type(datum->data, p, fp);
149 fprintf(fp, ";\n");
152 fprintf(fp, " ERROR: no valid rule type specified\n");
158 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);
178 fprintf(fp, "\n");
185 int display_bools(policydb_t * p, FILE * fp)
190 fprintf(fp, "%s : %d\n", p->p_bool_val_to_name[i],
196 void display_expr(policydb_t * p, cond_expr_t * exp, FILE * fp)
203 fprintf(fp, "%s ",
207 fprintf(fp, "! ");
210 fprintf(fp, "|| ");
213 fprintf(fp, "&& ");
216 fprintf(fp, "^ ");
219 fprintf(fp, "== ");
222 fprintf(fp, "!= ");
225 fprintf(fp, "error!");
231 int display_cond_expressions(policydb_t * p, FILE * fp)
238 fprintf(fp, "expression: ");
239 display_expr(p, cur->expr, fp);
240 fprintf(fp, "current state: %d\n", cur->cur_state);
241 fprintf(fp, "True list:\n");
249 fprintf(fp, "\t");
251 RENDER_CONDITIONAL, p, fp);
255 fprintf(fp, "False list:\n");
263 fprintf(fp, "\t");
265 RENDER_CONDITIONAL, p, fp);
288 int change_bool(char *name, int state, policydb_t * p, FILE * fp)
294 fprintf(fp, "Could not find bool %s\n", name);
302 static void display_policycaps(policydb_t * p, FILE * fp)
309 fprintf(fp, "policy capabilities:\n");
317 fprintf(fp, "\t%s\n", capname);
322 static void display_id(policydb_t *p, FILE *fp, uint32_t symbol_type,
326 fprintf(fp, " %s%s", prefix, id);
329 static void display_permissive(policydb_t *p, FILE *fp)
334 fprintf(fp, "permissive sids:\n");
337 fprintf(fp, "\t");
338 display_id(p, fp, SYM_TYPES, i - 1, "");
339 fprintf(fp, "\n");
344 static void display_role_trans(policydb_t *p, FILE *fp)
348 fprintf(fp, "role_trans rules:\n");
350 display_id(p, fp, SYM_ROLES, rt->role - 1, "");
351 display_id(p, fp, SYM_TYPES, rt->type - 1, "");
352 display_id(p, fp, SYM_CLASSES, rt->tclass - 1, ":");
353 display_id(p, fp, SYM_ROLES, rt->new_role - 1, "");
354 fprintf(fp, "\n");
358 static void display_filename_trans(policydb_t *p, FILE *fp)
362 fprintf(fp, "filename_trans rules:\n");
364 display_id(p, fp, SYM_TYPES, ft->stype - 1, "");
365 display_id(p, fp, SYM_TYPES, ft->ttype - 1, "");
366 display_id(p, fp, SYM_CLASSES, ft->tclass - 1, ":");
367 display_id(p, fp, SYM_TYPES, ft->otype - 1, "");
368 fprintf(fp, " %s\n", ft->name);