summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@heap.zone>2019-10-01 00:46:28 +0200
committerJonathan Schleifer <js@heap.zone>2019-10-01 00:46:28 +0200
commit9866ea74a3446129fb15d724654386e305e600bd (patch)
tree2050ce4b087a0becf77148165d6aa2bd6791fc9f
parent841af636a0dddb3baf9bcbc6e18fb341652572fa (diff)
Add OFDNSResponse
-rw-r--r--src/Makefile1
-rw-r--r--src/OFDNSResolver.h15
-rw-r--r--src/OFDNSResolver.m156
-rw-r--r--src/OFDNSResponse.h92
-rw-r--r--src/OFDNSResponse.m130
-rw-r--r--src/ObjFW.h3
-rw-r--r--utils/ofdns/OFDNS.m11
7 files changed, 293 insertions, 115 deletions
diff --git a/src/Makefile b/src/Makefile
index 99ea1d27..b1cba0d9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -137,6 +137,7 @@ SRCS_FILES = OFFile.m \
SRCS_PLUGINS = OFPlugin.m
SRCS_SOCKETS = OFDNSResolver.m \
OFDNSResourceRecord.m \
+ OFDNSResponse.m \
OFHTTPClient.m \
OFHTTPCookie.m \
OFHTTPCookieManager.m \
diff --git a/src/OFDNSResolver.h b/src/OFDNSResolver.h
index f7257c8a..255eede7 100644
--- a/src/OFDNSResolver.h
+++ b/src/OFDNSResolver.h
@@ -17,6 +17,7 @@
#import "OFObject.h"
#import "OFDNSResourceRecord.h"
+#import "OFDNSResponse.h"
#import "OFRunLoop.h"
#import "OFString.h"
@@ -64,9 +65,6 @@ typedef enum of_dns_resolver_error_t {
OF_DNS_RESOLVER_ERROR_SERVER_REFUSED
} of_dns_resolver_error_t;
-typedef OFDictionary OF_GENERIC(OFString *,
- OFArray OF_GENERIC(OFDNSResourceRecord *) *) *of_dns_resolver_records_t;
-
/*!
* @protocol OFDNSResolverDelegate OFDNSResolver.h ObjFW/OFDNSResolver.h
*
@@ -79,20 +77,13 @@ typedef OFDictionary OF_GENERIC(OFString *,
*
* @param resolver The acting resolver
* @param domainName The fully qualified domain name used to resolve the host
- * @param answerRecords The answer records from the name server, grouped by
- * domain name
- * @param authorityRecords The authority records from the name server, grouped
- * by domain name
- * @param additionalRecords Additional records sent by the name server, grouped
- * by domain name
+ * @param response The response from the DNS server, or nil on error
* @param exception An exception that happened during resolving, or nil on
* success
*/
- (void)resolver: (OFDNSResolver *)resolver
didResolveDomainName: (OFString *)domainName
- answerRecords: (nullable of_dns_resolver_records_t)answerRecords
- authorityRecords: (nullable of_dns_resolver_records_t)authorityRecords
- additionalRecords: (nullable of_dns_resolver_records_t)additionalRecords
+ response: (nullable OFDNSResponse *)response
exception: (nullable id)exception;
/*!
diff --git a/src/OFDNSResolver.m b/src/OFDNSResolver.m
index a65ef79a..818da8d5 100644
--- a/src/OFDNSResolver.m
+++ b/src/OFDNSResolver.m
@@ -163,30 +163,24 @@ static const of_run_loop_mode_t resolveRunLoopMode =
- (instancetype)initWithHost: (OFString *)host
delegate: (id)delegate;
- (bool)parseRecords: (OFArray *)records
- answerRecords: (OFDictionary *)answerRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
recordType: (of_dns_resource_record_type_t)recordType
recursion: (unsigned int)recursion
result: (OFMutableArray *)result;
- (void)resolveCNAME: (OFCNAMEDNSResourceRecord *)CNAME
- answerRecords: (OFDictionary *)answerRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
recordType: (of_dns_resource_record_type_t)recordType
recursion: (unsigned int)recursion
result: (OFMutableArray *)result;
-- (void)resolver: (OFDNSResolver *)resolver
- didResolveCNAME: (OFString *)CNAME
- answerRecords: (OFDictionary *)answerRecords
- authorityRecords: (OFDictionary *)authorityRecords
- additionalRecords: (OFDictionary *)additionalRecords
- context: (OFNumber *)context
- exception: (id)exception;
+- (void)resolver: (OFDNSResolver *)resolver
+ didResolveCNAME: (OFString *)CNAME
+ response: (OFDNSResponse *)response
+ context: (OFNumber *)context
+ exception: (id)exception;
- (void)done;
- (void)resolver: (OFDNSResolver *)resolver
didResolveDomainName: (OFString *)domainName
- answerRecords: (OFDictionary *)answerRecords
- authorityRecords: (OFDictionary *)authorityRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
context: (OFNumber *)context
exception: (id)exception;
@end
@@ -659,18 +653,16 @@ parseSection(const unsigned char *buffer, size_t length, size_t *i,
return ret;
}
-static void callback(id target, SEL selector, OFDNSResolver *resolver,
- OFString *domainName, OFDictionary *answerRecords,
- OFDictionary *authorityRecords, OFDictionary *additionalRecords, id context,
- id exception)
+static void
+callback(id target, SEL selector, OFDNSResolver *resolver, OFString *domainName,
+ OFDNSResponse *response, id context, id exception)
{
- void (*method)(id, SEL, OFDNSResolver *, OFString *, OFDictionary *,
- OFDictionary *, OFDictionary *, id, id) = (void (*)(id, SEL,
- OFDNSResolver *, OFString *, OFDictionary *, OFDictionary *,
- OFDictionary *, id, id))[target methodForSelector: selector];
+ void (*method)(id, SEL, OFDNSResolver *, OFString *, OFDNSResponse *,
+ id, id) = (void (*)(id, SEL, OFDNSResolver *, OFString *,
+ OFDNSResponse *, id, id))[target methodForSelector: selector];
- method(target, selector, resolver, domainName, answerRecords,
- authorityRecords, additionalRecords, context, exception);
+ method(target, selector, resolver, domainName, response, context,
+ exception);
}
@implementation OFDNSResolverSettings
@@ -844,29 +836,27 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
}
- (bool)parseRecords: (OFArray *)records
- answerRecords: (OFDictionary *)answerRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
recordType: (of_dns_resource_record_type_t)recordType
recursion: (unsigned int)recursion
result: (OFMutableArray *)result
{
bool found = false;
- for (OFDNSResourceRecord *record in records) {
- if (record.recordClass != OF_DNS_RESOURCE_RECORD_CLASS_IN)
+ for (OF_KINDOF(OFDNSResourceRecord *) record in records) {
+ if ([record recordClass] != OF_DNS_RESOURCE_RECORD_CLASS_IN)
continue;
- if (record.recordType == recordType) {
+ if ([record recordType] == recordType) {
[result addObject: record];
found = true;
- } else if (record.recordType ==
+ } else if ([record recordType] ==
OF_DNS_RESOURCE_RECORD_TYPE_CNAME) {
- [self resolveCNAME: (OFCNAMEDNSResourceRecord *)record
- answerRecords: answerRecords
- additionalRecords: additionalRecords
- recordType: recordType
- recursion: recursion
- result: result];
+ [self resolveCNAME: record
+ response: response
+ recordType: recordType
+ recursion: recursion
+ result: result];
found = true;
}
}
@@ -875,8 +865,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
}
- (void)resolveCNAME: (OFCNAMEDNSResourceRecord *)CNAME
- answerRecords: (OFDictionary *)answerRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
recordType: (of_dns_resource_record_type_t)recordType
recursion: (unsigned int)recursion
result: (OFMutableArray *)result
@@ -887,17 +876,15 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
if (recursion == 0)
return;
- if ([self parseRecords: [answerRecords objectForKey: alias]
- answerRecords: answerRecords
- additionalRecords: additionalRecords
+ if ([self parseRecords: [response.answerRecords objectForKey: alias]
+ response: response
recordType: recordType
recursion: recursion - 1
result: result])
found = true;
- if ([self parseRecords: [additionalRecords objectForKey: alias]
- answerRecords: answerRecords
- additionalRecords: additionalRecords
+ if ([self parseRecords: [response.additionalRecords objectForKey: alias]
+ response: response
recordType: recordType
recursion: recursion - 1
result: result])
@@ -921,22 +908,17 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
runLoopMode: runLoopMode
target: self
selector: @selector(resolver:
- didResolveCNAME:
- answerRecords:
- authorityRecords:
- additionalRecords:context:
- exception:)
+ didResolveCNAME:response:
+ context:exception:)
context: recordTypeNumber];
}
}
-- (void)resolver: (OFDNSResolver *)resolver
- didResolveCNAME: (OFString *)CNAME
- answerRecords: (OFDictionary *)answerRecords
- authorityRecords: (OFDictionary *)authorityRecords
- additionalRecords: (OFDictionary *)additionalRecords
- context: (OFNumber *)context
- exception: (id)exception
+- (void)resolver: (OFDNSResolver *)resolver
+ didResolveCNAME: (OFString *)CNAME
+ response: (OFDNSResponse *)response
+ context: (OFNumber *)context
+ exception: (id)exception
{
/*
* TODO: Error handling could be improved. Ignore error if there are
@@ -961,17 +943,15 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
records = [OFMutableArray array];
- if ([self parseRecords: [answerRecords objectForKey: CNAME]
- answerRecords: answerRecords
- additionalRecords: additionalRecords
+ if ([self parseRecords: [response.answerRecords objectForKey: CNAME]
+ response: response
recordType: recordType
recursion: CNAME_RECURSION
result: records])
found = true;
- if ([self parseRecords: [additionalRecords objectForKey: CNAME]
- answerRecords: answerRecords
- additionalRecords: additionalRecords
+ if ([self parseRecords: [response.additionalRecords objectForKey: CNAME]
+ response: response
recordType: recordType
recursion: CNAME_RECURSION
result: records])
@@ -1046,9 +1026,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
- (void)resolver: (OFDNSResolver *)resolver
didResolveDomainName: (OFString *)domainName
- answerRecords: (OFDictionary *)answerRecords
- authorityRecords: (OFDictionary *)authorityRecords
- additionalRecords: (OFDictionary *)additionalRecords
+ response: (OFDNSResponse *)response
context: (OFNumber *)context
exception: (id)exception
{
@@ -1080,9 +1058,8 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
return;
}
- [self parseRecords: [answerRecords objectForKey: _domainName]
- answerRecords: answerRecords
- additionalRecords: additionalRecords
+ [self parseRecords: [response.answerRecords objectForKey: _domainName]
+ response: response
recordType: recordType
recursion: CNAME_RECURSION
result: _records];
@@ -1654,20 +1631,15 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
- (void)of_resolver: (OFDNSResolver *)resolver
didResolveDomainName: (OFString *)domainName
- answerRecords: (of_dns_resolver_records_t)answerRecords
- authorityRecords: (of_dns_resolver_records_t)authorityRecords
- additionalRecords: (of_dns_resolver_records_t)additionalRecords
+ response: (OFDNSResponse *)response
context: (id)delegate
exception: (id)exception
{
if ([delegate respondsToSelector: @selector(resolver:
- didResolveDomainName:answerRecords:authorityRecords:
- additionalRecords:exception:)])
+ didResolveDomainName:response:exception:)])
[delegate resolver: resolver
didResolveDomainName: domainName
- answerRecords: answerRecords
- authorityRecords: authorityRecords
- additionalRecords: additionalRecords
+ response: response
exception: exception];
}
@@ -1680,8 +1652,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
runLoopMode: of_run_loop_mode_default
target: self
selector: @selector(of_resolver:didResolveDomainName:
- answerRecords:authorityRecords:
- additionalRecords:context:exception:)
+ response:context:exception:)
context: delegate];
}
@@ -1696,8 +1667,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
runLoopMode: of_run_loop_mode_default
target: self
selector: @selector(of_resolver:didResolveDomainName:
- answerRecords:authorityRecords:
- additionalRecords:context:exception:)
+ response:context:exception:)
context: delegate];
}
@@ -1713,8 +1683,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
runLoopMode: runLoopMode
target: self
selector: @selector(of_resolver:didResolveDomainName:
- answerRecords:authorityRecords:
- additionalRecords:context:exception:)
+ response:context:exception:)
context: delegate];
}
@@ -1863,7 +1832,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
error: OF_DNS_RESOLVER_ERROR_TIMEOUT];
callback(query->_target, query->_selector, self, query->_domainName,
- nil, nil, nil, query->_context, exception);
+ nil, query->_context, exception);
}
- (bool)socket: (OFUDPSocket *)sock
@@ -1875,6 +1844,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
unsigned char *buffer = buffer_;
OFDictionary *answerRecords = nil, *authorityRecords = nil;
OFDictionary *additionalRecords = nil;
+ OFDNSResponse *response = nil;
OFNumber *ID;
OFDNSResolverQuery *query;
@@ -2002,15 +1972,18 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
numAuthorityRecords);
additionalRecords = parseSection(buffer, length, &i,
numAdditionalRecords);
+ response = [OFDNSResponse
+ responseWithAnswerRecords: answerRecords
+ authorityRecords: authorityRecords
+ additionalRecords: additionalRecords];
} @catch (id e) {
callback(query->_target, query->_selector, self,
- query->_domainName, nil, nil, nil, query->_context, e);
+ query->_domainName, nil, query->_context, e);
return true;
}
callback(query->_target, query->_selector, self, query->_domainName,
- answerRecords, authorityRecords, additionalRecords,
- query->_context, nil);
+ response, query->_context, nil);
return true;
}
@@ -2197,9 +2170,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
target: context
selector: @selector(resolver:
didResolveDomainName:
- answerRecords:authorityRecords:
- additionalRecords:context:
- exception:)
+ response:context:exception:)
context: recordTypeNumber];
}
#endif
@@ -2213,9 +2184,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
target: context
selector: @selector(resolver:
didResolveDomainName:
- answerRecords:authorityRecords:
- additionalRecords:context:
- exception:)
+ response:context:exception:)
context: [OFNumber numberWithInt:
OF_DNS_RESOURCE_RECORD_TYPE_A]];
@@ -2284,8 +2253,7 @@ static void callback(id target, SEL selector, OFDNSResolver *resolver,
error: OF_DNS_RESOLVER_ERROR_CANCELED];
callback(query->_target, query->_selector, self,
- query->_domainName, nil, nil, nil, query->_context,
- exception);
+ query->_domainName, nil, query->_context, exception);
}
[_queries removeAllObjects];
diff --git a/src/OFDNSResponse.h b/src/OFDNSResponse.h
new file mode 100644
index 00000000..937604f2
--- /dev/null
+++ b/src/OFDNSResponse.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
+ * 2018, 2019
+ * Jonathan Schleifer <js@heap.zone>
+ *
+ * All rights reserved.
+ *
+ * This file is part of ObjFW. It may be distributed under the terms of the
+ * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
+ * the packaging of this file.
+ *
+ * Alternatively, it may be distributed under the terms of the GNU General
+ * 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 "OFDNSResourceRecord.h"
+
+OF_ASSUME_NONNULL_BEGIN
+
+@class OFArray OF_GENERIC(ObjectType);
+@class OFDictionary OF_GENERIC(KeyType, ObjectType);
+
+typedef OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC(
+ OF_KINDOF(OFDNSResourceRecord *)) *) *of_dns_response_records_t;
+
+/*!
+ * @class OFDNSResponse OFDNSResponse.h ObjFW/OFDNSResponse.h
+ *
+ * @brief A class storing a response from @ref OFDNSResolver.
+ */
+@interface OFDNSResponse: OFObject
+{
+ of_dns_response_records_t _Nullable _answerRecords;
+ of_dns_response_records_t _Nullable _authorityRecords;
+ of_dns_response_records_t _Nullable _additionalRecords;
+ OF_RESERVE_IVARS(4)
+}
+
+/*!
+ * @brief The answer records of the response.
+ */
+@property OF_NULLABLE_PROPERTY (nonatomic, readonly)
+ of_dns_response_records_t answerRecords;
+
+/*!
+ * @brief The authority records of the response.
+ */
+@property OF_NULLABLE_PROPERTY (nonatomic, readonly)
+ of_dns_response_records_t authorityRecords;
+
+/*!
+ * @brief The additional records of the response.
+ */
+@property OF_NULLABLE_PROPERTY (nonatomic, readonly)
+ of_dns_response_records_t additionalRecords;
+
+/*!
+ * @brief Creates a new, autoreleased OFDNSResponse.
+ *
+ * @param answerRecords The answer records of the response
+ * @param authorityRecords The authority records of the response
+ * @param additionalRecords The additional records of the response
+ * @return A new, autoreleased OFDNSResponse
+ */
++ (instancetype)
+ responseWithAnswerRecords: (nullable of_dns_response_records_t)answerRecords
+ authorityRecords: (nullable of_dns_response_records_t)
+ authorityRecords
+ additionalRecords: (nullable of_dns_response_records_t)
+ additionalRecords;
+
+/*!
+ * @brief Initializes an already allocated OFDNSResponse.
+ *
+ * @param answerRecords The answer records of the response
+ * @param authorityRecords The authority records of the response
+ * @param additionalRecords The additional records of the response
+ * @return An initialized OFDNSResponse
+ */
+- (instancetype)
+ initWithAnswerRecords: (nullable of_dns_response_records_t)answerRecords
+ authorityRecords: (nullable of_dns_response_records_t)authorityRecords
+ additionalRecords: (nullable of_dns_response_records_t)additionalRecords
+ OF_DESIGNATED_INITIALIZER;
+
+- (instancetype)init OF_UNAVAILABLE;
+@end
+
+OF_ASSUME_NONNULL_END
diff --git a/src/OFDNSResponse.m b/src/OFDNSResponse.m
new file mode 100644
index 00000000..38e4b725
--- /dev/null
+++ b/src/OFDNSResponse.m
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
+ * 2018, 2019
+ * Jonathan Schleifer <js@heap.zone>
+ *
+ * All rights reserved.
+ *
+ * This file is part of ObjFW. It may be distributed under the terms of the
+ * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
+ * the packaging of this file.
+ *
+ * Alternatively, it may be distributed under the terms of the GNU General
+ * 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.
+ */
+
+#include "config.h"
+
+#import "OFDNSResponse.h"
+#import "OFDictionary.h"
+#import "OFString.h"
+
+@implementation OFDNSResponse
+@synthesize answerRecords = _answerRecords;
+@synthesize authorityRecords = _authorityRecords;
+@synthesize additionalRecords = _additionalRecords;
+
++ (instancetype)
+ responseWithAnswerRecords: (of_dns_response_records_t)answerRecords
+ authorityRecords: (of_dns_response_records_t)authorityRecords
+ additionalRecords: (of_dns_response_records_t)additionalRecords
+{
+ return [[[self alloc]
+ initWithAnswerRecords: answerRecords
+ authorityRecords: authorityRecords
+ additionalRecords: additionalRecords] autorelease];
+}
+
+- (instancetype)
+ initWithAnswerRecords: (of_dns_response_records_t)answerRecords
+ authorityRecords: (of_dns_response_records_t)authorityRecords
+ additionalRecords: (of_dns_response_records_t)additionalRecords
+{
+ self = [super init];
+
+ @try {
+ _answerRecords = [answerRecords copy];
+ _authorityRecords = [authorityRecords copy];
+ _additionalRecords = [additionalRecords copy];
+ } @catch (id e) {
+ [self release];
+ @throw e;
+ }
+
+ return self;
+}
+
+- (instancetype)init OF_UNAVAILABLE
+{
+ OF_INVALID_INIT_METHOD
+}
+
+- (void)dealloc
+{
+ [_answerRecords release];
+ [_authorityRecords release];
+ [_additionalRecords release];
+
+ [super dealloc];
+}
+
+- (bool)isEqual: (id)object
+{
+ OFDNSResponse *other;
+
+ if (![object isKindOfClass: [OFDNSResponse class]])
+ return false;
+
+ other = object;
+
+ if (other->_answerRecords != _answerRecords &&
+ ![other->_answerRecords isEqual: _answerRecords])
+ return false;
+
+ if (other->_authorityRecords != _authorityRecords &&
+ ![other->_authorityRecords isEqual: _authorityRecords])
+ return false;
+
+ if (other->_additionalRecords != _additionalRecords &&
+ ![other->_additionalRecords isEqual: _additionalRecords])
+ return false;
+
+ return true;
+}
+
+- (uint32_t)hash
+{
+ uint32_t hash;
+
+ OF_HASH_INIT(hash);
+ OF_HASH_ADD_HASH(hash, [_answerRecords hash]);
+ OF_HASH_ADD_HASH(hash, [_authorityRecords hash]);
+ OF_HASH_ADD_HASH(hash, [_additionalRecords hash]);
+ OF_HASH_FINALIZE(hash);
+
+ return hash;
+}
+
+- (OFString *)description
+{
+ OFString *answerRecords = [_answerRecords.description
+ stringByReplacingOccurrencesOfString: @"\n"
+ withString: @"\n\t"];
+ OFString *authorityRecords = [_authorityRecords.description
+ stringByReplacingOccurrencesOfString: @"\n"
+ withString: @"\n\t"];
+ OFString *additionalRecords = [_additionalRecords.description
+ stringByReplacingOccurrencesOfString: @"\n"
+ withString: @"\n\t"];
+
+ return [OFString stringWithFormat:
+ @"<OFDNSResponse:\n"
+ @"\tAnswer records = %@\n"
+ @"\tAuthority records = %@\n"
+ @"\tAdditional records = %@\n"
+ @">",
+ answerRecords, authorityRecords, additionalRecords];
+}
+@end
diff --git a/src/ObjFW.h b/src/ObjFW.h
index cef0e6e8..507ca644 100644
--- a/src/ObjFW.h
+++ b/src/ObjFW.h
@@ -75,8 +75,9 @@
# import "OFUDPSocket.h"
# import "OFTLSSocket.h"
# import "OFKernelEventObserver.h"
-# import "OFDNSResolver.h"
# import "OFDNSResourceRecord.h"
+# import "OFDNSResponse.h"
+# import "OFDNSResolver.h"
#endif
#ifdef OF_HAVE_SOCKETS
# ifdef OF_HAVE_THREADS
diff --git a/utils/ofdns/OFDNS.m b/utils/ofdns/OFDNS.m
index db74040c..89f7dea3 100644
--- a/utils/ofdns/OFDNS.m
+++ b/utils/ofdns/OFDNS.m
@@ -31,9 +31,7 @@ OF_APPLICATION_DELEGATE(OFDNS)
@implementation OFDNS
- (void)resolver: (OFDNSResolver *)resolver
didResolveDomainName: (OFString *)domainName
- answerRecords: (of_dns_resolver_records_t)answerRecords
- authorityRecords: (of_dns_resolver_records_t)authorityRecords
- additionalRecords: (of_dns_resolver_records_t)additionalRecords
+ response: (OFDNSResponse *)response
exception: (id)exception
{
if (exception != nil) {
@@ -42,11 +40,8 @@ OF_APPLICATION_DELEGATE(OFDNS)
}
[of_stdout writeFormat: @"FQDN: %@\n"
- @"Answer records: %@\n"
- @"Authority records: %@\n"
- @"Additional records: %@\n",
- domainName, answerRecords, authorityRecords,
- additionalRecords];
+ @"Response: %@\n",
+ domainName, response];
[OFApplication terminate];
}