| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "webrtc/p2p/base/transportinfo.h" | 24 #include "webrtc/p2p/base/transportinfo.h" |
| 25 #include "webrtc/base/messagequeue.h" | 25 #include "webrtc/base/messagequeue.h" |
| 26 #include "webrtc/base/rtccertificate.h" | 26 #include "webrtc/base/rtccertificate.h" |
| 27 #include "webrtc/base/sigslot.h" | 27 #include "webrtc/base/sigslot.h" |
| 28 #include "webrtc/base/sslstreamadapter.h" | 28 #include "webrtc/base/sslstreamadapter.h" |
| 29 | 29 |
| 30 namespace cricket { | 30 namespace cricket { |
| 31 | 31 |
| 32 class TransportChannelImpl; | 32 class TransportChannelImpl; |
| 33 class TransportChannelImpl; | 33 class TransportChannelImpl; |
| 34 enum class IceCandidatePairState; |
| 34 | 35 |
| 35 typedef std::vector<Candidate> Candidates; | 36 typedef std::vector<Candidate> Candidates; |
| 36 | 37 |
| 37 // TODO(deadbeef): Move all of these enums, POD types and utility methods to | 38 // TODO(deadbeef): Move all of these enums, POD types and utility methods to |
| 38 // another header file. | 39 // another header file. |
| 39 | 40 |
| 40 // TODO(deadbeef): Unify with PeerConnectionInterface::IceConnectionState | 41 // TODO(deadbeef): Unify with PeerConnectionInterface::IceConnectionState |
| 41 // once /talk/ and /webrtc/ are combined, and also switch to ENUM_NAME naming | 42 // once /talk/ and /webrtc/ are combined, and also switch to ENUM_NAME naming |
| 42 // style. | 43 // style. |
| 43 enum IceConnectionState { | 44 enum IceConnectionState { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // The most recent port allocator session will keep on running. | 77 // The most recent port allocator session will keep on running. |
| 77 GATHER_CONTINUALLY, | 78 GATHER_CONTINUALLY, |
| 78 // The most recent port allocator session will keep on running, and it will | 79 // The most recent port allocator session will keep on running, and it will |
| 79 // try to recover connectivity if the channel becomes disconnected. | 80 // try to recover connectivity if the channel becomes disconnected. |
| 80 GATHER_CONTINUALLY_AND_RECOVER, | 81 GATHER_CONTINUALLY_AND_RECOVER, |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 // Stats that we can return about the connections for a transport channel. | 84 // Stats that we can return about the connections for a transport channel. |
| 84 // TODO(hta): Rename to ConnectionStats | 85 // TODO(hta): Rename to ConnectionStats |
| 85 struct ConnectionInfo { | 86 struct ConnectionInfo { |
| 86 ConnectionInfo() | 87 ConnectionInfo(); |
| 87 : best_connection(false), | |
| 88 writable(false), | |
| 89 receiving(false), | |
| 90 timeout(false), | |
| 91 new_connection(false), | |
| 92 rtt(0), | |
| 93 sent_total_bytes(0), | |
| 94 sent_bytes_second(0), | |
| 95 sent_discarded_packets(0), | |
| 96 sent_total_packets(0), | |
| 97 sent_ping_requests_total(0), | |
| 98 sent_ping_requests_before_first_response(0), | |
| 99 sent_ping_responses(0), | |
| 100 recv_total_bytes(0), | |
| 101 recv_bytes_second(0), | |
| 102 recv_ping_requests(0), | |
| 103 recv_ping_responses(0), | |
| 104 key(NULL) {} | |
| 105 | 88 |
| 106 bool best_connection; // Is this the best connection we have? | 89 bool best_connection; // Is this the best connection we have? |
| 107 bool writable; // Has this connection received a STUN response? | 90 bool writable; // Has this connection received a STUN response? |
| 108 bool receiving; // Has this connection received anything? | 91 bool receiving; // Has this connection received anything? |
| 109 bool timeout; // Has this connection timed out? | 92 bool timeout; // Has this connection timed out? |
| 110 bool new_connection; // Is this a newly created connection? | 93 bool new_connection; // Is this a newly created connection? |
| 111 size_t rtt; // The STUN RTT for this connection. | 94 size_t rtt; // The STUN RTT for this connection. |
| 112 size_t sent_total_bytes; // Total bytes sent on this connection. | 95 size_t sent_total_bytes; // Total bytes sent on this connection. |
| 113 size_t sent_bytes_second; // Bps over the last measurement interval. | 96 size_t sent_bytes_second; // Bps over the last measurement interval. |
| 114 size_t sent_discarded_packets; // Number of outgoing packets discarded due to | 97 size_t sent_discarded_packets; // Number of outgoing packets discarded due to |
| 115 // socket errors. | 98 // socket errors. |
| 116 size_t sent_total_packets; // Number of total outgoing packets attempted for | 99 size_t sent_total_packets; // Number of total outgoing packets attempted for |
| 117 // sending. | 100 // sending. |
| 118 size_t sent_ping_requests_total; // Number of STUN ping request sent. | 101 size_t sent_ping_requests_total; // Number of STUN ping request sent. |
| 119 size_t sent_ping_requests_before_first_response; // Number of STUN ping | 102 size_t sent_ping_requests_before_first_response; // Number of STUN ping |
| 120 // sent before receiving the first response. | 103 // sent before receiving the first response. |
| 121 size_t sent_ping_responses; // Number of STUN ping response sent. | 104 size_t sent_ping_responses; // Number of STUN ping response sent. |
| 122 | 105 |
| 123 size_t recv_total_bytes; // Total bytes received on this connection. | 106 size_t recv_total_bytes; // Total bytes received on this connection. |
| 124 size_t recv_bytes_second; // Bps over the last measurement interval. | 107 size_t recv_bytes_second; // Bps over the last measurement interval. |
| 125 size_t recv_ping_requests; // Number of STUN ping request received. | 108 size_t recv_ping_requests; // Number of STUN ping request received. |
| 126 size_t recv_ping_responses; // Number of STUN ping response received. | 109 size_t recv_ping_responses; // Number of STUN ping response received. |
| 127 Candidate local_candidate; // The local candidate for this connection. | 110 Candidate local_candidate; // The local candidate for this connection. |
| 128 Candidate remote_candidate; // The remote candidate for this connection. | 111 Candidate remote_candidate; // The remote candidate for this connection. |
| 129 void* key; // A static value that identifies this conn. | 112 void* key; // A static value that identifies this conn. |
| 113 // https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-state |
| 114 IceCandidatePairState state; |
| 115 // https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-priority |
| 116 uint64_t priority; |
| 130 }; | 117 }; |
| 131 | 118 |
| 132 // Information about all the connections of a channel. | 119 // Information about all the connections of a channel. |
| 133 typedef std::vector<ConnectionInfo> ConnectionInfos; | 120 typedef std::vector<ConnectionInfo> ConnectionInfos; |
| 134 | 121 |
| 135 // Information about a specific channel | 122 // Information about a specific channel |
| 136 struct TransportChannelStats { | 123 struct TransportChannelStats { |
| 137 int component = 0; | 124 int component = 0; |
| 138 ConnectionInfos connection_infos; | 125 ConnectionInfos connection_infos; |
| 139 int srtp_crypto_suite = rtc::SRTP_INVALID_CRYPTO_SUITE; | 126 int srtp_crypto_suite = rtc::SRTP_INVALID_CRYPTO_SUITE; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 359 |
| 373 // Candidate component => DTLS channel | 360 // Candidate component => DTLS channel |
| 374 std::map<int, TransportChannelImpl*> channels_; | 361 std::map<int, TransportChannelImpl*> channels_; |
| 375 | 362 |
| 376 RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport); | 363 RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport); |
| 377 }; | 364 }; |
| 378 | 365 |
| 379 } // namespace cricket | 366 } // namespace cricket |
| 380 | 367 |
| 381 #endif // WEBRTC_P2P_BASE_JSEPTRANSPORT_H_ | 368 #endif // WEBRTC_P2P_BASE_JSEPTRANSPORT_H_ |
| OLD | NEW |