/kernel/liteos_a/testsuites/unittest/net/socket/smoke/ |
D | net_socket_test_010.cpp | 43 static void InitIfreq(struct ifreq *ifr) in InitIfreq() argument 45 *ifr = (struct ifreq){{0}}; in InitIfreq() 46 …(void)strncpy_s(ifr->ifr_name, sizeof(ifr->ifr_name) - 1, gDefaultNetif, sizeof(ifr->ifr_name) - 1… in InitIfreq() 47 ifr->ifr_name[sizeof(ifr->ifr_name) - 1] = '\0'; in InitIfreq() 55 struct ifreq ifr; in IfIndex2Name() 58 ifr.ifr_ifindex = index; in IfIndex2Name() 59 ret = ioctl(fd, SIOCGIFNAME, &ifr); in IfIndex2Name() 63 ret = strncpy_s(name, IF_NAMESIZE - 1, ifr.ifr_name, IF_NAMESIZE - 1); in IfIndex2Name() 77 struct ifreq ifr; in IfName2Index() 80 ret = strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, name, sizeof(ifr.ifr_name) - 1); in IfName2Index() [all …]
|
D | net_socket_test_013.cpp | 134 struct ifreq ifr; in GetIp() local 136 int ret = strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, ifname, sizeof(ifr.ifr_name) - 1); in GetIp() 140 ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; in GetIp() 141 ret = ioctl(sfd, SIOCGIFADDR, &ifr); in GetIp() 143 ip = (reinterpret_cast<struct sockaddr_in *>(&(ifr.ifr_addr)))->sin_addr.s_addr; in GetIp() 150 struct ifreq ifr; in GetNetmask() local 152 int ret = strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, ifname, sizeof(ifr.ifr_name) - 1); in GetNetmask() 156 ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; in GetNetmask() 157 ret = ioctl(sfd, SIOCGIFNETMASK, &ifr); in GetNetmask() 159 msk = (reinterpret_cast<struct sockaddr_in *>(&(ifr.ifr_addr)))->sin_addr.s_addr; in GetNetmask()
|
/kernel/uniproton/src/net/lwip-2.1/src/ |
D | sockets.c | 286 static u8_t OsLwipIoctlInternalSiocgifConf(struct ifreq *ifr) in OsLwipIoctlInternalSiocgifConf() argument 294 struct ifconf *ifc = (struct ifconf *)ifr; in OsLwipIoctlInternalSiocgifConf() 339 static u8_t OsLwipIoctlInternalSiocgifAddr(struct ifreq *ifr) in OsLwipIoctlInternalSiocgifAddr() argument 344 struct netif *netif = netif_find(ifr->ifr_name); in OsLwipIoctlInternalSiocgifAddr() 348 sockIn = (struct sockaddr_in *)&ifr->ifr_addr; in OsLwipIoctlInternalSiocgifAddr() 354 static u8_t OsLwipIoctlInternalSiocgifNetmask(struct ifreq *ifr) in OsLwipIoctlInternalSiocgifNetmask() argument 359 struct netif *netif = netif_find(ifr->ifr_name); in OsLwipIoctlInternalSiocgifNetmask() 363 sockIn = (struct sockaddr_in *)&ifr->ifr_netmask; in OsLwipIoctlInternalSiocgifNetmask() 369 static u8_t OsLwipIoctlInternalSiocgifHwAddr(struct ifreq *ifr) in OsLwipIoctlInternalSiocgifHwAddr() argument 372 struct netif *netif = netif_find(ifr->ifr_name); in OsLwipIoctlInternalSiocgifHwAddr() [all …]
|
/kernel/linux/linux-5.10/net/core/ |
D | dev_ioctl.c | 22 static int dev_ifname(struct net *net, struct ifreq *ifr) in dev_ifname() argument 24 ifr->ifr_name[IFNAMSIZ-1] = 0; in dev_ifname() 25 return netdev_get_name(net, ifr->ifr_name, ifr->ifr_ifindex); in dev_ifname() 104 static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cmd) in dev_ifsioc_locked() argument 107 struct net_device *dev = dev_get_by_name_rcu(net, ifr->ifr_name); in dev_ifsioc_locked() 114 ifr->ifr_flags = (short) dev_get_flags(dev); in dev_ifsioc_locked() 119 ifr->ifr_metric = 0; in dev_ifsioc_locked() 123 ifr->ifr_mtu = dev->mtu; in dev_ifsioc_locked() 131 ifr->ifr_map.mem_start = dev->mem_start; in dev_ifsioc_locked() 132 ifr->ifr_map.mem_end = dev->mem_end; in dev_ifsioc_locked() [all …]
|
/kernel/liteos_m/components/net/lwip-2.1/porting/src/ |
D | sockets_porting.c | 294 static u8_t lwip_ioctl_internal_SIOCGIFCONF(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFCONF() argument 305 ifc = (struct ifconf *)ifr; in lwip_ioctl_internal_SIOCGIFCONF() 349 static u8_t lwip_ioctl_internal_SIOCGIFADDR(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFADDR() argument 355 netif = netif_find(ifr->ifr_name); in lwip_ioctl_internal_SIOCGIFADDR() 359 sock_in = (struct sockaddr_in *)&ifr->ifr_addr; in lwip_ioctl_internal_SIOCGIFADDR() 366 static u8_t lwip_ioctl_internal_SIOCGIFNETMASK(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFNETMASK() argument 372 netif = netif_find(ifr->ifr_name); in lwip_ioctl_internal_SIOCGIFNETMASK() 376 sock_in = (struct sockaddr_in *)&ifr->ifr_netmask; in lwip_ioctl_internal_SIOCGIFNETMASK() 383 static u8_t lwip_ioctl_internal_SIOCGIFHWADDR(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFHWADDR() argument 388 netif = netif_find(ifr->ifr_name); in lwip_ioctl_internal_SIOCGIFHWADDR() [all …]
|
/kernel/liteos_a/net/lwip-2.1/porting/src/ |
D | sockets.c | 466 static u8_t lwip_ioctl_internal_SIOCGIFCONF(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFCONF() argument 477 ifc = (struct ifconf *)ifr; in lwip_ioctl_internal_SIOCGIFCONF() 521 static u8_t lwip_ioctl_internal_SIOCGIFADDR(struct ifreq *ifr) in lwip_ioctl_internal_SIOCGIFADDR() argument 527 netif = netif_find(ifr->ifr_name); in lwip_ioctl_internal_SIOCGIFADDR() 531 sock_in = (struct sockaddr_in *)&ifr->ifr_addr; in lwip_ioctl_internal_SIOCGIFADDR() 551 static u8_t lwip_ioctl_internal_SIOCSIFADDR_6(struct ifreq *ifr) in lwip_ioctl_internal_SIOCSIFADDR_6() argument 553 (void)ifr; in lwip_ioctl_internal_SIOCSIFADDR_6() 557 static u8_t lwip_ioctl_internal_SIOCSIFADDR(struct ifreq *ifr) in lwip_ioctl_internal_SIOCSIFADDR() argument 564 SOCKADDR_TO_IPADDR_PORT(&ifr->ifr_addr, &taget_addr, taget_port); in lwip_ioctl_internal_SIOCSIFADDR() 573 netif = netif_find(ifr->ifr_name); in lwip_ioctl_internal_SIOCSIFADDR() [all …]
|
/kernel/linux/linux-5.10/drivers/net/wan/ |
D | hdlc_raw.c | 22 static int raw_ioctl(struct net_device *dev, struct ifreq *ifr); 36 static int raw_ioctl(struct net_device *dev, struct ifreq *ifr) in raw_ioctl() argument 38 raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc; in raw_ioctl() 44 switch (ifr->ifr_settings.type) { in raw_ioctl() 48 ifr->ifr_settings.type = IF_PROTO_HDLC; in raw_ioctl() 49 if (ifr->ifr_settings.size < size) { in raw_ioctl() 50 ifr->ifr_settings.size = size; /* data size wanted */ in raw_ioctl()
|
D | hdlc_raw_eth.c | 23 static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); 51 static int raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr) in raw_eth_ioctl() argument 53 raw_hdlc_proto __user *raw_s = ifr->ifr_settings.ifs_ifsu.raw_hdlc; in raw_eth_ioctl() 60 switch (ifr->ifr_settings.type) { in raw_eth_ioctl() 64 ifr->ifr_settings.type = IF_PROTO_HDLC_ETH; in raw_eth_ioctl() 65 if (ifr->ifr_settings.size < size) { in raw_eth_ioctl() 66 ifr->ifr_settings.size = size; /* data size wanted */ in raw_eth_ioctl()
|
D | pc300too.c | 191 static int pc300_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) in pc300_ioctl() argument 195 sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync; in pc300_ioctl() 206 return hdlc_ioctl(dev, ifr, cmd); in pc300_ioctl() 208 if (ifr->ifr_settings.type == IF_GET_IFACE) { in pc300_ioctl() 209 ifr->ifr_settings.type = port->iface; in pc300_ioctl() 210 if (ifr->ifr_settings.size < size) { in pc300_ioctl() 211 ifr->ifr_settings.size = size; /* data size wanted */ in pc300_ioctl() 221 (ifr->ifr_settings.type == IF_IFACE_SYNC_SERIAL || in pc300_ioctl() 222 ifr->ifr_settings.type == IF_IFACE_X21)) in pc300_ioctl() 226 (ifr->ifr_settings.type == IF_IFACE_SYNC_SERIAL || in pc300_ioctl() [all …]
|
D | hdlc_x25.c | 30 static int x25_ioctl(struct net_device *dev, struct ifreq *ifr); 273 static int x25_ioctl(struct net_device *dev, struct ifreq *ifr) in x25_ioctl() argument 275 x25_hdlc_proto __user *x25_s = ifr->ifr_settings.ifs_ifsu.x25; in x25_ioctl() 281 switch (ifr->ifr_settings.type) { in x25_ioctl() 285 ifr->ifr_settings.type = IF_PROTO_X25; in x25_ioctl() 286 if (ifr->ifr_settings.size < size) { in x25_ioctl() 287 ifr->ifr_settings.size = size; /* data size wanted */ in x25_ioctl() 302 if (ifr->ifr_settings.size == 0) { in x25_ioctl()
|
D | pci200syn.c | 182 static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) in pci200_ioctl() argument 186 sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync; in pci200_ioctl() 196 return hdlc_ioctl(dev, ifr, cmd); in pci200_ioctl() 198 switch(ifr->ifr_settings.type) { in pci200_ioctl() 200 ifr->ifr_settings.type = IF_IFACE_V35; in pci200_ioctl() 201 if (ifr->ifr_settings.size < size) { in pci200_ioctl() 202 ifr->ifr_settings.size = size; /* data size wanted */ in pci200_ioctl() 232 return hdlc_ioctl(dev, ifr, cmd); in pci200_ioctl()
|
D | c101.c | 222 static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) in c101_ioctl() argument 226 sync_serial_settings __user *line = ifr->ifr_settings.ifs_ifsu.sync; in c101_ioctl() 241 return hdlc_ioctl(dev, ifr, cmd); in c101_ioctl() 243 switch(ifr->ifr_settings.type) { in c101_ioctl() 245 ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL; in c101_ioctl() 246 if (ifr->ifr_settings.size < size) { in c101_ioctl() 247 ifr->ifr_settings.size = size; /* data size wanted */ in c101_ioctl() 275 return hdlc_ioctl(dev, ifr, cmd); in c101_ioctl()
|
D | hdlc_cisco.c | 63 static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr); 327 static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) in cisco_ioctl() argument 329 cisco_proto __user *cisco_s = ifr->ifr_settings.ifs_ifsu.cisco; in cisco_ioctl() 335 switch (ifr->ifr_settings.type) { in cisco_ioctl() 339 ifr->ifr_settings.type = IF_PROTO_CISCO; in cisco_ioctl() 340 if (ifr->ifr_settings.size < size) { in cisco_ioctl() 341 ifr->ifr_settings.size = size; /* data size wanted */ in cisco_ioctl()
|
D | hdlc_fr.c | 153 static int fr_ioctl(struct net_device *dev, struct ifreq *ifr); 378 static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) in pvc_ioctl() argument 383 if (ifr->ifr_settings.type == IF_GET_PROTO) { in pvc_ioctl() 385 ifr->ifr_settings.type = IF_PROTO_FR_ETH_PVC; in pvc_ioctl() 387 ifr->ifr_settings.type = IF_PROTO_FR_PVC; in pvc_ioctl() 389 if (ifr->ifr_settings.size < sizeof(info)) { in pvc_ioctl() 391 ifr->ifr_settings.size = sizeof(info); in pvc_ioctl() 397 if (copy_to_user(ifr->ifr_settings.ifs_ifsu.fr_pvc_info, in pvc_ioctl() 1187 static int fr_ioctl(struct net_device *dev, struct ifreq *ifr) in fr_ioctl() argument 1189 fr_proto __user *fr_s = ifr->ifr_settings.ifs_ifsu.fr; in fr_ioctl() [all …]
|
/kernel/linux/linux-5.10/Documentation/networking/ |
D | tuntap.rst | 95 struct ifreq ifr; 101 memset(&ifr, 0, sizeof(ifr)); 108 ifr.ifr_flags = IFF_TUN; 110 strncpy(ifr.ifr_name, dev, IFNAMSIZ); 112 if( (err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0 ){ 116 strcpy(dev, ifr.ifr_name); 150 struct ifreq ifr; 156 memset(&ifr, 0, sizeof(ifr)); 163 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_MULTI_QUEUE; 164 strcpy(ifr.ifr_name, dev); [all …]
|
/kernel/linux/linux-5.10/arch/um/os-Linux/drivers/ |
D | tuntap_user.c | 130 struct ifreq ifr; in tuntap_open() local 147 memset(&ifr, 0, sizeof(ifr)); in tuntap_open() 148 ifr.ifr_flags = IFF_TAP | IFF_NO_PI; in tuntap_open() 149 strlcpy(ifr.ifr_name, pri->dev_name, sizeof(ifr.ifr_name)); in tuntap_open() 150 if (ioctl(pri->fd, TUNSETIFF, &ifr) < 0) { in tuntap_open()
|
/kernel/linux/linux-5.10/drivers/spi/ |
D | atmel-quadspi.c | 300 u32 iar, icr, ifr; in atmel_qspi_set_cfg() local 306 ifr = QSPI_IFR_INSTEN; in atmel_qspi_set_cfg() 311 ifr |= atmel_qspi_modes[mode].config; in atmel_qspi_set_cfg() 333 ifr |= QSPI_IFR_OPTEN | QSPI_IFR_OPTL_8BIT; in atmel_qspi_set_cfg() 338 ifr &= ~QSPI_IFR_INSTEN; in atmel_qspi_set_cfg() 339 ifr |= QSPI_IFR_ADDREN; in atmel_qspi_set_cfg() 343 ifr |= QSPI_IFR_ADDREN; in atmel_qspi_set_cfg() 349 ifr |= QSPI_IFR_ADDREN; in atmel_qspi_set_cfg() 353 ifr |= QSPI_IFR_ADDREN | QSPI_IFR_ADDRL; in atmel_qspi_set_cfg() 366 ifr |= QSPI_IFR_NBDUM(dummy_cycles); in atmel_qspi_set_cfg() [all …]
|
/kernel/linux/linux-5.10/drivers/net/dsa/mv88e6xxx/ |
D | hwtstamp.h | 114 struct ifreq *ifr); 116 struct ifreq *ifr); 136 int port, struct ifreq *ifr) in mv88e6xxx_port_hwtstamp_set() argument 142 int port, struct ifreq *ifr) in mv88e6xxx_port_hwtstamp_get() argument
|
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
D | udpgso.c | 279 struct ifreq ifr; in get_device_mtu() local 281 memset(&ifr, 0, sizeof(ifr)); in get_device_mtu() 283 strcpy(ifr.ifr_name, ifname); in get_device_mtu() 285 if (ioctl(fd, SIOCGIFMTU, &ifr)) in get_device_mtu() 288 return ifr.ifr_mtu; in get_device_mtu() 293 struct ifreq ifr; in __set_device_mtu() local 295 memset(&ifr, 0, sizeof(ifr)); in __set_device_mtu() 297 ifr.ifr_mtu = mtu; in __set_device_mtu() 298 strcpy(ifr.ifr_name, ifname); in __set_device_mtu() 300 if (ioctl(fd, SIOCSIFMTU, &ifr)) in __set_device_mtu()
|
D | hwtstamp_config.c | 88 struct ifreq ifr; in main() local 114 strcpy(ifr.ifr_name, argv[1]); in main() 115 ifr.ifr_data = (caddr_t)&config; in main() 117 if (ioctl(sock, (argc == 2) ? SIOCGHWTSTAMP : SIOCSHWTSTAMP, &ifr)) { in main()
|
/kernel/linux/linux-5.10/drivers/staging/rtl8188eu/os_dep/ |
D | rtw_android.c | 130 int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) in rtw_android_priv_cmd() argument 138 if (!ifr->ifr_data) in rtw_android_priv_cmd() 140 if (copy_from_user(&priv_cmd, ifr->ifr_data, sizeof(priv_cmd))) in rtw_android_priv_cmd() 149 __func__, command, ifr->ifr_name); in rtw_android_priv_cmd() 159 __func__, command, ifr->ifr_name); in rtw_android_priv_cmd()
|
/kernel/linux/linux-5.10/drivers/net/ethernet/aquantia/atlantic/ |
D | aq_main.c | 267 static int aq_ndev_hwtstamp_set(struct aq_nic_s *aq_nic, struct ifreq *ifr) in aq_ndev_hwtstamp_set() argument 277 if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) in aq_ndev_hwtstamp_set() 285 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? in aq_ndev_hwtstamp_set() 290 static int aq_ndev_hwtstamp_get(struct aq_nic_s *aq_nic, struct ifreq *ifr) in aq_ndev_hwtstamp_get() argument 298 return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? in aq_ndev_hwtstamp_get() 303 static int aq_ndev_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in aq_ndev_ioctl() argument 309 return aq_ndev_hwtstamp_set(aq_nic, ifr); in aq_ndev_ioctl() 313 return aq_ndev_hwtstamp_get(aq_nic, ifr); in aq_ndev_ioctl()
|
/kernel/linux/linux-5.10/arch/um/drivers/ |
D | vector_user.c | 132 struct ifreq ifr; in create_tap_fd() local 141 memset(&ifr, 0, sizeof(ifr)); in create_tap_fd() 142 ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_VNET_HDR; in create_tap_fd() 143 strncpy((char *)&ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1); in create_tap_fd() 145 err = ioctl(fd, TUNSETIFF, (void *) &ifr); in create_tap_fd() 162 struct ifreq ifr; in create_raw_fd() local 172 memset(&ifr, 0, sizeof(ifr)); in create_raw_fd() 173 strncpy((char *)&ifr.ifr_name, iface, sizeof(ifr.ifr_name) - 1); in create_raw_fd() 174 if (ioctl(fd, SIOCGIFINDEX, (void *) &ifr) < 0) { in create_raw_fd() 181 sock.sll_ifindex = ifr.ifr_ifindex; in create_raw_fd()
|
/kernel/linux/linux-5.10/drivers/net/ |
D | tun.c | 2665 static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) in tun_set_iff() argument 2675 if ((ifr->ifr_flags & IFF_NAPI_FRAGS)) { in tun_set_iff() 2679 if (!(ifr->ifr_flags & IFF_NAPI) || in tun_set_iff() 2680 (ifr->ifr_flags & TUN_TYPE_MASK) != IFF_TAP) in tun_set_iff() 2684 dev = __dev_get_by_name(net, ifr->ifr_name); in tun_set_iff() 2686 if (ifr->ifr_flags & IFF_TUN_EXCL) in tun_set_iff() 2688 if ((ifr->ifr_flags & IFF_TUN) && dev->netdev_ops == &tun_netdev_ops) in tun_set_iff() 2690 else if ((ifr->ifr_flags & IFF_TAP) && dev->netdev_ops == &tap_netdev_ops) in tun_set_iff() 2695 if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != in tun_set_iff() 2705 err = tun_attach(tun, file, ifr->ifr_flags & IFF_NOFILTER, in tun_set_iff() [all …]
|
D | eql.c | 134 static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); 271 static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) in eql_ioctl() argument 279 return eql_enslave(dev, ifr->ifr_data); in eql_ioctl() 281 return eql_emancipate(dev, ifr->ifr_data); in eql_ioctl() 283 return eql_g_slave_cfg(dev, ifr->ifr_data); in eql_ioctl() 285 return eql_s_slave_cfg(dev, ifr->ifr_data); in eql_ioctl() 287 return eql_g_master_cfg(dev, ifr->ifr_data); in eql_ioctl() 289 return eql_s_master_cfg(dev, ifr->ifr_data); in eql_ioctl()
|