Lines Matching refs:ifr
34 struct ifreq *ifr; in iface_enumerate() local
75 ifr = (struct ifreq *)ptr; in iface_enumerate()
76 if (ifr->ifr_addr.sa_len > sizeof(ifr->ifr_ifru)) in iface_enumerate()
77 len = ifr->ifr_addr.sa_len + offsetof(struct ifreq, ifr_ifru); in iface_enumerate()
83 ifr = (struct ifreq *)ifreq.iov_base; in iface_enumerate()
84 memcpy(ifr, ptr, len); in iface_enumerate()
86 if (ifr->ifr_addr.sa_family == AF_INET && ipv4_callback) in iface_enumerate()
90 addr = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; in iface_enumerate()
91 if (ioctl(fd, SIOCGIFNETMASK, ifr) == -1) in iface_enumerate()
93 netmask = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; in iface_enumerate()
94 if (ioctl(fd, SIOCGIFBRDADDR, ifr) != -1) in iface_enumerate()
95 broadcast = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr; in iface_enumerate()
97 (int)if_nametoindex(ifr->ifr_name), in iface_enumerate()
103 else if (ifr->ifr_addr.sa_family == AF_INET6 && ipv6_callback) in iface_enumerate()
105 struct in6_addr *addr = &((struct sockaddr_in6 *)&ifr->ifr_addr)->sin6_addr; in iface_enumerate()
113 (int)((struct sockaddr_in6 *)&ifr->ifr_addr)->sin6_scope_id, in iface_enumerate()
114 (int)if_nametoindex(ifr->ifr_name), in iface_enumerate()
155 struct in_addr iface_addr, struct ifreq *ifr) in send_via_bpf() argument
179 mess->htype, ifr->ifr_name); in send_via_bpf()
183 ifr->ifr_addr.sa_family = AF_LINK; in send_via_bpf()
184 if (ioctl(daemon->dhcpfd, SIOCGIFADDR, ifr) < 0) in send_via_bpf()
187 memcpy(ether.ether_shost, LLADDR((struct sockaddr_dl *)&ifr->ifr_addr), ETHER_ADDR_LEN); in send_via_bpf()
238 ioctl(daemon->dhcp_raw_fd, BIOCSETIF, ifr); in send_via_bpf()