xref: /aosp_15_r20/external/webrtc/pc/transport_stats.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Worker /*
2*d9f75844SAndroid Build Coastguard Worker  *  Copyright 2018 The WebRTC Project Authors. All rights reserved.
3*d9f75844SAndroid Build Coastguard Worker  *
4*d9f75844SAndroid Build Coastguard Worker  *  Use of this source code is governed by a BSD-style license
5*d9f75844SAndroid Build Coastguard Worker  *  that can be found in the LICENSE file in the root of the source
6*d9f75844SAndroid Build Coastguard Worker  *  tree. An additional intellectual property rights grant can be found
7*d9f75844SAndroid Build Coastguard Worker  *  in the file PATENTS.  All contributing project authors may
8*d9f75844SAndroid Build Coastguard Worker  *  be found in the AUTHORS file in the root of the source tree.
9*d9f75844SAndroid Build Coastguard Worker  */
10*d9f75844SAndroid Build Coastguard Worker 
11*d9f75844SAndroid Build Coastguard Worker #ifndef PC_TRANSPORT_STATS_H_
12*d9f75844SAndroid Build Coastguard Worker #define PC_TRANSPORT_STATS_H_
13*d9f75844SAndroid Build Coastguard Worker 
14*d9f75844SAndroid Build Coastguard Worker #include <string>
15*d9f75844SAndroid Build Coastguard Worker #include <vector>
16*d9f75844SAndroid Build Coastguard Worker 
17*d9f75844SAndroid Build Coastguard Worker #include "api/dtls_transport_interface.h"
18*d9f75844SAndroid Build Coastguard Worker #include "p2p/base/dtls_transport_internal.h"
19*d9f75844SAndroid Build Coastguard Worker #include "p2p/base/ice_transport_internal.h"
20*d9f75844SAndroid Build Coastguard Worker #include "p2p/base/port.h"
21*d9f75844SAndroid Build Coastguard Worker #include "rtc_base/ssl_stream_adapter.h"
22*d9f75844SAndroid Build Coastguard Worker 
23*d9f75844SAndroid Build Coastguard Worker namespace cricket {
24*d9f75844SAndroid Build Coastguard Worker 
25*d9f75844SAndroid Build Coastguard Worker struct TransportChannelStats {
26*d9f75844SAndroid Build Coastguard Worker   TransportChannelStats();
27*d9f75844SAndroid Build Coastguard Worker   TransportChannelStats(const TransportChannelStats&);
28*d9f75844SAndroid Build Coastguard Worker   ~TransportChannelStats();
29*d9f75844SAndroid Build Coastguard Worker 
30*d9f75844SAndroid Build Coastguard Worker   int component = 0;
31*d9f75844SAndroid Build Coastguard Worker   int ssl_version_bytes = 0;
32*d9f75844SAndroid Build Coastguard Worker   int srtp_crypto_suite = rtc::kSrtpInvalidCryptoSuite;
33*d9f75844SAndroid Build Coastguard Worker   int ssl_cipher_suite = rtc::kTlsNullWithNullNull;
34*d9f75844SAndroid Build Coastguard Worker   absl::optional<rtc::SSLRole> dtls_role;
35*d9f75844SAndroid Build Coastguard Worker   webrtc::DtlsTransportState dtls_state = webrtc::DtlsTransportState::kNew;
36*d9f75844SAndroid Build Coastguard Worker   IceTransportStats ice_transport_stats;
37*d9f75844SAndroid Build Coastguard Worker };
38*d9f75844SAndroid Build Coastguard Worker 
39*d9f75844SAndroid Build Coastguard Worker // Information about all the channels of a transport.
40*d9f75844SAndroid Build Coastguard Worker // TODO(hta): Consider if a simple vector is as good as a map.
41*d9f75844SAndroid Build Coastguard Worker typedef std::vector<TransportChannelStats> TransportChannelStatsList;
42*d9f75844SAndroid Build Coastguard Worker 
43*d9f75844SAndroid Build Coastguard Worker // Information about the stats of a transport.
44*d9f75844SAndroid Build Coastguard Worker struct TransportStats {
45*d9f75844SAndroid Build Coastguard Worker   std::string transport_name;
46*d9f75844SAndroid Build Coastguard Worker   TransportChannelStatsList channel_stats;
47*d9f75844SAndroid Build Coastguard Worker };
48*d9f75844SAndroid Build Coastguard Worker 
49*d9f75844SAndroid Build Coastguard Worker }  // namespace cricket
50*d9f75844SAndroid Build Coastguard Worker 
51*d9f75844SAndroid Build Coastguard Worker #endif  // PC_TRANSPORT_STATS_H_
52