static Action_SkBuff dec_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_dec(ctr); } else { if (printk_ratelimit()) printk(KERN_INFO "[PFQ/lang] counter[%d]: bad index!\n", idx); } return Pass(b); }
static struct sk_buff * dec_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_dec(ctr); } else { if (printk_ratelimit()) printk(KERN_INFO "[PFQ] fun/count(%d): bad index!\n", idx); } return skb; }