From 951785568c509f1a127b3d6a1cc48f3796b20b96 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Tue, 1 May 2012 00:40:50 +0000 Subject: Implement HostPortAllocator. HostPortAllocator is a PortAllocator specific to Chromoting host. BUG=103991 Review URL: https://chromiumcodereview.appspot.com/10160013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134650 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/chromoting_host.h | 44 +---------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'remoting/host/chromoting_host.h') diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index a9749ac..0c88bfb 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -18,6 +18,7 @@ #include "remoting/host/desktop_environment.h" #include "remoting/host/host_key_pair.h" #include "remoting/host/host_status_observer.h" +#include "remoting/host/network_settings.h" #include "remoting/host/ui_strings.h" #include "remoting/jingle_glue/jingle_thread.h" #include "remoting/jingle_glue/signal_strategy.h" @@ -39,49 +40,6 @@ class DesktopEnvironment; class Encoder; class ScreenRecorder; -struct NetworkSettings { - enum NatTraversalMode { - // Don't use STUN or relay servers. Accept incoming P2P connection - // attempts, but don't initiate any. This ensures that the peer is - // on the same network. Note that connection will always fail if - // both ends use this mode. - NAT_TRAVERSAL_DISABLED, - - // Don't use STUN or relay servers but make outgoing connections. - NAT_TRAVERSAL_OUTGOING, - - // Active NAT traversal using STUN and relay servers. - NAT_TRAVERSAL_ENABLED, - }; - - NetworkSettings() - : nat_traversal_mode(NAT_TRAVERSAL_DISABLED), - min_port(0), - max_port(0) { - } - - explicit NetworkSettings(bool allow_nat_traversal) - : nat_traversal_mode(allow_nat_traversal ? - NAT_TRAVERSAL_ENABLED : - NAT_TRAVERSAL_DISABLED), - min_port(0), - max_port(0) { - } - - explicit NetworkSettings(NatTraversalMode nat_traversal_mode) - : nat_traversal_mode(nat_traversal_mode), - min_port(0), - max_port(0) { - } - - NatTraversalMode nat_traversal_mode; - - // |min_port| and |max_port| specify range (inclusive) of ports used by - // P2P sessions. Any port can be used when both values are set to 0. - int min_port; - int max_port; -}; - // A class to implement the functionality of a host process. // // Here's the work flow of this class: -- cgit v1.1