• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/sched/

Lines Matching refs:tree

166 static inline struct tcf_ematch * tcf_em_get_match(struct tcf_ematch_tree *tree,
169 return &tree->matches[index];
280 * tcf_em_tree_validate - validate ematch config TLV and build ematch tree
283 * @nla: ematch tree configuration TLV
284 * @tree: destination ematch tree variable to store the resulting
285 * ematch tree.
288 * ematch tree in @tree. The resulting tree must later be copied into
290 * provide the ematch tree variable of the private classifier data directly,
296 struct tcf_ematch_tree *tree)
304 memset(tree, 0, sizeof(*tree));
320 memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr));
326 tree->matches = kzalloc(matches_len, GFP_KERNEL);
327 if (tree->matches == NULL)
350 em = tcf_em_get_match(tree, idx);
373 tcf_em_tree_destroy(tp, tree);
379 * tcf_em_tree_destroy - destroy an ematch tree
382 * @tree: ematch tree to be deleted
384 * This functions destroys an ematch tree previously created by
386 * the ematch tree is not in use before calling this function.
388 void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree)
392 if (tree->matches == NULL)
395 for (i = 0; i < tree->hdr.nmatches; i++) {
396 struct tcf_ematch *em = tcf_em_get_match(tree, i);
407 tree->hdr.nmatches = 0;
408 kfree(tree->matches);
409 tree->matches = NULL;
414 * tcf_em_tree_dump - dump ematch tree into a rtnl message
417 * @t: ematch tree to be dumped
418 * @tlv: TLV type to be used to encapsulate the tree
420 * This function dumps a ematch tree into a rtnl message. It is valid to
421 * call this function while the ematch tree is in use.
425 int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv)
436 NLA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr);
443 for (i = 0; i < tree->hdr.nmatches; i++) {
445 struct tcf_ematch *em = tcf_em_get_match(tree, i);
485 int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree,
493 while (match_idx < tree->hdr.nmatches) {
494 cur_match = tcf_em_get_match(tree, match_idx);
516 cur_match = tcf_em_get_match(tree, match_idx);