Differences From Artifact [99b6530961]:
- File
src/OFDNSResolver.h
— part of check-in
[dd375b6d4e]
at
2018-07-08 12:07:16
on branch trunk
— Initial code for OFDNSResolver
This does nothing more than parse /etc/hosts and /etc/resolv.conf so
far. (user: js, size: 2317) [annotate] [blame] [check-ins using]
To Artifact [1ab5027353]:
- File src/OFDNSResolver.h — part of check-in [af4b18903d] at 2018-07-29 14:32:41 on branch trunk — OFDNSResolver: Initial support for resolving (user: js, size: 3018) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFString.h" OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); @class OFDictionary OF_GENERIC(KeyType, ObjectType); /*! * @class OFDNSResolver OFDNSResolver.h ObjFW/OFDNSResolver.h * * @brief A class for resolving DNS names. */ @interface OFDNSResolver: OFObject { OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC(OFString *) *) *_staticHosts; OFArray OF_GENERIC(OFString *) *_nameServers; OFString *_Nullable _localDomain; OFArray OF_GENERIC(OFString *) *_searchDomains; size_t _minNumberOfDotsInAbsoluteName; bool _usesTCP; } /*! * @brief A dictionary of static hosts. * * This dictionary is checked before actually looking up a host. */ | > > > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" #import "OFString.h" #import "OFDNSResourceRecord.h" OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); @class OFDictionary OF_GENERIC(KeyType, ObjectType); @class OFMutableDictionary OF_GENERIC(KeyType, ObjectType); @class OFNumber; /*! * @class OFDNSResolver OFDNSResolver.h ObjFW/OFDNSResolver.h * * @brief A class for resolving DNS names. */ @interface OFDNSResolver: OFObject { OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC(OFString *) *) *_staticHosts; OFArray OF_GENERIC(OFString *) *_nameServers; OFString *_Nullable _localDomain; OFArray OF_GENERIC(OFString *) *_searchDomains; size_t _minNumberOfDotsInAbsoluteName; bool _usesTCP; OFMutableDictionary OF_GENERIC(OFNumber *, id) *_queries; } /*! * @brief A dictionary of static hosts. * * This dictionary is checked before actually looking up a host. */ |
︙ | ︙ | |||
79 80 81 82 83 84 85 86 87 88 | */ + (instancetype)resolver; /*! * @brief Initializes an already allocated OFDNSResolver. */ - (instancetype)init; @end OF_ASSUME_NONNULL_END | > > > > > > > > > > > > > > > | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | */ + (instancetype)resolver; /*! * @brief Initializes an already allocated OFDNSResolver. */ - (instancetype)init; /*! * @brief Asynchronously resolves the specified host. * * @param host The host to resolve * @param target The target to call with the result once resolving is done * @param selector The selector to call on the target. The signature must be * `void (OFArray<OFDNSResourceRecord *> *response, id context, * id exception)`. * @param context A context object to pass along to the target */ - (void)asyncResolveHost: (OFString *)host target: (id)target selector: (SEL)selector context: (nullable id)context; @end OF_ASSUME_NONNULL_END |