2 .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH NET_PHYGETNEXT 9F "May 1, 2008"
8 net_phygetnext \- search through the current list of network interfaces
14 \fBphy_if_t\fR \fBnet_phygetnext\fR(\fBconst\fR \fBnet_data_t\fR \fInet\fR, \fBconst\fR \fBphy_if_t\fR \fIifp\fR);
20 Solaris DDI specific (Solaris DDI).
28 value returned from a successful call to \fBnet_protocol_lookup\fR(9F).
37 value returned from a successful call to this function or
38 \fBnet_phylookup\fR(9F).
44 The \fBnet_phygetnext()\fR function searches through all of the network
45 interfaces that a network protocol "owns". To start searching through all of
46 the interfaces owned by a protocol, a value of 0 should be passed through as
47 the value of \fBifp\fR. When 0 is returned by this function, the last of the
48 interfaces owned by this protocol has been reached.
51 When called successfully, the value returned represents a network interface
52 that exists, at the time of the call, within the scope of the network
53 interface. This value is only guaranteed to be unique for a name within the
54 scope of the network protocol.
63 net = net_protocol_lookup("inet");
66 for (ifp = net_phygetnext(net, 0); ifp != 0;
67 ifp = net_phygetnext(net, ifp)) {
68 /* Do something with ifp */
69 if (net_getifname(net, ifp, buffer,
71 printf("Interface %s0, buffer);
81 The \fBnet_phygetnext()\fR function returns -1 if it is not supported by the
82 network protocol or 0 if an attempt to go beyond the last network interface
83 is made. Otherwise, it returns a value representing a network interface.
87 The \fBnet_phygetnext()\fR function may be called from user, kernel, or
92 See \fBattributes\fR(5) for descriptions of the following attributes:
100 ATTRIBUTE TYPE ATTRIBUTE VALUE
102 Interface Stability Committed
108 \fBnet_phylookup\fR(9F), \fBnet_protocol_lookup\fR(9F), \fBattributes\fR(5)