Kernel Functions for Drivers nethookregister(9F)
NAME
nethookregister - add a hook to be called in event pro-
cessing
SYNOPSIS
#include
nethookt nethookregister(const netdatat net, hookt *hook);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
net value returned from a successful call to
netprotocolregister().
hook pointer to a hookt structure.
DESCRIPTION
The nethookregister() function uses hooks that allow call-
backs to be registered with events that belong to a network
protocol. A successful call to nethookregister() requires
that a valid handle for a network protocol be provided (the
net parameter), along with a hook description that includes
a reference to an available event.
While it is possible to use the same hookt structure with
multiple calls to nethookregister(), it is not encouraged.
The hookt structure passed in with this function is
described by hookt(9S). The following describes how this
structure is used.
hfunc Must be non-NUL and represent a
function that fits the specified
interface.
hname Gives the hook a name that represents
its owner. No duplication of hname
among the hooks present for an event
is allowed.
hflags Currently unused and must be set to
0.
SunOS 5.11 Last change: 1 May 2008 1
Kernel Functions for Drivers nethookregister(9F)
hhint, hhintvalue Specify a hint to nethookregister()
on how to insert this hook. If the
hint cannot be specified, then an
error is returned.
harg; May take any value that the consumer
wishes to have passed back when the
hook is activated.
RETURN VALUES
If the nethookregister() function succeeds, 0 is returned.
Otherwise, one of the following errors is returned:
ENOMEM The system cannot allocate any more memory to sup-
port registering this hook.
ENXIO A hook cannot be found among the given family of
events.
EXIST A hook with the given hname already exists on
that event.
ESRCH A before or after dependency cannot be satisfied
due to the hook with
EBUSY The hhint field specifies a hint that cannot
currently be satisfied because it conflicts with
another hook. An example of this might be specify-
ing HFIRST or HLAST when another hook has
already been registered with this value.
CONTEXT
The nethookregister() function may be called from user or
kernel context.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 1 May 2008 2
Kernel Functions for Drivers nethookregister(9F)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsu
Interface Stability Committed
SEE ALSO
nethookunregister(9F), hookt(9S)
SunOS 5.11 Last change: 1 May 2008 3
|