Lines Matching refs:tree

162 static inline struct tcf_ematch *tcf_em_get_match(struct tcf_ematch_tree *tree,  in tcf_em_get_match()  argument
165 return &tree->matches[index]; in tcf_em_get_match()
304 struct tcf_ematch_tree *tree) in tcf_em_tree_validate() argument
312 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()
398 void tcf_em_tree_destroy(struct tcf_ematch_tree *tree) in tcf_em_tree_destroy() argument
402 if (tree->matches == NULL) in tcf_em_tree_destroy()
405 for (i = 0; i < tree->hdr.nmatches; i++) { in tcf_em_tree_destroy()
406 struct tcf_ematch *em = tcf_em_get_match(tree, i); in tcf_em_tree_destroy()
417 tree->hdr.nmatches = 0; in tcf_em_tree_destroy()
418 kfree(tree->matches); in tcf_em_tree_destroy()
419 tree->matches = NULL; in tcf_em_tree_destroy()
435 int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) in tcf_em_tree_dump() argument
446 if (nla_put(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr)) in tcf_em_tree_dump()
454 for (i = 0; i < tree->hdr.nmatches; i++) { in tcf_em_tree_dump()
456 struct tcf_ematch *em = tcf_em_get_match(tree, i); in tcf_em_tree_dump()
498 int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, in __tcf_em_tree_match() argument
506 while (match_idx < tree->hdr.nmatches) { in __tcf_em_tree_match()
507 cur_match = tcf_em_get_match(tree, match_idx); in __tcf_em_tree_match()
529 cur_match = tcf_em_get_match(tree, match_idx); in __tcf_em_tree_match()