ObjFW
OFHostAddressResolver.h
1 /*
2  * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im>
3  *
4  * All rights reserved.
5  *
6  * This file is part of ObjFW. It may be distributed under the terms of the
7  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
8  * the packaging of this file.
9  *
10  * Alternatively, it may be distributed under the terms of the GNU General
11  * Public License, either version 2 or 3, which can be found in the file
12  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
13  * file.
14  */
15 
16 #import "OFObject.h"
17 #import "OFDNSResolver.h"
18 #import "OFRunLoop.h"
19 
20 #import "socket.h"
21 
22 OF_ASSUME_NONNULL_BEGIN
23 
24 @class OFDNSResolverSettings;
25 @class OFDNSResourceRecord;
26 @class OFMutableArray OF_GENERIC(ObjectType);
27 @class OFMutableData;
28 @class OFString;
29 
30 @interface OFHostAddressResolver: OFObject <OFDNSResolverQueryDelegate>
31 {
32  OFString *_host;
33  of_socket_address_family_t _addressFamily;
34  OFDNSResolver *_resolver;
35  OFDNSResolverSettings *_settings;
36  of_run_loop_mode_t _Nullable _runLoopMode;
37  id <OFDNSResolverHostDelegate> _Nullable _delegate;
38  bool _isFQDN;
39  size_t _searchDomainIndex;
40  unsigned int _numExpectedResponses;
41  OFMutableData *_addresses;
42 }
43 
44 - (instancetype)initWithHost: (OFString *)host
45  addressFamily: (of_socket_address_family_t)addressFamily
46  resolver: (OFDNSResolver *)resolver
47  settings: (OFDNSResolverSettings *)settings
48  runLoopMode: (nullable of_run_loop_mode_t)runLoopMode
49  delegate: (nullable id <OFDNSResolverHostDelegate>)delegate;
50 - (void)asyncResolve;
51 - (OFData *)resolve;
52 @end
53 
54 OF_ASSUME_NONNULL_END
struct objc_object * id
A pointer to any object.
Definition: ObjFWRT.h:90
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:42
A class for resolving DNS names.
Definition: OFDNSResolver.h:126
A class representing a DNS resource record.
Definition: OFDNSResourceRecord.h:75
A class for storing arbitrary data in an array.
Definition: OFData.h:40
An abstract class for storing, adding and removing objects in an array.
Definition: OFMutableArray.h:44
A class for storing and manipulating arbitrary data in an array.
Definition: OFMutableData.h:29
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class for handling strings.
Definition: OFString.h:132
A delegate for performed DNS queries.
Definition: OFDNSResolver.h:76
of_socket_address_family_t
A socket address family.
Definition: socket.h:88