Lines Matching refs:ifo
584 struct if_options *ifo = ifp->options; in get_option_routes() local
593 if (!has_option_mask(ifo->nomask, DHO_CSR)) in get_option_routes()
598 if (!p && !has_option_mask(ifo->nomask, DHO_MSCSR)) { in get_option_routes()
609 if (!(ifo->options & DHCPCD_CSR_WARNED) && in get_option_routes()
615 ifo->options |= DHCPCD_CSR_WARNED; in get_option_routes()
628 if (!has_option_mask(ifo->nomask, DHO_STATICROUTE)) in get_option_routes()
658 if (!has_option_mask(ifo->nomask, DHO_ROUTER)) in get_option_routes()
723 struct if_options *ifo = ifp->options; in make_message() local
759 if (ifo->options & DHCPCD_BROADCAST && in make_message()
774 if (!(ifo->options & DHCPCD_BOOTP)) { in make_message()
812 has_option_mask(ifo->requestmask, DHO_RAPIDCOMMIT)) in make_message()
819 if (type == DHCP_DISCOVER && ifo->options & DHCPCD_REQUEST) in make_message()
820 PUTADDR(DHO_IPADDRESS, ifo->req_addr); in make_message()
823 if (type == DHCP_DISCOVER && ifo->options & DHCPCD_IPV4LL) { in make_message()
833 if (!(ifo->options & DHCPCD_BOOTP)) { in make_message()
853 if (ifo->userclass[0]) { in make_message()
855 memcpy(p, ifo->userclass, in make_message()
856 (size_t)ifo->userclass[0] + 1); in make_message()
857 p += ifo->userclass[0] + 1; in make_message()
860 if (ifo->vendorclassid[0]) { in make_message()
862 memcpy(p, ifo->vendorclassid, in make_message()
863 (size_t)ifo->vendorclassid[0] + 1); in make_message()
864 p += ifo->vendorclassid[0] + 1; in make_message()
868 if (ifo->leasetime != 0) { in make_message()
871 ul = htonl(ifo->leasetime); in make_message()
877 if (ifo->hostname[0] == '\0') in make_message()
879 ifo->options & DHCPCD_HOSTNAME_SHORT ? 1 : 0); in make_message()
881 hostname = ifo->hostname; in make_message()
891 if (ifo->fqdn != FQDN_DISABLE) { in make_message()
907 *p++ = (uint8_t)((ifo->fqdn & 0x09) | 0x04); in make_message()
917 } else if (ifo->options & DHCPCD_HOSTNAME && hostname) { in make_message()
926 if (ifo->vendor[0]) { in make_message()
928 memcpy(p, ifo->vendor, (size_t)ifo->vendor[0] + 1); in make_message()
929 p += ifo->vendor[0] + 1; in make_message()
932 if ((ifo->auth.options & DHCPCD_AUTH_SENDREQUIRE) != in make_message()
941 if (ifo->vivco_len) { in make_message()
945 ul = htonl(ifo->vivco_en); in make_message()
948 for (i = 0, vivco = ifo->vivco; in make_message()
949 i < ifo->vivco_len; in make_message()
980 has_option_mask(ifo->requestmask, opt->option))) in make_message()
993 for (i = 0, opt = ifo->dhcp_override; in make_message()
994 i < ifo->dhcp_override_len; in make_message()
1004 has_option_mask(ifo->requestmask, opt->option))) in make_message()
1024 if (ifo->auth.options & DHCPCD_AUTH_SEND) { in make_message()
1025 ssize_t alen = dhcp_auth_encode(&ifo->auth, in make_message()
1055 if (ifo->auth.options & DHCPCD_AUTH_SEND && auth_len != 0) in make_message()
1056 dhcp_auth_encode(&ifo->auth, state->auth.token, in make_message()
1229 dhcp_getoverride(const struct if_options *ifo, unsigned int o) in dhcp_getoverride() argument
1234 for (i = 0, opt = ifo->dhcp_override; in dhcp_getoverride()
1235 i < ifo->dhcp_override_len; in dhcp_getoverride()
1281 const struct if_options *ifo; in dhcp_env() local
1294 ifo = ifp->options; in dhcp_env()
1308 if (has_option_mask(ifo->nomask, opt->option)) in dhcp_env()
1310 if (dhcp_getoverride(ifo, opt->option)) in dhcp_env()
1318 for (i = 0, opt = ifo->dhcp_override; in dhcp_env()
1319 i < ifo->dhcp_override_len; in dhcp_env()
1322 if (has_option_mask(ifo->nomask, opt->option)) in dhcp_env()
1389 if (has_option_mask(ifo->nomask, opt->option)) in dhcp_env()
1391 if (dhcp_getoverride(ifo, opt->option)) in dhcp_env()
1414 for (i = 0, opt = ifo->dhcp_override; in dhcp_env()
1415 i < ifo->dhcp_override_len; in dhcp_env()
1418 if (has_option_mask(ifo->nomask, opt->option)) in dhcp_env()
1644 struct if_options *ifo = ifp->options; in send_message() local
1660 ifo->options & DHCPCD_BOOTP ? "BOOTP" : get_dhcp_op(type), in send_message()
1677 ifo->options & DHCPCD_BOOTP ? "BOOTP" : get_dhcp_op(type), in send_message()
1707 (!(ifo->options & DHCPCD_INFORM) && in send_message()
1823 struct if_options *ifo = ifp->options; in dhcp_discover() local
1831 if (ifo->fallback) in dhcp_discover()
1833 ifo->reboot, dhcp_fallback, ifp); in dhcp_discover()
1834 else if (ifo->options & DHCPCD_IPV4LL && in dhcp_discover()
1837 ifo->reboot, ipv4ll_start, ifp); in dhcp_discover()
1838 if (ifo->options & DHCPCD_REQUEST) in dhcp_discover()
1841 ifp->name, inet_ntoa(ifo->req_addr)); in dhcp_discover()
1845 ifp->name, ifo->options & DHCPCD_BOOTP ? "BOOTP" : "DHCP"); in dhcp_discover()
2065 struct if_options *ifo = ifp->options; in dhcp_bind() local
2077 if (ifo->options & DHCPCD_STATIC) { in dhcp_bind()
2089 } else if (ifo->options & DHCPCD_INFORM) { in dhcp_bind()
2090 if (ifo->req_addr.s_addr != 0) in dhcp_bind()
2091 lease->addr.s_addr = ifo->req_addr.s_addr; in dhcp_bind()
2171 merge_option_values(state->old, state->new, ifo->requestmask); in dhcp_bind()
2188 if (!(ifo->options & DHCPCD_STATIC) && in dhcp_bind()
2194 !(ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC))) in dhcp_bind()
2201 if (ifo->options & DHCPCD_ARP && in dhcp_bind()
2262 struct if_options *ifo; in dhcp_static() local
2266 ifo = ifp->options; in dhcp_static()
2267 if (ifo->req_addr.s_addr == INADDR_ANY) { in dhcp_static()
2276 state->offer = dhcp_message_new(&ifo->req_addr, &ifo->req_mask); in dhcp_static()
2287 struct if_options *ifo; in dhcp_inform() local
2291 ifo = ifp->options; in dhcp_inform()
2295 state->addr.s_addr = ifo->req_addr.s_addr; in dhcp_inform()
2296 state->net.s_addr = ifo->req_mask.s_addr; in dhcp_inform()
2298 if (ifo->req_addr.s_addr == INADDR_ANY) { in dhcp_inform()
2314 dhcp_message_new(&ifo->req_addr, &ifo->req_mask); in dhcp_inform()
2316 ifo->options |= DHCPCD_STATIC; in dhcp_inform()
2318 ifo->options &= ~DHCPCD_STATIC; in dhcp_inform()
2331 struct if_options *ifo; in dhcp_reboot_newopts() local
2336 ifo = ifp->options; in dhcp_reboot_newopts()
2337 if ((ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC) && in dhcp_reboot_newopts()
2338 state->addr.s_addr != ifo->req_addr.s_addr) || in dhcp_reboot_newopts()
2340 !(ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC)))) in dhcp_reboot_newopts()
2351 struct if_options *ifo; in dhcp_reboot() local
2357 ifo = ifp->options; in dhcp_reboot()
2361 if (ifo->options & DHCPCD_LINK && ifp->carrier == LINK_DOWN) { in dhcp_reboot()
2366 if (ifo->options & DHCPCD_STATIC) { in dhcp_reboot()
2370 if (ifo->options & DHCPCD_UNICAST_ARP) { in dhcp_reboot()
2373 if (ifo->options & DHCPCD_INFORM) { in dhcp_reboot()
2379 if (ifo->reboot == 0 || state->offer == NULL) { in dhcp_reboot()
2393 if (!ifo->fallback && ifo->options & DHCPCD_IPV4LL && in dhcp_reboot()
2396 ifo->reboot, ipv4ll_start, ifp); in dhcp_reboot()
2398 if (ifo->options & DHCPCD_LASTLEASE && state->lease.frominfo) in dhcp_reboot()
2400 ifo->reboot, dhcp_timeout, ifp); in dhcp_reboot()
2401 else if (!(ifo->options & DHCPCD_INFORM)) in dhcp_reboot()
2403 ifo->reboot, dhcp_expire, ifp); in dhcp_reboot()
2542 blacklisted_ip(const struct if_options *ifo, in_addr_t addr) in blacklisted_ip() argument
2546 for (i = 0; i < ifo->blacklist_len; i += 2) in blacklisted_ip()
2547 if (ifo->blacklist[i] == (addr & ifo->blacklist[i + 1])) in blacklisted_ip()
2553 whitelisted_ip(const struct if_options *ifo, in_addr_t addr) in whitelisted_ip() argument
2557 if (ifo->whitelist_len == 0) in whitelisted_ip()
2559 for (i = 0; i < ifo->whitelist_len; i += 2) in whitelisted_ip()
2560 if (ifo->whitelist[i] == (addr & ifo->whitelist[i + 1])) in whitelisted_ip()
2694 struct if_options *ifo; in dhcp_arp_probed() local
2700 ifo = astate->iface->options; in dhcp_arp_probed()
2701 if (state->arping_index < ifo->arping_len) { in dhcp_arp_probed()
2702 if (++state->arping_index < ifo->arping_len) { in dhcp_arp_probed()
2704 ifo->arping[state->arping_index - 1]; in dhcp_arp_probed()
2712 if ((ifo->options & DHCPCD_ARPGW) && (dhcp_probe_gw(astate->iface))) { in dhcp_arp_probed()
2730 struct if_options *ifo; in dhcp_arp_conflicted() local
2733 ifo = astate->iface->options; in dhcp_arp_conflicted()
2735 state->arping_index <= ifo->arping_len && in dhcp_arp_conflicted()
2737 (amsg->sip.s_addr == ifo->arping[state->arping_index - 1] || in dhcp_arp_conflicted()
2739 amsg->tip.s_addr == ifo->arping[state->arping_index - 1]))) in dhcp_arp_conflicted()
2743 astate->failed.s_addr = ifo->arping[state->arping_index - 1]; in dhcp_arp_conflicted()
2828 struct if_options *ifo = ifp->options; in dhcp_handledhcp() local
2843 else if (ifo->options & DHCPCD_BOOTP) { in dhcp_handledhcp()
2856 if (dhcp_auth_validate(&state->auth, &ifo->auth, in dhcp_handledhcp()
2873 } else if (ifo->auth.options & DHCPCD_AUTH_REQUIRE) { in dhcp_handledhcp()
2876 } else if (ifo->auth.options & DHCPCD_AUTH_SEND) in dhcp_handledhcp()
2935 if (has_option_mask(ifo->rejectmask, i) && in dhcp_handledhcp()
2963 if (has_option_mask(ifo->requiremask, i) && in dhcp_handledhcp()
3114 if (!(ifo->options & DHCPCD_INFORM)) in dhcp_handledhcp()
3117 ifo->options &= ~DHCPCD_STATIC; in dhcp_handledhcp()
3150 if ((ifo->options & DHCPCD_ARP || state->nak_receive_count > 0 || in dhcp_handledhcp()
3171 if ((ifo->options & DHCPCD_ARPGW) && (dhcp_probe_gw(ifp))) { in dhcp_handledhcp()
3463 const struct if_options *ifo; in dhcp_init() local
3465 char buf[(sizeof(ifo->clientid) - 1) * 3]; in dhcp_init()
3487 ifo = ifp->options; in dhcp_init()
3490 if (ifo->options & DHCPCD_REQUEST) in dhcp_init()
3496 if (*ifo->clientid) { in dhcp_init()
3497 state->clientid = malloc((size_t)(ifo->clientid[0] + 1)); in dhcp_init()
3500 memcpy(state->clientid, ifo->clientid, in dhcp_init()
3501 (size_t)(ifo->clientid[0]) + 1); in dhcp_init()
3502 } else if (ifo->options & DHCPCD_CLIENTID) { in dhcp_init()
3503 if (ifo->options & DHCPCD_DUID) { in dhcp_init()
3509 memcpy(state->clientid + 2, ifo->iaid, 4); in dhcp_init()
3524 if (ifo->options & DHCPCD_DUID) in dhcp_init()
3529 if (ifo->options & DHCPCD_CLIENTID) in dhcp_init()
3547 struct if_options *ifo = ifp->options; in dhcp_start1() local
3553 if (!(ifo->options & DHCPCD_IPV4)) in dhcp_start1()
3582 if (state->arping_index < ifo->arping_len) { in dhcp_start1()
3594 if (ifo->options & DHCPCD_STATIC) { in dhcp_start1()
3599 if (ifo->options & DHCPCD_DHCP && dhcp_open(ifp) == -1) in dhcp_start1()
3602 if (ifo->options & DHCPCD_INFORM) { in dhcp_start1()
3606 if (ifp->hwlen == 0 && ifo->clientid[0] == '\0') { in dhcp_start1()
3628 !(ifo->options & DHCPCD_BOOTP)) || in dhcp_start1()
3633 ifo->options & DHCPCD_BOOTP)) in dhcp_start1()
3705 if (!(ifo->options & DHCPCD_DHCP)) { in dhcp_start1()
3706 if (ifo->options & DHCPCD_IPV4LL) { in dhcp_start1()
3750 struct if_options *ifo; in dhcp_handleifa() local
3773 ifo = ifp->options; in dhcp_handleifa()
3774 if (ifo->options & DHCPCD_INFORM) { in dhcp_handleifa()
3780 if (!(ifo->options & DHCPCD_STATIC)) in dhcp_handleifa()
3782 if (ifo->req_addr.s_addr != INADDR_ANY) in dhcp_handleifa()
3793 if (i != DHO_ROUTER && has_option_mask(ifo->dstmask,i)) in dhcp_handleifa()
3799 if (ifo->options & DHCPCD_INFORM) { in dhcp_handleifa()