Adding Protocol to io-net

Hi,

I want to confirm the following issues,

  1. Can I add as many protocols I want to io-net using
    #io-net -p

  2. If so, how to define the DOWN Converter NAME into the protocol to register with io-net, as this will be the terminating end for the packets coming to it.

  3. Can a convertor free the npkt structure, allocated by the Driver.
    The background is, I want to handle certain type of traffic coming to TCP/IP Stack in different way even before they reaches to TCP/IP Stack. What I can do, is modify the IP_ETH Convertor (or write a dummy convertor with UP as IP) and check for this specific type of traffic in this convertor. When receiving this, convertor will copy this into local memory, and pass it to dedicated application. And this will free the npkt structure in io-net associated with the incoming packet, allocated by the Driver. In the TX direction, this convertor will receive the packet from the application, and then it will create the io-net structure for this packet, and pass it to the Driver.

Is my understanding is right!!

Thanks in advance,

Sounds like you want a _REG_FILTER_ABOVE with
(io_net_registrant_t *)->top_type =
(io_net_registrant_t *)->bot_type = “en”;

This will get packets directly from / just before
they reach the ethernet driver. You can’t free
a packet you didn’t allocate; rather you call
ion->tx_done() on it to return it to its originator.

-seanb

This means, I need not to add any protocol to io-net. Rather just having the empty “top_type” for the _REG_FILTER_ABOVE I simply pass the packet to the application. Am I right!!

Yes. Being a “Filter”, you make the decision to pass the packet through (by call ion->tx_up()), or throw it away(by call ion->tx_done()),
or put it in a queue, and give it to someone else (through a message passing maybe?).

Note being a Filter, you also see all the outgoing packets (sent from the TCPIP stack), and in your case, you probably just ion->tx_down()
it to send it out, without touch it.

But you can’t have an empty top_type. You have
to read my previous post like a C preprocessor:

top_type = “en”;
bot_type = “en”;

Reading like pre-processor I am obliged to say “error: parse error before ‘->’ token” ;-)