svcadm(8)을 검색하려면 섹션에서 8 을 선택하고, 맨 페이지 이름에 svcadm을 입력하고 검색을 누른다.
dlpi_info(3dlpi)
Data Link Provider Interface Library Functions dlpi_info(3DLPI)
NAME
dlpi_info - get DLPI information
SYNOPSIS
cc [ flag ... ] file ... -ldlpi [ library ... ]
#include <libdlpi.h>
int dlpi_info(dlpi_handle_t dh, dlpi_info_t *infop,
uint_t version);
DESCRIPTION
The dlpi_info() function provides DLPI information about the open DLPI
link instance associated with DLPI handle dh. DLPI information can be
retrieved in any state of dh, but some of the information might not be
available if dh is in the DL_UNBOUND DLPI state. The DLPI information
received is copied into infop, which must point to a dlpi_info_t allo‐
cated by the caller. The version argument specifies the version of the
dlpi_info_t structure expected by the caller. Callers can use the macro
DLPI_INFO_VERSION to specify the default version, which is currently 0.
Callers can request version 1 of the dlpi_info_t structure by defining
DLPI_INFO_VERSION to 1 before including <libdlpi.h> and passing the
defined DLPI_INFO_VERSION value of 1 as the version argument. See the
description of di_linkname below for the difference between version 0
and 1.
The dlpi_info_t is a structure defined in <libdlpi.h> as follows:
typedef struct {
uint_t di_opts;
uint_t di_max_sdu;
uint_t di_min_sdu;
uint_t di_state;
uchar_t di_mactype;
char di_linkname[DLPI_LINKNAME_MAX];
uchar_t di_physaddr[DLPI_PHYSADDR_MAX];
uchar_t di_physaddrlen;
uchar_t di_bcastaddr[DLPI_PHYSADDR_MAX];
uchar_t di_bcastaddrlen;
uint_t di_sap;
int di_timeout;
dl_qos_cl_sel1_t di_qos_sel;
dl_qos_cl_range1_t di_qos_range;
} dlpi_info_t;
di_opts
Reserved for future dlpi_info_t expansion.
di_max_sdu
Maximum message size, in bytes, that the DLPI link is able to
accept for transmission. The value is guaranteed to be greater than
or equal to di_min_sdu.
di_min_sdu
Minimum message size, in bytes, that the DLPI link is able to
accept for transmission. The value is guaranteed to be greater than
or equal to one.
di_state
Current DLPI state of dh; either DL_UNBOUND or DL_IDLE.
di_mactype
MAC type supported by the DLPI link associated with dh. See
<sys/dlpi.h> for the list of possible MAC types.
di_linkname
Link name associated with DLPI handle dh. If the caller specifies
the default version argument value of 0, the size of this field is
DLPI_LINKNAME_MAX. If the caller defines DLPI_INFO_VERSION to value
1 before including <libdlpi.h>, the size of this field is
MAXLINKNAMESPECIFIER. See dlpi(4P) for information on link names
and the supported maximum length of DLPI link names.
di_physaddr
Link-layer physical address of bound dh. If dh is in the DL_UNBOUND
DLPI state, the contents of di_physaddr are unspecified.
di_physaddrlen
Physical address length, in bytes. If dh is in the DL_UNBOUND DLPI
state, di_physaddrlen is set to zero.
di_bcastaddr
Link-layer broadcast address. If the di_mactype of the DLPI link
does not support broadcast, the contents of di_bcastaddr are
unspecified.
di_bcastaddrlen
Link-layer broadcast address length, in bytes. If the di_mactype of
the DLPI link does not support broadcast, di_bcastaddrlen is set to
zero.
di_sap
SAP currently bound to handle. If dh is in the DL_UNBOUND DLPI
state, di_sap is set to zero.
di_timeout
Current timeout value, in seconds, set on the dlpi handle.
di_qos_sel
Current QOS parameters supported by the DLPI link instance associ‐
ated with dh. Unsupported QOS parameters are set to DL_UNKNOWN.
di_qos_range
Available range of QOS parameters supported by a DLPI link instance
associated with the DLPI handle dh. Unsupported QOS range values
are set to DL_UNKNOWN.
RETURN VALUES
Upon success, DLPI_SUCCESS is returned. If DL_SYSERR is returned, errno
contains the specific UNIX system error value. Otherwise, a DLPI error
value defined in <sys/dlpi.h> or an error value listed in the following
section is returned.
ERRORS
DLPI_EBADMSG Bad DLPI message
DLPI_EINHANDLE Invalid DLPI handle
DLPI_EINVAL Invalid argument
DLPI_EMODENOTSUP Unsupported DLPI connection mode
DLPI_ETIMEDOUT DLPI operation timed out
DLPI_EVERNOTSUP Unsupported DLPI Version
DLPI_FAILURE DLPI operation failed
EXAMPLES
Example 1 Get link-layer broadcast address
The following example shows how dlpi_info() can be used.
#include <libdlpi.h>
uchar_t *
get_bcastaddr(const char *linkname, uchar_t *baddrlenp)
{
dlpi_handle_t dh;
dlpi_info_t dlinfo;
uchar_t *baddr;
if (dlpi_open(linkname, &dh, 0) != DLPI_SUCCESS)
return (NULL);
if (dlpi_info(dh, &dlinfo, 0) != DLPI_SUCCESS) {
dlpi_close(dh);
return (NULL);
}
dlpi_close(dh);
*baddrlenp = dlinfo.di_bcastaddrlen;
if ((baddr = malloc(*baddrlenp)) == NULL)
return (NULL);
return (memcpy(baddr, dlinfo.di_bcastaddr, *baddrlenp));
}
ATTRIBUTES
See attributes(7) for description of the following attributes:
tab() box; lw(2.75i) |lw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
TRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelSafe
SEE ALSO
dlpi_bind(3DLPI), libdlpi(3LIB), dlpi(4P), attributes(7)
Oracle Solaris 11.4 15 Apr 2011 dlpi_info(3DLPI)