1dlpi_info(3DLPI)Data Link Provider Interface Library Functionsdlpi_info(3DLPI)
2
3
4

NAME

6       dlpi_info - get DLPI information
7

SYNOPSIS

9       cc [ flag ... ] file ... -ldlpi [ library ... ]
10       #include <libdlpi.h>
11
12       int dlpi_info(dlpi_handle_t dh, dlpi_info_t *infop,
13            uint_t opt);
14
15

DESCRIPTION

17       The  dlpi_info() function provides DLPI information about the open DLPI
18       link instance associated with DLPI handle dh. DLPI information  can  be
19       retrieved  in any state of dh, but some of the information might not be
20       available if dh is in the DL_UNBOUND DLPI state. The  DLPI  information
21       received  is copied into infop, which must point to a dlpi_info_t allo‐
22       cated by the caller. The opt argument is reserved for  future  use  and
23       must be set to 0.
24
25
26       The dlpi_info_t is a structure defined in <libdlpi.h> as follows:
27
28         typedef struct {
29              uint_t                  di_opts;
30              uint_t                  di_max_sdu;
31              uint_t                  di_min_sdu;
32              uint_t                  di_state;
33              uchar_t                 di_mactype;
34              char                    di_linkname[DLPI_LINKNAME_MAX];
35              uchar_t                 di_physaddr[DLPI_PHYSADDR_MAX];
36              uchar_t                 di_physaddrlen;
37              uchar_t                 di_bcastaddr[DLPI_PHYSADDR_MAX];
38              uchar_t                 di_bcastaddrlen;
39              uint_t                  di_sap;
40              int                     di_timeout;
41              dl_qos_cl_sel1_t        di_qos_sel;
42              dl_qos_cl_range1_t      di_qos_range;
43         } dlpi_info_t;
44
45
46       di_opts            Reserved for future dlpi_info_t expansion.
47
48
49       di_max_sdu         Maximum  message  size, in bytes, that the DLPI link
50                          is able to accept for  transmission.  The  value  is
51                          guaranteed   to   be   greater   than  or  equal  to
52                          di_min_sdu.
53
54
55       di_min_sdu         Minimum message size, in bytes, that the  DLPI  link
56                          is  able  to  accept  for transmission. The value is
57                          guaranteed to be greater than or equal to one.
58
59
60       di_state           Current DLPI  state  of  dh;  either  DL_UNBOUND  or
61                          DL_IDLE.
62
63
64       di_mactype         MAC  type supported by the DLPI link associated with
65                          dh. See <sys/dlpi.h> for the list  of  possible  MAC
66                          types.
67
68
69       di_linkname        Link name associated with DLPI handle dh.
70
71
72       di_physaddr        Link-layer physical address of bound dh. If dh is in
73                          the  DL_UNBOUND  DLPI   state,   the   contents   of
74                          di_physaddr are unspecified.
75
76
77       di_physaddrlen     Physical  address  length, in bytes. If dh is in the
78                          DL_UNBOUND DLPI  state,  di_physaddrlen  is  set  to
79                          zero.
80
81
82       di_bcastaddr       Link-layer  broadcast  address. If the di_mactype of
83                          the DLPI link does not support broadcast,  the  con‐
84                          tents of di_bcastaddr are unspecified.
85
86
87       di_bcastaddrlen    Link-layer  broadcast  address  length, in bytes. If
88                          the di_mactype of the DLPI  link  does  not  support
89                          broadcast, di_bcastaddrlen is set to zero.
90
91
92       di_sap             SAP  currently  bound  to  handle.  If  dh is in the
93                          DL_UNBOUND DLPI state, di_sap is set to zero.
94
95
96       di_timeout         Current timeout value, in seconds, set on  the  dlpi
97                          handle.
98
99
100       di_qos_sel         Current  QOS  parameters  supported by the DLPI link
101                          instance associated with dh. Unsupported QOS parame‐
102                          ters are set to DL_UNKNOWN.
103
104
105       di_qos_range       Available  range  of  QOS  parameters supported by a
106                          DLPI link instance associated with the  DLPI  handle
107                          dh.   Unsupported   QOS  range  values  are  set  to
108                          DL_UNKNOWN.
109
110

RETURN VALUES

112       Upon success, DLPI_SUCCESS is returned. If DL_SYSERR is returned, errno
113       contains  the specific UNIX system error value. Otherwise, a DLPI error
114       value defined in <sys/dlpi.h> or an error value listed in the following
115       section is returned.
116

ERRORS

118       DLPI_EBADMSG        Bad DLPI message
119
120
121       DLPI_EINHANDLE      Invalid DLPI handle
122
123
124       DLPI_EINVAL         Invalid argument
125
126
127       DLPI_EMODENOTSUP    Unsupported DLPI connection mode
128
129
130       DLPI_ETIMEDOUT      DLPI operation timed out
131
132
133       DLPI_EVERNOTSUP     Unsupported DLPI Version
134
135
136       DLPI_FAILURE        DLPI operation failed
137
138

EXAMPLES

140       Example 1 Get link-layer broadcast address
141
142
143       The following example shows how dlpi_info() can be used.
144
145
146         #include <libdlpi.h>
147
148         uchar_t *
149         get_bcastaddr(const char *linkname, uchar_t *baddrlenp)
150         {
151                 dlpi_handle_t   dh;
152                 dlpi_info_t     dlinfo;
153                 uchar_t         *baddr;
154
155                 if (dlpi_open(linkname, &dh, 0) != DLPI_SUCCESS)
156                         return (NULL);
157
158                 if (dlpi_info(dh, &dlinfo, 0) != DLPI_SUCCESS) {
159                         dlpi_close(dh);
160                         return (NULL);
161                 }
162                 dlpi_close(dh);
163
164                 *baddrlenp = dlinfo.di_bcastaddrlen;
165                 if ((baddr = malloc(*baddrlenp)) == NULL)
166                         return (NULL);
167
168                 return (memcpy(baddr, dlinfo.di_bcastaddr, *baddrlenp));
169         }
170
171

ATTRIBUTES

173       See attributes(5) for description of the following attributes:
174
175
176
177
178       ┌─────────────────────────────┬─────────────────────────────┐
179       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
180       ├─────────────────────────────┼─────────────────────────────┤
181       │Interface Stability          │Committed                    │
182       ├─────────────────────────────┼─────────────────────────────┤
183       │MT-Level                     │Safe                         │
184       └─────────────────────────────┴─────────────────────────────┘
185

SEE ALSO

187       dlpi_bind(3DLPI), libdlpi(3LIB), attributes(5)
188
189
190
191SunOS 5.11                        22 Aug 2007                 dlpi_info(3DLPI)
Impressum