aa_dfa_match_len(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 matching str against. 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