Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\match.c Create Date:2022-07-28 19:51:05
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:leftmatch_fb

Proto:static unsigned int leftmatch_fb(struct aa_dfa *dfa, unsigned int start, const char *str, struct match_workbuf *wb, unsigned int *count)

Type:unsigned int

Parameter:

TypeParameterName
struct aa_dfa *dfa
unsigned intstart
const char *str
struct match_workbuf *wb
unsigned int *count
651  def = DEFAULT_TABLE(dfa)
652  base = BASE_TABLE(dfa)
653  next = NEXT_TABLE(dfa)
654  check = CHECK_TABLE(dfa)
655  state = start
657  AA_BUG(!dfa)
658  AA_BUG(!str)
659  AA_BUG(!wb)
660  AA_BUG(!count)
662  count = 0
663  If state == 0 Then Return 0
667  If tables[YYTD_ID_EC] Then
669  equiv = EQUIV_TABLE(dfa)
671  When str cycle
674  history[pos] = state
675  pos = base_idx(base[state]) + equiv[(u8) * str++]
676  If check[pos] == state Then state = next[pos]
678  Else state = def[state]
685  inc_wb_pos(wb)
686  count++
688  Else
690  When str cycle
693  history[pos] = state
694  pos = base_idx(base[state]) + (u8) * str++
695  If check[pos] == state Then state = next[pos]
697  Else state = def[state]
704  inc_wb_pos(wb)
705  count++
709  out :
710  If Not state Then count = 0
712  Return state
Caller
NameDescribe
aa_dfa_leftmatchaa_dfa_leftmatch - traverse @dfa to find state @str stops at*@dfa: the dfa to match @str against (NOT NULL)*@start: the state of the dfa to start matching in*@str: the null terminated string of bytes to match against the dfa (NOT NULL)