Information used when registering with io-net
typedef struct _io_net_registrant {
uint32_t flags;
char *name;
char *top_type;
char *bot_type;
void *func_hdl;
io_net_registrant_funcs_t *funcs;
int ndependencies;
} io_net_registrant_t;
The io_net_registrant_t structure contains information that's
used when registering your driver with io-net.
It's a member of the
io_net_self_t
structure.
The members are defined as follows:
- flags
- The type and characteristics of the driver being registered.
The type is one of the following:
- _REG_FILTER_ABOVE -- a filter that sits above an
up producer and below the bottom end of a converter.
- _REG_FILTER_BELOW -- a filter that sits below a
down producer and above the top end of a converter.
- _REG_CONVERTOR -- a converter.
- _REG_PRODUCER_UP -- a producer in the
up direction.
- _REG_PRODUCER_DOWN -- a producer in the
down direction.
You can also OR in any combination of the following:
- _REG_DEREG_ALL -- if a shared object registers more
than once (i.e. multiple modules), and a umount is made for
a module with this bit set, io-net tries to shut down all of
the shared object's modules.
- _REG_INIT_ONCE -- if a shared object is loaded
and it registers with this flag, any attempt to load the same shared
object fails with an error code of EALREADY.
- _REG_NO_RAW_ACCESS -- a module that has
registered as _REG_FILTER_ABOVE and wants to provide
additional I/O support for modules below it can do so only for modules
that don't have this flag set.
- _REG_NO_UMOUNT -- don't support being shut down.
Any attempt to unmount the module fails with an error code of
EOPNOTSUPP.
You can use _REG_TYPE_MASK to mask out these additional
flags from the module type.
- name
- A pointer to the full ASCII name of the driver, for example,
devn-speedo.so.
- top_type
- A pointer to the ASCII name of the top type binding, for example,
en.
See the types listed below.
- bot_type
- A pointer to the ASCII name of the bottom type binding, for example,
ip.
See the types listed below.
- func_hdl
- A handle that you define that's passed to your functions when they
get called.
It's a convenient way of binding a data structure to this particular
registration instance (because your module can register multiple times
as different things).
- funcs
- A pointer to a function table.
See io_net_registrant_funcs_t.
- ndependencies
- The number of elements in the io_net_dependency_t table
that's assumed to implicitly follow the io_net_registrant_t
table.
The types (for top_type and bot_type) include:
- en
- Ethernet.
- ip
- TCP/IP.
- ppp
- Point-to-point protocol.
- qnet
- QNX native networking.
This structure is assumed to be followed by a variable number of
io_net_dependency_t elements, as specified by the
ndependencies member:
typedef struct _io_net_dependency {
char *dep;
uint32_t flags;
} io_net_dependency_t;
The members of this structure include:
- dep
- The name of a shared object that you depend on.
If you specify a dependency, io-net checks the
name of all currently registered modules (as specified in the
name member of their io_net_registrant_t
structures) and tries to load them if they aren't already present.
Similarly, if an attempt is made to unload a module that fulfills
another's dependency, EBUSY is returned (the dependent
module must be unloaded first).
- flags
- Used internally by io-net.
QNX
io_net_registrant_funcs_t,
io_net_self_t