• Home
  • Raw
  • Download

Lines Matching full:network

11 #include "rtc_base/network.h"
72 bool SameNameAndPrefix(const rtc::Network& a, const rtc::Network& b) { in SameNameAndPrefix()
102 const Network& network) { in IsIgnoredNetwork() argument
103 return network_manager.IsIgnoredNetwork(network); in IsIgnoredNetwork()
254 // Test that the Network ctor works properly.
256 Network ipv4_network1("test_eth0", "Test Network Adapter 1", in TEST_F()
259 EXPECT_EQ("Test Network Adapter 1", ipv4_network1.description()); in TEST_F()
266 Network ipv4_network1("test_eth0", "Test Network Adapter 1", in TEST_F()
268 Network ipv4_network2("test_eth1", "Test Network Adapter 2", in TEST_F()
277 Network ignore_me("ignore_me", "Ignore me please!", IPAddress(0x12345600U), in TEST_F()
279 Network include_me("include_me", "Include me please!", IPAddress(0x12345600U), in TEST_F()
338 // is called, after network update signal is already sent. in TEST_F()
359 // Verify that MergeNetworkList() merges network lists properly.
361 Network ipv4_network1("test_eth0", "Test Network Adapter 1", in TEST_F()
363 Network ipv4_network2("test_eth1", "Test Network Adapter 2", in TEST_F()
371 list.push_back(new Network(ipv4_network1)); in TEST_F()
382 Network* net1 = list[0]; in TEST_F()
388 list.push_back(new Network(ipv4_network2)); in TEST_F()
398 Network* net2 = list[0]; in TEST_F()
400 // Network id will increase. in TEST_F()
405 list.push_back(new Network(ipv4_network1)); in TEST_F()
406 list.push_back(new Network(ipv4_network2)); in TEST_F()
413 // Verify that we get previous instances of Network objects. in TEST_F()
424 list.push_back(new Network(ipv4_network2)); in TEST_F()
425 list.push_back(new Network(ipv4_network1)); in TEST_F()
432 // Verify that we get previous instances of Network objects. in TEST_F()
450 Network ipv6_eth0_linklocalnetwork("test_eth0", "Test NetworkAdapter 1", in SetupNetworks()
454 Network ipv6_eth1_linklocalnetwork("test_eth1", "Test NetworkAdapter 2", in SetupNetworks()
460 Network ipv6_eth0_publicnetwork1_ip1("test_eth0", "Test NetworkAdapter 1", in SetupNetworks()
465 Network ipv6_eth1_publicnetwork1_ip1("test_eth1", "Test NetworkAdapter 1", in SetupNetworks()
468 list->push_back(new Network(ipv6_eth0_linklocalnetwork)); in SetupNetworks()
469 list->push_back(new Network(ipv6_eth1_linklocalnetwork)); in SetupNetworks()
470 list->push_back(new Network(ipv6_eth0_publicnetwork1_ip1)); in SetupNetworks()
471 list->push_back(new Network(ipv6_eth1_publicnetwork1_ip1)); in SetupNetworks()
474 // Test that the basic network merging case works.
493 // Tests that when two network lists that describe the same set of networks are
516 for (const Network* network : second_list) { in TEST_F() local
517 EXPECT_THAT(resulting_list, Not(Contains(network))); in TEST_F()
521 // Test that we can merge a network that is the same as another network but with
522 // a different IP. The original network should remain in the list, but have its
530 // Make a network that we're going to change. in TEST_F()
534 Network* network_to_change = in TEST_F()
535 new Network("test_eth0", "Test Network Adapter 1", prefix, 64); in TEST_F()
536 Network* changed_network = new Network(*network_to_change); in TEST_F()
553 // Make sure the original network is still in the merged list. in TEST_F()
558 // Testing a similar case to above, but checking that a network can be updated
572 // Add a second IP to the public network on eth0 (2401:fa00:4:1000/64). in TEST_F()
575 Network ipv6_eth0_publicnetwork1_ip2("test_eth0", "Test NetworkAdapter 1", in TEST_F()
577 // This is the IP that already existed in the public network on eth0. in TEST_F()
580 original_list.push_back(new Network(ipv6_eth0_publicnetwork1_ip2)); in TEST_F()
595 // This should be the same network object as before. in TEST_F()
620 // A second network for eth0. in TEST_F()
623 Network ipv6_eth0_publicnetwork2_ip1("test_eth0", "Test NetworkAdapter 1", in TEST_F()
626 original_list.push_back(new Network(ipv6_eth0_publicnetwork2_ip1)); in TEST_F()
639 // Check the new network has 1 IP and that it's the correct one. in TEST_F()
677 // Test that when network interfaces are sorted and given preference values,
681 Network ipv4_network1("test_eth0", "Test Network Adapter 1", in TEST_F()
689 Network ipv6_eth1_publicnetwork1_ip1("test_eth1", "Test NetworkAdapter 2", in TEST_F()
694 list.push_back(new Network(ipv4_network1)); in TEST_F()
695 list.push_back(new Network(ipv6_eth1_publicnetwork1_ip1)); in TEST_F()
696 Network* net1 = list[0]; in TEST_F()
697 Network* net2 = list[1]; in TEST_F()
702 // After sorting IPv6 network should be higher order than IPv4 networks. in TEST_F()
710 Network* eth0 = new Network("test_eth0", "Test Network Adapter 1", in TEST_F()
713 Network* eth1 = new Network("test_eth1", "Test Network Adapter 2", in TEST_F()
730 Network wifi("wlan0", "Wireless Adapter", IPAddress(0x12345600U), 24, in TEST_F()
733 Network ethernet("eth0", "Ethernet", IPAddress(0x12345600U), 24, in TEST_F()
736 Network cellular("test_cell", "Cellular Adapter", IPAddress(0x12345600U), 24, in TEST_F()
739 Network vpn("bridge_test", "VPN Adapter", IPAddress(0x12345600U), 24, in TEST_F()
742 Network unknown("test", "Test Adapter", IPAddress(0x12345600U), 24, in TEST_F()
760 // Verify that if there are two addresses on one interface, only one network
794 // Tests that the network type can be updated after the network monitor is
802 // A network created before the network monitor is started will get in TEST_F()
809 // of an existing network can be changed after the network monitor starts in TEST_F()
810 // and detects the network type correctly. in TEST_F()
812 // After the network monitor starts, the type will be updated. in TEST_F()
815 // This brings up the hook with the network monitor. in TEST_F()
817 // Add the same ipv6 address as before but it has the right network type in TEST_F()
818 // detected by the network monitor now. in TEST_F()
824 // Add another network with the type inferred from the network monitor. in TEST_F()
832 // Test that the network type can be determined based on name matching in
905 // prefix/length into a single Network.
916 Network* net1 = new Network("em1", "em1", TruncateIP(ip1, 64), 64); in TEST_F()
917 Network* net2 = new Network("em1", "em1", TruncateIP(ip1, 64), 64); in TEST_F()
941 // a network becomes inactive and then active again.
944 Network network1("test_wifi", "Test Network Adapter 1", in TEST_F()
946 Network network2("test_eth0", "Test Network Adapter 2", in TEST_F()
951 Network* net1 = new Network(network1); in TEST_F()
962 Network* net2 = new Network(network2); in TEST_F()
973 list.push_back(new Network(network1)); in TEST_F()
983 // Test that the filtering logic follows the defined ruleset in network.h.
991 // Create a network with this prefix. in TEST_F()
992 Network ipv6_network("test_eth0", "Test NetworkAdapter", TruncateIP(ip, 64), in TEST_F()
1036 // Clear the networks so that there will be network changes below. in TEST_F()
1038 // Network manager is started, so the callback is called when the network in TEST_F()
1039 // monitor fires the network-change event. in TEST_F()
1043 // Network manager is stopped. in TEST_F()
1068 std::vector<Network*> networks; in TEST_F()
1071 for (const auto* network : networks) { in TEST_F() local
1072 if (network->GetBestIP().family() == AF_INET) { in TEST_F()
1074 } else if (network->GetBestIP().family() == AF_INET6 && in TEST_F()
1075 !IPIsLoopback(network->GetBestIP())) { in TEST_F()
1076 // Existence of an IPv6 loopback address doesn't mean it has IPv6 network in TEST_F()
1091 // default address may be different from the best IP address of any network. in TEST_F()
1095 // Create a network with a prefix of ip1. in TEST_F()
1096 Network ipv6_network("test_eth0", "Test NetworkAdapter", TruncateIP(ip1, 64), in TEST_F()
1102 BasicNetworkManager::NetworkList list(1, new Network(ipv6_network)); in TEST_F()
1105 // If the set default address is not in any network, GetDefaultLocalAddress in TEST_F()
1112 // If the set default address is in a network, GetDefaultLocalAddress will in TEST_F()
1113 // return the best IP in that network. in TEST_F()
1128 Network* net1 = new Network("em1", "em1", TruncateIP(ip1, 64), 64); in TEST_F()
1146 Network* net2 = new Network("em1", "em1", TruncateIP(ip1, 64), 64); in TEST_F()
1165 Network* net2 = new Network("em1", "em1", TruncateIP(ip1, 64), 64); in TEST_F()