Lines Matching refs:p

36 int mls_compute_context_len(struct policydb *p, struct context *context)  in mls_compute_context_len()  argument
43 if (!p->mls_enabled) in mls_compute_context_len()
49 len += strlen(sym_name(p, SYM_LEVELS, index_sens - 1)); in mls_compute_context_len()
59 nm = sym_name(p, SYM_CATS, prev); in mls_compute_context_len()
62 nm = sym_name(p, SYM_CATS, i); in mls_compute_context_len()
69 nm = sym_name(p, SYM_CATS, prev); in mls_compute_context_len()
89 void mls_sid_to_context(struct policydb *p, in mls_sid_to_context() argument
98 if (!p->mls_enabled) in mls_sid_to_context()
107 strcpy(scontextp, sym_name(p, SYM_LEVELS, in mls_sid_to_context()
123 nm = sym_name(p, SYM_CATS, prev); in mls_sid_to_context()
131 nm = sym_name(p, SYM_CATS, i); in mls_sid_to_context()
144 nm = sym_name(p, SYM_CATS, prev); in mls_sid_to_context()
161 int mls_level_isvalid(struct policydb *p, struct mls_level *l) in mls_level_isvalid() argument
165 if (!l->sens || l->sens > p->p_levels.nprim) in mls_level_isvalid()
167 levdatum = symtab_search(&p->p_levels, in mls_level_isvalid()
168 sym_name(p, SYM_LEVELS, l->sens - 1)); in mls_level_isvalid()
178 p->p_cats.nprim); in mls_level_isvalid()
181 int mls_range_isvalid(struct policydb *p, struct mls_range *r) in mls_range_isvalid() argument
183 return (mls_level_isvalid(p, &r->level[0]) && in mls_range_isvalid()
184 mls_level_isvalid(p, &r->level[1]) && in mls_range_isvalid()
192 int mls_context_isvalid(struct policydb *p, struct context *c) in mls_context_isvalid() argument
196 if (!p->mls_enabled) in mls_context_isvalid()
199 if (!mls_range_isvalid(p, &c->range)) in mls_context_isvalid()
208 if (!c->user || c->user > p->p_users.nprim) in mls_context_isvalid()
210 usrdatum = p->user_val_to_struct[c->user - 1]; in mls_context_isvalid()
361 int mls_from_string(struct policydb *p, char *str, struct context *context, in mls_from_string() argument
367 if (!p->mls_enabled) in mls_from_string()
374 rc = mls_context_to_sid(p, ':', tmpstr, context, in mls_from_string()
402 int mls_setup_user_range(struct policydb *p, in mls_setup_user_range() argument
406 if (p->mls_enabled) { in mls_setup_user_range()
489 int mls_compute_sid(struct policydb *p, in mls_compute_sid() argument
502 if (!p->mls_enabled) in mls_compute_sid()
511 r = policydb_rangetr_search(p, &rtr); in mls_compute_sid()
515 if (tclass && tclass <= p->p_classes.nprim) { in mls_compute_sid()
516 cladatum = p->class_val_to_struct[tclass - 1]; in mls_compute_sid()
541 if ((tclass == p->process_class) || sock) in mls_compute_sid()
566 void mls_export_netlbl_lvl(struct policydb *p, in mls_export_netlbl_lvl() argument
570 if (!p->mls_enabled) in mls_export_netlbl_lvl()
588 void mls_import_netlbl_lvl(struct policydb *p, in mls_import_netlbl_lvl() argument
592 if (!p->mls_enabled) in mls_import_netlbl_lvl()
610 int mls_export_netlbl_cat(struct policydb *p, in mls_export_netlbl_cat() argument
616 if (!p->mls_enabled) in mls_export_netlbl_cat()
640 int mls_import_netlbl_cat(struct policydb *p, in mls_import_netlbl_cat() argument
646 if (!p->mls_enabled) in mls_import_netlbl_cat()