1 /*
2  *  Copyright 2017 The WebRTC Project Authors. All rights reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #include "p2p/base/dtls_transport_internal.h"
12 
13 namespace cricket {
14 
15 DtlsTransportInternal::DtlsTransportInternal() = default;
16 
17 DtlsTransportInternal::~DtlsTransportInternal() = default;
18 
ConvertDtlsTransportState(cricket::DtlsTransportState cricket_state)19 webrtc::DtlsTransportState ConvertDtlsTransportState(
20     cricket::DtlsTransportState cricket_state) {
21   switch (cricket_state) {
22     case DtlsTransportState::DTLS_TRANSPORT_NEW:
23       return webrtc::DtlsTransportState::kNew;
24     case DtlsTransportState::DTLS_TRANSPORT_CONNECTING:
25       return webrtc::DtlsTransportState::kConnecting;
26     case DtlsTransportState::DTLS_TRANSPORT_CONNECTED:
27       return webrtc::DtlsTransportState::kConnected;
28     case DtlsTransportState::DTLS_TRANSPORT_CLOSED:
29       return webrtc::DtlsTransportState::kClosed;
30     case DtlsTransportState::DTLS_TRANSPORT_FAILED:
31       return webrtc::DtlsTransportState::kFailed;
32   }
33   RTC_NOTREACHED();
34   return webrtc::DtlsTransportState::kNew;
35 }
36 
37 }  // namespace cricket
38