Lines Matching defs:iter
144 static void linux_if_inet6_first(isc_interfaceiter_t *iter);
157 linux_if_inet6_first(isc_interfaceiter_t *iter) {
158 if (iter->proc != NULL) {
159 rewind(iter->proc);
160 (void)linux_if_inet6_next(iter);
162 iter->valid = ISC_R_NOMORE;
166 linux_if_inet6_next(isc_interfaceiter_t *iter) {
167 if (iter->proc != NULL &&
168 fgets(iter->entry, sizeof(iter->entry), iter->proc) != NULL)
169 iter->valid = ISC_R_SUCCESS;
171 iter->valid = ISC_R_NOMORE;
172 return (iter->valid);
176 linux_if_inet6_current(isc_interfaceiter_t *iter) {
184 if (iter->valid != ISC_R_SUCCESS)
185 return (iter->valid);
186 if (iter->proc == NULL) {
189 "/proc/net/if_inet6:iter->proc == NULL");
193 res = sscanf(iter->entry, "%32[a-f0-9] %x %x %x %x %16s\n",
215 iter->current.af = AF_INET6;
216 iter->current.flags = INTERFACE_F_UP;
217 isc_netaddr_fromin6(&iter->current.address, &addr6);
218 if (isc_netaddr_islinklocal(&iter->current.address)) {
219 isc_netaddr_setzone(&iter->current.address,
231 isc_netaddr_fromin6(&iter->current.netmask, &addr6);
232 strlcpy(iter->current.name, name, sizeof(iter->current.name));
242 isc_interfaceiter_current(isc_interfaceiter_t *iter,
245 REQUIRE(iter->result == ISC_R_SUCCESS);
246 memmove(ifdata, &iter->current, sizeof(*ifdata));
251 isc_interfaceiter_first(isc_interfaceiter_t *iter) {
254 REQUIRE(VALID_IFITER(iter));
256 internal_first(iter);
258 result = internal_current(iter);
261 result = internal_next(iter);
265 iter->result = result;
270 isc_interfaceiter_next(isc_interfaceiter_t *iter) {
273 REQUIRE(VALID_IFITER(iter));
274 REQUIRE(iter->result == ISC_R_SUCCESS);
277 result = internal_next(iter);
280 result = internal_current(iter);
284 iter->result = result;
291 isc_interfaceiter_t *iter;
293 iter = *iterp;
294 REQUIRE(VALID_IFITER(iter));
296 internal_destroy(iter);
297 if (iter->buf != NULL)
298 isc_mem_put(iter->mctx, iter->buf, iter->bufsize);
300 iter->magic = 0;
301 isc_mem_put(iter->mctx, iter, sizeof(*iter));