OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 IceCandidatePairType GetIceCandidatePairCounter( | 91 IceCandidatePairType GetIceCandidatePairCounter( |
92 const cricket::Candidate& local, | 92 const cricket::Candidate& local, |
93 const cricket::Candidate& remote) { | 93 const cricket::Candidate& remote) { |
94 const auto& l = local.type(); | 94 const auto& l = local.type(); |
95 const auto& r = remote.type(); | 95 const auto& r = remote.type(); |
96 const auto& host = LOCAL_PORT_TYPE; | 96 const auto& host = LOCAL_PORT_TYPE; |
97 const auto& srflx = STUN_PORT_TYPE; | 97 const auto& srflx = STUN_PORT_TYPE; |
98 const auto& relay = RELAY_PORT_TYPE; | 98 const auto& relay = RELAY_PORT_TYPE; |
99 const auto& prflx = PRFLX_PORT_TYPE; | 99 const auto& prflx = PRFLX_PORT_TYPE; |
100 if (l == host && r == host) | 100 if (l == host && r == host) { |
101 return kIceCandidatePairHostHost; | 101 bool local_private = IPIsPrivate(local.address().ipaddr()); |
| 102 bool remote_private = IPIsPrivate(remote.address().ipaddr()); |
| 103 if (local_private) { |
| 104 if (remote_private) { |
| 105 return kIceCandidatePairHostPrivateHostPrivate; |
| 106 } else { |
| 107 return kIceCandidatePairHostPrivateHostPublic; |
| 108 } |
| 109 } else { |
| 110 if (remote_private) { |
| 111 return kIceCandidatePairHostPublicHostPrivate; |
| 112 } else { |
| 113 return kIceCandidatePairHostPublicHostPublic; |
| 114 } |
| 115 } |
| 116 } |
102 if (l == host && r == srflx) | 117 if (l == host && r == srflx) |
103 return kIceCandidatePairHostSrflx; | 118 return kIceCandidatePairHostSrflx; |
104 if (l == host && r == relay) | 119 if (l == host && r == relay) |
105 return kIceCandidatePairHostRelay; | 120 return kIceCandidatePairHostRelay; |
106 if (l == host && r == prflx) | 121 if (l == host && r == prflx) |
107 return kIceCandidatePairHostPrflx; | 122 return kIceCandidatePairHostPrflx; |
108 if (l == srflx && r == host) | 123 if (l == srflx && r == host) |
109 return kIceCandidatePairSrflxHost; | 124 return kIceCandidatePairSrflxHost; |
110 if (l == srflx && r == srflx) | 125 if (l == srflx && r == srflx) |
111 return kIceCandidatePairSrflxSrflx; | 126 return kIceCandidatePairSrflxSrflx; |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 | 2096 |
2082 if (!srtp_cipher.empty()) { | 2097 if (!srtp_cipher.empty()) { |
2083 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 2098 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
2084 } | 2099 } |
2085 if (!ssl_cipher.empty()) { | 2100 if (!ssl_cipher.empty()) { |
2086 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 2101 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
2087 } | 2102 } |
2088 } | 2103 } |
2089 | 2104 |
2090 } // namespace webrtc | 2105 } // namespace webrtc |
OLD | NEW |