Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#include <sys/hook.h> #include <sys/neti.h> int net_event_notify_register(net_handle_t family, char *event, hook_notify_fn_t *callback, void *arg); int net_event_notify_unregister(net_handle_t family, char *event, hook_notify_fn_t *callback); typedef int (* hook_notify_fn_t)(hook_notify_cmd_t command, void *arg, const char *name1, const char *name2, const char *name3);
value returned from a successful call to net_protocol_lookup().
function to call when a change occurs.
name of the event for which notification of change is desired.
pointer to pass into the callback() function when a change occurs.
The net_event_notify_unregister() function indicates that there is no longer any desire to receive notification of changes to the event through function calls to the specified callback.
The name of a hook should be considered a private interface unless otherwise specified. The hook names used by IPFilter in illumos are a public, but uncommitted, interface.
Multiple callback functions may be registered through this interface. The same set of parameters is passed to each callback function. The memory referenced through the pointers passed to the callback should be treated as pointing to read-only memory. Changing this data is strictly prohibited.
The function that is called when the event occurs must not block any other events.
The arguments passed through to the callback are as follows (the command is either HN_REGISTER or HN_UNREGISTER): name1
is the name of the protocol.
is the name of the event
the given callback function is already registered.
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Committed |