/busybox-1.35.0/networking/ |
D | vconfig.c | 115 struct vlan_ioctl_args ifr; in vconfig_main() local 119 memset(&ifr, 0, sizeof(ifr)); in vconfig_main() 125 ifr.cmd = *p; in vconfig_main() 129 if (ifr.cmd == SET_VLAN_NAME_TYPE_CMD) { in vconfig_main() 131 ifr.u.name_type = *xfind_str(name_types + 1, argv[1]); in vconfig_main() 133 strncpy_IFNAMSIZ(ifr.device1, argv[1]); in vconfig_main() 142 if (ifr.cmd == SET_VLAN_FLAG_CMD) { in vconfig_main() 144 ifr.u.flag = xatou_range(p, 0, 1); in vconfig_main() 146 ifr.vlan_qos = xatou_range(argv[3], 0, 7); in vconfig_main() 147 } else if (ifr.cmd == ADD_VLAN_CMD) { in vconfig_main() [all …]
|
D | ifenslave.c | 178 static int ioctl_on_skfd(unsigned request, struct ifreq *ifr) in ioctl_on_skfd() argument 180 return ioctl(skfd, request, ifr); in ioctl_on_skfd() 183 static int set_ifrname_and_do_ioctl(unsigned request, struct ifreq *ifr, const char *ifname) in set_ifrname_and_do_ioctl() argument 185 strncpy_IFNAMSIZ(ifr->ifr_name, ifname); in set_ifrname_and_do_ioctl() 186 return ioctl_on_skfd(request, ifr); in set_ifrname_and_do_ioctl() 207 struct ifreq ifr; in set_hwaddr() local 209 memcpy(&(ifr.ifr_hwaddr), hwaddr, sizeof(*hwaddr)); in set_hwaddr() 210 return set_ifrname_and_do_ioctl(SIOCSIFHWADDR, &ifr, ifname); in set_hwaddr() 215 struct ifreq ifr; in set_mtu() local 217 ifr.ifr_mtu = mtu; in set_mtu() [all …]
|
D | tunctl.c | 64 struct ifreq ifr; in tunctl_main() local 94 memset(&ifr, 0, sizeof(ifr)); in tunctl_main() 95 ifr.ifr_flags = IFF_TAP | IFF_NO_PI; in tunctl_main() 96 strncpy_IFNAMSIZ(ifr.ifr_name, opt_name); in tunctl_main() 100 IOCTL(fd, TUNSETIFF, (void *)&ifr); in tunctl_main() 105 printf("Set '%s' nonpersistent\n", ifr.ifr_name); in tunctl_main() 125 puts(ifr.ifr_name); in tunctl_main() 127 printf("Set '%s' %spersistent", ifr.ifr_name, ""); in tunctl_main() 134 puts(ifr.ifr_name); in tunctl_main() 146 struct ifreq ifr; in tunctl_main() local [all …]
|
D | nameif.c | 256 struct ifreq ifr; in nameif_main() local 265 memset(&ifr, 0, sizeof(struct ifreq)); in nameif_main() 266 strncpy_IFNAMSIZ(ifr.ifr_name, token[0]); in nameif_main() 272 ifr.ifr_data = (caddr_t) ð_settings; in nameif_main() 273 ioctl(ctl_sk, SIOCETHTOOL, &ifr); in nameif_main() 278 ifr.ifr_data = (caddr_t) &drvinfo; in nameif_main() 280 ioctl(ctl_sk, SIOCETHTOOL, &ifr); in nameif_main() 282 ioctl(ctl_sk, SIOCGIFHWADDR, &ifr); in nameif_main() 294 if (ch->mac && memcmp(ch->mac, ifr.ifr_hwaddr.sa_data, ETH_ALEN) != 0) in nameif_main() 302 if (strcmp(ifr.ifr_name, ch->ifname) != 0) { in nameif_main() [all …]
|
D | interface.c | 509 struct ifreq *ifr; in if_readconf() local 532 ifr = ifc.ifc_req; in if_readconf() 534 add_interface(ilist, ifr->ifr_name); in if_readconf() 535 ifr++; in if_readconf() 587 struct ifreq ifr; in if_fetch() local 593 strncpy_IFNAMSIZ(ifr.ifr_name, ifname); in if_fetch() 594 if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) { in if_fetch() 598 ife->flags = ifr.ifr_flags; in if_fetch() 608 strncpy_IFNAMSIZ(ifr.ifr_name, ifname); in if_fetch() 609 if (ioctl(skfd, SIOCGIFHWADDR, &ifr) >= 0) in if_fetch() [all …]
|
D | ifconfig.c | 320 struct ifreq ifr; in ifconfig_main() local 371 strncpy_IFNAMSIZ(ifr.ifr_name, *argv); in ifconfig_main() 459 xioctl(sockfd6, SIOCGIFINDEX, &ifr); in ifconfig_main() 460 ifr6.ifr6_ifindex = ifr.ifr_ifindex; in ifconfig_main() 495 memcpy( ((char *)&ifr) + a1op->ifr_offset, in ifconfig_main() 500 p = ((char *)&ifr) + a1op->ifr_offset; in ifconfig_main() 503 xioctl(sockfd, SIOCGIFMAP, &ifr); in ifconfig_main() 518 ioctl_or_perror_and_die(sockfd, a1op->selector, &ifr, "SIOC%s", a1op->name); in ifconfig_main() 530 for (ptr = ifr.ifr_name; *ptr; ptr++) in ifconfig_main() 543 xioctl(sockfd, SIOCGIFFLAGS, &ifr); in ifconfig_main() [all …]
|
D | arp.c | 228 struct ifreq ifr; in arp_getdevhw() local 231 strncpy_IFNAMSIZ(ifr.ifr_name, ifname); in arp_getdevhw() 232 ioctl_or_perror_and_die(sockfd, SIOCGIFHWADDR, &ifr, in arp_getdevhw() 234 if (hw_set && (ifr.ifr_hwaddr.sa_family != hw->type)) { in arp_getdevhw() 237 memcpy(sa, &(ifr.ifr_hwaddr), sizeof(struct sockaddr)); in arp_getdevhw() 240 xhw = get_hwntype(ifr.ifr_hwaddr.sa_family); in arp_getdevhw() 246 xhw->print((unsigned char *) &ifr.ifr_hwaddr.sa_data)); in arp_getdevhw()
|
D | ether-wake.c | 273 struct ifreq ifr; in ether_wake_main() local 274 strncpy_IFNAMSIZ(ifr.ifr_name, ifname); in ether_wake_main() 275 xioctl(s, SIOCGIFINDEX, &ifr); in ether_wake_main() 278 whereto.sll_ifindex = ifr.ifr_ifindex; in ether_wake_main()
|
D | zcip.c | 234 struct ifreq ifr; in zcip_main() member 241 #define ifr (L.ifr ) in zcip_main() macro 317 strncpy_IFNAMSIZ(ifr.ifr_name, argv_intf); in zcip_main() 318 xioctl(sock_fd, SIOCGIFHWADDR, &ifr); in zcip_main() 319 memcpy(&G.our_ethaddr, &ifr.ifr_hwaddr.sa_data, ETH_ALEN); in zcip_main()
|
D | arping.c | 83 struct ifreq ifr; member 324 strncpy_IFNAMSIZ(G.ifr.ifr_name, device); in arping_main() 325 ioctl_or_perror_and_die(sock_fd, SIOCGIFINDEX, &G.ifr, err_str, "not found"); in arping_main() 326 me.sll_ifindex = G.ifr.ifr_ifindex; in arping_main() 328 xioctl(sock_fd, SIOCGIFFLAGS, (char *) &G.ifr); in arping_main() 330 if (!(G.ifr.ifr_flags & IFF_UP)) { in arping_main() 333 if (G.ifr.ifr_flags & (IFF_NOARP | IFF_LOOPBACK)) { in arping_main()
|
D | brctl.c | 670 struct ifreq ifr; in brctl_main() local 673 strncpy_IFNAMSIZ(ifr.ifr_name, br); in brctl_main() 674 ifr.ifr_ifindex = if_nametoindex(*argv); in brctl_main() 675 if (ifr.ifr_ifindex == 0) { in brctl_main() 680 &ifr, "bridge %s", br in brctl_main()
|
D | route.c | 434 struct ifreq ifr; in INET6_setroute() local 436 strncpy_IFNAMSIZ(ifr.ifr_name, devname); in INET6_setroute() 437 xioctl(skfd, SIOCGIFINDEX, &ifr); in INET6_setroute() 438 rt.rtmsg_ifindex = ifr.ifr_ifindex; in INET6_setroute()
|
/busybox-1.35.0/networking/udhcp/ |
D | socket.c | 32 struct ifreq *const ifr = (void *)ifr_buf; in udhcp_read_interface() local 37 memset(ifr, 0, sizeof(*ifr)); in udhcp_read_interface() 40 ifr->ifr_addr.sa_family = AF_INET; in udhcp_read_interface() 41 strncpy_IFNAMSIZ(ifr->ifr_name, interface); in udhcp_read_interface() 43 if (ioctl_or_perror(fd, SIOCGIFADDR, ifr, in udhcp_read_interface() 49 our_ip = (struct sockaddr_in *) &ifr->ifr_addr; in udhcp_read_interface() 55 if (ioctl_or_warn(fd, SIOCGIFINDEX, ifr) != 0) { in udhcp_read_interface() 59 log2("ifindex %d", ifr->ifr_ifindex); in udhcp_read_interface() 60 *ifindex = ifr->ifr_ifindex; in udhcp_read_interface() 64 if (ioctl_or_warn(fd, SIOCGIFHWADDR, ifr) != 0) { in udhcp_read_interface() [all …]
|
D | d6_socket.c | 78 struct ifreq ifr; in d6_read_interface() local 82 strncpy_IFNAMSIZ(ifr.ifr_name, interface); in d6_read_interface() 84 if (ioctl(fd, SIOCGIFINDEX, &ifr) == 0) { in d6_read_interface() 85 *ifindex = ifr.ifr_ifindex; in d6_read_interface()
|
/busybox-1.35.0/networking/libiproute/ |
D | iplink.c | 75 struct ifreq ifr; in do_chflags() local 78 strncpy_IFNAMSIZ(ifr.ifr_name, dev); in do_chflags() 80 xioctl(fd, SIOCGIFFLAGS, &ifr); in do_chflags() 81 if ((ifr.ifr_flags ^ flags) & mask) { in do_chflags() 82 ifr.ifr_flags &= ~mask; in do_chflags() 83 ifr.ifr_flags |= mask & flags; in do_chflags() 84 xioctl(fd, SIOCSIFFLAGS, &ifr); in do_chflags() 92 struct ifreq ifr; in do_changename() local 95 strncpy_IFNAMSIZ(ifr.ifr_name, dev); in do_changename() 96 strncpy_IFNAMSIZ(ifr.ifr_newname, newdev); in do_changename() [all …]
|
D | iptunnel.c | 72 struct ifreq ifr; in do_ioctl_get_ifindex() local 75 strncpy_IFNAMSIZ(ifr.ifr_name, dev); in do_ioctl_get_ifindex() 77 xioctl(fd, SIOCGIFINDEX, &ifr); in do_ioctl_get_ifindex() 79 return ifr.ifr_ifindex; in do_ioctl_get_ifindex() 84 struct ifreq ifr; in do_ioctl_get_iftype() local 88 strncpy_IFNAMSIZ(ifr.ifr_name, dev); in do_ioctl_get_iftype() 90 err = ioctl_or_warn(fd, SIOCGIFHWADDR, &ifr); in do_ioctl_get_iftype() 92 return err ? -1 : ifr.ifr_addr.sa_family; in do_ioctl_get_iftype() 97 struct ifreq ifr; in do_ioctl_get_ifname() local 101 ifr.ifr_ifindex = idx; in do_ioctl_get_ifname() [all …]
|
D | ipaddress.c | 93 struct ifreq ifr; in print_queuelen() local 100 memset(&ifr, 0, sizeof(ifr)); in print_queuelen() 101 strncpy_IFNAMSIZ(ifr.ifr_name, name); in print_queuelen() 102 if (ioctl_or_warn(s, SIOCGIFTXQLEN, &ifr) < 0) { in print_queuelen() 108 if (ifr.ifr_qlen) in print_queuelen() 109 printf("qlen %d", ifr.ifr_qlen); in print_queuelen()
|
/busybox-1.35.0/libbb/ |
D | xconnect.c | 53 struct ifreq ifr; in setsockopt_bindtodevice() local 54 strncpy_IFNAMSIZ(ifr.ifr_name, iface); in setsockopt_bindtodevice() 60 r = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)); in setsockopt_bindtodevice()
|