Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: trunk/src/remoting/jingle_glue/network_settings.h

Issue 268483003: Revert 267234 "New policies: enable/disable relay; port range" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/remoting/jingle_glue/network_settings.h
===================================================================
--- trunk/src/remoting/jingle_glue/network_settings.h (revision 267240)
+++ trunk/src/remoting/jingle_glue/network_settings.h (working copy)
@@ -5,11 +5,6 @@
#ifndef REMOTING_JINGLE_GLUE_NETWORK_SETTINGS_H_
#define REMOTING_JINGLE_GLUE_NETWORK_SETTINGS_H_
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/logging.h"
-
namespace remoting {
struct NetworkSettings {
@@ -20,49 +15,34 @@
static const int kDefaultMinPort = 12400;
static const int kDefaultMaxPort = 12409;
- enum Flags {
+ enum NatTraversalMode {
+ // Active NAT traversal using STUN and relay servers.
+ NAT_TRAVERSAL_ENABLED,
+
// 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 = 0x0,
+ NAT_TRAVERSAL_DISABLED,
- // Allow outgoing connections, even when STUN and RELAY are not enabled.
- NAT_TRAVERSAL_OUTGOING = 0x1,
-
- // Active NAT traversal using STUN.
- NAT_TRAVERSAL_STUN = 0x2,
-
- // Allow the use of relay servers when a direct connection is not available.
- NAT_TRAVERSAL_RELAY = 0x4,
-
- // Active NAT traversal using STUN and relay servers.
- NAT_TRAVERSAL_FULL = NAT_TRAVERSAL_STUN | NAT_TRAVERSAL_RELAY |
- NAT_TRAVERSAL_OUTGOING
+ // Don't use STUN or relay servers but make outgoing connections.
+ NAT_TRAVERSAL_OUTGOING,
};
NetworkSettings()
- : flags(NAT_TRAVERSAL_DISABLED),
+ : nat_traversal_mode(NAT_TRAVERSAL_DISABLED),
min_port(0),
max_port(0) {
- DCHECK(!(flags & (NAT_TRAVERSAL_STUN | NAT_TRAVERSAL_RELAY)) ||
- (flags & NAT_TRAVERSAL_OUTGOING));
}
- explicit NetworkSettings(uint32 flags)
- : flags(flags),
+ explicit NetworkSettings(NatTraversalMode nat_traversal_mode)
+ : nat_traversal_mode(nat_traversal_mode),
min_port(0),
max_port(0) {
}
- // Parse string in the form "<min_port>-<max_port>". E.g. "12400-12409".
- // Returns true if string was parsed successfuly.
- static bool ParsePortRange(const std::string& port_range,
- int* out_min_port,
- int* out_max_port);
+ NatTraversalMode nat_traversal_mode;
- uint32 flags;
-
// |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;
« no previous file with comments | « trunk/src/remoting/jingle_glue/chromium_port_allocator.cc ('k') | trunk/src/remoting/jingle_glue/network_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698