• Home
  • Raw
  • Download

Lines Matching refs:ifp

106 if_free(struct interface *ifp)  in if_free()  argument
109 if (ifp == NULL) in if_free()
111 ipv4_free(ifp); in if_free()
112 dhcp_free(ifp); in if_free()
113 dhcp6_free(ifp); in if_free()
114 ipv6nd_free(ifp); in if_free()
115 ipv6_free(ifp); in if_free()
116 free_options(ifp->options); in if_free()
117 free(ifp); in if_free()
155 if_setflag(struct interface *ifp, short flag) in if_setflag() argument
163 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); in if_setflag()
173 ifp->flags = (unsigned int)ifr.ifr_flags; in if_setflag()
195 struct interface *ifp; in if_learnaddrs1() local
208 if ((ifp = if_find(ifs, ifa->ifa_name)) == NULL) in if_learnaddrs1()
222 ifa_flags = if_addrflags(&addr->sin_addr, ifp); in if_learnaddrs1()
239 ifa_flags = if_addrflags6(&sin6->sin6_addr, ifp); in if_learnaddrs1()
259 struct interface *ifp; in if_discover() local
315 TAILQ_FOREACH(ifp, ifs, next) { in if_discover()
316 if (strcmp(ifp->name, ifa->ifa_name) == 0) in if_discover()
319 if (ifp) in if_discover()
384 ifp = calloc(1, sizeof(*ifp)); in if_discover()
385 if (ifp == NULL) { in if_discover()
389 ifp->ctx = ctx; in if_discover()
391 strlcpy(ifp->alias, alias, sizeof(ifp->alias)); in if_discover()
393 strlcpy(ifp->name, p, sizeof(ifp->name)); in if_discover()
395 strlcpy(ifp->lease_identifier, lease_identifier, in if_discover()
396 sizeof(ifp->lease_identifier)); in if_discover()
398 ifp->flags = ifa->ifa_flags; in if_discover()
399 ifp->carrier = if_carrier(ifp); in if_discover()
407 strlcpy(iflr.iflr_name, ifp->name, in if_discover()
416 if_free(ifp); in if_discover()
421 ifp->index = sdl->sdl_index; in if_discover()
436 !if_hasconf(ctx, ifp->name)) in if_discover()
438 logger(ifp->ctx, LOG_DEBUG, in if_discover()
442 ifp->name); in if_discover()
443 if_free(ifp); in if_discover()
455 ifp->family = ARPHRD_ETHER; in if_discover()
459 ifp->family = ARPHRD_IEEE1394; in if_discover()
464 ifp->family = ARPHRD_INFINIBAND; in if_discover()
471 !if_hasconf(ctx, ifp->name)) in if_discover()
473 if_free(ifp); in if_discover()
476 logger(ifp->ctx, LOG_WARNING, in if_discover()
478 ifp->name, sdl->sdl_type); in if_discover()
480 ifp->family = ARPHRD_ETHER; in if_discover()
483 ifp->hwlen = sdl->sdl_alen; in if_discover()
487 memcpy(ifp->hwaddr, CLLADDR(sdl), ifp->hwlen); in if_discover()
490 ifp->index = (unsigned int)sll->sll_ifindex; in if_discover()
491 ifp->family = sll->sll_hatype; in if_discover()
492 ifp->hwlen = sll->sll_halen; in if_discover()
493 if (ifp->hwlen != 0) in if_discover()
494 memcpy(ifp->hwaddr, sll->sll_addr, ifp->hwlen); in if_discover()
500 ifp->index = if_nametoindex(ifp->name); in if_discover()
504 if (ifp->family != ARPHRD_ETHER) { in if_discover()
506 ctx->ifac == 0 && !if_hasconf(ctx, ifp->name)) in if_discover()
508 if_free(ifp); in if_discover()
511 switch (ifp->family) { in if_discover()
526 logger(ifp->ctx, LOG_WARNING, in if_discover()
528 ifp->name, ifp->family); in if_discover()
535 if (if_init(ifp) == -1) { in if_discover()
536 logger(ifp->ctx, LOG_ERR, "%s: if_init: %m", p); in if_discover()
537 if_free(ifp); in if_discover()
542 if (if_getmtu(ifp->name) < MTU_MIN && in if_discover()
543 if_setmtu(ifp->name, MTU_MIN) == -1) in if_discover()
545 logger(ifp->ctx, LOG_ERR, "%s: set_mtu: %m", p); in if_discover()
546 if_free(ifp); in if_discover()
553 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name)); in if_discover()
555 ifp->metric = ifr.ifr_metric; in if_discover()
559 ifp->metric = 200 + ifp->index; in if_discover()
560 if (if_getssid(ifp) != -1) { in if_discover()
561 ifp->wireless = 1; in if_discover()
562 ifp->metric += 100; in if_discover()
566 TAILQ_INSERT_TAIL(ifs, ifp, next); in if_discover()
595 struct interface *ifp; in if_findindexname() local
597 TAILQ_FOREACH(ifp, ifaces, next) { in if_findindexname()
598 if ((ifp->options == NULL || in if_findindexname()
599 !(ifp->options->options & DHCPCD_PFXDLGONLY)) && in if_findindexname()
600 ((name && strcmp(ifp->name, name) == 0) || in if_findindexname()
602 (name && strcmp(ifp->alias, name) == 0) || in if_findindexname()
604 (!name && ifp->index == idx))) in if_findindexname()
605 return ifp; in if_findindexname()
699 struct interface *ifp, *ift; in if_sortinterfaces() local
702 (ifp = TAILQ_FIRST(ctx->ifaces)) == NULL || in if_sortinterfaces()
703 TAILQ_NEXT(ifp, next) == NULL) in if_sortinterfaces()
707 TAILQ_REMOVE(ctx->ifaces, ifp, next); in if_sortinterfaces()
708 TAILQ_INSERT_HEAD(&sorted, ifp, next); in if_sortinterfaces()
709 while ((ifp = TAILQ_FIRST(ctx->ifaces))) { in if_sortinterfaces()
710 TAILQ_REMOVE(ctx->ifaces, ifp, next); in if_sortinterfaces()
712 if (if_cmp(ifp, ift) == -1) { in if_sortinterfaces()
713 TAILQ_INSERT_BEFORE(ift, ifp, next); in if_sortinterfaces()
718 TAILQ_INSERT_TAIL(&sorted, ifp, next); in if_sortinterfaces()