ObjFW
OFDNSResponse.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 "OFDNSResourceRecord.h"
18 
19 OF_ASSUME_NONNULL_BEGIN
20 
21 @class OFArray OF_GENERIC(ObjectType);
22 @class OFDictionary OF_GENERIC(KeyType, ObjectType);
23 
24 typedef OFDictionary OF_GENERIC(OFString *, OFArray OF_GENERIC(
26 
33 {
34  OFString *_domainName;
35  of_dns_response_records_t _answerRecords;
36  of_dns_response_records_t _authorityRecords;
37  of_dns_response_records_t _additionalRecords;
38  OF_RESERVE_IVARS(OFDNSResponse, 4)
39 }
40 
44 @property (readonly, nonatomic) OFString *domainName;
45 
52 @property (readonly, nonatomic) of_dns_response_records_t answerRecords;
53 
60 @property (readonly, nonatomic) of_dns_response_records_t authorityRecords;
61 
68 @property (readonly, nonatomic) of_dns_response_records_t additionalRecords;
69 
79 + (instancetype)
80  responseWithDomainName: (OFString *)domainName
81  answerRecords: (of_dns_response_records_t)answerRecords
82  authorityRecords: (of_dns_response_records_t)authorityRecords
83  additionalRecords: (of_dns_response_records_t)additionalRecords;
84 
94 - (instancetype)
95  initWithDomainName: (OFString *)domainName
96  answerRecords: (of_dns_response_records_t)answerRecords
97  authorityRecords: (of_dns_response_records_t)authorityRecords
98  additionalRecords: (of_dns_response_records_t)additionalRecords
99  OF_DESIGNATED_INITIALIZER;
100 
101 - (instancetype)init OF_UNAVAILABLE;
102 @end
103 
104 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:92
A class representing a DNS resource record.
Definition: OFDNSResourceRecord.h:75
A class storing a response from OFDNSResolver.
Definition: OFDNSResponse.h:33
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:58
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class for handling strings.
Definition: OFString.h:132