OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 21 matching lines...) Expand all Loading... |
32 class TransportDescriptionFactory { | 32 class TransportDescriptionFactory { |
33 public: | 33 public: |
34 // Default ctor; use methods below to set configuration. | 34 // Default ctor; use methods below to set configuration. |
35 TransportDescriptionFactory(); | 35 TransportDescriptionFactory(); |
36 SecurePolicy secure() const { return secure_; } | 36 SecurePolicy secure() const { return secure_; } |
37 // The certificate to use when setting up DTLS. | 37 // The certificate to use when setting up DTLS. |
38 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate() const { | 38 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate() const { |
39 return certificate_; | 39 return certificate_; |
40 } | 40 } |
41 | 41 |
| 42 // Specifies the transport protocol to be use. |
| 43 void set_protocol(TransportProtocol protocol) { protocol_ = protocol; } |
42 // Specifies the transport security policy to use. | 44 // Specifies the transport security policy to use. |
43 void set_secure(SecurePolicy s) { secure_ = s; } | 45 void set_secure(SecurePolicy s) { secure_ = s; } |
44 // Specifies the certificate to use (only used when secure != SEC_DISABLED). | 46 // Specifies the certificate to use (only used when secure != SEC_DISABLED). |
45 void set_certificate( | 47 void set_certificate( |
46 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { | 48 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) { |
47 certificate_ = certificate; | 49 certificate_ = certificate; |
48 } | 50 } |
49 | 51 |
50 // Creates a transport description suitable for use in an offer. | 52 // Creates a transport description suitable for use in an offer. |
51 TransportDescription* CreateOffer(const TransportOptions& options, | 53 TransportDescription* CreateOffer(const TransportOptions& options, |
52 const TransportDescription* current_description) const; | 54 const TransportDescription* current_description) const; |
53 // Create a transport description that is a response to an offer. | 55 // Create a transport description that is a response to an offer. |
54 TransportDescription* CreateAnswer( | 56 TransportDescription* CreateAnswer( |
55 const TransportDescription* offer, | 57 const TransportDescription* offer, |
56 const TransportOptions& options, | 58 const TransportOptions& options, |
57 const TransportDescription* current_description) const; | 59 const TransportDescription* current_description) const; |
58 | 60 |
59 private: | 61 private: |
60 bool SetSecurityInfo(TransportDescription* description, | 62 bool SetSecurityInfo(TransportDescription* description, |
61 ConnectionRole role) const; | 63 ConnectionRole role) const; |
62 | 64 |
| 65 TransportProtocol protocol_; |
63 SecurePolicy secure_; | 66 SecurePolicy secure_; |
64 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; | 67 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; |
65 }; | 68 }; |
66 | 69 |
67 } // namespace cricket | 70 } // namespace cricket |
68 | 71 |
69 #endif // WEBRTC_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_ | 72 #endif // WEBRTC_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_ |
OLD | NEW |