Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Why doesn't the pfil filter module attach to the active ethernet driver?: (2 Items)
   
Why doesn't the pfil filter module attach to the active ethernet driver?  
Hi,
     Isn't the ethernet driver mounted first than the pfil filter module. If that is the case then why doesn't the pfil 
filter module attach to the active ethernet driver by itself when mounted.

How can I explicitily attach a pfil filter module to already mounted ethernet driver?  If I do it, I get an error saying
 the resource is busy. And that is what even I was expecting. The ethernet driver is already mounted after startup.

Is it not true that pfil filter module has to be mounted only after the ethernet driver is loaded. Only then it makes 
sense for data extraction on the stack. 

Please correct me if I am wrong.

All I want to do is attach my pfil filter module to my devn-i82544.so driver module which is already mounted.

Thanks
Vinod
Re: Why doesn't the pfil filter module attach to the active ethernet driver?  
On 14/01/10 03:30 PM, Vinod Kolapuram wrote:
> Hi,
>       Isn't the ethernet driver mounted first than the pfil filter module. If that is the case then why doesn't the 
pfil filter module attach to the active ethernet driver by itself when mounted.
>    
I think I wrote it elsewhere too just a few minutes ago, so sorry for 
the repetition. Your filter module registers with the stack, not with a 
driver directly.
> How can I explicitily attach a pfil filter module to already mounted ethernet driver?  If I do it, I get an error 
saying the resource is busy. And that is what even I was expecting. The ethernet driver is already mounted after startup
.
>    
I'm not sure what you mean when you say you try explicitly attach a pfil 
filter module to an ethernet driver, what commands did you do?

> Is it not true that pfil filter module has to be mounted only after the ethernet driver is loaded. Only then it makes 
sense for data extraction on the stack.
>    
It's not true. The network drivers can be mounted at any time before or 
after the packet filter module. Yes, the filter will only get some data 
packets once there's at least one network driver mounted so that there 
is at least one network interface to get packets from the network.

> Please correct me if I am wrong.
>
> All I want to do is attach my pfil filter module to my devn-i82544.so driver module which is already mounted.
>    
This request doesn't make sense, please see above and previous posts. 
I'm must assume you want to get packets from network interfaces that 
this particular driver is creating?

The example filter module on the wiki 
(http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Filtering_wiki_page) 
will get the input/output_hook() functions invoked with packets 
sent/received by the stack. The arguments to this function can be used 
to determine where the packets are going to/from etc.

If you're interested in digging deeper into this topic, try printing 
some of the contents of the arguments of the hooks and look at other 
code that's using the pf API (e.g. nraw and autoip: 
http://community.qnx.com/integration/viewvc/viewvc.cgi/trunk/lib/io-pkt/sys/lsm/?root=core_networking&system=exsy1001)

Hope this helps!
/P