1dlpi_enabnotify(3DDaLtPaI)Link Provider Interface Library Funcdtlipoin_senabnotify(3DLPI)
2
3
4

NAME

6       dlpi_enabnotify - enable DLPI notification
7

SYNOPSIS

9       cc [ flag... ] file... -ldlpi [ library... ]
10       #include <libdlpi.h>
11
12       int dlpi_enabnotify(dlpi_handle_t dh, uint_t notes,
13            dlpi_notifyfunc_t *funcp, void *arg, dlpi_notifyid_t *id);
14
15
16       typedef void dlpi_notifyfunc_t(dlpi_handle_t,
17            dlpi_notifyinfo_t *, void *);
18
19

DESCRIPTION

21       The  dlpi_enabnotify() function enables a notification callback for the
22       set of events specified in notes, which must be one or more (by a logi‐
23       cal  OR  operation)  of  the DLPI notifications documented in dlpi(7P).
24       The callback function funcp is registered with the DLPI handle  dh  and
25       is invoked when dh receives notification for any of the specified event
26       types. Upon success, id contains the  identifier  associated  with  the
27       registration.
28
29
30       Multiple  event  types can be registered for a callback function on the
31       DLPI handle dh. Similarly, the same event type can be registered multi‐
32       ple times on the same handle.
33
34
35       Once  a  callback has been registered, libdlpi will check for notifica‐
36       tion events on the DLPI handle dh, when exchanging DLPI  messages  with
37       the  underlying  DLPI link instance. The dlpi_recv(3DLPI) function will
38       always check for notification events, but other libdlpi operations  may
39       also  lead to an event callback being invoked. Although there may be no
40       expected data messages to be received, dlpi_recv() can  be  called,  as
41       shown  below, with a null buffer to force a check for pending events on
42       the underlying DLPI link instance.
43
44         dlpi_recv(dh, NULL, NULL, NULL, NULL, 0, NULL);
45
46
47
48       When a notification event of interest occurs, the callback function  is
49       invoked  with  the  arguments  arg,  originally passed to dlpi_disabno‐
50       tify(3DLPI), and infop, whose members are described below.
51
52       uint_t dni_note            Notification event type.
53
54
55       uint_t dni_speed           Current speed, in kilobits  per  second,  of
56                                  the DLPI link. Valid only for DL_NOTE_SPEED.
57
58
59       uint_t dni_size            Current maximum message size, in bytes, that
60                                  the DLPI link is able to accept  for  trans‐
61                                  mission. Valid only for DL_NOTE_SDU_SIZE.
62
63
64       uchar_t dni_physaddrlen    Link-layer   physical   address  length,  in
65                                  bytes. Valid only for DL_NOTE_PHYS_ADDR.
66
67
68       uchar_t dni_physaddr[]     Link-layer physical address  of  DLPI  link.
69                                  Valid only for DL_NOTE_PHYS_ADDR.
70
71
72
73       The libdlpi library will allocate and free the dlpi_notifyinfo_t struc‐
74       ture and the caller must not allocate  the  structure  or  perform  any
75       operations that require its size to be known.
76
77
78       The   callback  is  not  allowed  to  block.   This  precludes  calling
79       dlpi_enabnotify() from a callback, but non-blocking libdlpi  functions,
80       including dlpi_disabnotify(), can be called.
81

RETURN VALUES

83       Upon  success,  DLPI_SUCCESS  is  returned. If  DL_SYSERR  is returned,
84       errno  contains  the  specific  UNIX system error value.  Otherwise,  a
85       DLPI  error  value  defined in <sys/dlpi.h> or an error value listed in
86       the following section is returned.
87

ERRORS

89       DLPI_EINHANDLE       A DLPI handle is invalid.
90
91
92       DLPI_EINVAL          An argument is invalid.
93
94
95       DLPI_ENOTEIDINVAL    The DLPI notification ID is invalid.
96
97
98       DLPI_ENOTENOTSUP     The DLPI notification  is  not  supported  by  the
99                            link.
100
101
102       DLPI_ETIMEDOUT       The DLPI operation timed out.
103
104
105       DLPI_FAILURE         The DLPI operation failed.
106
107

ATTRIBUTES

109       See attributes(5) for descriptions of the following attributes:
110
111
112
113
114       ┌─────────────────────────────┬─────────────────────────────┐
115       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
116       ├─────────────────────────────┼─────────────────────────────┤
117       │Interface Stability          │Committed                    │
118       ├─────────────────────────────┼─────────────────────────────┤
119       │MT-Level                     │Safe                         │
120       └─────────────────────────────┴─────────────────────────────┘
121

SEE ALSO

123       dlpi_disabnotify(3DLPI),        dlpi_recv(3DLPI),        libdlpi(3LIB),
124       attributes(5), dlpi(7P)
125
126
127
128SunOS 5.11                        10 Mar 2009           dlpi_enabnotify(3DLPI)
Impressum