#if 0
#elif defined(__x86_64__) && __x86_64__
// Generated by Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
#ifndef MPACCSDK_SWIFT_H
#define MPACCSDK_SWIFT_H
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgcc-compat"

#if !defined(__has_include)
# define __has_include(x) 0
#endif
#if !defined(__has_attribute)
# define __has_attribute(x) 0
#endif
#if !defined(__has_feature)
# define __has_feature(x) 0
#endif
#if !defined(__has_warning)
# define __has_warning(x) 0
#endif

#if __has_include(<swift/objc-prologue.h>)
# include <swift/objc-prologue.h>
#endif

#pragma clang diagnostic ignored "-Wauto-import"
#if defined(__OBJC__)
#include <Foundation/Foundation.h>
#endif
#if defined(__cplusplus)
#include <cstdint>
#include <cstddef>
#include <cstdbool>
#include <cstring>
#include <stdlib.h>
#include <new>
#include <type_traits>
#else
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#endif
#if defined(__cplusplus)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module"
#if defined(__arm64e__) && __has_include(<ptrauth.h>)
# include <ptrauth.h>
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wreserved-macro-identifier"
# ifndef __ptrauth_swift_value_witness_function_pointer
#  define __ptrauth_swift_value_witness_function_pointer(x)
# endif
# ifndef __ptrauth_swift_class_method_pointer
#  define __ptrauth_swift_class_method_pointer(x)
# endif
#pragma clang diagnostic pop
#endif
#pragma clang diagnostic pop
#endif

#if !defined(SWIFT_TYPEDEFS)
# define SWIFT_TYPEDEFS 1
# if __has_include(<uchar.h>)
#  include <uchar.h>
# elif !defined(__cplusplus)
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
# endif
typedef float swift_float2  __attribute__((__ext_vector_type__(2)));
typedef float swift_float3  __attribute__((__ext_vector_type__(3)));
typedef float swift_float4  __attribute__((__ext_vector_type__(4)));
typedef double swift_double2  __attribute__((__ext_vector_type__(2)));
typedef double swift_double3  __attribute__((__ext_vector_type__(3)));
typedef double swift_double4  __attribute__((__ext_vector_type__(4)));
typedef int swift_int2  __attribute__((__ext_vector_type__(2)));
typedef int swift_int3  __attribute__((__ext_vector_type__(3)));
typedef int swift_int4  __attribute__((__ext_vector_type__(4)));
typedef unsigned int swift_uint2  __attribute__((__ext_vector_type__(2)));
typedef unsigned int swift_uint3  __attribute__((__ext_vector_type__(3)));
typedef unsigned int swift_uint4  __attribute__((__ext_vector_type__(4)));
#endif

#if !defined(SWIFT_PASTE)
# define SWIFT_PASTE_HELPER(x, y) x##y
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
#endif
#if !defined(SWIFT_METATYPE)
# define SWIFT_METATYPE(X) Class
#endif
#if !defined(SWIFT_CLASS_PROPERTY)
# if __has_feature(objc_class_property)
#  define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
# else
#  define SWIFT_CLASS_PROPERTY(...) 
# endif
#endif
#if !defined(SWIFT_RUNTIME_NAME)
# if __has_attribute(objc_runtime_name)
#  define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
# else
#  define SWIFT_RUNTIME_NAME(X) 
# endif
#endif
#if !defined(SWIFT_COMPILE_NAME)
# if __has_attribute(swift_name)
#  define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
# else
#  define SWIFT_COMPILE_NAME(X) 
# endif
#endif
#if !defined(SWIFT_METHOD_FAMILY)
# if __has_attribute(objc_method_family)
#  define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
# else
#  define SWIFT_METHOD_FAMILY(X) 
# endif
#endif
#if !defined(SWIFT_NOESCAPE)
# if __has_attribute(noescape)
#  define SWIFT_NOESCAPE __attribute__((noescape))
# else
#  define SWIFT_NOESCAPE 
# endif
#endif
#if !defined(SWIFT_RELEASES_ARGUMENT)
# if __has_attribute(ns_consumed)
#  define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
# else
#  define SWIFT_RELEASES_ARGUMENT 
# endif
#endif
#if !defined(SWIFT_WARN_UNUSED_RESULT)
# if __has_attribute(warn_unused_result)
#  define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
# else
#  define SWIFT_WARN_UNUSED_RESULT 
# endif
#endif
#if !defined(SWIFT_NORETURN)
# if __has_attribute(noreturn)
#  define SWIFT_NORETURN __attribute__((noreturn))
# else
#  define SWIFT_NORETURN 
# endif
#endif
#if !defined(SWIFT_CLASS_EXTRA)
# define SWIFT_CLASS_EXTRA 
#endif
#if !defined(SWIFT_PROTOCOL_EXTRA)
# define SWIFT_PROTOCOL_EXTRA 
#endif
#if !defined(SWIFT_ENUM_EXTRA)
# define SWIFT_ENUM_EXTRA 
#endif
#if !defined(SWIFT_CLASS)
# if __has_attribute(objc_subclassing_restricted)
#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
#  define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# else
#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
#  define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
# endif
#endif
#if !defined(SWIFT_RESILIENT_CLASS)
# if __has_attribute(objc_class_stub)
#  define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
#  define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
# else
#  define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
#  define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
# endif
#endif
#if !defined(SWIFT_PROTOCOL)
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
#endif
#if !defined(SWIFT_EXTENSION)
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
#endif
#if !defined(OBJC_DESIGNATED_INITIALIZER)
# if __has_attribute(objc_designated_initializer)
#  define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
# else
#  define OBJC_DESIGNATED_INITIALIZER 
# endif
#endif
#if !defined(SWIFT_ENUM_ATTR)
# if __has_attribute(enum_extensibility)
#  define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
# else
#  define SWIFT_ENUM_ATTR(_extensibility) 
# endif
#endif
#if !defined(SWIFT_ENUM)
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# if __has_feature(generalized_swift_name)
#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
# else
#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
# endif
#endif
#if !defined(SWIFT_UNAVAILABLE)
# define SWIFT_UNAVAILABLE __attribute__((unavailable))
#endif
#if !defined(SWIFT_UNAVAILABLE_MSG)
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
#endif
#if !defined(SWIFT_AVAILABILITY)
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
#endif
#if !defined(SWIFT_WEAK_IMPORT)
# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
#endif
#if !defined(SWIFT_DEPRECATED)
# define SWIFT_DEPRECATED __attribute__((deprecated))
#endif
#if !defined(SWIFT_DEPRECATED_MSG)
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
#endif
#if !defined(SWIFT_DEPRECATED_OBJC)
# if __has_feature(attribute_diagnose_if_objc)
#  define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
# else
#  define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
# endif
#endif
#if defined(__OBJC__)
#if !defined(IBSegueAction)
# define IBSegueAction 
#endif
#endif
#if !defined(SWIFT_EXTERN)
# if defined(__cplusplus)
#  define SWIFT_EXTERN extern "C"
# else
#  define SWIFT_EXTERN extern
# endif
#endif
#if !defined(SWIFT_CALL)
# define SWIFT_CALL __attribute__((swiftcall))
#endif
#if !defined(SWIFT_INDIRECT_RESULT)
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result))
#endif
#if !defined(SWIFT_CONTEXT)
# define SWIFT_CONTEXT __attribute__((swift_context))
#endif
#if !defined(SWIFT_ERROR_RESULT)
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result))
#endif
#if defined(__cplusplus)
# define SWIFT_NOEXCEPT noexcept
#else
# define SWIFT_NOEXCEPT 
#endif
#if !defined(SWIFT_C_INLINE_THUNK)
# if __has_attribute(always_inline)
# if __has_attribute(nodebug)
#  define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug))
# else
#  define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline))
# endif
# else
#  define SWIFT_C_INLINE_THUNK inline
# endif
#endif
#if defined(_WIN32)
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport)
#endif
#else
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL)
# define SWIFT_IMPORT_STDLIB_SYMBOL 
#endif
#endif
#if defined(__OBJC__)
#if __has_feature(objc_modules)
#if __has_warning("-Watimport-in-framework-header")
#pragma clang diagnostic ignored "-Watimport-in-framework-header"
#endif
@import Dispatch;
@import Foundation;
@import NetworkExtension;
@import ObjectiveC;
#endif

#endif
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
#pragma clang diagnostic ignored "-Wduplicate-method-arg"
#if __has_warning("-Wpragma-clang-attribute")
# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas"
#pragma clang diagnostic ignored "-Wnullability"
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"

#if __has_attribute(external_source_symbol)
# pragma push_macro("any")
# undef any
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="MpAccSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
# pragma pop_macro("any")
#endif

#if defined(__OBJC__)
@class NSString;
@class NSError;
@class MpPathDetail;
enum MpInterfaceType : NSInteger;

/// 加速事件回调
SWIFT_PROTOCOL("_TtP8MpAccSDK11AccCallback_")
@protocol AccCallback <NSObject>
@optional
/// 加速成功回调
/// @param ip 加速节点IP
/// @param port 加速节点端口
- (void)onAccSuccessWithIp:(NSString * _Nonnull)ip port:(NSInteger)port;
/// 启动加速失败
/// @param error 错误信息
- (void)onAccFail:(NSError * _Nonnull)error;
/// 网络速率回调（回调频率由<code>AccConfig.pingInterval</code>设置）
/// @param tRx 总接受数据量（单位：byte）
/// @param tTx 总发送数据量（单位：byte）
/// @param pathDetails 链路详细信息
- (void)onAccDataUpdateWithTRx:(int64_t)tRx tTx:(int64_t)tTx pathDetails:(NSArray<MpPathDetail *> * _Nonnull)pathDetails;
/// 加速汇总信息更新
/// @param summaryInfo 加速汇总信息
- (void)onSummaryInfoUpdate:(NSString * _Nonnull)summaryInfo;
/// 网卡链路状态变化回调
/// @param type 网卡类型  0：mobile 1：wifi
/// @param available  网卡是否可用  true：可用  false：不可用
/// @param ip  网卡ip(IPV4)，若不可用为空
- (void)onNetworkStateChanged:(enum MpInterfaceType)type available:(BOOL)available ip:(NSString * _Nonnull)ip;
@end

@class AccNode;
enum AccMode : NSInteger;
enum MpCongrestionMode : NSInteger;
@class AccRule;
@class MpValue;
@class NetworkConditions;
@class Ipv4Route;

/// 加速配置config
SWIFT_CLASS("_TtC8MpAccSDK9AccConfig")
@interface AccConfig : NSObject
/// 加速节点，包含ipList+port，默认ipList为空数组，port为-1
@property (nonatomic, strong) AccNode * _Nonnull node;
/// 加速模式:  聚合 / 双发 / 实时快切，默认为聚合
@property (nonatomic) enum AccMode accMode;
/// 回调间隔时间
@property (nonatomic) NSInteger pingInterval;
/// 拥塞算法
@property (nonatomic) enum MpCongrestionMode congrestionMode;
/// 是否加密
@property (nonatomic) BOOL encryption;
/// UDP超时时间
@property (nonatomic) NSInteger udpTimeout;
/// 连接最长超时时间，超过不再重连，单位：秒
@property (nonatomic) NSInteger maxReconnectTimeout;
/// 加速规则
@property (nonatomic, copy) NSArray<AccRule *> * _Nonnull accRules;
/// 链路优先级
/// key:  0：mobile 1：wifi  priority=[0:64, 1: 32] 设置type=0（mobile）的链路优先级是64，type=1 （wifi）链路优先级 32
/// value: 优先级为数字0-255， 数字越低优先级越高，默认64。当优先级数字>=128时，表示该链路为备份链路。
@property (nonatomic, copy) NSDictionary<NSNumber *, NSNumber *> * _Nonnull priority;
/// 扩展参数
@property (nonatomic, readonly, copy) NSDictionary<NSString *, MpValue *> * _Nonnull extraParams;
/// 启动加速所需网络条件，默认无条件
@property (nonatomic, strong) NetworkConditions * _Nonnull networkConditions;
/// 设置是否保活，若保活，则加速状态以UDP是否加速为准
@property (nonatomic) BOOL keepAlive;
/// TCP直连
@property (nonatomic) BOOL tcpDirect;
/// UDP直连
@property (nonatomic) BOOL udpDirect;
/// AppGroup
@property (nonatomic, copy) NSString * _Nonnull groupId;
/// VPN名称
@property (nonatomic, copy) NSString * _Nonnull vpnName;
/// VPN Target Bundle ID
@property (nonatomic, copy) NSString * _Nullable vpnTargetBundleId;
/// 白名单，默认拦截所有ip
@property (nonatomic, copy) NSArray<Ipv4Route *> * _Nonnull whiteList;
/// 设置黑名单
@property (nonatomic, copy) NSArray<Ipv4Route *> * _Nonnull blackList;
/// socks5代理端口号，默认 3000
@property (nonatomic) NSInteger socksProxyPort;
/// socks5代理预设用户名
@property (nonatomic, copy) NSString * _Nullable socksUsername;
/// socks5代理预设密码
@property (nonatomic, copy) NSString * _Nullable socksPassword;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end



@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// 添加dns服务器，可多次调用添加多个dns，优先使用先添加的
- (void)addDnsWithDns:(NSString * _Nonnull)dns;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
@end



@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] 针对聚合模式,链路时延高于该数值后,该链路不参与聚合,单位为ms,默认为460ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MAX_RTT_DISABLE_AGGREGATION;)
+ (NSString * _Nonnull)KEY_MAX_RTT_DISABLE_AGGREGATION SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] QUIC握手超时时间，单位为s,默认为5s
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_HANDSHAKE_TIMEOUT;)
+ (NSString * _Nonnull)KEY_HANDSHAKE_TIMEOUT SWIFT_WARN_UNUSED_RESULT;
/// [Int] QUIC连接空闲时长，单位为s,默认为30s
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_IDEL_TIMEOUT;)
+ (NSString * _Nonnull)KEY_IDEL_TIMEOUT SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// 添加Bool扩展参数
- (void)setBool:(BOOL)value forKey:(NSString * _Nonnull)key;
/// 添加Int扩展参数
- (void)setInt:(NSInteger)value forKey:(NSString * _Nonnull)key;
/// 添加String扩展参数
- (void)setFloat:(double)value forKey:(NSString * _Nonnull)key;
/// 添加String扩展参数
- (void)setString:(NSString * _Nonnull)value forKey:(NSString * _Nonnull)key;
/// 添加[String]扩展参数
- (void)setStringList:(NSArray<NSString *> * _Nonnull)value forKey:(NSString * _Nonnull)key;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] 链路时延超过该数值才进行CheckLatestRTT判断,单位为ms,默认为150ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MAX_RRT_THRESHOLD;)
+ (NSString * _Nonnull)KEY_MAX_RRT_THRESHOLD SWIFT_WARN_UNUSED_RESULT;
/// [Float64] 链路最小时延的放大因子,如果当前链路时延>链路最小时延*因子,可认为链路高时延了,默认为15
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MIN_RTT_FACTOR;)
+ (NSString * _Nonnull)KEY_MIN_RTT_FACTOR SWIFT_WARN_UNUSED_RESULT;
/// [Float64] 对比上次采用时延的放大因子,如果当前链路时延>上次采样时延*因子,可认为链路高时延了,默认为5
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_LATEST_RTT_FACTOR;)
+ (NSString * _Nonnull)KEY_LATEST_RTT_FACTOR SWIFT_WARN_UNUSED_RESULT;
/// [Int] 禁止链路保持的最小时长,单位为s,默认为3s// 快切
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MIN_WAITING_WHEN_PATH_FAILED;)
+ (NSString * _Nonnull)KEY_MIN_WAITING_WHEN_PATH_FAILED SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [String] 证书域名
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_SERVER_DOMAIN;)
+ (NSString * _Nonnull)KEY_SERVER_DOMAIN SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 允许内网互通
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ALLOW_PRIVATE;)
+ (NSString * _Nonnull)KEY_ALLOW_PRIVATE SWIFT_WARN_UNUSED_RESULT;
/// [String] 密钥ID
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_SECRET_KEY_ID;)
+ (NSString * _Nonnull)KEY_SECRET_KEY_ID SWIFT_WARN_UNUSED_RESULT;
/// [String] 签名字符串
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_CIPHERTEXT;)
+ (NSString * _Nonnull)KEY_CIPHERTEXT SWIFT_WARN_UNUSED_RESULT;
/// [String] 数字签名
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_SIGNTURE;)
+ (NSString * _Nonnull)KEY_SIGNTURE SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] 针对快切模式,低于该值不触发链路切换，单位为ms，默认为20ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MIN_SWITCH_RTT;)
+ (NSString * _Nonnull)KEY_MIN_SWITCH_RTT SWIFT_WARN_UNUSED_RESULT;
/// [Float64] 针对快切模式, 容忍系数，放大当前路径时延后与其他路径比较，避免频繁切换，默认为1.125
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_SWITCH_TOLERANCE;)
+ (NSString * _Nonnull)KEY_SWITCH_TOLERANCE SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 针对快切模式, 是否关闭动态切换功能，默认为false
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_DISABLE_AUTO_SWITCH;)
+ (NSString * _Nonnull)KEY_DISABLE_AUTO_SWITCH SWIFT_WARN_UNUSED_RESULT;
/// [Int] 针对快切模式,判断报文丢失的最小时延,超过这个时延才判断是否禁用链路,单位为ms,默认为150ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MIN_DELAY_UNTIL_LOST;)
+ (NSString * _Nonnull)KEY_MIN_DELAY_UNTIL_LOST SWIFT_WARN_UNUSED_RESULT;
/// [Int] 针对快切模式,容忍的最大时间阈值,超过该阀值,禁用该链路发包,单位为ms,默认为460ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MAX_DELAY_UNTIL_FAILED;)
+ (NSString * _Nonnull)KEY_MAX_DELAY_UNTIL_FAILED SWIFT_WARN_UNUSED_RESULT;
/// [Float64] 针对快切模式,链路时延的放大因子,用于判断链路是否发生了故障,默认为2.25
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_TIME_REORDERING_FRACTION;)
+ (NSString * _Nonnull)KEY_TIME_REORDERING_FRACTION SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] 针对 UDP 增强聚合模式，补偿时延，单位为ms，默认为0ms
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_JITTER_DELAY;)
+ (NSString * _Nonnull)KEY_JITTER_DELAY SWIFT_WARN_UNUSED_RESULT;
/// [Int] 针对 UDP 增强聚合模式，路径空闲时长，不参与补偿，单位为s,默认为1s
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_PATH_IDLE_TIMEOUT;)
+ (NSString * _Nonnull)KEY_PATH_IDLE_TIMEOUT SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 针对 UDP 增强聚合参数，开启后单路径也进行时延平滑，默认false
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ENABLE_SINGLE_PATH_SMOOTHING;)
+ (NSString * _Nonnull)KEY_ENABLE_SINGLE_PATH_SMOOTHING SWIFT_WARN_UNUSED_RESULT;
/// [Float64] 针对 UDP 增强聚合参数，用于计算单向平滑时延,默认0.125
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_DELAY_FACTOR;)
+ (NSString * _Nonnull)KEY_DELAY_FACTOR SWIFT_WARN_UNUSED_RESULT;
/// [Float64] quic拥塞窗口增益系数
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_OUTER_CWND_GAIN;)
+ (NSString * _Nonnull)KEY_OUTER_CWND_GAIN SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 是否忽略 PotentiallyFailed 状态, 默认为false
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_IGNORE_POTENTIALLY_FAILED;)
+ (NSString * _Nonnull)KEY_IGNORE_POTENTIALLY_FAILED SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Int] 最大重试次数, 默认 3 次
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_MAX_RETRY_TIMES;)
+ (NSString * _Nonnull)KEY_MAX_RETRY_TIMES SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 是否开启源站混淆IP
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ENABLE_OBFUSCATED;)
+ (NSString * _Nonnull)KEY_ENABLE_OBFUSCATED SWIFT_WARN_UNUSED_RESULT;
/// [Bool] 是否通过ppv2传递IP地址
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ENABLE_PPV2;)
+ (NSString * _Nonnull)KEY_ENABLE_PPV2 SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ENABLE_TOA;)
+ (NSString * _Nonnull)KEY_ENABLE_TOA SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_REAL_ADDR;)
+ (NSString * _Nonnull)KEY_REAL_ADDR SWIFT_WARN_UNUSED_RESULT;
@end


@interface AccConfig (SWIFT_EXTENSION(MpAccSDK))
/// [Bool] 是否开启 T2 加速, 默认为 false
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_ENABLE_T2ACC;)
+ (NSString * _Nonnull)KEY_ENABLE_T2ACC SWIFT_WARN_UNUSED_RESULT;
/// [String] 指定 T2 段出口，默认为空自动路由
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2OUT;)
+ (NSString * _Nonnull)KEY_T2OUT SWIFT_WARN_UNUSED_RESULT;
/// [String] 指定 T2 加速应用: App Id List
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2_APP_ID_LIST;)
+ (NSString * _Nonnull)KEY_T2_APP_ID_LIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速 IP CIDR 黑名单(Direct)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_IP_PREFIX_BLACKLIST;)
+ (NSString * _Nonnull)KEY_T2ACC_IP_PREFIX_BLACKLIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速 IP CIDR 白名单(ACC)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_IP_PREFIX_WHITELIST;)
+ (NSString * _Nonnull)KEY_T2ACC_IP_PREFIX_WHITELIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速域名黑名单(Direct)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_DOMAIN_BLACKLIST;)
+ (NSString * _Nonnull)KEY_T2ACC_DOMAIN_BLACKLIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速域名白名单(ACC)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_DOMAIN_WHITELIST;)
+ (NSString * _Nonnull)KEY_T2ACC_DOMAIN_WHITELIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速域名后缀黑名单(Direct)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_DOMAIN_SUFFIX_BLACKLIST;)
+ (NSString * _Nonnull)KEY_T2ACC_DOMAIN_SUFFIX_BLACKLIST SWIFT_WARN_UNUSED_RESULT;
/// [String] T2 加速域名后缀白名单(ACC)
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull KEY_T2ACC_DOMAIN_SUFFIX_WHITELIST;)
+ (NSString * _Nonnull)KEY_T2ACC_DOMAIN_SUFFIX_WHITELIST SWIFT_WARN_UNUSED_RESULT;
@end

typedef SWIFT_ENUM(NSInteger, AccErrorType, open) {
/// vpn fd空指针异常
  AccErrorTypeVpnInterfaceNullPoint = -1,
/// mpquic异常
  AccErrorTypeMpQuicLibraryException = -2,
/// vpn连接建立异常
  AccErrorTypeEstablishVpnException = -3,
/// <em>⚠️andriod code</em>  无效包名（白名单）异常
  AccErrorTypeInvalidPackageName = -4,
/// 系统异常
  AccErrorTypeVpnDisconnectException = -5,
/// acc测速 丢包率异常
  AccErrorTypeAccContinuePackageLossException = -6,
/// acc加速 最大时延数异常
  AccErrorTypeAccMaxRttCountException = -7,
/// acc测速 对比wifi时延异常
  AccErrorTypeAccRttContrastException = -8,
/// acc测速 平均时延超出最大阈值
  AccErrorTypeAccAvgRttException = -9,
/// acc测速 平均丢包率异常
  AccErrorTypeAccAvgPackageLossException = -10,
/// 加速认证失败
  AccErrorTypeAccAuthenticationFailed = -11,
/// 认证连接超时
  AccErrorTypeAccAuthenticationTimeOut = -12,
/// 认证连接异常
  AccErrorTypeAccAuthenticationException = -13,
/// SLA一般负优化
  AccErrorTypeSlaNormalAccException = -16,
/// 加速参数非法
  AccErrorTypeAccIllegalParamter = -17,
/// <em>⚠️andriod code</em> 拉起vpn服务失败
  AccErrorTypeSetUpVpnServiceFailed = -18,
/// 拉起测速服务失败
  AccErrorTypeSetUpMeasureFailed = -19,
/// 没有有效接入点
  AccErrorTypeNoValidAccessPoint = -20,
/// 账号认证失败
  AccErrorTypeAccountAuthenticationError = -21,
/// 网卡状态不满足加速条件
  AccErrorTypeNotMeetAccConditions = -22,
/// 无效测速地址
  AccErrorTypeInvalidSpeedTestAddress = -23,
/// 无效自定义网卡 ⚠️ Android 错误码
  AccErrorTypeInvalidReflectObject = -24,
/// 无效加速插件
  AccErrorTypeInvalidAccProxyPlugin = -25,
/// 当前设备无活跃网卡
  AccErrorTypeNoConnectedNetworkCard = -26,
/// 节点udping不通
  AccErrorTypeAccessPointUdpingFailed = -28,
/// 不支持加速此设备
  AccErrorTypeUnsupportAccDevice = -29,
/// 不存在有效链路
  AccErrorTypeNoValidLineType = -34,
/// MpAccClient.shared.status 状态错误
  AccErrorTypeStatusError = -50,
/// 多通道加速已经拉起
  AccErrorTypeMulitpathStarted = -100,
/// 多通道加速内部错误
  AccErrorTypeMulitpathCoreFailed = -101,
/// 加速代理拉起失败
  AccErrorTypeMulitpathTunDevFailed = -102,
/// 无效加速节点IP
  AccErrorTypeMulitpathCoreAccIpInvalid = -103,
/// 无效加速模式
  AccErrorTypeMulitpathCoreAccModeInvalid = -104,
/// 加速token鉴权失败
  AccErrorTypeMulitpathCoreAccAuthFailed = -105,
/// 加速链路通知被关闭
  AccErrorTypeMulitpathCoreAccControllerClose = -106,
/// 通道握手建立超时
  AccErrorTypeMulitpathCoreAccHandshakeTimeout = -107,
/// 加速重连超时
  AccErrorTypeMulitpathCoreAccReconnectTimeout = -108,
/// socks5代理失败
  AccErrorTypeMulitpathCoreSocks5Failed = -109,
/// 达到当前网关最大接入数
  AccErrorTypeReachedMaximumNumberGratewayAccesses = -110,
};

/// 加速线路
typedef SWIFT_ENUM(NSInteger, AccLineType, open) {
/// 直连
  AccLineTypeDirect = 0,
/// EO
  AccLineTypeEo = 1,
};


SWIFT_PROTOCOL("_TtP8MpAccSDK12AccLogPlugin_")
@protocol AccLogPlugin <NSObject>
/// 上传为完成的上传任务
- (void)upLoadLogCacheIfNeed;
/// 返回日志级别
- (NSInteger)getLogLevel SWIFT_WARN_UNUSED_RESULT;
/// 写日志入口
/// \param message 日志信息
///
- (void)writeLogWithMessage:(NSString * _Nonnull)message;
/// 同步日志缓存至文件
- (void)flushLogCacheToFile;
/// 上传文件至服务器
- (void)uploadLogFile;
/// 检测Config，触发上传逻辑
- (void)checkConfigWithIsWifi:(BOOL)isWifi;
@end

/// 加速模式
typedef SWIFT_ENUM(NSInteger, AccMode, open) {
/// 聚合
  AccModeBonding = 1,
/// 双发
  AccModeRedundant = 2,
/// 实时快切
  AccModeFastSwitching = 3,
};


/// 加速节点结构
SWIFT_CLASS("_TtC8MpAccSDK7AccNode")
@interface AccNode : NSObject
/// 节点ip列表，默认为空
@property (nonatomic, copy) NSArray<NSString *> * _Nonnull ipList;
/// 节点端口，默认值 -1
@property (nonatomic) NSInteger port;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
- (nonnull instancetype)initWithIpList:(NSArray<NSString *> * _Nonnull)ipList port:(NSInteger)port OBJC_DESIGNATED_INITIALIZER;
@end


SWIFT_CLASS("_TtC8MpAccSDK16AccPluginManager")
@interface AccPluginManager : NSObject
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) AccPluginManager * _Nonnull shared;)
+ (AccPluginManager * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@interface AccPluginManager (SWIFT_EXTENSION(MpAccSDK))
/// \param logUploadPlugin 插件实例
///
- (void)setLogPlugin:(id <AccLogPlugin> _Nullable)logUploadPlugin;
/// 获取插件实例
///
/// returns:
/// 插件实例
- (id <AccLogPlugin> _Nullable)getLogPlugin SWIFT_WARN_UNUSED_RESULT;
@end

@protocol AccProxyPlugin;

@interface AccPluginManager (SWIFT_EXTENSION(MpAccSDK))
/// 设置插件
/// \param accProxyPlugin 插件实例
///
- (void)setAccProxyPlugin:(id <AccProxyPlugin> _Nullable)accProxyPlugin;
/// 获取插件实例
///
/// returns:
/// 插件实例
- (id <AccProxyPlugin> _Nullable)getAccProxyPlugin SWIFT_WARN_UNUSED_RESULT;
@end


SWIFT_PROTOCOL("_TtP8MpAccSDK14AccProxyPlugin_")
@protocol AccProxyPlugin <NSObject>
/// @return 获取socks端口号
- (uint16_t)getSocksPort SWIFT_WARN_UNUSED_RESULT;
/// @return 获取trtc服务ip
- (NSString * _Nonnull)getServerIp SWIFT_WARN_UNUSED_RESULT;
/// 打开/关闭 socks代理
/// @param enable true：打开  false：关闭
- (void)enableProxyWithEnable:(BOOL)enable;
@end


/// 加速规则
SWIFT_CLASS("_TtC8MpAccSDK7AccRule")
@interface AccRule : NSObject
/// 设置优先级,值越小优先级越高, 优先级为数字0-255， 数字越低优先级越高，默认64
@property (nonatomic) NSInteger priority;
/// 设置目的IP,支持掩码, 例如10.8.0.0/8, 空值表示匹配任意目的IP地址
@property (nonatomic, copy) NSString * _Nonnull dstIPCIDR;
/// 设置目的端口,支持范围, 例如5002-5003, 空值表示匹配任意目的端口
@property (nonatomic, copy) NSString * _Nonnull dstPortRange;
/// 设置协议类型,支持”TCP”,“UDP”, 空值表示匹配任意协议
@property (nonatomic, copy) NSString * _Nonnull proto;
/// 设置加速模式,支持 1：聚合 2：双发 3：rtc
@property (nonatomic) NSInteger mode;
- (nonnull instancetype)initWithPriority:(NSInteger)priority dstIPCIDR:(NSString * _Nonnull)dstIPCIDR dstPortRange:(NSString * _Nonnull)dstPortRange proto:(NSString * _Nonnull)proto mode:(NSInteger)mode OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

/// Acc 状态
typedef SWIFT_ENUM(NSInteger, AccStatus, open) {
/// idle状态
  AccStatusIdle = 0,
/// 启动中
  AccStatusLaunching = 1,
/// 启动状态（未加速：AccConfig.keepAlive = true 的情况下，SDK start, 但是UDP为直连，则为该状态）
  AccStatusLaunched = 2,
/// 加速状态
  AccStatusStarted = 3,
};

/// 加速类型
typedef SWIFT_ENUM(NSInteger, AccType, open) {
  AccTypeUnowned = 0,
/// < 无效值
  AccTypeVpn = 1,
/// < vpn加速
  AccTypeSocks5 = 2,
};


/// 黑白名单ip结构
SWIFT_CLASS("_TtC8MpAccSDK9Ipv4Route")
@interface Ipv4Route : NSObject
/// ipv4
@property (nonatomic, readonly, copy) NSString * _Nonnull ip;
/// 子网掩码
@property (nonatomic, readonly, copy) NSString * _Nonnull mask;
- (nonnull instancetype)initWithIp:(NSString * _Nonnull)ip ipMask:(NSString * _Nonnull)ipMask OBJC_DESIGNATED_INITIALIZER;
- (nonnull instancetype)initWithIp:(NSString * _Nonnull)ip OBJC_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

/// 日志等级,0:Panic 2:Fatal 3:Warn 4:Info 5:Debug 6:Trace
typedef SWIFT_ENUM(NSInteger, LogLevel, open) {
  LogLevelDEBUG = 5,
  LogLevelINFO = 4,
  LogLevelWARN = 3,
  LogLevelFATAL = 2,
  LogLevelPANIC = 0,
};


SWIFT_CLASS("_TtC8MpAccSDK11MpAccClient")
@interface MpAccClient : NSObject
/// 单例
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) MpAccClient * _Nonnull shared;)
+ (MpAccClient * _Nonnull)shared SWIFT_WARN_UNUSED_RESULT;
/// Acc开启状态  (**注释：**若keepAlive为true，则 ** isStart = !udpDirect **)
@property (nonatomic, readonly) BOOL isStart;
/// Acc状态：.idle /.launching/.launched/.started
@property (nonatomic, readonly) enum AccStatus status;
/// 加速模式：.vpn / .socks5 / .unowned。默认为unowned，加速前需要修改，否则会报错
@property (nonatomic) enum AccType accType;
/// 当前配置
@property (nonatomic, readonly, strong) AccConfig * _Nullable accConfig;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

@class MpMeasureConfig;

@interface MpAccClient (SWIFT_EXTENSION(MpAccSDK))
/// 开启网络测量
/// @param measureConfig 测量配置
- (void)startMeasureWithMeasureConfig:(MpMeasureConfig * _Nonnull)measureConfig;
/// 停止网络测量
- (void)stopMeasure;
/// 添加上报事件
/// @param event 事件
/// @param msg 详情
- (void)addEventInfoWithEvent:(NSInteger)event msg:(NSString * _Nonnull)msg;
@end



@protocol MpLoggerDelegate;
@protocol MpMeasureCallback;

@interface MpAccClient (SWIFT_EXTENSION(MpAccSDK))
/// 设置日志代理，接管日志处理
/// @param delegate 日志代理
- (void)setupLogDelegate:(id <MpLoggerDelegate> _Nullable)delegate;
/// 设置日志级别
/// @param logLevel 日志级别枚举
- (void)setupLogLevel:(enum LogLevel)logLevel;
/// 设置回调队列，默认为子线程
/// @param queue 回调队列（dispatch queue）
- (void)setupCallbackQueue:(dispatch_queue_t _Nonnull)queue;
/// 发起监听加速状态
/// @param callback 加速状态回调接口
- (void)registerAccCallback:(id <AccCallback> _Nonnull)callback;
/// 取消监听加速状态
/// @param callback 加速状态回调接口
/// @note callback为弱引用，不要在dealloc、deinit中调用该方法，会造成crash
- (void)unRegisterAccCallback:(id <AccCallback> _Nonnull)callback;
/// 注册网络测量回调监听
/// @param callback 测速回调接口
- (void)registerMeasureCallback:(id <MpMeasureCallback> _Nonnull)callback;
/// 取消网络测量回调监听
/// @param callback 测速回调接口
/// @note callback为弱引用，不要在dealloc、deinit中调用该方法，会造成crash
- (void)unRegisterMeasureCallback:(id <MpMeasureCallback> _Nonnull)callback;
@end


@interface MpAccClient (SWIFT_EXTENSION(MpAccSDK))
/// 设置公有云注册参数
/// @param dataKey 设备密钥
/// @param uuid 设备唯一标识
- (void)setupDatakey:(NSString * _Nonnull)datakey uuid:(NSString * _Nonnull)uuid;
/// 设置应用签名鉴权
/// @param appId 应用ID
/// @param sign 签名
- (void)setSignWithAppId:(NSString * _Nonnull)appId sign:(NSString * _Nonnull)sign;
/// 是否根据地域选择接入点
/// \param isRegionalAccess true : 是  false： 否 ；  默认true
///
- (void)setupRegionalAccess:(BOOL)isRegionalAccess;
/// 设置注册超时时长，默认10s
/// @param connectTimeout 超时时长
- (void)setupRegisterConnectTimeout:(NSInteger)connectTimeout;
- (void)setGatewayId:(NSString * _Nonnull)gwId;
@end


@interface MpAccClient (SWIFT_EXTENSION(MpAccSDK))
/// 预注册，耗时接口
/// @param mode 加速模式
/// @param completion 预注册回调对象
- (void)registerWithMode:(enum AccMode)mode completion:(void (^ _Nullable)(NSError * _Nullable))completion;
/// 发起加速
/// @param config 加速配置
- (void)startWithConfig:(AccConfig * _Nonnull)config;
/// 停止加速
- (void)stop;
/// APP重启后可调用此接口恢复VPN事件监听
/// @param groupId AppGroupId，需要与上一次启动VPN的groupId保持一致
- (void)resumeVpn;
/// 获取VPN状态，异步返回
/// @param completion 状态获取完成回调
/// 状态值参考：
/// NEVPNStatus.invalid : 未配置
/// NEVPNStatus.connected : 已连接
/// NEVPNStatus.connecting : 正在连接
/// NEVPNStatus.disconnected : 已断开连接
/// NEVPNStatus.disconnecting : 正在断开连接
/// NEVPNStatus.reasserting : 正在重启
- (void)getVpnStatus:(void (^ _Nonnull)(NEVPNStatus))completion;
/// 更新udp直连状态
/// @param direct true：直连  false：不直连
/// @return ture:设置成功 flase：设置失败
- (void)updateUDPDirect:(BOOL)direct conditions:(NetworkConditions * _Nonnull)conditions completion:(void (^ _Nonnull)(BOOL))completion;
/// 更新udp直连状态
/// @param direct true：直连  false：不直连
/// @return ture:设置成功 flase：设置失败
/// @note  ** vpn 模式下不可以在主线程中调用**
- (BOOL)updateUDPDirect:(BOOL)direct conditions:(NetworkConditions * _Nonnull)conditions SWIFT_WARN_UNUSED_RESULT;
/// 更新tcp直连状态
/// @param direct true：直连  false：不直连
/// @return ture:设置成功 flase：设置失败
- (void)updateTCPDirect:(BOOL)direct conditions:(NetworkConditions * _Nonnull)conditions completion:(void (^ _Nonnull)(BOOL))completion;
/// 更新tcp直连状态
/// @param direct true：直连  false：不直连
/// @return ture:设置成功 flase：设置失败
/// @note  ** vpn 模式下不可以在主线程中调用**
- (BOOL)updateTCPDirect:(BOOL)direct conditions:(NetworkConditions * _Nonnull)conditions SWIFT_WARN_UNUSED_RESULT;
/// 获取版本号
- (NSString * _Nonnull)getSdkVersion SWIFT_WARN_UNUSED_RESULT;
@end

@class PacketLossEscape;
@class MaxRttEscape;
@class RttExceptionEscape;
@class StopAccRemind;

SWIFT_CLASS("_TtC8MpAccSDK19MpAdditionalOptions")
@interface MpAdditionalOptions : NSObject
/// 加速链路连续【packetLossCount】失联
@property (nonatomic, strong) PacketLossEscape * _Nullable packetLossEscape;
/// 加速链路连续【maxRttCount】ping值大于等于【rttThreshold】ms；
@property (nonatomic, strong) MaxRttEscape * _Nullable maxRttEscape;
/// 加速链路【detectWindowTime】平均ping值大于主链路【rttDiffThreshold】%，并且acc平均时延大于【accBenchmarkRtt】ms；
@property (nonatomic, strong) RttExceptionEscape * _Nullable rttExceptionEscape;
@property (nonatomic, strong) StopAccRemind * _Nullable stopAccRemind;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end


/// 加速链路连续【packetLossCount】失联
SWIFT_CLASS("_TtCC8MpAccSDK19MpAdditionalOptions16PacketLossEscape")
@interface PacketLossEscape : NSObject
@property (nonatomic) NSInteger packetLossCount;
- (nonnull instancetype)initWithPacketLossCount:(NSInteger)packetLossCount OBJC_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


/// 加速链路连续【maxRttCount】ping值大于等于【rttThreshold】ms；
SWIFT_CLASS("_TtCC8MpAccSDK19MpAdditionalOptions12MaxRttEscape")
@interface MaxRttEscape : NSObject
@property (nonatomic) NSInteger maxRttCount;
@property (nonatomic) NSInteger rttThreshold;
- (nonnull instancetype)initWithMaxRttCount:(NSInteger)maxRttCount rttThreshold:(NSInteger)rttThreshold OBJC_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


/// 加速链路【detectWindowTime】平均ping值大于主链路【rttDiffThreshold】%，并且acc平均时延大于【accBenchmarkRtt】ms；
SWIFT_CLASS("_TtCC8MpAccSDK19MpAdditionalOptions18RttExceptionEscape")
@interface RttExceptionEscape : NSObject
@property (nonatomic) NSInteger detectWindowTime;
@property (nonatomic) NSInteger accBenchmarkRtt;
@property (nonatomic) NSInteger rttDiffThreshold;
- (nonnull instancetype)initWithDetectWindowTime:(NSInteger)detectWindowTime accBenchmarkRtt:(NSInteger)accBenchmarkRtt rttDiffThreshold:(NSInteger)rttDiffThreshold OBJC_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


SWIFT_CLASS("_TtCC8MpAccSDK19MpAdditionalOptions13StopAccRemind")
@interface StopAccRemind : NSObject
@property (nonatomic) NSInteger detectWindowTime;
@property (nonatomic) NSInteger rttDiffRate;
@property (nonatomic) NSInteger jitterRate;
- (nonnull instancetype)initWithDetectWindowTime:(NSInteger)detectWindowTime rttDiffRate:(NSInteger)rttDiffRate jitterRate:(NSInteger)jitterRate OBJC_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

typedef SWIFT_ENUM(NSInteger, MpCongrestionMode, open) {
/// bbr（优化的 BBR 算法，默认使用，相较于标准 BBR 链路带宽利用率更高）
  MpCongrestionModeBBR = 0,
  MpCongrestionModeCUBIC = 1,
/// bbr-normal（标准BBR）
  MpCongrestionModeBBR_NORMAL = 2,
};

typedef SWIFT_ENUM(NSInteger, MpInterfaceType, open) {
  MpInterfaceTypeMobile = 0,
  MpInterfaceTypeWifi = 1,
  MpInterfaceTypeAcc = 2,
};


SWIFT_PROTOCOL("_TtP8MpAccSDK16MpLoggerDelegate_")
@protocol MpLoggerDelegate <NSObject>
@optional
- (void)didReceiveLogWithLogStr:(NSString * _Nonnull)logStr;
@end


SWIFT_PROTOCOL("_TtP8MpAccSDK17MpMeasureCallback_")
@protocol MpMeasureCallback <NSObject>
@optional
/// 建议开启双发
/// @param code  触发码 1：时延异常触发  2：丢包率异常触发  3：抖动异常触发
- (void)onStartMpAccWithCode:(NSInteger)code;
/// 建议关闭双发
/// @param code  触发码  1：单网卡触发  2：无优化触发  3：无网络触发 4：加速网卡和实际活跃网卡不一致
/// @msg 触发信息
- (void)onStopMpAccWithCode:(NSInteger)code msg:(NSString * _Nonnull)msg;
/// 当前网络状态无策略可用
/// @param code 触发码  1: 单moblie  2：单wifi  3: 无网  4：内部错误 -19: 拉起测速服务失败  -23: 测试地址无效 -25：plugin错误  -23：无效测速网  -11 认证错误
/// @param message 触发信息，若message不为空，则以message信息为主
- (void)onNoPolicyWithCode:(NSInteger)code message:(NSString * _Nullable)message;
/// 加速链路出现异常（此种情况sdk会主动关闭加速，切回正常模式）
/// @param errorCode 错误码
/// @param msg 错误信息
- (void)onAccExceptionWithErrorCode:(NSInteger)errorCode msg:(NSString * _Nonnull)msg;
/// 旁路udping rtt时延回调
/// @param type 种类（0：mobile 1：wifi 2：acc ）
/// @param rtt  时延（ms） 丢包值为460
- (void)onRttChangedWithType:(NSInteger)type rtt:(NSInteger)rtt;
/// 聚合加速状态改变回调
/// @param state  false：关闭     true：打开
/// @param code   0：正常开启 1：正常关闭 2：异常关闭
- (void)onAccStateChangedWithState:(BOOL)state code:(NSInteger)code;
@end


SWIFT_CLASS("_TtC8MpAccSDK15MpMeasureConfig")
@interface MpMeasureConfig : NSObject
/// 测速地址（私有云设置）格式为”IP:PORT”,多个探测点以分号区分,例如”172.17.0.4:9000;172.17.0.4:9001”
@property (nonatomic, copy) NSString * _Nullable addr;
/// 滑动窗口测量时间 （ms）
@property (nonatomic) NSInteger time;
/// 时延阈值
@property (nonatomic) NSInteger rtt;
/// 丢包率阈值
@property (nonatomic) NSInteger loss;
/// 抖动阈值
@property (nonatomic) NSInteger jitter;
/// 快启动窗口时间
@property (nonatomic) NSInteger quickTime;
/// 快启动时延阈值
@property (nonatomic) NSInteger quickRtt;
/// 测量回调频率
@property (nonatomic) NSInteger interval;
/// 加速模式, 默认双发模式
@property (nonatomic) enum AccMode mode;
/// T2段测速地址
@property (nonatomic, copy) NSString * _Nullable t2AccProbeAddr;
/// 设置延迟提醒时间，单位毫秒
@property (nonatomic) NSInteger delayRemindTime;
/// 设置ping包超时时间，单位：ms
@property (nonatomic) NSInteger pingTimeout;
/// 设置禁用快速检测, true 禁用  false：不禁用
@property (nonatomic) BOOL disableQuickDetect;
/// 设置逃生附件选项
@property (nonatomic, strong) MpAdditionalOptions * _Nullable additionalOptions;
/// 设置禁用从路丢包检测, true 禁用  false：不禁用
@property (nonatomic) BOOL disableSlaveLossDetect;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end



@interface MpMeasureConfig (SWIFT_EXTENSION(MpAccSDK))
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull FRANKFURT_ADDRESS;)
+ (NSString * _Nonnull)FRANKFURT_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull SILICON_VALLEY_ADDRESS;)
+ (NSString * _Nonnull)SILICON_VALLEY_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull SAO_PAULO_ADDRESS;)
+ (NSString * _Nonnull)SAO_PAULO_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull TOKYO_ADDRESS;)
+ (NSString * _Nonnull)TOKYO_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull BANGKOK_ADDRESS;)
+ (NSString * _Nonnull)BANGKOK_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull SINGAPORE_ADDRESS;)
+ (NSString * _Nonnull)SINGAPORE_ADDRESS SWIFT_WARN_UNUSED_RESULT;
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, copy) NSString * _Nonnull HONG_KONG_ADDRESS;)
+ (NSString * _Nonnull)HONG_KONG_ADDRESS SWIFT_WARN_UNUSED_RESULT;
@end

@class NEPacketTunnelProvider;
@class NSData;

SWIFT_CLASS("_TtC8MpAccSDK21MpPacketTunnelManager")
@interface MpPacketTunnelManager : NSObject
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
/// 开启VPN tunnel，参数透传给SDK
/// @param packetTunnel
/// @param options
/// @param completionHandler
- (void)startTunnelWithPacketTunnel:(NEPacketTunnelProvider * _Nonnull)packetTunnel options:(NSDictionary<NSString *, NSObject *> * _Nullable)options completionHandler:(void (^ _Nonnull)(NSError * _Nullable))completionHandler;
/// 接受主程序消息，参数透传给SDK
/// @param messageData
/// @param completionHandler
/// 以上参数透传即可
- (void)handleAppMessage:(NSData * _Nonnull)messageData completionHandler:(void (^ _Nullable)(NSData * _Nullable))completionHandler;
/// 关闭VPN Tunnel
- (void)stopTunnel;
/// 获取版本号
- (NSString * _Nonnull)getSdkVersion SWIFT_WARN_UNUSED_RESULT;
@end



@interface MpPacketTunnelManager (SWIFT_EXTENSION(MpAccSDK)) <MpLoggerDelegate>
- (void)didReceiveLogWithLogStr:(NSString * _Nonnull)logStr;
@end





@interface MpPacketTunnelManager (SWIFT_EXTENSION(MpAccSDK))
/// 设置日志代理
- (void)setupLogDelegate:(id <MpLoggerDelegate> _Nullable)delegate;
/// 注册网络测速回调监听
/// @param callback 测速回调接口
- (void)registerMeasureCallback:(id <MpMeasureCallback> _Nonnull)callback;
/// 取消网络测速回调监听
/// @param callback 测量回调接口
- (void)unRegisterMeasureCallback:(id <MpMeasureCallback> _Nonnull)callback;
@end


SWIFT_CLASS("_TtC8MpAccSDK12MpPathDetail")
@interface MpPathDetail : NSObject
/// 下行数据
@property (nonatomic, readonly) int64_t rxBytes;
/// 上行数据
@property (nonatomic, readonly) int64_t txBytes;
/// 丢包率
@property (nonatomic, readonly) float lost;
/// 数据时延
@property (nonatomic, readonly) NSInteger RTT;
/// 网卡类型
@property (nonatomic, readonly) enum MpInterfaceType type;
/// 网卡名称
@property (nonatomic, readonly, copy) NSString * _Nonnull ifName;
/// 目标ip
@property (nonatomic, readonly, copy) NSString * _Nonnull dstIp;
/// pathId
@property (nonatomic, readonly) int8_t pathID;
@property (nonatomic, readonly) int64_t rxPackets;
@property (nonatomic, readonly) int64_t txPackets;
/// 下行总流量
@property (nonatomic, readonly) int64_t totalRxBytes;
/// 上行总流量
@property (nonatomic, readonly) int64_t totalTxBytes;
/// 下行峰值流量
@property (nonatomic, readonly) int64_t peakRxBytes;
/// 上行峰值流量
@property (nonatomic, readonly) int64_t peakTxBytes;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


/// 值包装类，主要解决OC不支持<code>Codable</code>的问题，编解码时，会直接解析为对应值，而不作为类
/// OC只兼容简单类型，目前不兼容codableArray
SWIFT_CLASS("_TtC8MpAccSDK7MpValue")
@interface MpValue : NSObject
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end


@interface MpValue (SWIFT_EXTENSION(MpAccSDK))
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
@end



@interface MpValue (SWIFT_EXTENSION(MpAccSDK))
@property (nonatomic, readonly) NSInteger integer;
@property (nonatomic, readonly, copy) NSString * _Nonnull string;
@property (nonatomic, readonly, getter=bool) BOOL bool_;
@property (nonatomic, readonly, getter=float) double float_;
+ (MpValue * _Nonnull)integer:(NSInteger)value SWIFT_WARN_UNUSED_RESULT;
+ (MpValue * _Nonnull)string:(NSString * _Nonnull)value SWIFT_WARN_UNUSED_RESULT;
+ (MpValue * _Nonnull)boolValue:(BOOL)value SWIFT_WARN_UNUSED_RESULT;
+ (MpValue * _Nonnull)floatValue:(double)value SWIFT_WARN_UNUSED_RESULT;
+ (MpValue * _Nonnull)stringList:(NSArray<NSString *> * _Nonnull)value SWIFT_WARN_UNUSED_RESULT;
@end




SWIFT_CLASS("_TtC8MpAccSDK17NetworkConditions")
@interface NetworkConditions : NSObject
/// 默认项，不做条件判断，rawValue 0
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NetworkConditions * _Nonnull MUST_NONE;)
+ (NetworkConditions * _Nonnull)MUST_NONE SWIFT_WARN_UNUSED_RESULT;
/// 需WiFi可用， rawValue 1
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NetworkConditions * _Nonnull MUST_WIFI_ACTIVE;)
+ (NetworkConditions * _Nonnull)MUST_WIFI_ACTIVE SWIFT_WARN_UNUSED_RESULT;
/// 需sim存在，   rawValue 2
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NetworkConditions * _Nonnull MUST_SIM_CARD_READY;)
+ (NetworkConditions * _Nonnull)MUST_SIM_CARD_READY SWIFT_WARN_UNUSED_RESULT;
/// 需Mobile网卡开启，rawValue 4
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) NetworkConditions * _Nonnull MUST_MOBILE_DATA_ENABLE;)
+ (NetworkConditions * _Nonnull)MUST_MOBILE_DATA_ENABLE SWIFT_WARN_UNUSED_RESULT;
@property (nonatomic, readonly) NSInteger rawValue;
+ (NetworkConditions * _Nonnull)combine:(NSArray<NetworkConditions *> * _Nonnull)conditions SWIFT_WARN_UNUSED_RESULT;
@property (nonatomic, readonly, copy) NSString * _Nonnull description;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

/// 发布环境，默认为正式环境(product)
typedef SWIFT_ENUM(NSInteger, RegEnv, open) {
  RegEnvPreProduct = -2,
/// < 预发布环境
  RegEnvTest = -1,
/// < 测试环境
  RegEnvProduct = 0,
};

#endif
#if __has_attribute(external_source_symbol)
# pragma clang attribute pop
#endif
#if defined(__cplusplus)
#endif
#pragma clang diagnostic pop
#endif

#else
#error unsupported Swift architecture
#endif
