Kernel Functions for Drivers netlifgetnext(9F)
NAME
netlifgetnext - search through a list of logical network
interfaces
SYNOPSIS
#include
netift netlifgetnext(const netdatat net, const phyift ifp,
netift lif);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
net value returned from a successful call to
netprotocollookup(9F).
ifp value returned from a successful call to
netphylookup(9F) or netphygetnext(9F).
lif value returned from a successful call to this func-
tion.
DESCRIPTION
The netlifgetnext() function is used to search through all
of the logical interfaces that are associated with a physi-
cal network interface. To start searching through this list,
a value of 0 should be passed through as the value of lif.
When 0 is returned by this function, the last of the inter-
faces owned by this protocol has been reached.
When called successfully, the value returned represents a
logical interface that exists, at the time of the call,
within the scope of the network interface and its assigned
network protocol. This value is only guaranteed to be unique
for a name within the scope of the network interface and its
assigned protocol.
EXAMPLES
netdatat net;
phyift ifp;
netift lif;
char buffer[32];
netifaddrt atype[1];
struct sockaddrin sin[1];
net = netprotocollookup("inet");
SunOS 5.11 Last change: 1 May 2008 1
Kernel Functions for Drivers netlifgetnext(9F)
if (net != NUL) {
atype[0] = NADRES;
ifp = netphylookup(net, "hme0");
for (lif = netlifgetnext(net, 0); lif != 0;
lif = netlifgetnext(net, lif)) {
/* Do something with lif */
if (netgetlifaddr(net, ifp, lif, 1, atype, sin) == 0)
printf("hme0:%d %x0, lif,
ntohl(sin[0].sinaddr.saddr));
}
}
RETURN VALUES
The netlifgetnext() function returns a value of -1 if it is
not supported by the network protocol and a value of 0 if an
attempt to go beyond the last network interface is made.
Otherwise, it returns a value representing a network inter-
face.
CONTEXT
The netlifgetnext() function may be called from user, ker-
nel, or interrupt context.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsu
Interface Stability Committed
SEE ALSO
netphygetnext(9F), netphylookup(9F)
SunOS 5.11 Last change: 1 May 2008 2
|