Lines Matching refs:ifr

388     struct ifreq ifr;  in get_first_ethernet()  local
436 memset(&ifr, 0, sizeof(ifr)); in get_first_ethernet()
437 strncpy(ifr.ifr_name, pifreq->ifr_name, sizeof(ifr.ifr_name)); in get_first_ethernet()
438 if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0) { in get_first_ethernet()
444 fl = ifr.ifr_flags; in get_first_ethernet()
457 strncpy(first_ether_name, ifr.ifr_name, sizeof(first_ether_name)); in get_first_ethernet()
576 struct ifreq ifr; in sys_init() local
701 memset(&ifr, 0, sizeof(ifr)); in sys_init()
702 sprintf(ifr.ifr_name, "%s", ifname); in sys_init()
703 ifr.ifr_ip_muxid = ipmuxid; in sys_init()
712 if (ioctl(ipfd, SIOCSIFMUXID, &ifr) < 0) { in sys_init()
758 slprintf(ifr.ifr_name, sizeof(ifr.ifr_name), PPP_DRV_NAME "%d", ifunit); in sys_init()
759 ifr.ifr_metric = ipmuxid; in sys_init()
760 if (strioctl(ipfd, SIOCSIFNAME, (char *)&ifr, sizeof ifr, 0) < 0) in sys_init()
761 fatal("Can't set interface name %s: %m", ifr.ifr_name); in sys_init()
776 struct ifreq ifr; in sys_cleanup() local
797 memset(&ifr, 0, sizeof(ifr)); in sys_cleanup()
798 sprintf(ifr.ifr_name, "%s", ifname); in sys_cleanup()
799 if (ioctl(ipfd, SIOCGIFFLAGS, &ifr) < 0) { in sys_cleanup()
804 if (ioctl(ipfd, SIOCGIFMUXID, &ifr) < 0) { in sys_cleanup()
809 ipmuxid = ifr.ifr_ip_muxid; in sys_cleanup()
1508 struct ifreq ifr; local
1514 memset(&ifr, 0, sizeof(ifr));
1515 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1516 ifr.ifr_metric = link_mtu;
1517 if (ioctl(ipfd, SIOCSIFMTU, &ifr) < 0) {
1518 error("Couldn't set IP MTU (%s): %m", ifr.ifr_name);
1531 error("Couldn't set IPv6 MTU (%s): %m", ifr.ifr_name);
1769 struct ifreq ifr; local
1771 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1772 if (ioctl(ipfd, SIOCGIFFLAGS, &ifr) < 0) {
1776 ifr.ifr_flags |= IFF_UP;
1777 if (ioctl(ipfd, SIOCSIFFLAGS, &ifr) < 0) {
1792 struct ifreq ifr; local
1796 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1797 if (ioctl(ipfd, SIOCGIFFLAGS, &ifr) < 0) {
1801 ifr.ifr_flags &= ~IFF_UP;
1802 if (ioctl(ipfd, SIOCSIFFLAGS, &ifr) < 0) {
1973 struct ifreq ifr; local
1976 memset(&ifr, 0, sizeof(ifr));
1977 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
1978 ifr.ifr_addr.sa_family = AF_INET;
1979 INET_ADDR(ifr.ifr_addr) = m;
1980 if (ioctl(ipfd, SIOCSIFNETMASK, &ifr) < 0) {
1984 ifr.ifr_addr.sa_family = AF_INET;
1985 INET_ADDR(ifr.ifr_addr) = o;
1986 if (ioctl(ipfd, SIOCSIFADDR, &ifr) < 0) {
1995 if (ioctl(ipfd, SIOCGIFFLAGS, &ifr) >= 0
1996 && (ifr.ifr_flags & IFF_POINTOPOINT) == 0) {
1997 ifr.ifr_flags |= IFF_POINTOPOINT;
1998 if (ioctl(ipfd, SIOCSIFFLAGS, &ifr) < 0) {
2003 ifr.ifr_dstaddr.sa_family = AF_INET;
2004 INET_ADDR(ifr.ifr_dstaddr) = h;
2005 if (ioctl(ipfd, SIOCSIFDSTADDR, &ifr) < 0) {
2155 struct ifreq *ifr, *ifend, ifreq; local
2177 for (ifr = ifc.ifc_req; ifr < ifend; ++ifr) {
2178 if (ifr->ifr_addr.sa_family != AF_INET)
2183 strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
2195 ina = INET_ADDR(ifr->ifr_addr);
2201 if (ifr >= ifend) {
2207 info("found interface %s for proxy ARP", ifr->ifr_name);
2208 if (!get_hw_addr(ifr->ifr_name, ina, hwaddr)) {
2209 error("Couldn't get hardware address for %s", ifr->ifr_name);
2398 struct ifreq *ifr, *ifend, ifreq; local
2429 for (ifr = ifc.ifc_req; ifr < ifend; ++ifr) {
2433 if (ifr->ifr_addr.sa_family != AF_INET)
2435 ina = INET_ADDR(ifr->ifr_addr);
2441 strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));