Example #1
0
static Action_SkBuff
inc_counter(arguments_t args, SkBuff b)
{
        const int idx = GET_ARG(int,args);

        sparse_counter_t * ctr;

        ctr = get_counter(b, idx);
        if (ctr)  {
                sparse_inc(ctr);
        }
        else {
                if (printk_ratelimit())
                        printk(KERN_INFO "[PFQ/lang] counter[%d]: bad index!\n", idx);
        }

        return Pass(b);
}
Example #2
0
File: misc.c Project: prodigeni/PFQ
static struct sk_buff *
inc_counter(arguments_t args, struct sk_buff *skb)
{
        const int idx = get_data(int,args);

        sparse_counter_t * ctr;

        ctr = get_counter(skb, idx);
        if (ctr)  {
                sparse_inc(ctr);
        }
        else {
                if (printk_ratelimit())
                        printk(KERN_INFO "[PFQ] fun/count(%d): bad index!\n", idx);
        }

        return skb;
}