//
//  YCKSdwan.h
//  YCKSdwan
//
//  Created by 徐家骏 on 2019/3/21.
//  Copyright © 2019 徐家骏. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for YCKSdwan.
FOUNDATION_EXPORT double YCKSdwanVersionNumber;

//! Project version string for YCKSdwan.
FOUNDATION_EXPORT const unsigned char YCKSdwanVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <YCKSdwan/PublicHeader.h>

#import <YCKSdwan/YCKLoginManagerProtocol.h>
#import <YCKSdwan/YCKSignalManagerProtocol.h>
#import <YCKSdwan/YCKOption.h>
#import <YCKSdwan/YCKAccount.h>
#import <YCKSdwan/YCKTransportSession.h>
#import <YCKSdwan/YCKObfuscate.h>
#import <YCKSdwan/YCKRaptorTest.h>
#import <YCKSdwan/YCKRaptor.h>
#import <YCKSdwan/YCKDispatch.h>
#import <YCKSdwan/YCKLog.h>
#import <YCKSdwan/YCKNetworkState.h>
#import <YCKSdwan/YCKDeviceInfo.h>
#import <YCKSdwan/YCKDevicePolicy.h>
#import <YCKSdwan/NVURLProtocol.h>
#import <YCKSdwan/NVCustomDNS.h>

@protocol YCKSdwanDelegate <NSObject>

@end

@interface YCKSdwan : NSObject

@property(nonatomic, strong, nullable)  YCKTransportSession   *activeSession;
@property(nonatomic, strong, nullable, readonly)  id<YCKLoginManager> loginManager;
@property(nonatomic, strong, nullable)  id<YCKSignalManager>   signalManager;
@property(nonatomic) int    p2pEnabledRatio;
@property(nonatomic) BOOL   transportationEncryptionEnabled;

+ (nonnull instancetype)sharedSDK;

//sdwan初始化，和周期刷新
- (void)registerWithOption:(nonnull YCKOption *)option;

- (nullable NSString *)appID;
- (nullable NSString *)appSecret;

- (BOOL)isUsingDemoAppID;
- (NSString *)sdkVersion;

//用户注册，用户id，认证id，id注册到多个relay上。重启时自动注册，进前台时刷新relay注册，relay刷新时刷新

- (nonnull YCKTransportSession *)newTransportSessionWithId:(int64_t)sessionId relayList:(nonnull NSArray *)relayList andType:(YCKTransportSessionType)type;

//这个要重新设计一下
//- (NSArray *)getAllRelays;
//
//- (NSArray *)getSelectedRelays;

- (nonnull NSArray *)getSessionRelays;
- (nonnull NSArray *)selectedUdpRelays;
- (NSArray *)getPubkeyOfSessionRelays:(NSArray *)list;
- (NSArray *)getPubkeyOfUdpRelays:(NSArray *)list;
- (NSString *)getPubkeyOfUdpRelay:(NSString *)relay;
- (void)setPubkeyOfUdpRelay:(NSString *)relay pubkey:(NSString *)pubkey;

///在调用sdk任何功能之前配置 格式： https://***.com
- (void)setServerAddress:(nonnull NSString *)serverAddress;

@end

double serverTimestampMs(void);
