2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH NET_EVENT_NOTIFY_REGISTER 9F "Oct 30, 2008"
8 net_event_notify_register, net_event_notify_unregister \- add/delete a function
9 to be called for changes to a event
16 \fBint\fR \fBnet_event_notify_register\fR(\fBnet_handle_t\fR \fIfamily\fR, \fBchar\fR
17 *\fIevent\fR, \fBhook_notify_fn_t\fR *\fIcallback\fR, \fBvoid\fR *\fIarg\fR);
19 \fBint\fR \fBnet_event_notify_unregister\fR(\fBnet_handle_t\fR \fIfamily\fR, \fBchar\fR
20 *\fIevent\fR, \fBhook_notify_fn_t\fR *\fIcallback\fR);
22 \fBtypedef int\fR (* \fBhook_notify_fn_t\fR)(\fBhook_notify_cmd_t command,\fR
23 \fBvoid\fR *\fIarg\fR, \fBconst char\fR *\fIname1\fR, \fBconst char\fR *\fIname2\fR, \fBconst char\fR
30 Solaris DDI specific (Solaris DDI).
38 value returned from a successful call to \fBnet_protocol_lookup()\fR.
47 function to call when a change occurs.
56 name of the event for which notification of change is desired.
65 pointer to pass into the \fBcallback()\fR function when a change occurs.
71 The \fBnet_event_notify_register()\fR function registers a function represented
72 by the pointer \fIcallback\fR to be called when there is a change to the event
73 represented by \fIfamily\fR. The types of changes for which notifications are
74 available for is currently limited to the addition and removal of hooks.
77 The \fBnet_event_notify_unregister()\fR function indicates that there is no
78 longer any desire to receive notification of changes to the event through
79 function calls to the specified \fIcallback\fR.
82 The name of a hook should be considered a private interface unless otherwise
83 specified. The hook names used by \fBIPFilter\fR in Solaris are a public, but
84 uncommitted, interface.
87 Multiple \fIcallback\fR functions may be registered through this interface. The
88 same set of parameters is passed to each \fIcallback\fR function. The memory
89 referenced through the pointers passed to the \fIcallback\fR should be
90 treated as pointing to read-only memory. Changing this data is strictly
94 The function that is called when the \fIevent\fR occurs must not block any
98 The arguments passed through to the \fBcallback\fR are as follows (the command
99 is either \fBHN_REGISTER\fR or \fBHN_UNREGISTER\fR):
106 is the name of the protocol.
115 is the name of the event
124 is the name of the hook being added/removed
130 If these functions succeed, 0 is returned. Otherwise, the following error is
138 the given callback function is already registered.
144 These functions may be called from user or kernel context.
148 See \fBattributes\fR(5) for descriptions of the following attributes:
156 ATTRIBUTE TYPE ATTRIBUTE VALUE
158 Interface Stability Committed
164 \fBattributes\fR(5), \fBnet_hook_register\fR(9F),
165 \fBnet_hook_unregister\fR(9F), \fBnet_protocol_lookup\fR(9F)