Can I add as many protocols I want to io-net using #io-net -p
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.
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.
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.
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.