Device Information Library Functions diwalkminor(3DEVINFO)
NAME
diwalkminor - traverse libdevinfo minor nodes
SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ]
#include
int diwalkminor(dinodet root, const char *minornodetype,
uintt flag, void *arg, int (*minorcallback)(dinodet node,
diminort minor, void *arg));
PARAMETERS
arg Pointer to caller- specific user data.
flag Specify 0. Reserved for future use.
minor The minor node visited.
minornodetype A character string specifying the minor
data type, which may be one of the types
defined by the Solaris DI framework, for
example, DINTBLOCK. NUL matches all
minornode types. See
ddicreateminornode(9F).
node The device node with which to the minor
node is associated.
root Root of subtree to visit.
DESCRIPTION
The diwalkminor() function visits all minor nodes attached
to device nodes in a subtree rooted at root. For each minor
node that matches minornodetype, the caller-supplied func-
tion minorcallback() is invoked. The walk terminates
immediately when minorcallback() returns DIWALKTERMINATE.
RETURN VALUES
Upon successful completion, diwalkminor() returns 0. Oth-
erwise, -1 is returned and errno is set to indicate the
error.
The minorcallback() function returns one of the following:
SunOS 5.11 Last change: 14 Jan 2009 1
Device Information Library Functions diwalkminor(3DEVINFO)
DIWALKCONTINUE Continue to visit subsequent minor data
nodes.
DIWALKTERMINATE Terminate the walk immediately.
ERORS
The diwalkminor() function will fail if:
EINVAL Invalid argument.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Committed
MT-Level Safe
SEE ALSO
dladm(1M), diminornodetype(3DEVINFO), dlpiwalk(3DLPI),
libdevinfo(3LIB), attributes(5), filesystem(5),
ddicreateminornode(9F)
Writing Device Drivers
NOTES
The diwalkminor() function is no longer an accurate method
for walking network datalink interfaces on the system.
Applications should use dlpiwalk(3DLPI) instead. It has
been common for applications to use diwalkminor() to walk
networking devices by passing in a minornodetype of
DINTNET, in most cases to discover the set of DLPI dev-
ices on the system. Solaris now makes a layering distinction
between networking devices (the objects displayed in the
DEVICE field by dladm show-phys) and network datalink inter-
faces (the objects displayed by dladm show-link). Datalink
interfaces are represented as the set of DLPI device nodes
that applications can open by using dlpiopen(3DLPI) or by
opening DLPI nodes out of the /dev/net filesystem (see
filesystem(5)). The dlpiwalk(3DLPI) function is the proper
function to walk these nodes.
SunOS 5.11 Last change: 14 Jan 2009 2
|