Lines Matching refs:ii
216 struct if_info *ii, *ii2; in init_one() local
241 for (ii = iflist; ii != NULL; ii = ii->ii_next) in init_one()
242 if (strcmp(ifa->ifa_name, ii->ii_ifname) == 0) in init_one()
245 if (pass1 && ii != NULL) in init_one()
250 if (ii == NULL) { in init_one()
251 ii = (struct if_info *)malloc(sizeof(*ii)); in init_one()
252 if (ii == NULL) { in init_one()
257 bzero(ii, sizeof(*ii)); in init_one()
258 ii->ii_fd = -1; in init_one()
259 strlcpy(ii->ii_ifname, ifa->ifa_name, sizeof(ii->ii_ifname)); in init_one()
260 ii->ii_next = iflist; in init_one()
261 iflist = ii; in init_one()
262 } else if (!pass1 && ii->ii_ipaddr != 0) { in init_one()
275 memcpy(ii2, ii, sizeof(*ii2)); in init_one()
280 ii = ii2; in init_one()
285 ii->ii_ipaddr = SATOSIN(ifa->ifa_addr)->sin_addr.s_addr; in init_one()
286 ii->ii_netmask = SATOSIN(ifa->ifa_netmask)->sin_addr.s_addr; in init_one()
287 if (ii->ii_netmask == 0) in init_one()
288 ii->ii_netmask = ipaddrtonetmask(ii->ii_ipaddr); in init_one()
289 if (ii->ii_fd < 0) in init_one()
290 ii->ii_fd = rarp_open(ii->ii_ifname); in init_one()
298 bcopy(LLADDR(ll), ii->ii_eaddr, 6); in init_one()
312 struct if_info *ii, *nii, *lii; in init() local
338 for (ii = iflist; ii != NULL; ii = nii) { in init()
339 nii = ii->ii_next; in init()
340 if (ii->ii_ipaddr == 0 || in init()
341 bcmp(ii->ii_eaddr, zero, 6) == 0) { in init()
346 if (ii->ii_fd >= 0) in init()
347 close(ii->ii_fd); in init()
348 free(ii); in init()
351 lii = ii; in init()
356 for (ii = iflist; ii != NULL; ii = ii->ii_next) in init()
358 ii->ii_ifname, intoa(ntohl(ii->ii_ipaddr)), in init()
359 (in_addr_t)ntohl(ii->ii_netmask), eatoa(ii->ii_eaddr)); in init()
509 struct if_info *ii; in rarp_loop() local
531 for (ii = iflist; ii != NULL; ii = ii->ii_next) { in rarp_loop()
532 FD_SET(ii->ii_fd, &fds); in rarp_loop()
533 if (ii->ii_fd > maxfd) in rarp_loop()
534 maxfd = ii->ii_fd; in rarp_loop()
544 for (ii = iflist; ii != NULL; ii = ii->ii_next) { in rarp_loop()
545 fd = ii->ii_fd; in rarp_loop()
564 rarp_process(ii, bp + hdrlen, caplen); in rarp_loop()
639 rarp_process(struct if_info *ii, u_char *pkt, u_int len) in rarp_process() argument
668 ii->ii_ipaddr & ii->ii_netmask, in rarp_process()
669 ii->ii_netmask); in rarp_process()
672 ename, intoa(ntohl(ii->ii_ipaddr & ii->ii_netmask))); in rarp_process()
676 rarp_reply(ii, ep, target_ipaddr, len); in rarp_process()
679 ii->ii_ifname, in rarp_process()
842 rarp_reply(struct if_info *ii, struct ether_header *ep, in_addr_t ipaddr, in rarp_reply() argument
859 bcopy((char *)ii->ii_eaddr, (char *)&ep->ether_shost, 6); in rarp_reply()
860 bcopy((char *)ii->ii_eaddr, (char *)&ap->arp_sha, 6); in rarp_reply()
864 bcopy((char *)&ii->ii_ipaddr, (char *)ap->arp_spa, 4); in rarp_reply()
869 n = write(ii->ii_fd, (char *)ep, len); in rarp_reply()
873 logmsg(LOG_INFO, "%s %s at %s REPLIED", ii->ii_ifname, in rarp_reply()