Kernel functions net_hook_register(9F) NAME net_hook_register - add hook to be called in event process- ing SYNOPSIS #include net_hook_t net_hook_register(const net_data_t net, hook_t *hook); INTERFACE LEVEL Solaris DDI specific (Solaris DDI) PARAMETERS net value returned from a successful call to net_protocol_register. hook pointer to a hook_t structure as described below. DESCRIPTION Use of this function allows for hooks that describe call- backs to be registered with events that belong to a network protocol. A successful call to net_hook_register requires that a valid handle for a network protocol be provided (the first parameter, net) along with a hook description that includes a reference to an availabel event. While it is possible to use the same hook_t structure with multiple calls to net_hook_register, this is not encouraged. The hook_t structure passed in with this function is described by hook_t(9s). The following describes how the structure is used. h_func must be non-NULL and represent a function that fits the specified interface. h_name is available for giving the hook a name that represents its owner. Duplication of h_name amongst the hooks present for an event is not allowed. h_flags is currently unused and must be set to 0. SunOS 5.10 Last change: 25 March 2008 1 Kernel functions net_hook_register(9F) h_hint, h_hintvalue specify a hint to net_hook_register on how to insert this hook. If the hint cannot be specified, then an error is returned. h_arg; may take any value that the consumer wishes to have passed back to them when the hook is activated. RETURN VALUES If this function succeeds, 0 is returned, else one of the following errors is passed back. ENOMEM the system cannot allocate any more memory to support registering this hook. ENXIO hook cannot be found amongst the given family of events. EEXIST a hook with the given h_name already exists on that event. ESRCH a before/after dependency cannot be satisfied due to the hook with EBUSY the h_hint field specifies a hint that cannot currently be satisfied because it conflicts with another hook. An example of this might be specifying HH_FIRST or HH_LAST when another hook has already been registered with this value. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SEE ALSO net_event_register(9f), net_event_unregister(9f), net_hook_unregister(9f), net_protocol_unregister(9f), net_protocol_register(9f) SunOS 5.10 Last change: 25 March 2008 2