--- zzzz-none-000/linux-2.6.19.2/net/core/dev.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/net/core/dev.c 2007-07-03 11:34:51.000000000 +0000 @@ -149,6 +149,7 @@ static DEFINE_SPINLOCK(ptype_lock); static struct list_head ptype_base[16]; /* 16 way hashed list */ static struct list_head ptype_all; /* Taps */ +static int (*avm_recvhook)(struct sk_buff *skb); #ifdef CONFIG_NET_DMA static struct dma_client *net_dma_client; @@ -226,6 +227,13 @@ *******************************************************************************/ +void set_avm_recvhook(int (*recvhook)(struct sk_buff *skb)) +{ + spin_lock_bh(&ptype_lock); + avm_recvhook = recvhook; + spin_unlock_bh(&ptype_lock); +} + /* * For efficiency */ @@ -1827,6 +1835,14 @@ ncls: #endif + if (avm_recvhook && (*avm_recvhook)(skb)) { + /* + * paket consumed by hook + */ + ret = NET_RX_SUCCESS; + goto out; + } + handle_diverter(skb); if (handle_bridge(&skb, &pt_prev, &ret, orig_dev)) @@ -3598,3 +3614,5 @@ #endif EXPORT_PER_CPU_SYMBOL(softnet_data); + +EXPORT_SYMBOL(set_avm_recvhook);