Skip to contentSkip to conversation

capture arp in hook and queue to userspace

DISCUSSION Magnus Westbergh 1 participant 1 message Aug 25, 2004

lore
Share & tools
lore
#0 lore raw

Hello,

I intend to capture all incoming packets (IP and ARP) and queue them for userspace using the ip_queue module, and let my userspace application make all verdicts. I have written a module using netfilter, and successfully queued all IP-packets, but now I have no clue how to capture the ARP packets, using this hook...

my_pre.hook        = my_in_hook;
my_pre.hooknum     = NF_IP_PRE_ROUTING;
my_pre.pf          = PF_INET;
my_pre.priority    = NF_IP_PRI_FIRST; 

unsigned int my_in_hook( unsigned int hooknum,
struct sk_buff **skb, const struct net_device *in, const struct net_device *out, int ( *okfn ) ( struct sk_buff *) )

How does the ARP hook work? What do I have to change to capture all ARP packets? Please show me an example
Thanks for helping me,

Sincerely Magnus