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