1net_protocol_notify_registKeerr(n9eFl)Functions for Dnreitv_eprrsotocol_notify_register(9F)
2
3
4
6 net_protocol_notify_register, net_instance_protocol_unregister -
7 add/delete a function to be called for changes to a protocol
8
10 #include <sys/hook.h>
11 #include <sys/neti.h>
12
13 int net_protocol_notify_register(net_handle_t family,
14 hook_notify_fn_t *callback, void *arg);
15
16 int net_protocol_notify_unregister(net_handle_t family,
17 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 net_protocol_lookup().
29
30
31 callback function to call when a change occurs.
32
33
34 arg pointer to pass into the callback() function when a change
35 occurs.
36
37
39 The net_protocol_notify_register() function registers a function repre‐
40 sented by the pointer callback to be called when there is a change to
41 the protocol represented by family. The types of changes for which
42 notifications are available for is currently limited to the addition
43 and removal of protocols.
44
45
46 The net_protocol_notify_unregister() function removes the function
47 specified by the pointer callback from the list of functions to call.
48 This call may fail if the specified function cannot be found.
49
50
51 Multiple callback functions may be registered through this interface.
52 The same set of parameters is passed to each callback function. The
53 memory referenced through the pointers passed to the callback should be
54 treated as pointing to read-only memory. Changing this data is strictly
55 prohibited.
56
57
58 The function that is called must not block any other protocols.
59
60
61 The arguments passed through to the callback are as follows (the com‐
62 mand is either HN_REGISTER or HN_UNREGISTER):
63
64 name1 is the name of the protocol
65
66
67 name2 is NULL.
68
69
70 name3 is the name of the protocol being added/removed
71
72
74 If these functions succeed, 0 is returned. Otherwise, the following
75 error is returned:
76
77 EEXIST the given callback function is already registered.
78
79
81 These functions may be called from user or kernel context.
82
84 See attributes(5) for descriptions of the following attributes:
85
86
87
88
89 ┌─────────────────────────────┬─────────────────────────────┐
90 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
91 ├─────────────────────────────┼─────────────────────────────┤
92 │Availability │SUNWcsu │
93 ├─────────────────────────────┼─────────────────────────────┤
94 │Interface Stability │Committed │
95 └─────────────────────────────┴─────────────────────────────┘
96
98 attributes(5), net_protocol_lookup(9F)
99
100
101
102SunOS 5.11 30 Oct 2008 net_protocol_notify_register(9F)