Lines Matching defs:ifr
124 struct ifreq ifr;
131 memset(&ifr, 0, sizeof(ifr));
132 strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name));
133 if (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) {
137 iface->flags = (unsigned int)ifr.ifr_flags;
146 r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_UNKNOWN;
148 r = ifr.ifr_flags & IFF_RUNNING ? LINK_UP : LINK_DOWN;
157 struct ifreq ifr;
162 memset(&ifr, 0, sizeof(ifr));
163 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
165 if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) {
166 if (flag == 0 || (ifr.ifr_flags & flag) == flag)
169 ifr.ifr_flags |= flag;
170 if (ioctl(s, SIOCSIFFLAGS, &ifr) == 0)
173 ifp->flags = (unsigned int)ifr.ifr_flags;
270 struct ifreq ifr;
552 memset(&ifr, 0, sizeof(ifr));
553 strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
554 if (ioctl(s_inet, SIOCGIFPRIORITY, &ifr) == 0)
555 ifp->metric = ifr.ifr_metric;
631 struct ifreq ifr;
635 memset(&ifr, 0, sizeof(ifr));
636 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
637 ifr.ifr_mtu = mtu;
638 r = ioctl(s, mtu ? SIOCSIFMTU : SIOCGIFMTU, &ifr);
642 return ifr.ifr_mtu;