xref: /aosp_15_r20/external/webrtc/sdk/objc/api/peerconnection/RTCIceServer.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Worker /*
2*d9f75844SAndroid Build Coastguard Worker  *  Copyright 2015 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 #import <Foundation/Foundation.h>
12*d9f75844SAndroid Build Coastguard Worker 
13*d9f75844SAndroid Build Coastguard Worker #import "RTCMacros.h"
14*d9f75844SAndroid Build Coastguard Worker 
15*d9f75844SAndroid Build Coastguard Worker typedef NS_ENUM(NSUInteger, RTCTlsCertPolicy) {
16*d9f75844SAndroid Build Coastguard Worker   RTCTlsCertPolicySecure,
17*d9f75844SAndroid Build Coastguard Worker   RTCTlsCertPolicyInsecureNoCheck
18*d9f75844SAndroid Build Coastguard Worker };
19*d9f75844SAndroid Build Coastguard Worker 
20*d9f75844SAndroid Build Coastguard Worker NS_ASSUME_NONNULL_BEGIN
21*d9f75844SAndroid Build Coastguard Worker 
22*d9f75844SAndroid Build Coastguard Worker RTC_OBJC_EXPORT
23*d9f75844SAndroid Build Coastguard Worker @interface RTC_OBJC_TYPE (RTCIceServer) : NSObject
24*d9f75844SAndroid Build Coastguard Worker 
25*d9f75844SAndroid Build Coastguard Worker /** URI(s) for this server represented as NSStrings. */
26*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly) NSArray<NSString *> *urlStrings;
27*d9f75844SAndroid Build Coastguard Worker 
28*d9f75844SAndroid Build Coastguard Worker /** Username to use if this RTCIceServer object is a TURN server. */
29*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly, nullable) NSString *username;
30*d9f75844SAndroid Build Coastguard Worker 
31*d9f75844SAndroid Build Coastguard Worker /** Credential to use if this RTCIceServer object is a TURN server. */
32*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly, nullable) NSString *credential;
33*d9f75844SAndroid Build Coastguard Worker 
34*d9f75844SAndroid Build Coastguard Worker /**
35*d9f75844SAndroid Build Coastguard Worker  * TLS certificate policy to use if this RTCIceServer object is a TURN server.
36*d9f75844SAndroid Build Coastguard Worker  */
37*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly) RTCTlsCertPolicy tlsCertPolicy;
38*d9f75844SAndroid Build Coastguard Worker 
39*d9f75844SAndroid Build Coastguard Worker /**
40*d9f75844SAndroid Build Coastguard Worker   If the URIs in `urls` only contain IP addresses, this field can be used
41*d9f75844SAndroid Build Coastguard Worker   to indicate the hostname, which may be necessary for TLS (using the SNI
42*d9f75844SAndroid Build Coastguard Worker   extension). If `urls` itself contains the hostname, this isn't necessary.
43*d9f75844SAndroid Build Coastguard Worker  */
44*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly, nullable) NSString *hostname;
45*d9f75844SAndroid Build Coastguard Worker 
46*d9f75844SAndroid Build Coastguard Worker /** List of protocols to be used in the TLS ALPN extension. */
47*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly) NSArray<NSString *> *tlsAlpnProtocols;
48*d9f75844SAndroid Build Coastguard Worker 
49*d9f75844SAndroid Build Coastguard Worker /**
50*d9f75844SAndroid Build Coastguard Worker   List elliptic curves to be used in the TLS elliptic curves extension.
51*d9f75844SAndroid Build Coastguard Worker   Only curve names supported by OpenSSL should be used (eg. "P-256","X25519").
52*d9f75844SAndroid Build Coastguard Worker   */
53*d9f75844SAndroid Build Coastguard Worker @property(nonatomic, readonly) NSArray<NSString *> *tlsEllipticCurves;
54*d9f75844SAndroid Build Coastguard Worker 
55*d9f75844SAndroid Build Coastguard Worker - (nonnull instancetype)init NS_UNAVAILABLE;
56*d9f75844SAndroid Build Coastguard Worker 
57*d9f75844SAndroid Build Coastguard Worker /** Convenience initializer for a server with no authentication (e.g. STUN). */
58*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings;
59*d9f75844SAndroid Build Coastguard Worker 
60*d9f75844SAndroid Build Coastguard Worker /**
61*d9f75844SAndroid Build Coastguard Worker  * Initialize an RTCIceServer with its associated URLs, optional username,
62*d9f75844SAndroid Build Coastguard Worker  * optional credential, and credentialType.
63*d9f75844SAndroid Build Coastguard Worker  */
64*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
65*d9f75844SAndroid Build Coastguard Worker                           username:(nullable NSString *)username
66*d9f75844SAndroid Build Coastguard Worker                         credential:(nullable NSString *)credential;
67*d9f75844SAndroid Build Coastguard Worker 
68*d9f75844SAndroid Build Coastguard Worker /**
69*d9f75844SAndroid Build Coastguard Worker  * Initialize an RTCIceServer with its associated URLs, optional username,
70*d9f75844SAndroid Build Coastguard Worker  * optional credential, and TLS cert policy.
71*d9f75844SAndroid Build Coastguard Worker  */
72*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
73*d9f75844SAndroid Build Coastguard Worker                           username:(nullable NSString *)username
74*d9f75844SAndroid Build Coastguard Worker                         credential:(nullable NSString *)credential
75*d9f75844SAndroid Build Coastguard Worker                      tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy;
76*d9f75844SAndroid Build Coastguard Worker 
77*d9f75844SAndroid Build Coastguard Worker /**
78*d9f75844SAndroid Build Coastguard Worker  * Initialize an RTCIceServer with its associated URLs, optional username,
79*d9f75844SAndroid Build Coastguard Worker  * optional credential, TLS cert policy and hostname.
80*d9f75844SAndroid Build Coastguard Worker  */
81*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
82*d9f75844SAndroid Build Coastguard Worker                           username:(nullable NSString *)username
83*d9f75844SAndroid Build Coastguard Worker                         credential:(nullable NSString *)credential
84*d9f75844SAndroid Build Coastguard Worker                      tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
85*d9f75844SAndroid Build Coastguard Worker                           hostname:(nullable NSString *)hostname;
86*d9f75844SAndroid Build Coastguard Worker 
87*d9f75844SAndroid Build Coastguard Worker /**
88*d9f75844SAndroid Build Coastguard Worker  * Initialize an RTCIceServer with its associated URLs, optional username,
89*d9f75844SAndroid Build Coastguard Worker  * optional credential, TLS cert policy, hostname and ALPN protocols.
90*d9f75844SAndroid Build Coastguard Worker  */
91*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
92*d9f75844SAndroid Build Coastguard Worker                           username:(nullable NSString *)username
93*d9f75844SAndroid Build Coastguard Worker                         credential:(nullable NSString *)credential
94*d9f75844SAndroid Build Coastguard Worker                      tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
95*d9f75844SAndroid Build Coastguard Worker                           hostname:(nullable NSString *)hostname
96*d9f75844SAndroid Build Coastguard Worker                   tlsAlpnProtocols:(NSArray<NSString *> *)tlsAlpnProtocols;
97*d9f75844SAndroid Build Coastguard Worker 
98*d9f75844SAndroid Build Coastguard Worker /**
99*d9f75844SAndroid Build Coastguard Worker  * Initialize an RTCIceServer with its associated URLs, optional username,
100*d9f75844SAndroid Build Coastguard Worker  * optional credential, TLS cert policy, hostname, ALPN protocols and
101*d9f75844SAndroid Build Coastguard Worker  * elliptic curves.
102*d9f75844SAndroid Build Coastguard Worker  */
103*d9f75844SAndroid Build Coastguard Worker - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
104*d9f75844SAndroid Build Coastguard Worker                           username:(nullable NSString *)username
105*d9f75844SAndroid Build Coastguard Worker                         credential:(nullable NSString *)credential
106*d9f75844SAndroid Build Coastguard Worker                      tlsCertPolicy:(RTCTlsCertPolicy)tlsCertPolicy
107*d9f75844SAndroid Build Coastguard Worker                           hostname:(nullable NSString *)hostname
108*d9f75844SAndroid Build Coastguard Worker                   tlsAlpnProtocols:(nullable NSArray<NSString *> *)tlsAlpnProtocols
109*d9f75844SAndroid Build Coastguard Worker                  tlsEllipticCurves:(nullable NSArray<NSString *> *)tlsEllipticCurves
110*d9f75844SAndroid Build Coastguard Worker     NS_DESIGNATED_INITIALIZER;
111*d9f75844SAndroid Build Coastguard Worker 
112*d9f75844SAndroid Build Coastguard Worker @end
113*d9f75844SAndroid Build Coastguard Worker 
114*d9f75844SAndroid Build Coastguard Worker NS_ASSUME_NONNULL_END
115