Home | History | Annotate | Download | only in dhcpcd-6.8.2

Lines Matching defs:astate

103 arp_report_conflicted(const struct arp_state *astate, const struct arp_msg *amsg)
109 logger(astate->iface->ctx, LOG_ERR,
111 astate->iface->name,
112 hwaddr_ntoa(amsg->sha, astate->iface->hwlen,
114 inet_ntoa(astate->failed));
116 logger(astate->iface->ctx, LOG_ERR,
118 astate->iface->name, inet_ntoa(astate->failed));
131 struct arp_state *astate, *astaten;
185 TAILQ_FOREACH_SAFE(astate, &state->arp_states, next, astaten) {
186 if (astate->conflicted_cb)
187 astate->conflicted_cb(astate, &arm);
213 struct arp_state *astate = arg;
215 if (astate->announced_cb) {
216 astate->announced_cb(astate);
221 arp_free(astate);
227 struct arp_state *astate = arg;
228 struct interface *ifp = astate->iface;
230 if (++astate->claims < ANNOUNCE_NUM)
234 ifp->name, inet_ntoa(astate->addr),
235 astate->claims, ANNOUNCE_NUM, ANNOUNCE_WAIT);
239 ifp->name, inet_ntoa(astate->addr),
240 astate->claims, ANNOUNCE_NUM);
241 if (arp_request(ifp, astate->addr.s_addr, astate->addr.s_addr,
245 astate->claims < ANNOUNCE_NUM ? arp_announce1 : arp_announced,
246 astate);
250 arp_announce(struct arp_state *astate)
253 arp_open(astate->iface);
254 astate->claims = 0;
255 arp_announce1(astate);
261 struct arp_state *astate = arg;
263 astate->probed_cb(astate);
269 struct arp_state *astate = arg;
270 struct interface *ifp = astate->iface;
274 if (++astate->probes < PROBE_NUM) {
279 eloop_timeout_add_tv(ifp->ctx->eloop, &tv, arp_probe1, astate);
283 eloop_timeout_add_tv(ifp->ctx->eloop, &tv, arp_probed, astate);
287 ifp->name, inet_ntoa(astate->addr),
288 astate->probes ? astate->probes : PROBE_NUM, PROBE_NUM,
290 if (astate->dest_hwlen == ifp->hwlen)
291 dest_hwaddr = astate->dest_hwaddr;
292 if (arp_request(ifp, astate->src_addr.s_addr,
293 astate->addr.s_addr, dest_hwaddr) == -1)
298 arp_probe(struct arp_state *astate)
301 arp_open(astate->iface);
302 astate->probes = 0;
303 logger(astate->iface->ctx, LOG_DEBUG, "%s: probing for %s",
304 astate->iface->name, inet_ntoa(astate->addr));
305 arp_probe1(astate);
311 struct arp_state *astate;
315 TAILQ_FOREACH(astate, &state->arp_states, next) {
316 if (astate->addr.s_addr == addr->s_addr && astate->iface == ifp)
317 return astate;
326 struct arp_state *astate;
329 if (addr && (astate = arp_find(ifp, addr)))
330 return astate;
332 if ((astate = calloc(1, sizeof(*astate))) == NULL) {
337 astate->iface = ifp;
339 astate->addr = *addr;
340 TAILQ_INSERT_TAIL(&state->arp_states, astate, next);
341 return astate;
345 arp_cancel(struct arp_state *astate)
348 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, astate);
352 arp_free(struct arp_state *astate)
356 if (astate) {
357 eloop_timeout_delete(astate->iface->ctx->eloop, NULL, astate);
358 state = D_STATE(astate->iface);
359 TAILQ_REMOVE(&state->arp_states, astate, next);
360 if (state->arp_ipv4ll == astate) {
361 ipv4ll_stop(astate->iface);
364 free(astate);
369 arp_free_but(struct arp_state *astate)
374 state = D_STATE(astate->iface);
376 if (p != astate)
385 struct arp_state *astate;
396 while ((astate = TAILQ_FIRST(&state->arp_states))) {
400 arp_free(astate);
411 struct arp_state *astate, *asn;
416 TAILQ_FOREACH_SAFE(astate, &state->arp_states, next, asn) {
417 if (astate->addr.s_addr == addr->s_addr) {
419 if (astate->conflicted_cb)
420 astate->conflicted_cb(astate, NULL);
422 if (astate->probed_cb)
423 astate->probed_cb(astate);