Converter vs. Filter DDK Question

Hello,

I am sifting through the QNX Network DDK and am trying to determine how
to create an intermediate driver that intercepts all packets between
TCPIP and Ethernet. The documentation indicates that there is an “ip-en”
converter module that sits between TCPIP and Ethernet and provides ARP
services.

My network shim would ideally sit below this ip-en converter and above
the ethernet UP_PRODUCER. The documentation seems a little ambiguous as
to whether you can specify another converter as a top_type in the
io_net_registrant_t structure. Or do i need to register myself as a
REG_FILTER_ABOVE? In the filter case would i need to specify the
top_type at all?

Any insight would be helpful.

Steve.

Steven Erickson <sojg@mediaone.net> wrote:

Hello,

I am sifting through the QNX Network DDK and am trying to determine how
to create an intermediate driver that intercepts all packets between
TCPIP and Ethernet. The documentation indicates that there is an “ip-en”
converter module that sits between TCPIP and Ethernet and provides ARP
services.

My network shim would ideally sit below this ip-en converter and above
the ethernet UP_PRODUCER. The documentation seems a little ambiguous as
to whether you can specify another converter as a top_type in the
io_net_registrant_t structure. Or do i need to register myself as a
REG_FILTER_ABOVE? In the filter case would i need to specify the
top_type at all?

To my knowladge, converter and producer must be altered. So you must have
ip down producer (tcpip) → ip_en converter (arp) → en up producter (driver).
If you want to add layer in between arp/driver, you HAVE TO make it a
filter, and it’s top_type = bottom_type = “en”.

-xtang

Hello,

Thanks for responding. I am working through trying to get an intermediate driver
up and running and i am having a few problems. If you could provide any insight, i
would appreciate it.

At this time, i am just trying to get an intermediate driver that acts as a pass
through driver (just to make sure i can do it), installed below the ip-en
converter and above ethernet (“en”). I am specifiying “en” as the top and the
bottom as you suggested. I have setup my io_net_registrant_t structure like this

io_net_registrant_t shim_entry =
{
_REG_FILTER_ABOVE,
“devn-shim”,
“en”,
“en”,
NULL,
&shim_funcs,
0
};

Here is some of the behavior i am seeing.

  1. I can install my driver succesfully using the mount command. I implemented the
    advertise routine, which i call from my init function. Do i need to create an
    advertise routine even if there is no hardware associated with my driver?

  2. With the driver installed and i try to ping, the packets go down through my
    rx-down function. I call io-net->tx_down, and the packets successfully get out on
    the wire. The destination host replies (either arp or icmp - which ever it happens
    to be), however, i do not get the packet passed up from the ethernet layer. The
    packet is dropped somewhere before it gets to me. I have registered successfully,
    and have created an rx_up routine, can you think of any reason why the packet
    wouldn’t get to me?

  3. I can’t seem to umount the driver once installed. I give umount the full path
    to the driver and it won’t unmount it. It says “function not implemented”. I have
    implemented shutdown, shutdown1, and shutdown2. Is there any others i need to
    umount?

Anyway, thanks again for your help, and any additional info you could provide
would be great.

Steve.

Xiaodan Tang wrote:

Steven Erickson <> sojg@mediaone.net> > wrote:
Hello,

I am sifting through the QNX Network DDK and am trying to determine how
to create an intermediate driver that intercepts all packets between
TCPIP and Ethernet. The documentation indicates that there is an “ip-en”
converter module that sits between TCPIP and Ethernet and provides ARP
services.

My network shim would ideally sit below this ip-en converter and above
the ethernet UP_PRODUCER. The documentation seems a little ambiguous as
to whether you can specify another converter as a top_type in the
io_net_registrant_t structure. Or do i need to register myself as a
REG_FILTER_ABOVE? In the filter case would i need to specify the
top_type at all?

To my knowladge, converter and producer must be altered. So you must have
ip down producer (tcpip) → ip_en converter (arp) → en up producter (driver).
If you want to add layer in between arp/driver, you HAVE TO make it a
filter, and it’s top_type = bottom_type = “en”.

-xtang

Hello,

Thanks for responding. I am working through trying to get an intermediate driver
up and running and i am having a few problems. If you could provide any insight, i
would appreciate it.

At this time, i am just trying to get an intermediate driver that acts as a pass
through driver (just to make sure i can do it), installed below the ip-en
converter and above ethernet (“en”). I am specifiying “en” as the top and the
bottom as you suggested. I have setup my io_net_registrant_t structure like this

io_net_registrant_t shim_entry =
{
_REG_FILTER_ABOVE,
“devn-shim”,
“en”,
“en”,
NULL,
&shim_funcs,
0
};

Here is some of the behavior i am seeing.

  1. I can install my driver succesfully using the mount command. I implemented the
    advertise routine, which i call from my init function. Do i need to create an
    advertise routine even if there is no hardware associated with my driver?

  2. With the driver installed and i try to ping, the packets go down through my
    rx-down function. I call io-net->tx_down, and the packets successfully get out on
    the wire. The destination host replies (either arp or icmp - which ever it happens
    to be), however, i do not get the packet passed up from the ethernet layer. The
    packet is dropped somewhere before it gets to me. I have registered successfully,
    and have created an rx_up routine, can you think of any reason why the packet
    wouldn’t get to me?

  3. I can’t seem to umount the driver once installed. I give umount the full path
    to the driver and it won’t unmount it. It says “function not implemented”. I have
    implemented shutdown, shutdown1, and shutdown2. Is there any others i need to
    umount?

Anyway, thanks again for your help, and any additional info you could provide
would be great.

Steve.

Xiaodan Tang wrote:

Steven Erickson <> sojg@mediaone.net> > wrote:
Hello,

I am sifting through the QNX Network DDK and am trying to determine how
to create an intermediate driver that intercepts all packets between
TCPIP and Ethernet. The documentation indicates that there is an “ip-en”
converter module that sits between TCPIP and Ethernet and provides ARP
services.

My network shim would ideally sit below this ip-en converter and above
the ethernet UP_PRODUCER. The documentation seems a little ambiguous as
to whether you can specify another converter as a top_type in the
io_net_registrant_t structure. Or do i need to register myself as a
REG_FILTER_ABOVE? In the filter case would i need to specify the
top_type at all?

To my knowladge, converter and producer must be altered. So you must have
ip down producer (tcpip) → ip_en converter (arp) → en up producter (driver).
If you want to add layer in between arp/driver, you HAVE TO make it a
filter, and it’s top_type = bottom_type = “en”.

-xtang

Steven Erickson <sojg@mediaone.net> wrote:

Hello,

Thanks for responding. I am working through trying to get an intermediate driver
up and running and i am having a few problems. If you could provide any insight, i
would appreciate it.

I guess there is no filter sample in DDK right now. Try download the
source package of “ipfilter” (http://staff.qnx.com/~xtang/repository/
or search on www.qnxstart.com), and check the source ipf_npi.c,
that is a live sample of filter.

At this time, i am just trying to get an intermediate driver that acts as a pass
through driver (just to make sure i can do it), installed below the ip-en
converter and above ethernet (“en”). I am specifiying “en” as the top and the
bottom as you suggested. I have setup my io_net_registrant_t structure like this

io_net_registrant_t shim_entry =
{
_REG_FILTER_ABOVE,
“devn-shim”,
“en”,
“en”,
NULL,
&shim_funcs,
0
};

Here is some of the behavior i am seeing.

  1. I can install my driver succesfully using the mount command. I implemented the
    advertise routine, which i call from my init function. Do i need to create an
    advertise routine even if there is no hardware associated with my driver?

No, you don’t need advertise as a filter. Advertise usually is a lower
up producer (ether driver) to tell upper layer it is fully ready.

You should, however, catch all the message packet (_NPKT_MESSAGE), and
once receiver a advertise packet (from your driver under you), always
tx_up() it so modules on top of you (arp, tcpip) will know the driver.

  1. With the driver installed and i try to ping, the packets go down through my
    rx-down function. I call io-net->tx_down, and the packets successfully get out on
    the wire. The destination host replies (either arp or icmp - which ever it happens
    to be), however, i do not get the packet passed up from the ethernet layer. The
    packet is dropped somewhere before it gets to me. I have registered successfully,
    and have created an rx_up routine, can you think of any reason why the packet
    wouldn’t get to me?

My guess is you have not regist the byte patten (reg_byte_pat()), you
should call this function with _BYTE_PAT_ALL, so all the packets
comes to you. (you could also setup the patten so you only receive
ARP packet, or maybe IP packet)

  1. I can’t seem to umount the driver once installed. I give umount the full path
    to the driver and it won’t unmount it. It says “function not implemented”. I have
    implemented shutdown, shutdown1, and shutdown2. Is there any others i need to
    umount?

You need to umount the driver created by io-net, which is usually
/dev/io-net/en_en0

-xtang

Anyway, thanks again for your help, and any additional info you could provide
would be great.

Steve.

Xiaodan Tang wrote:

Steven Erickson <> sojg@mediaone.net> > wrote:
Hello,

I am sifting through the QNX Network DDK and am trying to determine how
to create an intermediate driver that intercepts all packets between
TCPIP and Ethernet. The documentation indicates that there is an “ip-en”
converter module that sits between TCPIP and Ethernet and provides ARP
services.

My network shim would ideally sit below this ip-en converter and above
the ethernet UP_PRODUCER. The documentation seems a little ambiguous as
to whether you can specify another converter as a top_type in the
io_net_registrant_t structure. Or do i need to register myself as a
REG_FILTER_ABOVE? In the filter case would i need to specify the
top_type at all?

To my knowladge, converter and producer must be altered. So you must have
ip down producer (tcpip) → ip_en converter (arp) → en up producter (driver).
If you want to add layer in between arp/driver, you HAVE TO make it a
filter, and it’s top_type = bottom_type = “en”.

-xtang

… Wow, if I only would read newsgroups more carefully. It took me the
whole last week to set up a filter just like this … I just started to
disassemble Xiaodan Tang’s nfm-bfp.so module to find out (I’m sorry for that
but it helped me find the last missing piece). Why don’t you include it’s
source in the network DDK? I think the network DDK documentation is rather
incomplete and actually more a reference from/to the programmers that
actually wrote the io-net stuff.

Peter

hello Peter…

As one of the maintainers of that document I would love get your feedback
on what you think is too thin or too thick. Now remember, the NetDDK’s current
target is network drivers only, the fact that it can be used as a reference
for filters and converters just comes out of io-net being documented. Are
these the main areas you are concerned with? Regardless, any feedback anyone
has will only make it better!

chris


Peter Kleinstuck <pkx544@gmx.de> wrote:

… Wow, if I only would read newsgroups more carefully. It took me the
whole last week to set up a filter just like this … I just started to
disassemble Xiaodan Tang’s nfm-bfp.so module to find out (I’m sorry for that
but it helped me find the last missing piece). Why don’t you include it’s
source in the network DDK? I think the network DDK documentation is rather
incomplete and actually more a reference from/to the programmers that
actually wrote the io-net stuff.

Peter

cdm@qnx.com > “The faster I go, the behinder I get.”

Chris McKillop – Lewis Carroll –
Software Engineer, QSSL
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<