1net_event_notify_register(K9eFr)nel Functions for Drivneerts_event_notify_register(9F)
2
3
4
6 net_event_notify_register, net_event_notify_unregister - add/delete a
7 function to be called for changes to a event
8
10 #include <sys/hook.h>
11 #include <sys/neti.h>
12
13 int net_event_notify_register(net_handle_t family, char
14 *event, hook_notify_fn_t *callback, void *arg);
15
16 int net_event_notify_unregister(net_handle_t family, char
17 *event, hook_notify_fn_t *callback);
18
19 typedef int (* hook_notify_fn_t)(hook_notify_cmd_t command,
20 void *arg, const char *name1, const char *name2, const char
21 *name3);
22
23
25 Solaris DDI specific (Solaris DDI).
26
28 family value returned from a successful call to net_proto‐
29 col_lookup().
30
31
32 callback function to call when a change occurs.
33
34
35 event name of the event for which notification of change is
36 desired.
37
38
39 arg pointer to pass into the callback() function when a change
40 occurs.
41
42
44 The net_event_notify_register() function registers a function repre‐
45 sented by the pointer callback to be called when there is a change to
46 the event represented by family. The types of changes for which notifi‐
47 cations are available for is currently limited to the addition and
48 removal of hooks.
49
50
51 The net_event_notify_unregister() function indicates that there is no
52 longer any desire to receive notification of changes to the event
53 through function calls to the specified callback.
54
55
56 The name of a hook should be considered a private interface unless oth‐
57 erwise specified. The hook names used by IPFilter in Solaris are a pub‐
58 lic, but uncommitted, interface.
59
60
61 Multiple callback functions may be registered through this interface.
62 The same set of parameters is passed to each callback function. The
63 memory referenced through the pointers passed to the callback should
64 be treated as pointing to read-only memory. Changing this data is
65 strictly prohibited.
66
67
68 The function that is called when the event occurs must not block any
69 other events.
70
71
72 The arguments passed through to the callback are as follows (the com‐
73 mand is either HN_REGISTER or HN_UNREGISTER):
74
75 name1 is the name of the protocol.
76
77
78 name2 is the name of the event
79
80
81 name3 is the name of the hook being added/removed
82
83
85 If these functions succeed, 0 is returned. Otherwise, the following
86 error is returned:
87
88 EEXIST the given callback function is already registered.
89
90
92 These functions may be called from user or kernel context.
93
95 See attributes(5) for descriptions of the following attributes:
96
97
98
99
100 ┌─────────────────────────────┬─────────────────────────────┐
101 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
102 ├─────────────────────────────┼─────────────────────────────┤
103 │Availability │SUNWcsu │
104 ├─────────────────────────────┼─────────────────────────────┤
105 │Interface Stability │Committed │
106 └─────────────────────────────┴─────────────────────────────┘
107
109 attributes(5), net_hook_register(9F), net_hook_unregister(9F), net_pro‐
110 tocol_lookup(9F)
111
112
113
114SunOS 5.11 30 Oct 2008 net_event_notify_register(9F)