Data Link Provider Interface Library Functions dlpiinfo(3DLPI)
NAME
dlpiinfo - get DLPI information
SYNOPSIS
cc [ flag ... ] file ... -ldlpi [ library ... ]
#include
int dlpiinfo(dlpihandlet dh, dlpiinfot *infop,
uintt opt);
DESCRIPTION
The dlpiinfo() 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
DLUNBOUND DLPI state. The DLPI information received is
copied into infop, which must point to a dlpiinfot allo-
cated by the caller. The opt argument is reserved for future
use and must be set to 0.
The dlpiinfot is a structure defined in as
follows:
typedef struct {
uintt diopts;
uintt dimaxsdu;
uintt diminsdu;
uintt distate;
uchart dimactype;
char dilinkname[DLPILINKNAMEMAX];
uchart diphysaddr[DLPIPHYSADRMAX];
uchart diphysaddrlen;
uchart dibcastaddr[DLPIPHYSADRMAX];
uchart dibcastaddrlen;
uintt disap;
int ditimeout;
dlqosclsel1t diqossel;
dlqosclrange1t diqosrange;
} dlpiinfot;
diopts Reserved for future dlpiinfot expan-
sion.
dimaxsdu Maximum message size, in bytes, that the
DLPI link is able to accept for transmis-
sion. The value is guaranteed to be
greater than or equal to diminsdu.
SunOS 5.11 Last change: 22 Aug 2007 1
Data Link Provider Interface Library Functions dlpiinfo(3DLPI)
diminsdu Minimum message size, in bytes, that the
DLPI link is able to accept for transmis-
sion. The value is guaranteed to be
greater than or equal to one.
distate Current DLPI state of dh; either
DLUNBOUND or DLIDLE.
dimactype MAC type supported by the DLPI link asso-
ciated with dh. See for the
list of possible MAC types.
dilinkname Link name associated with DLPI handle dh.
diphysaddr Link-layer physical address of bound dh.
If dh is in the DLUNBOUND DLPI state,
the contents of diphysaddr are unspeci-
fied.
diphysaddrlen Physical address length, in bytes. If dh
is in the DLUNBOUND DLPI state,
diphysaddrlen is set to zero.
dibcastaddr Link-layer broadcast address. If the
dimactype of the DLPI link does not sup-
port broadcast, the contents of
dibcastaddr are unspecified.
dibcastaddrlen Link-layer broadcast address length, in
bytes. If the dimactype of the DLPI link
does not support broadcast,
dibcastaddrlen is set to zero.
disap SAP currently bound to handle. If dh is
in the DLUNBOUND DLPI state, disap is
set to zero.
ditimeout Current timeout value, in seconds, set on
the dlpi handle.
diqossel Current QOS parameters supported by the
DLPI link instance associated with dh.
SunOS 5.11 Last change: 22 Aug 2007 2
Data Link Provider Interface Library Functions dlpiinfo(3DLPI)
Unsupported QOS parameters are set to
DLUNKNOWN.
diqosrange Available range of QOS parameters sup-
ported by a DLPI link instance associated
with the DLPI handle dh. Unsupported QOS
range values are set to DLUNKNOWN.
RETURN VALUES
Upon success, DLPISUCES is returned. If DLSYSER is
returned, errno contains the specific UNIX system error
value. Otherwise, a DLPI error value defined in
or an error value listed in the following section is
returned.
ERORS
DLPIEBADMSG Bad DLPI message
DLPIEINHANDLE Invalid DLPI handle
DLPIEINVAL Invalid argument
DLPIEMODENOTSUP Unsupported DLPI connection mode
DLPIETIMEDOUT DLPI operation timed out
DLPIEVERNOTSUP Unsupported DLPI Version
DLPIFAILURE DLPI operation failed
EXAMPLES
Example 1 Get link-layer broadcast address
The following example shows how dlpiinfo() can be used.
#include
uchart *
getbcastaddr(const char *linkname, uchart *baddrlenp)
{
dlpihandlet dh;
SunOS 5.11 Last change: 22 Aug 2007 3
Data Link Provider Interface Library Functions dlpiinfo(3DLPI)
dlpiinfot dlinfo;
uchart *baddr;
if (dlpiopen(linkname, &dh, 0) != DLPISUCES)
return (NUL);
if (dlpiinfo(dh, &dlinfo, 0) != DLPISUCES) {
dlpiclose(dh);
return (NUL);
}
dlpiclose(dh);
*baddrlenp = dlinfo.dibcastaddrlen;
if ((baddr = malloc(*baddrlenp)) == NUL)
return (NUL);
return (memcpy(baddr, dlinfo.dibcastaddr, *baddrlenp));
}
ATRIBUTES
See attributes(5) for description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
dlpibind(3DLPI), libdlpi(3LIB), attributes(5)
SunOS 5.11 Last change: 22 Aug 2007 4
|