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()
150 static struct aa_perms *compute_fperms(struct aa_dfa *dfa, in compute_fperms() argument
157 AA_BUG(!dfa); in compute_fperms()
159 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in compute_fperms()
167 table[state * 2] = compute_fperms_user(dfa, state); in compute_fperms()
168 table[state * 2 + 1] = compute_fperms_other(dfa, state); in compute_fperms()
210 static struct aa_perms compute_perms_entry(struct aa_dfa *dfa, in compute_perms_entry() argument
216 perms.allow = dfa_user_allow(dfa, state); in compute_perms_entry()
217 perms.audit = dfa_user_audit(dfa, state); in compute_perms_entry()
218 perms.quiet = dfa_user_quiet(dfa, state); in compute_perms_entry()
231 perms.allow |= map_other(dfa_other_allow(dfa, state)); in compute_perms_entry()
235 perms.allow |= map_xbits(dfa_user_xbits(dfa, state)); in compute_perms_entry()
241 perms.audit |= map_other(dfa_other_audit(dfa, state)); in compute_perms_entry()
242 perms.quiet |= map_other(dfa_other_quiet(dfa, state)); in compute_perms_entry()
244 perms.quiet |= map_xbits(dfa_other_xbits(dfa, state)); in compute_perms_entry()
249 static struct aa_perms *compute_perms(struct aa_dfa *dfa, u32 version, in compute_perms() argument
256 AA_BUG(!dfa); in compute_perms()
258 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in compute_perms()
267 table[state] = compute_perms_entry(dfa, state, version); in compute_perms()
282 static void remap_dfa_accept(struct aa_dfa *dfa, unsigned int factor) in remap_dfa_accept() argument
285 unsigned int state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in remap_dfa_accept()
287 AA_BUG(!dfa); in remap_dfa_accept()
290 ACCEPT_TABLE(dfa)[state] = state * factor; in remap_dfa_accept() local
291 kvfree(dfa->tables[YYTD_ID_ACCEPT2]); in remap_dfa_accept()
292 dfa->tables[YYTD_ID_ACCEPT2] = NULL; in remap_dfa_accept()
298 policy->perms = compute_xmatch_perms(policy->dfa, &policy->size); in aa_compat_map_xmatch()
302 remap_dfa_accept(policy->dfa, 1); in aa_compat_map_xmatch()
309 policy->perms = compute_perms(policy->dfa, version, &policy->size); in aa_compat_map_policy()
313 remap_dfa_accept(policy->dfa, 1); in aa_compat_map_policy()
320 policy->perms = compute_fperms(policy->dfa, &policy->size); in aa_compat_map_file()
324 remap_dfa_accept(policy->dfa, 2); in aa_compat_map_file()