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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
|
@implementation TestsAppDelegate (OFDNSResolverTests)
- (void)DNSResolverTests
{
void *pool = objc_autoreleasePoolPush();
OFDNSResolver *resolver = [OFDNSResolver resolver];
OFMutableString *staticHosts = [OFMutableString string];
[of_stdout setForegroundColor: [OFColor lime]];
[OFStdOut setForegroundColor: [OFColor lime]];
for (OFString *host in resolver.staticHosts) {
OFString *IPs;
if (staticHosts.length > 0)
[staticHosts appendString: @"; "];
IPs = [[resolver.staticHosts objectForKey: host]
componentsJoinedByString: @", "];
[staticHosts appendFormat: @"%@=(%@)", host, IPs];
}
[of_stdout writeFormat: @"[OFDNSResolver] Static hosts: %@\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Static hosts: %@\n",
staticHosts];
[of_stdout writeFormat: @"[OFDNSResolver] Name servers: %@\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Name servers: %@\n",
[resolver.nameServers componentsJoinedByString: @", "]];
[of_stdout writeFormat: @"[OFDNSResolver] Local domain: %@\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Local domain: %@\n",
resolver.localDomain];
[of_stdout writeFormat: @"[OFDNSResolver] Search domains: %@\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Search domains: %@\n",
[resolver.searchDomains componentsJoinedByString: @", "]];
[of_stdout writeFormat: @"[OFDNSResolver] Timeout: %lf\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Timeout: %lf\n",
resolver.timeout];
[of_stdout writeFormat: @"[OFDNSResolver] Max attempts: %u\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Max attempts: %u\n",
resolver.maxAttempts];
[of_stdout writeFormat:
[OFStdOut writeFormat:
@"[OFDNSResolver] Min number of dots in absolute name: %u\n",
resolver.minNumberOfDotsInAbsoluteName];
[of_stdout writeFormat: @"[OFDNSResolver] Uses TCP: %u\n",
[OFStdOut writeFormat: @"[OFDNSResolver] Uses TCP: %u\n",
resolver.usesTCP];
[of_stdout writeFormat:
[OFStdOut writeFormat:
@"[OFDNSResolver] Config reload interval: %lf\n",
resolver.configReloadInterval];
objc_autoreleasePoolPop(pool);
}
@end
|