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

Unified Diff: webrtc/p2p/stunprober/stunprober.h

Issue 1166013002: Better determination of Symmetric NAT (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « webrtc/p2p/stunprober/main.cc ('k') | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/stunprober/stunprober.h
diff --git a/webrtc/p2p/stunprober/stunprober.h b/webrtc/p2p/stunprober/stunprober.h
index 9352e36dbc574f2346046381b73484939c792a30..d773d5760ea612c2d3bda3a4caaa6780d41bc29c 100644
--- a/webrtc/p2p/stunprober/stunprober.h
+++ b/webrtc/p2p/stunprober/stunprober.h
@@ -30,6 +30,14 @@ static const int kMaxUdpBufferSize = 1200;
typedef rtc::Callback1<void, int> AsyncCallback;
+enum NatType {
+ NATTYPE_INVALID,
+ NATTYPE_NONE, // Not behind a NAT.
+ NATTYPE_UNKNOWN, // Behind a NAT but type can't be determine.
+ NATTYPE_SYMMETRIC, // Behind a symmetric NAT.
+ NATTYPE_NON_SYMMETRIC // Behind a non-symmetric NAT.
+};
+
class HostNameResolverInterface {
public:
HostNameResolverInterface() {}
@@ -139,10 +147,10 @@ class StunProber {
struct Stats {
Stats() {}
+
int num_request_sent = 0;
int num_response_received = 0;
- bool behind_nat = false;
- bool symmetric_nat = false;
+ NatType nat_type = NATTYPE_INVALID;
int average_rtt_ms = -1;
int success_percent = 0;
int target_request_interval_ns = 0;
@@ -188,7 +196,7 @@ class StunProber {
// Method to retrieve the Stats once |finish_callback| is invoked. Returning
// false when the result is inconclusive, for example, whether it's behind a
// NAT or not.
- bool GetStats(Stats* stats);
+ bool GetStats(Stats* stats) const;
private:
// A requester tracks the requests and responses from a single socket to many
« no previous file with comments | « webrtc/p2p/stunprober/main.cc ('k') | webrtc/p2p/stunprober/stunprober.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698