ObjFW
Loading...
Searching...
No Matches
OFHostAddressResolver.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFObject.h"
21#import "OFDNSResolver.h"
22#import "OFRunLoop.h"
23#import "OFSocket.h"
24
25OF_ASSUME_NONNULL_BEGIN
26
27@class OFDNSResolverSettings;
29@class OFMutableArray OF_GENERIC(ObjectType);
30@class OFMutableData;
31@class OFString;
32
33@interface OFHostAddressResolver: OFObject <OFDNSResolverQueryDelegate>
34{
35 OFString *_host;
36 OFSocketAddressFamily _addressFamily;
37 OFDNSResolver *_resolver;
38 OFDNSResolverSettings *_settings;
39 OFRunLoopMode _Nullable _runLoopMode;
40 id <OFDNSResolverHostDelegate> _Nullable _delegate;
41 bool _isFQDN;
42 size_t _searchDomainIndex;
43 unsigned int _numExpectedResponses;
44 OFMutableData *_addresses;
45}
46
47- (instancetype)initWithHost: (OFString *)host
48 addressFamily: (OFSocketAddressFamily)addressFamily
49 resolver: (OFDNSResolver *)resolver
50 settings: (OFDNSResolverSettings *)settings
51 runLoopMode: (nullable OFRunLoopMode)runLoopMode
52 delegate: (nullable id <OFDNSResolverHostDelegate>)delegate;
53- (void)asyncResolve;
54- (OFData *)resolve;
55@end
56
57OF_ASSUME_NONNULL_END
OFSocketAddressFamily
A socket address family.
Definition OFSocket.h:107
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:42
A class for resolving DNS names.
Definition OFDNSResolver.h:132
A class representing a DNS resource record.
Definition OFDNSResourceRecord.h:82
A class for storing arbitrary data in an array.
Definition OFData.h:46
An abstract class for storing, adding and removing objects in an array.
Definition OFMutableArray.h:48
A class for storing and manipulating arbitrary data in an array.
Definition OFMutableData.h:30
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:139
A delegate for performed DNS queries.
Definition OFDNSResolver.h:82