Lines Matching refs:astate
1907 dhcp_arp_announced(struct arp_state *astate) in dhcp_arp_announced() argument
1910 arp_close(astate->iface); in dhcp_arp_announced()
2062 dhcp_bind(struct interface *ifp, struct arp_state *astate) in dhcp_bind() argument
2205 if (astate) in dhcp_bind()
2206 arp_free_but(astate); in dhcp_bind()
2211 if (astate == NULL) { in dhcp_bind()
2212 astate = arp_new(ifp, &state->addr); in dhcp_bind()
2213 astate->announced_cb = in dhcp_bind()
2216 if (astate) { in dhcp_bind()
2217 arp_announce(astate); in dhcp_bind()
2219 arp_free_but(astate); in dhcp_bind()
2574 dhcp_probe_gw_timeout(struct arp_state *astate) in dhcp_probe_gw_timeout() argument
2576 struct dhcp_state *state = D_STATE(astate->iface); in dhcp_probe_gw_timeout()
2579 if (astate->dest_hwlen) in dhcp_probe_gw_timeout()
2583 logger(astate->iface->ctx, LOG_ERR, in dhcp_probe_gw_timeout()
2585 astate->iface->name, inet_ntoa(astate->addr)); in dhcp_probe_gw_timeout()
2586 astate->iface->options->options &= ~DHCPCD_ARPGW; in dhcp_probe_gw_timeout()
2590 dhcp_decline(astate->iface); in dhcp_probe_gw_timeout()
2592 ia = ipv4_iffindaddr(astate->iface, &astate->addr, NULL); in dhcp_probe_gw_timeout()
2594 ipv4_deladdr(astate->iface, &ia->addr, &ia->net); in dhcp_probe_gw_timeout()
2596 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, in dhcp_probe_gw_timeout()
2597 astate->iface); in dhcp_probe_gw_timeout()
2598 eloop_timeout_add_sec(astate->iface->ctx->eloop, in dhcp_probe_gw_timeout()
2599 DHCP_RAND_MAX, dhcp_discover, astate->iface); in dhcp_probe_gw_timeout()
2603 dhcp_probe_gw_response(struct arp_state *astate, const struct arp_msg *amsg) in dhcp_probe_gw_response() argument
2606 if (astate->src_addr.s_addr != 0 && in dhcp_probe_gw_response()
2608 amsg->tip.s_addr == astate->src_addr.s_addr && in dhcp_probe_gw_response()
2609 amsg->sip.s_addr == astate->addr.s_addr) { in dhcp_probe_gw_response()
2610 if (astate->dest_hwlen) { in dhcp_probe_gw_response()
2612 rpc_notify_unicast_arp(astate->iface); in dhcp_probe_gw_response()
2615 save_gateway_addr(astate->iface, amsg->sha); in dhcp_probe_gw_response()
2617 dhcp_close(astate->iface); in dhcp_probe_gw_response()
2618 eloop_timeout_delete(astate->iface->ctx->eloop, in dhcp_probe_gw_response()
2619 NULL, astate->iface); in dhcp_probe_gw_response()
2621 ipv4_finaliseaddr(astate->iface); in dhcp_probe_gw_response()
2623 dhcp_bind(astate->iface, NULL); in dhcp_probe_gw_response()
2626 arp_close(astate->iface); in dhcp_probe_gw_response()
2634 struct arp_state *astate; in dhcp_probe_gw() local
2639 astate = arp_new(ifp, &gateway_addr); in dhcp_probe_gw()
2640 if (astate) { in dhcp_probe_gw()
2641 astate->src_addr.s_addr = state->offer->yiaddr; in dhcp_probe_gw()
2642 astate->probed_cb = dhcp_probe_gw_timeout; in dhcp_probe_gw()
2643 astate->conflicted_cb = dhcp_probe_gw_response; in dhcp_probe_gw()
2644 arp_probe(astate); in dhcp_probe_gw()
2657 struct arp_state *astate; in start_unicast_arp() local
2671 astate = arp_new(ifp, &gwa); in start_unicast_arp()
2672 if (!astate) in start_unicast_arp()
2675 astate->src_addr.s_addr = state->offer->yiaddr; in start_unicast_arp()
2677 astate->src_addr.s_addr = state->offer->ciaddr; in start_unicast_arp()
2678 astate->probed_cb = dhcp_probe_gw_timeout; in start_unicast_arp()
2679 astate->conflicted_cb = dhcp_probe_gw_response; in start_unicast_arp()
2680 astate->dest_hwlen = state->server_info.gw_hwlen; in start_unicast_arp()
2681 memcpy(astate->dest_hwaddr, state->server_info.gw_hwaddr, in start_unicast_arp()
2684 arp_probe(astate); in start_unicast_arp()
2691 dhcp_arp_probed(struct arp_state *astate) in dhcp_arp_probed() argument
2699 state = D_STATE(astate->iface); in dhcp_arp_probed()
2700 ifo = astate->iface->options; in dhcp_arp_probed()
2703 astate->addr.s_addr = in dhcp_arp_probed()
2705 arp_probe(astate); in dhcp_arp_probed()
2707 dhcpcd_startinterface(astate->iface); in dhcp_arp_probed()
2712 if ((ifo->options & DHCPCD_ARPGW) && (dhcp_probe_gw(astate->iface))) { in dhcp_arp_probed()
2716 dhcp_close(astate->iface); in dhcp_arp_probed()
2717 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, astate->iface); in dhcp_arp_probed()
2719 ipv4_finaliseaddr(astate->iface); in dhcp_arp_probed()
2720 arp_close(astate->iface); in dhcp_arp_probed()
2722 dhcp_bind(astate->iface, astate); in dhcp_arp_probed()
2727 dhcp_arp_conflicted(struct arp_state *astate, const struct arp_msg *amsg) in dhcp_arp_conflicted() argument
2732 state = D_STATE(astate->iface); in dhcp_arp_conflicted()
2733 ifo = astate->iface->options; in dhcp_arp_conflicted()
2743 astate->failed.s_addr = ifo->arping[state->arping_index - 1]; in dhcp_arp_conflicted()
2744 arp_report_conflicted(astate, amsg); in dhcp_arp_conflicted()
2745 hwaddr_ntoa(amsg->sha, astate->iface->hwlen, buf, sizeof(buf)); in dhcp_arp_conflicted()
2746 if (dhcpcd_selectprofile(astate->iface, buf) == -1 && in dhcp_arp_conflicted()
2747 dhcpcd_selectprofile(astate->iface, in dhcp_arp_conflicted()
2748 inet_ntoa(astate->failed)) == -1) in dhcp_arp_conflicted()
2753 dhcp_arp_probed(astate); in dhcp_arp_conflicted()
2756 dhcp_close(astate->iface); in dhcp_arp_conflicted()
2757 arp_close(astate->iface); in dhcp_arp_conflicted()
2758 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, in dhcp_arp_conflicted()
2759 astate->iface); in dhcp_arp_conflicted()
2760 dhcpcd_startinterface(astate->iface); in dhcp_arp_conflicted()
2775 astate->failed.s_addr = state->offer->yiaddr; in dhcp_arp_conflicted()
2778 astate->failed = astate->addr; in dhcp_arp_conflicted()
2779 state->failed = astate->addr; in dhcp_arp_conflicted()
2782 arp_report_conflicted(astate, amsg); in dhcp_arp_conflicted()
2785 dhcp_decline(astate->iface); in dhcp_arp_conflicted()
2787 ia = ipv4_iffindaddr(astate->iface, &astate->addr, NULL); in dhcp_arp_conflicted()
2789 ipv4_deladdr(astate->iface, &ia->addr, &ia->net); in dhcp_arp_conflicted()
2791 arp_close(astate->iface); in dhcp_arp_conflicted()
2792 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, in dhcp_arp_conflicted()
2793 astate->iface); in dhcp_arp_conflicted()
2794 eloop_timeout_add_sec(astate->iface->ctx->eloop, in dhcp_arp_conflicted()
2795 DHCP_RAND_MAX, dhcp_discover, astate->iface); in dhcp_arp_conflicted()
2837 struct arp_state *astate; in dhcp_handledhcp() local
3136 astate = NULL; in dhcp_handledhcp()
3140 astate = arp_new(ifp, &addr); in dhcp_handledhcp()
3141 if (astate) { in dhcp_handledhcp()
3142 astate->probed_cb = dhcp_arp_probed; in dhcp_handledhcp()
3143 astate->conflicted_cb = dhcp_arp_conflicted; in dhcp_handledhcp()
3159 astate = arp_new(ifp, &addr); in dhcp_handledhcp()
3160 if (astate) { in dhcp_handledhcp()
3161 astate->probed_cb = dhcp_arp_probed; in dhcp_handledhcp()
3162 astate->conflicted_cb = dhcp_arp_conflicted; in dhcp_handledhcp()
3163 arp_probe(astate); in dhcp_handledhcp()
3176 dhcp_bind(ifp, astate); in dhcp_handledhcp()
3583 struct arp_state *astate; in dhcp_start1() local
3585 astate = arp_new(ifp, NULL); in dhcp_start1()
3586 if (astate) { in dhcp_start1()
3587 astate->probed_cb = dhcp_arp_probed; in dhcp_start1()
3588 astate->conflicted_cb = dhcp_arp_conflicted; in dhcp_start1()
3589 dhcp_arp_probed(astate); in dhcp_start1()