Lines Matching refs:tree

166 static inline struct tcf_ematch *tcf_em_get_match(struct tcf_ematch_tree *tree,  in tcf_em_get_match()  argument
169 return &tree->matches[index]; in tcf_em_get_match()
305 struct tcf_ematch_tree *tree) in tcf_em_tree_validate() argument
313 memset(tree, 0, sizeof(*tree)); in tcf_em_tree_validate()
329 memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr)); in tcf_em_tree_validate()
335 tree->matches = kzalloc(matches_len, GFP_KERNEL); in tcf_em_tree_validate()
336 if (tree->matches == NULL) in tcf_em_tree_validate()
360 em = tcf_em_get_match(tree, idx); in tcf_em_tree_validate()
384 tcf_em_tree_destroy(tree); in tcf_em_tree_validate()
399 void tcf_em_tree_destroy(struct tcf_ematch_tree *tree) in tcf_em_tree_destroy() argument
403 if (tree->matches == NULL) in tcf_em_tree_destroy()
406 for (i = 0; i < tree->hdr.nmatches; i++) { in tcf_em_tree_destroy()
407 struct tcf_ematch *em = tcf_em_get_match(tree, i); in tcf_em_tree_destroy()
418 tree->hdr.nmatches = 0; in tcf_em_tree_destroy()
419 kfree(tree->matches); in tcf_em_tree_destroy()
420 tree->matches = NULL; in tcf_em_tree_destroy()
436 int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) in tcf_em_tree_dump() argument
447 if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr)) in tcf_em_tree_dump()
455 for (i = 0; i < tree->hdr.nmatches; i++) { in tcf_em_tree_dump()
457 struct tcf_ematch *em = tcf_em_get_match(tree, i); in tcf_em_tree_dump()
499 int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, in __tcf_em_tree_match() argument
507 while (match_idx < tree->hdr.nmatches) { in __tcf_em_tree_match()
508 cur_match = tcf_em_get_match(tree, match_idx); in __tcf_em_tree_match()
530 cur_match = tcf_em_get_match(tree, match_idx); in __tcf_em_tree_match()