Home
last modified time | relevance | path

Searched refs:netmask (Results 1 – 25 of 105) sorted by relevance

12345

/third_party/lwip/test/unit/dhcp/
Dtest_dhcp.c437 ip4_addr_t netmask; in START_TEST() local
447 IP4_ADDR(&netmask, 0, 0, 0, 0); in START_TEST()
450 netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); in START_TEST()
463 fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); in START_TEST()
491 IP4_ADDR(&netmask, 255, 255, 255, 0); in START_TEST()
494 fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); in START_TEST()
511 ip4_addr_t netmask; in START_TEST() local
520 IP4_ADDR(&netmask, 0, 0, 0, 0); in START_TEST()
523 netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); in START_TEST()
536 fail_if(memcmp(&netmask, &net_test.netmask, sizeof(ip4_addr_t))); in START_TEST()
[all …]
/third_party/lwip/test/unit/core/
Dtest_netif.c96 ip4_addr_t netmask; in NETIF_DECLARE_EXT_CALLBACK() local
101 IP4_ADDR(&netmask, 0, 0, 0, 0); in NETIF_DECLARE_EXT_CALLBACK()
114 netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); in NETIF_DECLARE_EXT_CALLBACK()
133 IP4_ADDR(&netmask, 255, 255, 255, 0); in NETIF_DECLARE_EXT_CALLBACK()
136 netif_set_netmask(&net_test, &netmask); in NETIF_DECLARE_EXT_CALLBACK()
151 IP4_ADDR(&netmask, 0, 0, 0, 0); in NETIF_DECLARE_EXT_CALLBACK()
154 netif_set_netmask(&net_test, &netmask); in NETIF_DECLARE_EXT_CALLBACK()
166 IP4_ADDR(&netmask, 255, 255, 255, 0); in NETIF_DECLARE_EXT_CALLBACK()
171 netif_set_addr(&net_test, &addr, &netmask, &gw); in NETIF_DECLARE_EXT_CALLBACK()
180 netif_set_netmask(&net_test, &netmask); in NETIF_DECLARE_EXT_CALLBACK()
[all …]
/third_party/ltp/testcases/network/stress/interface/
Dif-addr-adddel.sh21 local netmask=64
24 local netmask=24
41 ifconfig $iface add $new_ip/$netmask
43 ifconfig $iface:1 $new_ip netmask 255.255.255.0
46 ip) ip addr add $new_ip/$netmask dev $iface ;;
68 ifconfig $iface del $new_ip/$netmask
73 ip) ip addr del $new_ip/$netmask dev $iface ;;
Dif-addr-addlarge.sh19 [ "$TST_IPV6" ] && local netmask=64 || local netmask=16
54 ifconfig $iface add $new_ip/$netmask
56 ifconfig $iface:$x:$y $new_ip netmask 255.255.0.0
59 ip) ip addr add $new_ip/$netmask dev $iface ;;
79 ifconfig $iface del $new_ip/$netmask
84 ip) ip addr del $new_ip/$netmask dev $iface ;;
Dif-mtu-change.sh46 [ "$TST_IPV6" ] && local netmask=64 || local netmask=16
/third_party/lwip/src/api/
Dnetifapi.c70 API_EXPR_REF(msg->msg.add.netmask), in netifapi_do_netif_add()
95 API_EXPR_REF(msg->msg.add.netmask), in netifapi_do_netif_set_addr()
224 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, in netifapi_netif_add() argument
236 if (netmask == NULL) { in netifapi_netif_add()
237 netmask = IP4_ADDR_ANY4; in netifapi_netif_add()
247 NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask); in netifapi_netif_add()
269 const ip4_addr_t *netmask, in netifapi_netif_set_addr() argument
279 if (netmask == NULL) { in netifapi_netif_set_addr()
280 netmask = IP4_ADDR_ANY4; in netifapi_netif_set_addr()
288 NETIFAPI_VAR_REF(msg).msg.add.netmask = NETIFAPI_VAR_REF(netmask); in netifapi_netif_set_addr()
/third_party/boost/libs/asio/test/ip/
Dnetwork_v4.cpp55 ip::address_v4 addr2 = net1.netmask(); in test()
179 BOOST_ASIO_CHECK(net4.netmask() == make_address_v4("255.255.254.0")); in test()
182 BOOST_ASIO_CHECK(net5.netmask() == make_address_v4("255.240.0.0")); in test()
185 BOOST_ASIO_CHECK(net6.netmask() == make_address_v4("255.255.255.0")); in test()
188 BOOST_ASIO_CHECK(net7.netmask() == make_address_v4("255.255.0.0")); in test()
191 BOOST_ASIO_CHECK(net8.netmask() == make_address_v4("255.0.0.0")); in test()
194 BOOST_ASIO_CHECK(net9.netmask() == make_address_v4("255.255.255.255")); in test()
197 BOOST_ASIO_CHECK(net10.netmask() == make_address_v4("128.0.0.0")); in test()
200 BOOST_ASIO_CHECK(net11.netmask() == make_address_v4("0.0.0.0")); in test()
283 BOOST_ASIO_CHECK(net12.netmask() == make_address_v4("255.255.255.0")); in test()
[all …]
Daddress_v4.cpp104 addr1 = ip::address_v4::netmask(addr2); in test()
302 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x01000000)) == class_a_net); in test()
303 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x7F000000)) == class_a_net); in test()
304 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0x80000000)) == class_b_net); in test()
305 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xBFFF0000)) == class_b_net); in test()
306 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xC0000000)) == class_c_net); in test()
307 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xDFFFFF00)) == class_c_net); in test()
308 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xE0000000)) == other_net); in test()
309 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xEFFFFFFF)) == other_net); in test()
310 BOOST_ASIO_CHECK(address_v4::netmask(address_v4(0xF0000000)) == other_net); in test()
[all …]
/third_party/ltp/testcases/network/stress/ns-tools/
Dset_ipv4addr78 netmask=`echo $network_part | sed "s/[[:digit:]]*/255/g"`.`echo $host_part | sed "s/[[:digit:]]*/0/…
86 ifconfig $ifname $addr netmask $netmask broadcast $broadcast
89 …sbin:$PATH ; ifconfig '$ifname' up && ifconfig '$ifname $addr' netmask '$netmask' broadcast '$broa…
Dadd_ipv6addr78 netmask=64
84 ifconfig ${ifname} up ; ifconfig ${ifname} add ${addr}/${netmask}
87 …n:$PATH ; ifconfig '${ifname}' up && ifconfig '${ifname}' add '${addr}/${netmask}' ) >/dev/null 2>…
/third_party/toybox/toys/pending/
Droute.c192 static void get_next_params(char **argv, struct rtentry *rt, char **netmask) in get_next_params() argument
211 *netmask = argv[1]; in get_next_params()
212 get_hostname(*netmask, (struct sockaddr_in *) &sock); in get_next_params()
242 static void verify_netmask(struct rtentry *rt, char *netmask) in verify_netmask() argument
251 if (addr_mask & (addr_mask + 1)) perror_exit("wrong netmask '%s'", netmask); in verify_netmask()
261 char *netmask, *targetip; in setroute() local
273 netmask = strchr(targetip, '/'); in setroute()
274 if (netmask) { in setroute()
275 *netmask++ = 0; in setroute()
278 = htonl((1<<(32-atolx_range(netmask, 0, 32)))-1); in setroute()
[all …]
Dip.c396 static int get_nmask_prefix(uint32_t *netmask, uint8_t af, in get_nmask_prefix() argument
404 *netmask = (af == AF_INET6) ? 128 : 32; // set default netmask in get_nmask_prefix()
407 if (!ptr || ptr == name || *ptr || !plen || plen > *netmask) { in get_nmask_prefix()
416 *netmask = plen; in get_nmask_prefix()
426 static void parse_prefix(uint32_t *addr, uint32_t *netmask, uint8_t *len, in parse_prefix() argument
436 if (get_nmask_prefix(netmask, af, slash+1, family)) in parse_prefix()
440 else if (af == AF_INET && *addr) *netmask = 32; in parse_prefix()
441 else if (af == AF_INET6 && (*addr || *(addr+3))) *netmask = 128; in parse_prefix()
1141 uint32_t addr[4] = {0,}, netmask = 0; in ipaddrupdate() local
1143 parse_prefix(addr, &netmask, &len, *argv, in ipaddrupdate()
[all …]
/third_party/python/Lib/
Dipaddress.py726 if self.netmask != other.netmask:
727 return self.netmask < other.netmask
734 int(self.netmask) == int(other.netmask))
739 return hash(int(self.network_address) ^ int(self.netmask))
751 return other._ip & self.netmask._ip == self.network_address._ip
767 return self._address_class(int(self.netmask) ^ self._ALL_ONES)
775 return '%s/%s' % (self.network_address, self.netmask)
915 if self.netmask < other.netmask:
917 if self.netmask > other.netmask:
929 return (self._version, self.network_address, self.netmask)
[all …]
/third_party/libcoap/examples/lwip/
Dserver.c47 static ip4_addr_t ipaddr, netmask, gw; variable
60 IP4_ADDR(&netmask, 255,255,255,0); in main()
66 netif_add(&netif, &ipaddr, &netmask, &gw, NULL, tapif_init, ethernet_input); in main()
/third_party/libuv/src/unix/
Dbsd-ifaddrs.c117 memset(&address->netmask, 0, sizeof(address->netmask)); in uv_interface_addresses()
119 address->netmask.netmask6 = *((struct sockaddr_in6*) ent->ifa_netmask); in uv_interface_addresses()
121 address->netmask.netmask4 = *((struct sockaddr_in*) ent->ifa_netmask); in uv_interface_addresses()
/third_party/boost/boost/asio/ip/
Dnetwork_v4.hpp106 BOOST_ASIO_DECL address_v4 netmask() const BOOST_ASIO_NOEXCEPT;
111 return address_v4(address_.to_uint() & netmask().to_uint()); in network()
117 return address_v4(network().to_uint() | (netmask().to_uint() ^ 0xFFFFFFFF)); in broadcast()
126 return network_v4(network(), netmask()); in canonical()
/third_party/lwip/src/include/lwip/
Dip4_addr.h131 #define ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netma… argument
153 #define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr) argument
154 u8_t ip4_addr_netmask_valid(u32_t netmask);
Dnetif.h269 ip_addr_t netmask; member
417 … const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
419 void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask,
436 void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask);
441 #define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask)))
447 #define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask))
/third_party/uboot/u-boot-2020.01/drivers/net/
Dnetconsole.c56 static struct in_addr netmask; in is_broadcast() local
63 netmask = env_get_ip("netmask"); in is_broadcast()
70 ((netmask.s_addr & our_ip.s_addr) == in is_broadcast()
71 (netmask.s_addr & ip.s_addr) && /* on the same net and */ in is_broadcast()
72 (netmask.s_addr | ip.s_addr) == ~0)); /* bcast to our net */ in is_broadcast()
/third_party/lwip/src/core/
Dnetif.c278 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, in netif_add() argument
302 if (netmask == NULL) { in netif_add()
303 netmask = ip_2_ip4(IP4_ADDR_ANY); in netif_add()
311 ip_addr_set_zero_ip4(&netif->netmask); in netif_add()
367 netif_set_addr(netif, ipaddr, netmask, gw); in netif_add()
430 ip4_addr_debug_print(NETIF_DEBUG, netmask); in netif_add()
523 netif_do_set_netmask(struct netif *netif, const ip4_addr_t *netmask, ip_addr_t *old_nm) in netif_do_set_netmask() argument
526 if (ip4_addr_cmp(netmask, netif_ip4_netmask(netif)) == 0) { in netif_do_set_netmask()
535 ip4_addr_set(ip_2_ip4(&netif->netmask), netmask); in netif_do_set_netmask()
536 IP_SET_TYPE_VAL(netif->netmask, IPADDR_TYPE_V4); in netif_do_set_netmask()
[all …]
/third_party/libuv/test/
Dtest-platform-output.c142 if (interfaces[i].netmask.netmask4.sin_family == AF_INET) { in TEST_IMPL()
143 uv_ip4_name(&interfaces[i].netmask.netmask4, buffer, sizeof(buffer)); in TEST_IMPL()
145 } else if (interfaces[i].netmask.netmask4.sin_family == AF_INET6) { in TEST_IMPL()
146 uv_ip6_name(&interfaces[i].netmask.netmask6, buffer, sizeof(buffer)); in TEST_IMPL()
/third_party/lwip/test/unit/mqtt/
Dtest_mqtt.c22 test_mqtt_init_netif(struct netif *netif, const ip_addr_t *ip_addr, const ip_addr_t *netmask) in test_mqtt_init_netif() argument
28 ip_addr_copy_from_ip4(netif->netmask, *ip_2_ip4(netmask)); in test_mqtt_init_netif()
/third_party/node/src/
Dnode_os.cc169 char netmask[INET6_ADDRSTRLEN]; in GetInterfaceAddresses() local
210 uv_ip4_name(&interfaces[i].netmask.netmask4, netmask, sizeof(netmask)); in GetInterfaceAddresses()
214 uv_ip6_name(&interfaces[i].netmask.netmask6, netmask, sizeof(netmask)); in GetInterfaceAddresses()
223 result.emplace_back(OneByteString(isolate, netmask)); in GetInterfaceAddresses()
/third_party/lwip/test/fuzz/
Dfuzz.c145 ip4_addr_t netmask; in main() local
152 IP4_ADDR(&netmask, 255, 255, 255, 0); in main()
155 netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input); in main()
/third_party/FreeBSD/sys/dev/usb/net/
Dusb_eth_drv.c65 ip4_addr_t ipaddr, netmask, gw; in eth_drv_init() local
70 IP4_ADDR(&netmask, 255, 255, 255, 0); in eth_drv_init()
87 ret = netifapi_netif_add(usb_netif, &ipaddr, &netmask, &gw); in eth_drv_init()

12345