1net_phygetnext(9F)       Kernel Functions for Drivers       net_phygetnext(9F)
2
3
4

NAME

6       net_phygetnext - search through the current list of network interfaces
7

SYNOPSIS

9       #include <sys/neti.h>
10
11       phy_if_t net_phygetnext(const net_data_t net, const phy_if_t ifp);
12
13

INTERFACE LEVEL

15       Solaris DDI specific (Solaris DDI).
16

PARAMETERS

18       net    value   returned   from   a   successful   call   to  net_proto‐
19              col_lookup(9F).
20
21
22       ifp    value returned from  a  successful  call  to  this  function  or
23              net_phylookup(9F).
24
25

DESCRIPTION

27       The  net_phygetnext()  function  searches  through  all  of the network
28       interfaces that a network protocol "owns". To start  searching  through
29       all  of  the  interfaces  owned  by  a protocol, a value of 0 should be
30       passed through as the value of ifp. When 0 is returned  by  this  func‐
31       tion,  the  last  of  the  interfaces  owned  by this protocol has been
32       reached.
33
34
35       When called successfully,  the  value  returned  represents  a  network
36       interface that exists, at the time of the call, within the scope of the
37       network interface. This value is only guaranteed to  be  unique  for  a
38       name within the scope of the network protocol.
39

EXAMPLES

41            net_data_t net;
42             phy_if_t ifp;
43             char buffer[32];
44
45             net = net_protocol_lookup("inet");
46
47             if (net != NULL) {
48                  for (ifp = net_phygetnext(net, 0); ifp != 0;
49                       ifp = net_phygetnext(net, ifp)) {
50                       /* Do something with ifp */
51                       if (net_getifname(net, ifp, buffer,
52                            sizeof(buffer) >= 0)
53                             printf("Interface %s0, buffer);
54                   }
55               }
56
57
58

RETURN VALUES

60       The  net_phygetnext() function returns -1 if it is not supported by the
61       network  protocol or 0 if an attempt to  go  beyond  the  last  network
62       interface   is   made.  Otherwise,  it returns  a  value representing a
63       network interface.
64

CONTEXT

66       The net_phygetnext() function may be  called  from  user,   kernel,  or
67       interrupt context.
68

ATTRIBUTES

70       See attributes(5) for descriptions of the following attributes:
71
72
73
74
75       ┌─────────────────────────────┬─────────────────────────────┐
76       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
77       ├─────────────────────────────┼─────────────────────────────┤
78       │Availability                 │SUNWcsu                      │
79       ├─────────────────────────────┼─────────────────────────────┤
80       │Interface Stability          │Committed                    │
81       └─────────────────────────────┴─────────────────────────────┘
82

SEE ALSO

84       net_phylookup(9F), net_protocol_lookup(9F), attributes(5)
85
86
87
88SunOS 5.11                        1 May 2008                net_phygetnext(9F)
Impressum