summaryrefslogtreecommitdiffstats
path: root/remoting/host
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host')
-rw-r--r--remoting/host/chromoting_host.cc12
-rw-r--r--remoting/host/chromoting_host.h8
-rw-r--r--remoting/host/client_session.cc11
-rw-r--r--remoting/host/client_session.h16
-rw-r--r--remoting/host/host_event_logger.cc12
-rw-r--r--remoting/host/host_event_logger.h8
-rw-r--r--remoting/host/host_mock_objects.h8
-rw-r--r--remoting/host/host_status_observer.h7
8 files changed, 51 insertions, 31 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 6821e75..8865e2d 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -225,13 +225,15 @@ void ChromotingHost::OnSessionSequenceNumber(ClientSession* session,
recorder_->UpdateSequenceNumber(sequence_number);
}
-void ChromotingHost::OnSessionIpAddress(ClientSession* session,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) {
+void ChromotingHost::OnSessionRouteChange(
+ ClientSession* session,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) {
DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
FOR_EACH_OBSERVER(HostStatusObserver, status_observers_,
- OnClientIpAddress(session->client_jid(), channel_name,
- end_point));
+ OnClientRouteChange(session->client_jid(), channel_name,
+ remote_end_point, local_end_point));
}
void ChromotingHost::OnSessionManagerReady() {
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h
index 8b56ab9..dc06acc 100644
--- a/remoting/host/chromoting_host.h
+++ b/remoting/host/chromoting_host.h
@@ -110,9 +110,11 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
virtual void OnSessionClosed(ClientSession* session) OVERRIDE;
virtual void OnSessionSequenceNumber(ClientSession* session,
int64 sequence_number) OVERRIDE;
- virtual void OnSessionIpAddress(ClientSession* session,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) OVERRIDE;
+ virtual void OnSessionRouteChange(
+ ClientSession* session,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) OVERRIDE;
// SessionManager::Listener implementation.
virtual void OnSessionManagerReady() OVERRIDE;
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 140f4c5..7989e09 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -125,12 +125,15 @@ void ClientSession::OnSequenceNumberUpdated(
event_handler_->OnSessionSequenceNumber(this, sequence_number);
}
-void ClientSession::OnClientIpAddress(protocol::ConnectionToClient* connection,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) {
+void ClientSession::OnRouteChange(
+ protocol::ConnectionToClient* connection,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(connection_.get(), connection);
- event_handler_->OnSessionIpAddress(this, channel_name, end_point);
+ event_handler_->OnSessionRouteChange(this, channel_name, remote_end_point,
+ local_end_point);
}
void ClientSession::Disconnect() {
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
index 98f6cf8..44607c4 100644
--- a/remoting/host/client_session.h
+++ b/remoting/host/client_session.h
@@ -49,9 +49,11 @@ class ClientSession : public protocol::HostStub,
// Called on notification of a route change event, when a channel is
// connected.
- virtual void OnSessionIpAddress(ClientSession* client,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) = 0;
+ virtual void OnSessionRouteChange(
+ ClientSession* client,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) = 0;
};
// Takes ownership of |connection|. Does not take ownership of
@@ -75,9 +77,11 @@ class ClientSession : public protocol::HostStub,
protocol::Session::Error error) OVERRIDE;
virtual void OnSequenceNumberUpdated(
protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE;
- virtual void OnClientIpAddress(protocol::ConnectionToClient* connection,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) OVERRIDE;
+ virtual void OnRouteChange(
+ protocol::ConnectionToClient* connection,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) OVERRIDE;
// Disconnects the session and destroys the transport. Event handler
// is guaranteed not to be called after this method is called. Can
diff --git a/remoting/host/host_event_logger.cc b/remoting/host/host_event_logger.cc
index 4947d06..9cd6258 100644
--- a/remoting/host/host_event_logger.cc
+++ b/remoting/host/host_event_logger.cc
@@ -33,10 +33,14 @@ void HostEventLogger::OnAccessDenied(const std::string& jid) {
Log("Access denied for client: " + jid);
}
-void HostEventLogger::OnClientIpAddress(const std::string& jid,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) {
- Log("Channel IP for client: " + jid + " ip='" + end_point.ToString() +
+void HostEventLogger::OnClientRouteChange(
+ const std::string& jid,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) {
+ Log("Channel IP for client: " + jid +
+ " ip='" + remote_end_point.ToString() +
+ "' host_ip='" + local_end_point.ToString() +
"' channel='" + channel_name + "'");
}
diff --git a/remoting/host/host_event_logger.h b/remoting/host/host_event_logger.h
index 1944756..3c92bd6 100644
--- a/remoting/host/host_event_logger.h
+++ b/remoting/host/host_event_logger.h
@@ -28,9 +28,11 @@ class HostEventLogger : public HostStatusObserver {
virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
virtual void OnAccessDenied(const std::string& jid) OVERRIDE;
- virtual void OnClientIpAddress(const std::string& jid,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) OVERRIDE;
+ virtual void OnClientRouteChange(
+ const std::string& jid,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) OVERRIDE;
virtual void OnShutdown() OVERRIDE;
private:
diff --git a/remoting/host/host_mock_objects.h b/remoting/host/host_mock_objects.h
index e1c91fa..f1b440f 100644
--- a/remoting/host/host_mock_objects.h
+++ b/remoting/host/host_mock_objects.h
@@ -104,9 +104,11 @@ class MockClientSessionEventHandler : public ClientSession::EventHandler {
MOCK_METHOD1(OnSessionFailed, void(ClientSession* client));
MOCK_METHOD2(OnSessionSequenceNumber, void(ClientSession* client,
int64 sequence_number));
- MOCK_METHOD3(OnSessionIpAddress, void(ClientSession* client,
- const std::string& channel_name,
- const net::IPEndPoint& end_point));
+ MOCK_METHOD4(OnSessionRouteChange, void(
+ ClientSession* client,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point));
private:
DISALLOW_COPY_AND_ASSIGN(MockClientSessionEventHandler);
diff --git a/remoting/host/host_status_observer.h b/remoting/host/host_status_observer.h
index 29a7193..7a1fa6c 100644
--- a/remoting/host/host_status_observer.h
+++ b/remoting/host/host_status_observer.h
@@ -32,9 +32,10 @@ class HostStatusObserver {
// Called on notification of a route change event, when a channel is
// connected.
- virtual void OnClientIpAddress(const std::string& jid,
- const std::string& channel_name,
- const net::IPEndPoint& end_point) { }
+ virtual void OnClientRouteChange(const std::string& jid,
+ const std::string& channel_name,
+ const net::IPEndPoint& remote_end_point,
+ const net::IPEndPoint& local_end_point) { }
// Called when the host shuts down.
virtual void OnShutdown() = 0;