Home | History | Annotate | Download | only in dhcpcd

Lines Matching refs:iface

48 send_arp(const struct interface *iface, int op, in_addr_t sip, in_addr_t tip)
56 ar.ar_hrd = htons(iface->family);
58 ar.ar_hln = iface->hwlen;
63 memcpy(p, iface->hwaddr, iface->hwlen);
64 p += iface->hwlen;
68 retval = iface->hwlen;
74 retval = send_raw_packet(iface, ETHERTYPE_ARP, arp_buffer, len);
79 handle_arp_failure(struct interface *iface)
84 if ((iface->state->offer != NULL &&
85 iface->state->offer->cookie != htonl(MAGIC_COOKIE)) ||
86 (iface->state->new != NULL &&
87 iface->state->new->cookie != htonl(MAGIC_COOKIE)))
89 handle_ipv4ll_failure(iface);
93 unlink(iface->leasefile);
94 if (!iface->state->lease.frominfo)
95 send_decline(iface);
96 close_sockets(iface);
97 delete_timeout(NULL, iface);
98 if (iface->state->lease.frominfo)
99 start_interface(iface);
101 add_timeout_sec(DHCP_ARP_FAIL, start_interface, iface);
107 struct interface *iface = arg;
114 struct if_state *state = iface->state;
121 bytes = get_raw_packet(iface, ETHERTYPE_ARP,
146 if (ar.ar_hln == iface->hwlen &&
147 memcmp(hw_s, iface->hwaddr, iface->hwlen) == 0)
165 iface->name, inet_ntoa(ina), hwaddr);
166 if (select_profile(iface, hwaddr) == -1 &&
168 select_profile(iface, inet_ntoa(ina));
169 close_sockets(iface);
170 delete_timeout(NULL, iface);
171 start_interface(iface);
182 if (IN_LINKLOCAL(htonl(iface->addr.s_addr)) &&
183 (reply_s == iface->addr.s_addr ||
184 (reply_s == 0 && reply_t == iface->addr.s_addr)))
185 state->fail.s_addr = iface->addr.s_addr;
189 iface->name,
194 handle_arp_failure(iface);
203 struct interface *iface = arg;
204 struct if_state *state = iface->state;
209 if (iface->arp_fd == -1) {
210 open_socket(iface, ETHERTYPE_ARP);
211 add_event(iface->arp_fd, handle_arp_packet, iface);
217 iface->name, state->claims, ANNOUNCE_NUM, ANNOUNCE_WAIT);
221 iface->name, state->claims, ANNOUNCE_NUM);
222 if (send_arp(iface, ARPOP_REQUEST,
226 add_timeout_sec(ANNOUNCE_WAIT, send_arp_announce, iface);
239 add_timeout_tv(&tv, start_discover, iface);
241 delete_event(iface->arp_fd);
242 close(iface->arp_fd);
243 iface->arp_fd = -1;
250 struct interface *iface = arg;
251 struct if_state *state = iface->state;
265 addr.s_addr = iface->addr.s_addr;
267 if (iface->arp_fd == -1) {
268 open_socket(iface, ETHERTYPE_ARP);
269 add_event(iface->arp_fd, handle_arp_packet, iface);
274 iface->name, inet_ntoa(addr));
277 iface->name, inet_ntoa(addr));
283 add_timeout_tv(&tv, send_arp_probe, iface);
290 add_timeout_tv(&tv, send_arp_probe, iface);
292 add_timeout_tv(&tv, start_interface, iface);
294 add_timeout_tv(&tv, bind_interface, iface);
298 iface->name, state->probes ? state->probes : PROBE_NUM, PROBE_NUM,
300 if (send_arp(iface, ARPOP_REQUEST, 0, addr.s_addr) == -1)
305 start_arping(struct interface *iface)
307 iface->state->probes = 0;
308 iface->state->arping_index = 0;
309 send_arp_probe(iface);