// // HttpdnsRequest.h // TrustHttpDNS // // Created by xuyecan on 2024/5/19. // Copyright ツゥ 2024 trustapp.com. All rights reserved. // #import 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; /// 隗」譫占カ�慮譌カ髣エ�悟ッケ莠主酔豁・謗・蜿」�悟叉荳コ譛€螟ァ遲牙セ�慮髣エ�悟ッケ莠主シよュ・謗・蜿」�悟叉荳コ譛€螟ァ遲牙セ�屓隹�慮髣? /// 鮟倩ョ、蛟?遘抵シ悟叙蛟シ蠢�。サ蝨ィ0.5遘?- 5遘剃ケ矩�? @property (nonatomic, assign) double resolveTimeoutInSecond; /// 譟・隸「IP邀サ蝙� /// 鮟倩ョ、荳コHttpdnsQueryIPTypeAuto�梧ュ、邀サ蝙倶ク具シ郡DK閾ウ蟆台シ夊ッキ豎りァ」譫進pv4蝨ー蝮€�瑚凶蛻、譁ュ蛻ー蠖灘燕鄂醍サ懃識蠅�髪謖(pv6�悟�霑倅シ夊ッキ豎りァ」譫進pv6蝨ー蝮€ /// HttpdnsQueryIPTypeIpv4�悟宵隸キ豎りァ」譫進pv4 /// HttpdnsQueryIPTypeIpv6�悟宵隸キ豎りァ」譫進pv6 /// HttpdnsQueryIPTypeBoth�御ク咲ョ。蠖灘燕鄂醍サ懃識蠅�弍莉€荵茨シ御シ壼ー晁ッ募酔譌カ隸キ豎りァ」譫進pv4蝨ー蝮€蜥景pv6蝨ー蝮€�瑚ソ咏ァ咲畑豕包シ碁€壼クク髴€隕∵響蛻ー扈捺棡荵句錘閾ェ陦悟愛譁ュ鄂醍サ懃識蠅��螳壻スソ逕ィ蜩ェ荳ェ扈捺�? @property (nonatomic, assign) HttpdnsQueryIPType queryIpType; /// SDNS蜿よ焚�碁宙蟇ケ霓ッ莉カ閾ェ螳壻ケ芽ァ」譫仙惻譎ッ菴ソ逕ィ @property (nonatomic, copy, nullable) NSDictionary *sdnsParams; /// 郛灘ュ婁ey�碁宙蟇ケ霓ッ莉カ閾ェ螳壻ケ芽ァ」譫仙惻譎ッ菴ソ逕ィ @property (nonatomic, copy, nullable) NSString *cacheKey; /// 隸キ豎よ園螻樒噪雍ヲ蜿キID�檎畑莠主惠螟夊エヲ蜿キ蝨コ譎ッ荳句ョ壻ス榊ョ樔セ� @property (nonatomic, assign) NSInteger accountId; - (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType; - (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType sdnsParams:(nullable NSDictionary *)sdnsParams cacheKey:(nullable NSString *)cacheKey; - (instancetype)initWithHost:(NSString *)host queryIpType:(HttpdnsQueryIPType)queryIpType sdnsParams:(nullable NSDictionary *)sdnsParams cacheKey:(nullable NSString *)cacheKey resolveTimeout:(double)timeoutInSecond; @end NS_ASSUME_NONNULL_END