Lines Matching refs:Connection
17 #include "shill/connection.h"
52 static string ObjectID(Connection* c) {
54 return "(connection)";
69 const uint32_t Connection::kDefaultMetric = 1;
71 const uint32_t Connection::kNonDefaultMetricBase = 10;
73 const uint32_t Connection::kMarkForUserTraffic = 0x1;
75 const uint8_t Connection::kSecondaryTableId = 0x1;
77 Connection::Binder::Binder(const string& name,
82 Connection::Binder::~Binder() {
86 void Connection::Binder::Attach(const ConnectionRefPtr& to_connection) {
89 LOG(INFO) << name_ << ": unbound from connection: "
96 LOG(INFO) << name_ << ": bound to connection: "
101 void Connection::Binder::OnDisconnect() {
102 LOG(INFO) << name_ << ": bound connection disconnected: "
111 Connection::Connection(int interface_index,
129 // Connection owns a single instance of |lower_binder_| so it's safe
131 Bind(&Connection::OnLowerDisconnect, Unretained(this))),
146 Connection::~Connection() {
158 void Connection::UpdateFromIPConfig(const IPConfigRefPtr& config) {
178 // A VPN connection can currently be bound to exactly one lower connection
180 // that connection. Setting up the routing table this way ensures that when
181 // the lower connection goes offline, the associated entries in the routing
184 // connection and the others over a different connection, all routes are
185 // still pinned to a connection.
187 // The optimal connection to reach the first excluded IP is found below.
302 bool Connection::SetupIptableEntries() {
319 bool Connection::TearDownIptableEntries() {
323 void Connection::SetIsDefault(bool is_default) {
345 void Connection::UpdateDNSServers(const vector<string>& dns_servers) {
350 void Connection::PushDNSConfig() {
354 // Only run DNS server proxy for the current default connection.
375 void Connection::RequestRouting() {
387 void Connection::ReleaseRouting() {
404 bool Connection::RequestHostRoute(const IPAddress& address) {
408 // connection closes. Also, add route query callback to determine the lower
409 // connection and bind to it.
414 Bind(&Connection::OnRouteQueryResponse,
424 bool Connection::PinPendingRoutes(int interface_index,
440 string Connection::GetSubnetName() const {
449 bool Connection::FixGatewayReachability(const IPAddress& local,
459 LOG(WARNING) << "No gateway address was provided for this connection.";
558 uint32_t Connection::GetMetric(bool is_default) {
565 bool Connection::PinHostRoute(const IPAddress& trusted_ip,
575 // a gateway route that will interfere with our primary connection, so
584 void Connection::SetMTU(int32_t mtu) {
601 void Connection::OnRouteQueryResponse(int interface_index,
611 ConnectionRefPtr connection = device->connection();
612 if (!connection) {
613 LOG(ERROR) << "Device " << interface_index << " has no connection.";
616 if (connection == this) {
617 LOG(ERROR) << "Avoiding a connection bind loop for " << interface_name();
620 lower_binder_.Attach(connection);
621 connection->CreateGatewayRoute();
626 bool Connection::CreateGatewayRoute() {
627 // Ensure that the gateway for the lower connection remains reachable,
639 // and only pins persistent state that was already true of the connection.
640 // If DHCP parameters change later (without the connection having been
647 void Connection::OnLowerDisconnect() {
651 // NotifyBindersOnDisconnect because the latter may be invoked by Connection's
653 ConnectionRefPtr connection(this);
654 connection->NotifyBindersOnDisconnect();
657 void Connection::NotifyBindersOnDisconnect() {
661 // Unbinds the lower connection before notifying the binders. This ensures
673 void Connection::AttachBinder(Binder* binder) {
679 void Connection::DetachBinder(Binder* binder) {
690 ConnectionRefPtr Connection::GetCarrierConnection() {
692 set<Connection*> visited;
696 LOG(ERROR) << "Circular connection chain starting at: "
699 // connection is unknown.
705 SLOG(this, 2) << "Carrier connection: " << carrier->interface_name()
710 bool Connection::IsIPv6() {