Kernel functions net_lifgetnext(9F) NAME net_lifgetnext - iterate through a list of logical network interfaces SYNOPSIS #include net_if_t net_lifgetnext(const net_data_t net, const phy_if_t ifp, net_if_t lif); INTERFACE LEVEL Solaris DDI specific (Solaris DDI) PARAMETERS net value returned from a successful call to net_protocol_lookup. ifp value returned from a successful call to net_phylookup or net_phygetnext. lif value returned from a successful call to net_lifgetnext. DESCRIPTION This function can be used to enumerate through all of the logical interfaces that are associated with a physical net- work interface. To start walking through this list, 0 should be passed through as the value of lif. When 0 is returned by this function, the last of the interfaces owned by this protocol will have 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. The value representing a network inter- face is only guaranteed to be unique for a name within the scope of the network interface and its assigned protocol. EXAMPLES net_data_t net; phy_if_t ifp; net_if_t lif; char buffer[32]; SunOS 5.10 Last change: 25 March 2008 1 Kernel functions net_lifgetnext(9F) net_ifaddr_t atype[1]; struct sockaddr_in sin[1]; net = net_protocol_lookup("inet"); if (net != NULL) { atype[0] = NA_ADDRESS; ifp = net_phylookup(net, "hme0"); for (lif = net_lifgetnext(net, 0); lif != 0; lif = net_lifgetnext(net, lif)) { /* Do something with lif */ if (net_getlifaddr(net, ifp, lif, 1, atype, sin) == 0) printf("hme0:%d %x0, lif, ntohl(sin[0].sin_addr.s_addr)); } } RETURN VALUES This interface returns "-1" if it is not support by the net- work protocol, "0" if an attempt to go beyond the last net- work interface is made and otherwise returns a value representing a network interface. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| SEE ALSO net_phylookup(9f), net_phygetnext(9f) SunOS 5.10 Last change: 25 March 2008 2