[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1319008331.17914.4.camel@edumazet-laptop>
Date: Wed, 19 Oct 2011 09:12:11 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: raviraj joshi <raviraj.j1991@...il.com>
Cc: netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
netfilter@...r.kernel.org
Subject: Re: kenel level packet capturing
Le mercredi 19 octobre 2011 à 12:24 +0530, raviraj joshi a écrit :
> Hi,
>
> We are making a kernel level packet capture module as a part of our BE project .
> We are finding it difficult to understand kenel networking code.
> We studied structures and functions like sk_buff, netif_rx(),dev_alloc_skb.
>
> However we were not able to trace the actual path a simple packet follows.
>
> Moreover we tried to count the no of times netif_rx function was
> called it was much much lower than amount of packets actually being
> received.
>
> Can anyone please let us know the reason for this and how to approach
> the problem of writing a kernel level packet capture module ,resoruces
> we need to refer to (we are currently constrained to documents on
> kernel-networking available online).
>
Most drivers call netif_receive_skb() from softirq handler
netif_rx() is used only on cases where we are in hard irq handler, or we
want to avoid a recursion (tunnels for example)
To install a packet capture, you should take a look at dev_add_pack()
and friends [ net/packet/af_packet.c being a good reference ]
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists