Make DTLS role visible on DtlsTransport interface
This is important for writing tests that affect the DTLS role.
Bug: webrtc:13668
Change-Id: I5d9a93eca7996a8b74cdcfe412f59a85892e1ec1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251389
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35971}
diff --git a/api/dtls_transport_interface.cc b/api/dtls_transport_interface.cc
index a68ff8f..faebc09 100644
--- a/api/dtls_transport_interface.cc
+++ b/api/dtls_transport_interface.cc
@@ -20,11 +20,27 @@
DtlsTransportInformation::DtlsTransportInformation(
DtlsTransportState state,
+ absl::optional<DtlsTransportTlsRole> role,
absl::optional<int> tls_version,
absl::optional<int> ssl_cipher_suite,
absl::optional<int> srtp_cipher_suite,
std::unique_ptr<rtc::SSLCertChain> remote_ssl_certificates)
: state_(state),
+ role_(role),
+ tls_version_(tls_version),
+ ssl_cipher_suite_(ssl_cipher_suite),
+ srtp_cipher_suite_(srtp_cipher_suite),
+ remote_ssl_certificates_(std::move(remote_ssl_certificates)) {}
+
+// Deprecated version
+DtlsTransportInformation::DtlsTransportInformation(
+ DtlsTransportState state,
+ absl::optional<int> tls_version,
+ absl::optional<int> ssl_cipher_suite,
+ absl::optional<int> srtp_cipher_suite,
+ std::unique_ptr<rtc::SSLCertChain> remote_ssl_certificates)
+ : state_(state),
+ role_(absl::nullopt),
tls_version_(tls_version),
ssl_cipher_suite_(ssl_cipher_suite),
srtp_cipher_suite_(srtp_cipher_suite),
@@ -33,6 +49,7 @@
DtlsTransportInformation::DtlsTransportInformation(
const DtlsTransportInformation& c)
: state_(c.state()),
+ role_(c.role_),
tls_version_(c.tls_version_),
ssl_cipher_suite_(c.ssl_cipher_suite_),
srtp_cipher_suite_(c.srtp_cipher_suite_),
@@ -43,6 +60,7 @@
DtlsTransportInformation& DtlsTransportInformation::operator=(
const DtlsTransportInformation& c) {
state_ = c.state();
+ role_ = c.role_;
tls_version_ = c.tls_version_;
ssl_cipher_suite_ = c.ssl_cipher_suite_;
srtp_cipher_suite_ = c.srtp_cipher_suite_;