Lines Matching defs:ifp
380 const struct interface *ifp,
391 ifp->hwaddr, ifp->hwlen,
392 ifp->ssid, ifp->ssid_len,
394 ifp->ctx->secret, ifp->ctx->secret_len);
402 ipv6_makeaddr(struct in6_addr *addr, const struct interface *ifp,
413 if (ifp->options->options & DHCPCD_SLAACPRIVATE) {
414 if (ifp->ctx->secret_len == 0) {
415 if (ipv6_readsecret(ifp->ctx) == -1)
420 prefix, prefix_len, ifp, &dad) == -1)
429 if ((ap = ipv6_linklocal(ifp)) == NULL) {
637 struct interface *ifp;
643 TAILQ_FOREACH(ifp, ap->iface->ctx->ifaces, next) {
644 if (ifp == ap->iface || strcmp(ifp->name, ap->iface->name) == 0)
646 state = IPV6_STATE(ifp);
891 ipv6_getstate(struct interface *ifp)
895 state = IPV6_STATE(ifp);
897 ifp->if_data[IF_DATA_IPV6] = calloc(1, sizeof(*state));
898 state = IPV6_STATE(ifp);
900 logger(ifp->ctx, LOG_ERR, "%s: %m", __func__);
907 if (ifp->options &&
908 ifp->options->options & DHCPCD_IPV6RA_OWN &&
909 ip6_use_tempaddr(ifp->name))
910 ipv6_regentempifid(ifp);
920 struct interface *ifp;
939 TAILQ_FOREACH(ifp, ifs, next) {
941 if (strcmp(ifp->name, ifname))
943 state = ipv6_getstate(ifp);
970 ap->iface = ifp;
1045 ipv6_iffindaddr(const struct interface *ifp, const struct in6_addr *addr)
1050 state = IPV6_CSTATE(ifp);
1068 ipv6_addlinklocalcallback(struct interface *ifp,
1074 state = ipv6_getstate(ifp);
1082 logger(ifp->ctx, LOG_ERR, "%s: %m", __func__);
1093 ipv6_newlinklocal(struct interface *ifp)
1099 ap->iface = ifp;
1117 ipv6_addlinklocal(struct interface *ifp)
1124 if (!(ifp->options->options & DHCPCD_SLAACPRIVATE)) {
1125 switch (ifp->family) {
1128 if (ifp->hwlen != 6 && ifp->hwlen != 8) {
1132 if (memcmp(ifp->hwaddr, allzero, ifp->hwlen) == 0 ||
1133 memcmp(ifp->hwaddr, allone, ifp->hwlen) == 0)
1145 state = ipv6_getstate(ifp);
1149 ap = ipv6_newlinklocal(ifp);
1153 if (ifp->options->options & DHCPCD_SLAACPRIVATE) {
1157 &ap->prefix, ap->prefix_len, ifp, &dadcounter) == -1)
1165 switch (ifp->family) {
1167 if (ifp->hwlen == 6) {
1168 ap->addr.s6_addr[ 8] = ifp->hwaddr[0];
1169 ap->addr.s6_addr[ 9] = ifp->hwaddr[1];
1170 ap->addr.s6_addr[10] = ifp->hwaddr[2];
1173 ap->addr.s6_addr[13] = ifp->hwaddr[3];
1174 ap->addr.s6_addr[14] = ifp->hwaddr[4];
1175 ap->addr.s6_addr[15] = ifp->hwaddr[5];
1176 } else if (ifp->hwlen == 8)
1177 memcpy(&ap->addr.s6_addr[8], ifp->hwaddr, 8);
1199 if (ifp->options->options &
1227 ipv6_start(struct interface *ifp)
1234 if (ifp->flags & IFF_POINTOPOINT)
1237 state = IPV6_CSTATE(ifp);
1245 if (ifp->options->options & DHCPCD_IPV6RA_OWN &&
1246 ip6_use_tempaddr(ifp->name))
1247 ipv6_regentempifid(ifp);
1251 if (ap == NULL && ipv6_addlinklocal(ifp) == -1)
1255 if_initrt6(ifp);
1260 ipv6_freedrop(struct interface *ifp, int drop)
1265 if (ifp == NULL)
1268 if ((state = IPV6_STATE(ifp)) == NULL)
1281 ifp->if_data[IF_DATA_IPV6] = NULL;
1282 eloop_timeout_delete(ifp->ctx->eloop, NULL, ifp);
1352 const struct interface *ifp;
1356 TAILQ_FOREACH(ifp, ctx->ifaces, next) {
1357 ifp))) {
1373 ipv6_regen_desync(struct interface *ifp, int force)
1378 state = IPV6_STATE(ifp);
1384 max = ip6_temp_preferred_lifetime(ifp->name) - REGEN_ADVANCE;
1391 max = ip6_temp_preferred_lifetime(ifp->name) -
1393 eloop_timeout_add_sec(ifp->ctx->eloop, max, ipv6_regentempifid, ifp);
1397 ipv6_gentempifid(struct interface *ifp)
1404 if ((state = IPV6_STATE(ifp)) == NULL)
1439 ipv6_findaddrid(ifp->ctx, state->randomid))
1490 const struct interface *ifp;
1526 TAILQ_FOREACH(ifp, ia0->iface->ctx->ifaces, next) {
1527 cstate = IPV6_CSTATE(ifp);
1584 ipv6_settempstale(struct interface *ifp)
1589 state = IPV6_STATE(ifp);
1675 ipv6_addtempaddrs(struct interface *ifp, const struct timespec *now)
1680 state = IPV6_STATE(ifp);
1707 struct interface *ifp = arg;
1710 state = IPV6_STATE(ifp);
1712 ipv6_gentempifid(ifp);
1714 ipv6_regen_desync(ifp, 1);
1898 make_route(const struct interface *ifp, const struct ra *rap)
1904 logger(ifp->ctx, LOG_ERR, "%s: %m", __func__);
1907 r->iface = ifp;
1909 r->metric = ifp->metric;
1919 make_prefix(const struct interface *ifp, const struct ra *rap,
1940 r = make_route(ifp, rap);
2003 const struct interface *ifp;
2008 TAILQ_FOREACH(ifp, ctx->ifaces, next) {
2009 ifp);
2012 rt = make_prefix(ifp, NULL, addr);
2071 //rt->src.s_addr = ifp->addr.s_addr;
2078 // or->src.s_addr != ifp->addr.s_addr ||