Lines Matching refs:dfa

53 #define dfa_user_allow(dfa, state) (((ACCEPT_TABLE(dfa)[state]) & 0x7f) | \  argument
54 ((ACCEPT_TABLE(dfa)[state]) & 0x80000000))
55 #define dfa_user_xbits(dfa, state) (((ACCEPT_TABLE(dfa)[state]) >> 7) & 0x7f) argument
56 #define dfa_user_audit(dfa, state) ((ACCEPT_TABLE2(dfa)[state]) & 0x7f) argument
57 #define dfa_user_quiet(dfa, state) (((ACCEPT_TABLE2(dfa)[state]) >> 7) & 0x7f) argument
58 #define dfa_user_xindex(dfa, state) \ argument
59 (dfa_map_xindex(ACCEPT_TABLE(dfa)[state] & 0x3fff))
61 #define dfa_other_allow(dfa, state) ((((ACCEPT_TABLE(dfa)[state]) >> 14) & \ argument
63 ((ACCEPT_TABLE(dfa)[state]) & 0x80000000))
64 #define dfa_other_xbits(dfa, state) \ argument
65 ((((ACCEPT_TABLE(dfa)[state]) >> 7) >> 14) & 0x7f)
66 #define dfa_other_audit(dfa, state) (((ACCEPT_TABLE2(dfa)[state]) >> 14) & 0x7f) argument
67 #define dfa_other_quiet(dfa, state) \ argument
68 ((((ACCEPT_TABLE2(dfa)[state]) >> 7) >> 14) & 0x7f)
69 #define dfa_other_xindex(dfa, state) \ argument
70 dfa_map_xindex((ACCEPT_TABLE(dfa)[state] >> 14) & 0x3fff)
100 static void compute_fperms_allow(struct aa_perms *perms, struct aa_dfa *dfa, in compute_fperms_allow() argument
106 if (ACCEPT_TABLE(dfa)[state] & 0x80000000) in compute_fperms_allow()
108 if (ACCEPT_TABLE(dfa)[state] & 0x40000000) in compute_fperms_allow()
112 static struct aa_perms compute_fperms_user(struct aa_dfa *dfa, in compute_fperms_user() argument
117 perms.allow = map_old_perms(dfa_user_allow(dfa, state)); in compute_fperms_user()
118 perms.audit = map_old_perms(dfa_user_audit(dfa, state)); in compute_fperms_user()
119 perms.quiet = map_old_perms(dfa_user_quiet(dfa, state)); in compute_fperms_user()
120 perms.xindex = dfa_user_xindex(dfa, state); in compute_fperms_user()
122 compute_fperms_allow(&perms, dfa, state); in compute_fperms_user()
127 static struct aa_perms compute_fperms_other(struct aa_dfa *dfa, in compute_fperms_other() argument
132 perms.allow = map_old_perms(dfa_other_allow(dfa, state)); in compute_fperms_other()
133 perms.audit = map_old_perms(dfa_other_audit(dfa, state)); in compute_fperms_other()
134 perms.quiet = map_old_perms(dfa_other_quiet(dfa, state)); in compute_fperms_other()
135 perms.xindex = dfa_other_xindex(dfa, state); in compute_fperms_other()
137 compute_fperms_allow(&perms, dfa, state); in compute_fperms_other()
149 static struct aa_perms *compute_fperms(struct aa_dfa *dfa) in compute_fperms() argument
155 AA_BUG(!dfa); in compute_fperms()
157 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in compute_fperms()
164 table[state * 2] = compute_fperms_user(dfa, state); in compute_fperms()
165 table[state * 2 + 1] = compute_fperms_other(dfa, state); in compute_fperms()
203 static struct aa_perms compute_perms_entry(struct aa_dfa *dfa, in compute_perms_entry() argument
209 perms.allow = dfa_user_allow(dfa, state); in compute_perms_entry()
210 perms.audit = dfa_user_audit(dfa, state); in compute_perms_entry()
211 perms.quiet = dfa_user_quiet(dfa, state); in compute_perms_entry()
224 perms.allow |= map_other(dfa_other_allow(dfa, state)); in compute_perms_entry()
228 perms.allow |= map_xbits(dfa_user_xbits(dfa, state)); in compute_perms_entry()
234 perms.audit |= map_other(dfa_other_audit(dfa, state)); in compute_perms_entry()
235 perms.quiet |= map_other(dfa_other_quiet(dfa, state)); in compute_perms_entry()
237 perms.quiet |= map_xbits(dfa_other_xbits(dfa, state)); in compute_perms_entry()
242 static struct aa_perms *compute_perms(struct aa_dfa *dfa, u32 version) in compute_perms() argument
248 AA_BUG(!dfa); in compute_perms()
250 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in compute_perms()
258 table[state] = compute_perms_entry(dfa, state, version); in compute_perms()
273 static void remap_dfa_accept(struct aa_dfa *dfa, unsigned int factor) in remap_dfa_accept() argument
276 unsigned int state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in remap_dfa_accept()
278 AA_BUG(!dfa); in remap_dfa_accept()
281 ACCEPT_TABLE(dfa)[state] = state * factor; in remap_dfa_accept() local
282 kvfree(dfa->tables[YYTD_ID_ACCEPT2]); in remap_dfa_accept()
283 dfa->tables[YYTD_ID_ACCEPT2] = NULL; in remap_dfa_accept()
289 policy->perms = compute_xmatch_perms(policy->dfa); in aa_compat_map_xmatch()
293 remap_dfa_accept(policy->dfa, 1); in aa_compat_map_xmatch()
300 policy->perms = compute_perms(policy->dfa, version); in aa_compat_map_policy()
304 remap_dfa_accept(policy->dfa, 1); in aa_compat_map_policy()
311 policy->perms = compute_fperms(policy->dfa); in aa_compat_map_file()
315 remap_dfa_accept(policy->dfa, 2); in aa_compat_map_file()