Home | History | Annotate | Download | only in shill

Lines Matching refs:Connection

17 #include "shill/connection.h"
84 connection_(new Connection(
126 void ReplaceSingletons(ConnectionRefPtr connection) {
128 connection->resolver_ = &resolver_;
130 connection->dns_server_proxy_factory_ = &dns_server_proxy_factory_;
132 connection->routing_table_ = &routing_table_;
133 connection->rtnl_handler_ = &rtnl_handler_;
144 bool PinHostRoute(ConnectionRefPtr connection,
147 return connection->PinHostRoute(trusted_ip, gateway);
150 const IPAddress& GetLocalAddress(ConnectionRefPtr connection) {
151 return connection->local_;
154 const IPAddress& GetGatewayAddress(ConnectionRefPtr connection) {
155 return connection->gateway_;
158 bool GetHasBroadcastDomain(ConnectionRefPtr connection) {
159 return connection->has_broadcast_domain_;
163 return Connection::kDefaultMetric;
167 return Connection::kNonDefaultMetricBase;
212 // Returns a new test connection object. The caller usually needs to call
215 ConnectionRefPtr connection(new Connection(kTestDeviceInterfaceIndex0,
220 ReplaceSingletons(connection);
221 return connection;
364 ConnectionRefPtr connection = GetNewConnection();
392 connection->firewall_proxy_.reset(firewall_proxy);
399 connection->UpdateFromIPConfig(ipconfig_);
413 EXPECT_CALL(*device1, connection())
422 connection->OnRouteQueryResponse(
429 EXPECT_TRUE(test_local_address.Equals(GetLocalAddress(connection)));
430 EXPECT_TRUE(gateway_address_.Equals(GetGatewayAddress(connection)));
431 EXPECT_TRUE(GetHasBroadcastDomain(connection));
432 EXPECT_FALSE(connection->IsIPv6());
440 EXPECT_TRUE(connection->CreateGatewayRoute());
441 EXPECT_FALSE(connection->CreateGatewayRoute());
442 connection->has_broadcast_domain_ = false;
443 EXPECT_FALSE(connection->CreateGatewayRoute());
461 connection->SetIsDefault(true);
463 EXPECT_TRUE(connection->is_default());
469 connection->SetIsDefault(false);
470 EXPECT_FALSE(connection->is_default());
531 // Connection should add a link route which will allow the
678 // Non-default connection.
692 // Default connection.
708 ConnectionRefPtr connection = GetNewConnection();
720 connection->RequestRouting();
721 connection->RequestRouting();
724 connection->ReleaseRouting();
729 connection->ReleaseRouting();
736 ConnectionRefPtr connection(new Connection(kTestDeviceInterfaceIndex1,
742 connection->resolver_ = &resolver_;
744 connection->dns_server_proxy_factory_ = &dns_server_proxy_factory_;
746 connection->routing_table_ = &routing_table_;
747 connection->rtnl_handler_ = &rtnl_handler_;
751 connection = nullptr;
755 ConnectionRefPtr connection = GetNewConnection();
767 EXPECT_TRUE(connection->RequestHostRoute(address));
784 Connection::kDefaultMetric,
793 ConnectionRefPtr connection = GetNewConnection();
799 EXPECT_FALSE(PinHostRoute(connection, trusted_ip, gateway));
805 EXPECT_FALSE(PinHostRoute(connection, trusted_ip, gateway));
813 EXPECT_TRUE(PinHostRoute(connection, trusted_ip,
821 EXPECT_FALSE(PinHostRoute(connection, trusted_ip, gateway));
827 EXPECT_TRUE(PinHostRoute(connection, trusted_ip, gateway));
834 ConnectionRefPtr connection = GetNewConnection();
845 EXPECT_FALSE(connection->FixGatewayReachability(
856 EXPECT_TRUE(connection->FixGatewayReachability(
873 EXPECT_TRUE(connection->FixGatewayReachability(
885 EXPECT_FALSE(connection->FixGatewayReachability(
895 EXPECT_TRUE(connection->FixGatewayReachability(
904 EXPECT_FALSE(connection->FixGatewayReachability(
916 EXPECT_TRUE(connection->FixGatewayReachability(
931 Connection::Binder binder0("binder0", target0.callback());
932 Connection::Binder binder1("binder1", target1.callback());
933 Connection::Binder binder2("binder2", target2.callback());
934 Connection::Binder binder3("binder3", target3.callback());
964 // No connection should be bound initially.
965 Connection::Binder* binder = &connection_->lower_binder_;
976 EXPECT_EQ(connection1.get(), binder->connection().get());
1002 Connection::Binder test_binder("from_test", target.callback());
1013 // Binding a connection to itself should be safe.
1014 ConnectionRefPtr connection = GetNewConnection();
1016 connection->lower_binder_.Attach(connection);
1018 EXPECT_FALSE(connection->binders_.empty());
1021 Connection::Binder binder("test", target.callback());
1022 binder.Attach(connection);
1026 connection = nullptr;
1041 Connection::Binder binder_a("test_a", target_a.callback());
1042 Connection::Binder binder_b("test_b", target_b.callback());
1057 // Test the weak pointer to the bound Connection. This is not a case that
1060 Connection::Binder binder("test_weak", target.callback());
1061 ConnectionRefPtr connection = GetNewConnection();
1062 binder.Attach(connection);
1064 // Make sure the connection doesn't notify the binder on destruction.
1065 connection->binders_.clear();
1068 connection = nullptr;
1070 // Ensure no crash -- the weak pointer to connection should be nullptr.
1071 EXPECT_FALSE(binder.connection());
1077 Connection::Binder* binder = &connection_->lower_binder_;
1078 ConnectionRefPtr connection = GetNewConnection();
1088 // Make sure we unbind the old lower connection even if we can't lookup the
1089 // lower connection device.
1090 binder->Attach(connection);
1098 // Check for graceful handling of a connection loop.
1099 EXPECT_CALL(*device, connection())
1107 // Check for graceful handling of a device with no connection.
1109 EXPECT_CALL(*device, connection())
1117 // Create a mock connection that will be used for binding.
1126 EXPECT_CALL(*device, connection())
1132 // connection to create a gateway route.
1136 // Ensure that the Device is notified of the change to the connection.
1141 // Check that the upper connection is bound to the lower connection.
1143 EXPECT_EQ(mock_connection.get(), binder->connection().get());
1146 connection = nullptr;