We recommend that you use pfil hooks to rewrite your io-net filter to work in io-pkt . Here are the basic steps:
struct _iopkt_lsm_entry IOPKT_LSM_ENTRY_SYM(mod) = IOPKT_LSM_ENTRY_SYM_INIT(mod_entry);
Information about the interface that the packet was received on is contained in the ifp pointer (defined in usr/include/net/if.h). For example, the external interface name is in ifp->if_xname; you can use this to determine where the packet came from.
The cell, endpoint, and iface parameters are essentially wrapped up in the ifp pointer.
You can find information about using mbuf buffers in many places on the web. The header file that covers the io-pkt mbuf support is in $QNX_TARGET/usr/include/sys/mbuf.h.
In io-pkt, all buffer allocation is handled explicitly by the stack middleware. This means that any element requiring a buffer goes directly to the middleware to get it, and anything freeing a buffer (e.g. the driver) puts it directly back into the middleware buffer pools. This makes things easier to deal with, because you now no longer have to track and manage your own buffer pools as an endpoint. As soon as the code is finished with the buffer, it simply performs an m_freem() of the buffer which places it back in the general pool.
There is one downside to the global buffer implementation. You can't create a thread using pthread_create() that allocates or frees a buffer from the stack, because the thread has to modify internal stack structures. The locking implemented within io-pkt is optimized to reduce thread context-switch times, and this means that non-stack threads can't lock-protect these structures. Instead, the stack provides its own thread-creation function (defined in trunk/sys/nw_thread.h):
int nw_pthread_create(pthread_t *tidp, pthread_attr_t *attrp, void *(*funcp)(void *), void *arg, int flags, int (*init_func)(void *), void *init_arg);
The first four arguments are the standard arguments to pthread_create(); the last three are specific to io-pkt. You can find a fairly simplistic example of how to use this function in net/ppp_tty.c.