Robert craig
|
Re: when does the iface_hook() gets invoked
|
Robert craig
01/14/2010 5:25 PM
post45266
|
Re: when does the iface_hook() gets invoked
Hi Vinod:
I think that the confusion is coming from the fact that the pfil hook attaches itself to the stack (above the driver
interface), and not into a driver .
The iface hook will get invoked when an ethernet interface is either added into the stack (mounted) or removed from the
stack (destroyed). There doesn't have to be any driver interface present when you load in the pfil hook.
The sample code does something a bit peculiar in that it detaches itself as soon as any interface is destroyed. This
was just a convenient mechanism for showing how to remove the pfil hook and not representative of any standard way of
operating.
The ifacecfg hook will get called if you re-configure any interface (e.g. by bringing any interface up or down).
Robert.
|
|
|
Patrik Lahti
|
Re: when does the iface_hook() gets invoked
|
Patrik Lahti
01/15/2010 5:14 PM
post45350
|
Re: when does the iface_hook() gets invoked
On 14/01/10 03:53 PM, Vinod Kolapuram wrote:
> Hi Patrik,
> I have added some log messages on each function of the sample pfil filter code which you are reffering
to. I even have one message when the interface is attached or detached.
> My question is, in my case when the pfil filter module is mounted manually with mount command from the shell, by then
already the ethernet driver is loaded and available.
>
Yes, the ethernet driver is already loaded an the network interfaces it
creates are already created. Hence when you load the example filter the
stack won't call any PFIL_IFNET hooks for creation of interface since
the interface already exists.
> Do you mean to say the pfil hook interface is attached to the ethernet driver when I mount the pfil filter module
>
> Or
>
> the pfil hook interface is yet to be attached to the driver. If it is yet to be attached, then how do I attach my pfil
filter module to the ethernet driver. Only then it makes sense to extract the stack data.
>
The pfil hook interface is to the stack, not the driver. Your example
pfil code is registering hooks with the stack not the driver.
> I just posted one more question please respond to that.
>
Sure, I'll try my best :-)
PS. If you need prompt support then please go through the appropriate
QNX support channels. We're a community here and everyone here makes
every attempt to help on their own time but sometimes there's a lot to
do... :-)
Hope we'll get this cleared out, have a good weekend!
/P
|
|
|