Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net_hook_register(9f) [opensolaris man page]

net_hook_register(9F)					   Kernel Functions for Drivers 				     net_hook_register(9F)

NAME
net_hook_register - add a hook to be called in event processing SYNOPSIS
#include <sys/neti.h> 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. DESCRIPTION
The net_hook_register() function uses hooks that allow callbacks to be registered with events that belong to a network protocol. A success- ful call to net_hook_register() 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 hook_t structure with multiple calls to net_hook_register(), it is not encouraged. The hook_t structure passed in with this function is described by hook_t(9S). The following describes how this structure is used. h_func Must be non-NULL and represent a function that fits the specified interface. h_name Gives the hook a name that represents its owner. No duplication of h_name among the hooks present for an event is allowed. h_flags Currently unused and must be set to 0. 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 when the hook is activated. RETURN VALUES
If the net_hook_register() function succeeds, 0 is returned. Otherwise, one of the following errors is returned: ENOMEM The system cannot allocate any more memory to support registering this hook. ENXIO A hook cannot be found among the given family of events. EEXIST A hook with the given h_name already exists on that event. ESRCH A before or 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. CONTEXT
The net_hook_register() function may be called from user or kernel context. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
net_hook_unregister(9F), hook_t(9S) SunOS 5.11 1 May 2008 net_hook_register(9F)

Check Out this Related Man Page

hook(3FORM)															       hook(3FORM)

NAME
hook - set hooks for automatic invocation by applications SYNOPSIS
#include <form.h> int set_field_init(FORM *form, Form_Hook func); Form_Hook field_init(const FORM *form); int set_field_term(FORM *form, Form_Hook func); Form_Hook field_term(const FORM *form); int set_form_init(FORM *form, Form_Hook func); Form_Hook form_init(const FORM *form); int set_form_term(FORM *form, Form_Hook func); Form_Hook form_term(const FORM *form); DESCRIPTION
These functions make it possible to set hook functions to be called at various points in the automatic processing of input event codes by form_driver. The function set_field_init sets a hook to be called at form-post time and each time the selected field changes (after the change). field_init returns the current field init hook, if any (NULL if there is no such hook). The function set_field_term sets a hook to be called at form-unpost time and each time the selected field changes (before the change). field_term returns the current field term hook, if any (NULL if there is no such hook). The function set_form_init sets a hook to be called at form-post time and just after a page change once it is posted. form_init returns the current form init hook, if any (NULL if there is no such hook). The function set_form_term sets a hook to be called at form-unpost time and just before a page change once it is posted. form_init returns the current form term hook, if any (NULL if there is no such hook). RETURN VALUE
Routines that return pointers return NULL on error. Other routines return one of the following: E_OK The routine succeeded. E_SYSTEM_ERROR System error occurred (see errno). SEE ALSO
ncurses(3NCURSES), form(3FORM). NOTES
The header file <form.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. hook(3FORM)
Man Page