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

NAME

6       net_lifgetnext - search through a list of logical network interfaces
7

SYNOPSIS

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

INTERFACE LEVEL

16       Solaris DDI specific (Solaris DDI).
17

PARAMETERS

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

DESCRIPTION

31       The net_lifgetnext() function is used to search through all of the log‐
32       ical interfaces that are associated with a physical network  interface.
33       To  start  searching  through  this list, a value of 0 should be passed
34       through as the value of lif. When 0 is returned by this  function,  the
35       last of the interfaces owned by this protocol has been reached.
36
37
38       When  called  successfully,  the  value  returned  represents a logical
39       interface that exists, at the time of the call, within the scope of the
40       network interface and its assigned network protocol. This value is only
41       guaranteed to be unique for a name within  the  scope  of  the  network
42       interface and its assigned protocol.
43

EXAMPLES

45            net_data_t net;
46             phy_if_t ifp;
47             net_if_t lif;
48             char buffer[32];
49             net_ifaddr_t atype[1];
50             struct sockaddr_in sin[1];
51
52             net = net_protocol_lookup("inet");
53
54             if (net != NULL) {
55                  atype[0] = NA_ADDRESS;
56                  ifp = net_phylookup(net, "hme0");
57                  for (lif = net_lifgetnext(net, 0); lif != 0;
58                        lif = net_lifgetnext(net, lif)) {
59                        /* Do something with lif */
60                        if (net_getlifaddr(net, ifp, lif, 1, atype, sin) == 0)
61                              printf("hme0:%d %x0, lif,
62                                  ntohl(sin[0].sin_addr.s_addr));
63                   }
64               }
65
66
67

RETURN VALUES

69       The  net_lifgetnext()  function returns a value of -1 if it is not sup‐
70       ported by the network protocol and a value of 0 if  an  attempt  to  go
71       beyond  the  last  network  interface  is made. Otherwise, it returns a
72       value representing a network interface.
73

CONTEXT

75       The net_lifgetnext() function may be  called  from  user,   kernel,  or
76       interrupt context.
77

ATTRIBUTES

79       See attributes(5) for descriptions of the following attributes:
80
81
82
83
84       ┌─────────────────────────────┬─────────────────────────────┐
85       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
86       ├─────────────────────────────┼─────────────────────────────┤
87       │Availability                 │SUNWcsu                      │
88       ├─────────────────────────────┼─────────────────────────────┤
89       │Interface Stability          │Committed                    │
90       └─────────────────────────────┴─────────────────────────────┘
91

SEE ALSO

93       net_phygetnext(9F), net_phylookup(9F)
94
95
96
97SunOS 5.11                        1 May 2008                net_lifgetnext(9F)
Impressum