This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Global symbol exported by shared objects to be loaded by io-net
typedef struct _io_net_dll_entry { int nfuncs; int (*init) (void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char *options ); int (*shutdown) (void *dll_hdl ); } io_net_dll_entry_t;
The io_net_dll_entry_t data structure defines a network driver's primary entry points. Your driver must contain a public symbol of type io_net_dll_entry_t called io_net_dll_entry.
The nfuncs member specifies the number of functions in the io_net_dll_entry_t structure. Your driver should set this to 2, because two functions are currently defined: init() and shutdown().
A pointer to your driver's initialization function, which is mandatory. This is the first of your driver's functions that io-net calls. The prototype is:
int (*init) (void *dll_hdl, dispatch_t *dpp, io_net_self_t *ion, char *options );
The arguments are:
Your init() function should return 0 on success. If an error occurs, this function should set errno and return -1.
The shutdown function will be called before the driver is unloaded from memory.
The prototype is:
int (*shutdown) (void *dll_hdl );
The dll_hdl is the handle that was passed to the driver's initialization function.
When a particular registration instance (a "registrant") is shut down, its shutdown1() and shutdown2() functions (from the io_net_registrant_t structure's io_net_registrant_funcs_t function pointer array) are called.
When all of the shared object's registrants are closed, this shutdown() function is called. It may be necessary to use this entry point to do additional cleanup to ensure that any resources that we allocated during the lifetime of the driver have been deallocated. If you don't wish to supply this function, place a NULL in this member.
Your driver's shutdown() function should return 0.
QNX Neutrino
io_net_registrant_t, io_net_registrant_funcs_t