Print this page
Clearview IPMP manpages
| Split |
Close |
| Expand all |
| Collapse all |
--- old/./if_nameindex.txt
+++ new/./if_nameindex.txt
1 1 Sockets Library Functions if_nametoindex(3SOCKET)
2 2
3 3
4 4
5 5 NAME
6 6 if_nametoindex, if_indextoname, if_nameindex,
7 7 if_freenameindex - routines to map Internet Protocol network
8 8 interface names and interface indexes
9 9
10 10 SYNOPSIS
11 11 cc [ flag... ] file... -lsocket [ library... ]
12 12 #include <net/if.h>
13 13
14 14 unsigned int if_nametoindex(const char *ifname);
15 15
16 16
17 17 char *if_indextoname(unsigned int ifindex, char *ifname);
18 18
19 19
20 20 struct if_nameindex *if_nameindex(void)
21 21
22 22
23 23 void if_freenameindex(struct if_nameindex *ptr);
24 24
25 25
26 26 PARAMETERS
27 27 ifname interface name
28 28
29 29
30 30 ifindex interface index
31 31
32 32
33 33 ptr pointer returned by if_nameindex()
34 34
35 35
36 36 DESCRIPTION
37 37 This API defines two functions that map between an Internet
38 38 Protocol network interface name and index, a third function
39 39 that returns all the interface names and indexes, and a
40 40 fourth function to return the dynamic memory allocated by
41 41 the previous function.
42 42
43 43
44 44 Network interfaces are normally known by names such as eri0,
45 45 sl1, ppp2, and the like. The ifname argument must point to
46 46 a buffer of at least IF_NAMESIZE bytes into which the inter-
47 47 face name corresponding to the specified index is returned.
48 48 IF_NAMESIZE is defined in <net/if.h> and its value includes
49 49 a terminating null byte at the end of the interface name.
50 50
51 51 if_nametoindex() The if_nametoindex() function returns
52 52 the interface index corresponding to
53 53 the interface name pointed to by the
54 54 ifname pointer. If the specified
55 55 interface name does not exist, the
56 56 return value is 0, and errno is set to
57 57
58 58
59 59
60 60 SunOS 5.11 Last change: 12 Dec 2003 1
61 61
62 62
63 63
64 64
65 65
66 66
67 67 Sockets Library Functions if_nametoindex(3SOCKET)
68 68
69 69
70 70
71 71 ENXIO. If there was a system error,
72 72 such as running out of memory, the
73 73 return value is 0 and errno is set to
74 74 the proper value, for example, ENOMEM.
75 75
76 76
77 77 if_indextoname() The if_indextoname() function maps an
78 78 interface index into its corresponding
|
↓ open down ↓ |
78 lines elided |
↑ open up ↑ |
79 79 name. This pointer is also the return
80 80 value of the function. If there is no
81 81 interface corresponding to the speci-
82 82 fied index, NULL is returned, and
83 83 errno is set to ENXIO, if there was a
84 84 system error, such as running out of
85 85 memory, if_indextoname() returns NULL
86 86 and errno would be set to the proper
87 87 value, for example, ENOMEM.
88 88
89 -
90 - *if_nameindex() The if_nameindex() function returns an
89 +
90 + if_nameindex() The if_nameindex() function returns an
91 91 array of if_nameindex structures, one
92 92 structure per interface. The
93 93 if_nameindex structure holds the
94 94 information about a single interface
95 95 and is defined when the <net/if.h>
96 96 header is included:
97 97
98 98 struct if_nameindex
99 99 unsigned int if_index; /* 1, 2, ... */
100 - char *if_name; /* null terminated name: "eri0", ... */
100 + char *if_name; /* "net0", ... */
101 101 };
102 102
103 + While any IPMP IP interfaces are
104 + returned by *if_nameindex()*, the
105 + underlying IP interfaces that comprise
106 + each IPMP group are not returned.
107 +
103 108 The end of the array of structures is
104 109 indicated by a structure with an
105 110 if_index of 0 and an if_name of NULL.
106 111 The function returns a null pointer
107 112 upon an error and sets errno to the
108 113 appropriate value. The memory used for
109 114 this array of structures along with
110 115 the interface names pointed to by the
111 116 if_name members is obtained dynami-
112 117 cally. This memory is freed by the
113 118 if_freenameindex() function.
114 119
115 120
116 121 if_freenameindex() The if_freenameindex() function frees
117 122 the dynamic memory that was allocated
118 123 by if_nameindex(). The argument to
119 124 this function must be a pointer that
120 125 was returned by if_nameindex().
121 126
122 127
123 128
124 129
125 130
126 131 SunOS 5.11 Last change: 12 Dec 2003 2
127 132
128 133
129 134
130 135
131 136
132 137
133 138 Sockets Library Functions if_nametoindex(3SOCKET)
134 139
135 140
136 141
137 142 ATTRIBUTES
138 143 See attributes(5) for descriptions of the following attri-
139 144 butes:
140 145
141 146
142 147
143 148 ____________________________________________________________
144 149 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
145 150 |_____________________________|_____________________________|
146 151 | Availability | SUNWcsl (32-bit) |
147 152 | | SUNWcslx (64-bit) |
148 153 |_____________________________|_____________________________|
149 154 | MT Level | MT Safe |
150 155 |_____________________________|_____________________________|
151 156
152 157
153 158 SEE ALSO
154 159 ifconfig(1M), if_nametoindex(3XNET), attributes(5), if(7P)
155 160
156 161
157 162
158 163
159 164
160 165
161 166
162 167
163 168
164 169
165 170
166 171
167 172
168 173
169 174
170 175
171 176
172 177
173 178
174 179
175 180
176 181
177 182
178 183
179 184
180 185
181 186
182 187
183 188
184 189
185 190
186 191
187 192
188 193
189 194
190 195
191 196
192 197 SunOS 5.11 Last change: 12 Dec 2003 3
193 198
194 199
195 200
|
↓ open down ↓ |
83 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX