QNDns.h 883 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // QNDns.h
  3. // QnDNS
  4. //
  5. // Created by yangsen on 2020/3/26.
  6. // Copyright © 2020 com.qiniu. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @protocol QNIDnsNetworkAddress <NSObject>
  11. /// 域名
  12. @property(nonatomic, copy, readonly)NSString *hostValue;
  13. /// 地址IP信息
  14. @property(nonatomic, copy, readonly)NSString *ipValue;
  15. /// ip有效时间 单位:秒
  16. @property(nonatomic, strong, readonly)NSNumber *ttlValue;
  17. /// ip预取来源, 自定义dns返回 @"customized"
  18. @property(nonatomic, copy, readonly)NSString *sourceValue;
  19. /// 解析到host时的时间戳 单位:秒
  20. @property(nonatomic, strong, readonly)NSNumber *timestampValue;
  21. @end
  22. @protocol QNDnsDelegate <NSObject>
  23. /// 根据host获取解析结果
  24. /// @param host 域名
  25. - (NSArray < id <QNIDnsNetworkAddress> > *)query:(NSString *)host;
  26. @end
  27. NS_ASSUME_NONNULL_END