71 lines
3.3 KiB
Objective-C
71 lines
3.3 KiB
Objective-C
//
|
||
// HttpdnsRequest.h
|
||
// TrustHttpDNS
|
||
//
|
||
// Created by xuyecan on 2024/5/19.
|
||
// Copyright ツゥ 2024 trustapp.com. All rights reserved.
|
||
//
|
||
|
||
#import <Foundation/Foundation.h>
|
||
|
||
NS_ASSUME_NONNULL_BEGIN
|
||
|
||
#ifndef NEWHTTPDNSQUERYIPTYPE
|
||
#define NEWHTTPDNSQUERYIPTYPE
|
||
|
||
typedef enum {
|
||
NewHttpDNS_IPTypeV4 = 0, //ipv4
|
||
NewHttpDNS_IPTypeV6 = 1, //ipv6
|
||
NewHttpDNS_IPTypeDual = 2, //both
|
||
} NewHttpDNS_IPType;
|
||
|
||
// Compatibility aliases
|
||
typedef NewHttpDNS_IPType TrustHttpDNS_IPType;
|
||
#define TrustHttpDNS_IPTypeV4 NewHttpDNS_IPTypeV4
|
||
#define TrustHttpDNS_IPTypeV6 NewHttpDNS_IPTypeV6
|
||
#define TrustHttpDNS_IPTypeV64 NewHttpDNS_IPTypeDual
|
||
|
||
typedef NS_OPTIONS(NSUInteger, HttpdnsQueryIPType) {
|
||
HttpdnsQueryIPTypeAuto NS_SWIFT_NAME(auto) = 0,
|
||
HttpdnsQueryIPTypeIpv4 = 1 << 0,
|
||
HttpdnsQueryIPTypeIpv6 = 1 << 1,
|
||
HttpdnsQueryIPTypeBoth = HttpdnsQueryIPTypeIpv4 | HttpdnsQueryIPTypeIpv6,
|
||
};
|
||
|
||
#endif
|
||
|
||
@interface HttpdnsRequest : NSObject
|
||
|
||
/// 髴隕∬ァ」譫千噪蝓溷錐
|
||
@property (nonatomic, copy) NSString *host;
|
||
|
||
/// 隗」譫占カ<E58DA0>慮譌カ髣エ<E9ABA3>悟ッケ莠主酔豁・謗・蜿」<E89CBF>悟叉荳コ譛螟ァ遲牙セ<E78999>慮髣エ<E9ABA3>悟ッケ莠主シよュ・謗・蜿」<E89CBF>悟叉荳コ譛螟ァ遲牙セ<E78999>屓隹<E5B193>慮髣?
|
||
/// 鮟倩ョ、蛟?遘抵シ悟叙蛟シ蠢<EFBDBC>。サ蝨ィ0.5遘?- 5遘剃ケ矩<EFBDB9>?
|
||
@property (nonatomic, assign) double resolveTimeoutInSecond;
|
||
|
||
/// 譟・隸「IP邀サ蝙<EFBDBB>
|
||
/// 鮟倩ョ、荳コHttpdnsQueryIPTypeAuto<74>梧ュ、邀サ蝙倶ク具シ郡DK閾ウ蟆台シ夊ッキ豎りァ」譫進pv4蝨ー蝮<E89DAE>瑚凶蛻、譁ュ蛻ー蠖灘燕鄂醍サ懃識蠅<E8AD98>髪謖(pv6<76>悟<EFBFBD>霑倅シ夊ッキ豎りァ」譫進pv6蝨ー蝮
|
||
/// HttpdnsQueryIPTypeIpv4<76>悟宵隸キ豎りァ」譫進pv4
|
||
/// HttpdnsQueryIPTypeIpv6<76>悟宵隸キ豎りァ」譫進pv6
|
||
/// HttpdnsQueryIPTypeBoth<74>御ク咲ョ。蠖灘燕鄂醍サ懃識蠅<E8AD98>弍莉荵茨シ御シ壼ー晁ッ募酔譌カ隸キ豎りァ」譫進pv4蝨ー蝮蜥景pv6蝨ー蝮<E89DAE>瑚ソ咏ァ咲畑豕包シ碁壼クク髴隕∵響蛻ー扈捺棡荵句錘閾ェ陦悟愛譁ュ鄂醍サ懃識蠅<E8AD98><E8A085>螳壻スソ逕ィ蜩ェ荳ェ扈捺<E68988>?
|
||
@property (nonatomic, assign) HttpdnsQueryIPType queryIpType;
|
||
|
||
/// SDNS蜿よ焚<E38288>碁宙蟇ケ霓ッ莉カ閾ェ螳壻ケ芽ァ」譫仙惻譎ッ菴ソ逕ィ
|
||
@property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *sdnsParams;
|
||
|
||
/// 郛灘ュ婁ey<65>碁宙蟇ケ霓ッ莉カ閾ェ螳壻ケ芽ァ」譫仙惻譎ッ菴ソ逕ィ
|
||
@property (nonatomic, copy, nullable) NSString *cacheKey;
|
||
|
||
/// 隸キ豎よ園螻樒噪雍ヲ蜿キID<49>檎畑莠主惠螟夊エヲ蜿キ蝨コ譎ッ荳句ョ壻ス榊ョ樔セ<E6A894>
|
||
@property (nonatomic, assign) NSInteger accountId;
|
||
|
||
- (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType;
|
||
|
||
- (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType sdnsParams:(nullable NSDictionary<NSString *, NSString *> *)sdnsParams cacheKey:(nullable NSString *)cacheKey;
|
||
|
||
- (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType sdnsParams:(nullable NSDictionary<NSString *, NSString *> *)sdnsParams cacheKey:(nullable NSString *)cacheKey resolveTimeout:(double)timeoutInSecond;
|
||
|
||
@end
|
||
|
||
NS_ASSUME_NONNULL_END
|