]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
Is able of classifying acording to single CAN ID passed from userspace.
authorRostislav Lisovy <lisovy@gmail.com>
Mon, 8 Aug 2011 12:10:44 +0000 (14:10 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Mon, 8 Aug 2011 12:10:44 +0000 (14:10 +0200)
net/sched/cls_canprio.c

index 9c3b9943a39aa0ef40bec23c534883049c9a25c7..a4e2aa63be45b6a72bbf2cd0cc5b8c441594cf13 100644 (file)
@@ -85,7 +85,9 @@ static int canprio_classify(struct sk_buff *skb, struct tcf_proto *tp,
        printk(" canprio_classify invoked\n");
 
        list_for_each_entry(f, &head->flist, link) {
-               if (canprio_get_id(skb) == 123) { // Should match value given by user
+               printk("  canprio_classify can ID = 0x%x\n", canprio_get_id(skb));
+               if (canprio_get_id(skb) == f->match) {
+                       printk( "   canprio_classify match ID 0x%x\n", f->match);
                        *res = f->res;
                        return TC_POLICE_OK;
                }
@@ -215,7 +217,7 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle,
 
        //f->match = nla_data(tb[TCA_CANPRIO_MATCH]);
        f->match = nla_get_u32(tb[TCA_CANPRIO_MATCH]);
-       printk(" match = %d\n", f->match);
+       printk(" can ID to match = 0x%x\n", f->match);
 
        //Add newly created filter to list of all filters
        tcf_tree_lock(tp);