aa_dfa_match_len(9)
β¨ aa_dfa_match_len β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is aa_dfa_match_len(9) π
like yes she's a kernel function, no she's not scary, let's go.
π NAME π
aa_dfa_match_len β traverse @dfa to find state @str stops at
πΈ SYNOPSIS πΈ
aa_state_t aa_dfa_match_len (const struct aa_dfa *dfa , aa_state_t start
, const char *str , int len );
π ARGUMENTS π
dfaβ the dfa you're matchingstragainst. NOT NULL bestie, like do not even try it πstartβ the state of the dfa where matching begins. your starting point, your main character entrance β¨strβ the string of bytes you're matching against the dfa. also NOT NULL π«Άlenβ how long that string of bytes is, aka how many bytes we're feeding her π
π¦ DESCRIPTION π¦
aa_dfa_match_len matches str against the dfa and hands back the state it finished matching in. that final state is genuinely useful β you can use it to look up the accepting label, or as the start state of a continuing match. lowkey iconic how one state does both π«
and here's the lil quirk you need to know: this function will happily match again the 0 byte and only finishes when len input is consumed. she's not looking for a null terminator, she's counting bytes, periodt π so len is the whole vibe check here.
π₯ RETURN π₯
the final state reached after input is consumed π
π SEE ALSO π
Kernel file ./security/apparmor/match.c unpack_table(9), verify_table_headers(9), verify_dfa(9), dfa_free(9), aa_dfa_free_kref(9), remap_data16_to_data32(9), aa_dfa_unpack(9), aa_dfa_match(9), aa_dfa_next(9), aa_dfa_match_until(9), aa_dfa_matchn_until(9), aa_dfa_leftmatch(9)
and that's the whole page, bestie, go forth and match some bytes π this lil cutie lives in ./security/apparmor and the manual's dated October 2026 β mwah, see u in the group chat π§πβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms