[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

io_net_dll_entry_t

Global symbol exported by shared objects to be loaded by io-net

Synopsis:

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;

Description:

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().

init()

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:

dll_hdl
An internal handle used by io-net -- you'll need this handle for future calls into the io-net framework.
dpp
This pointer should be ignored.
ion
A pointer to a data structure of the io-net functions that your driver can call to interact with the networking subsystem. The driver should always keep a copy of this pointer. For more information, see io_net_self_t.
options
A pointer to an ASCII string, which, if non-NULL, should be parsed by the driver.

Your init() function should return 0 on success. If an error occurs, this function should set errno and return -1.

shutdown()

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.

Classification:

QNX Neutrino

See also:

io_net_registrant_t, io_net_registrant_funcs_t


[Previous] [Contents] [Index] [Next]