2 .\" Copyright (c) 2007, 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 DLPI_INFO 3DLPI "Aug 22, 2007"
8 dlpi_info \- get DLPI information
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-ldlpi\fR [ \fIlibrary\fR ... ]
15 \fBint\fR \fIdlpi_info\fR(\fBdlpi_handle_t\fR \fIdh\fR, \fBdlpi_info_t *\fR\fIinfop\fR,
16 \fBuint_t\fR \fIopt\fR);
22 The \fBdlpi_info()\fR function provides \fBDLPI\fR information about the open
23 \fBDLPI\fR link instance associated with \fBDLPI\fR handle \fIdh\fR. \fBDLPI\fR
24 information can be retrieved in any state of \fIdh\fR, but some of the
25 information might not be available if \fIdh\fR is in the \fBDL_UNBOUND\fR
26 \fBDLPI\fR state. The \fBDLPI\fR information received is copied into
27 \fIinfop\fR, which must point to a \fBdlpi_info_t\fR allocated by the caller.
28 The \fIopt\fR argument is reserved for future use and must be set to 0.
31 The \fBdlpi_info_t\fR is a structure defined in \fB<libdlpi.h>\fR as follows:
41 char di_linkname[DLPI_LINKNAME_MAX];
42 uchar_t di_physaddr[DLPI_PHYSADDR_MAX];
43 uchar_t di_physaddrlen;
44 uchar_t di_bcastaddr[DLPI_PHYSADDR_MAX];
45 uchar_t di_bcastaddrlen;
48 dl_qos_cl_sel1_t di_qos_sel;
49 dl_qos_cl_range1_t di_qos_range;
60 Reserved for future \fBdlpi_info_t\fR expansion.
66 \fB\fIdi_max_sdu\fR\fR
69 Maximum message size, in bytes, that the \fBDLPI\fR link is able to accept for
70 transmission. The value is guaranteed to be greater than or equal to
77 \fB\fIdi_min_sdu\fR\fR
80 Minimum message size, in bytes, that the \fBDLPI\fR link is able to accept for
81 transmission. The value is guaranteed to be greater than or equal to one.
90 Current \fBDLPI\fR state of \fIdh\fR; either \fBDL_UNBOUND\fR or \fBDL_IDLE\fR.
96 \fB\fIdi_mactype\fR\fR
99 \fBMAC\fR type supported by the \fBDLPI\fR link associated with \fIdh\fR. See
100 \fB<sys/dlpi.h>\fR for the list of possible \fBMAC\fR types.
106 \fB\fIdi_linkname\fR\fR
109 Link name associated with \fBDLPI\fR handle \fIdh\fR.
115 \fB\fIdi_physaddr\fR\fR
118 Link-layer physical address of bound \fIdh\fR. If \fIdh\fR is in the
119 \fBDL_UNBOUND\fR \fBDLPI\fR state, the contents of \fIdi_physaddr\fR are
126 \fB\fIdi_physaddrlen\fR\fR
129 Physical address length, in bytes. If \fIdh\fR is in the \fBDL_UNBOUND\fR
130 \fBDLPI\fR state, \fIdi_physaddrlen\fR is set to zero.
136 \fB\fIdi_bcastaddr\fR\fR
139 Link-layer broadcast address. If the \fIdi_mactype\fR of the \fBDLPI\fR link
140 does not support broadcast, the contents of \fIdi_bcastaddr\fR are unspecified.
146 \fB\fIdi_bcastaddrlen\fR\fR
149 Link-layer broadcast address length, in bytes. If the \fIdi_mactype\fR of the
150 \fBDLPI\fR link does not support broadcast, \fIdi_bcastaddrlen\fR is set to
160 \fBSAP\fR currently bound to handle. If \fIdh\fR is in the \fBDL_UNBOUND\fR
161 \fBDLPI\fR state, \fIdi_sap\fR is set to zero.
167 \fB\fIdi_timeout\fR\fR
170 Current timeout value, in seconds, set on the \fBdlpi\fR handle.
176 \fB\fIdi_qos_sel\fR\fR
179 Current \fBQOS\fR parameters supported by the \fBDLPI\fR link instance
180 associated with \fIdh\fR. Unsupported \fBQOS\fR parameters are set to
187 \fB\fIdi_qos_range\fR\fR
190 Available range of \fBQOS\fR parameters supported by a \fBDLPI\fR link instance
191 associated with the \fBDLPI\fR handle \fIdh\fR. Unsupported \fBQOS\fR range
192 values are set to \fBDL_UNKNOWN\fR.
198 Upon success, \fBDLPI_SUCCESS\fR is returned. If \fBDL_SYSERR\fR is returned,
199 \fBerrno\fR contains the specific UNIX system error value. Otherwise, a
200 \fBDLPI\fR error value defined in \fB<sys/dlpi.h>\fR or an error value listed
201 in the following section is returned.
206 \fB\fBDLPI_EBADMSG\fR\fR
215 \fB\fBDLPI_EINHANDLE\fR\fR
218 Invalid \fBDLPI\fR handle
224 \fB\fBDLPI_EINVAL\fR\fR
233 \fB\fBDLPI_EMODENOTSUP\fR\fR
236 Unsupported \fBDLPI\fR connection mode
242 \fB\fBDLPI_ETIMEDOUT\fR\fR
245 \fBDLPI\fR operation timed out
251 \fB\fBDLPI_EVERNOTSUP\fR\fR
254 Unsupported \fBDLPI\fR Version
260 \fB\fBDLPI_FAILURE\fR\fR
263 \fBDLPI\fR operation failed
268 \fBExample 1 \fRGet link-layer broadcast address
271 The following example shows how \fBdlpi_info()\fR can be used.
279 get_bcastaddr(const char *linkname, uchar_t *baddrlenp)
285 if (dlpi_open(linkname, &dh, 0) != DLPI_SUCCESS)
288 if (dlpi_info(dh, &dlinfo, 0) != DLPI_SUCCESS) {
294 *baddrlenp = dlinfo.di_bcastaddrlen;
295 if ((baddr = malloc(*baddrlenp)) == NULL)
298 return (memcpy(baddr, dlinfo.di_bcastaddr, *baddrlenp));
306 See \fBattributes\fR(5) for description of the following attributes:
314 ATTRIBUTE TYPE ATTRIBUTE VALUE
316 Interface Stability Committed
324 \fBdlpi_bind\fR(3DLPI), \fBlibdlpi\fR(3LIB), \fBattributes\fR(5)