ObjFW
OFDNSResourceRecord.h
Go to the documentation of this file.
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 "OFSocket.h"
22 #import "OFString.h"
23 
24 OF_ASSUME_NONNULL_BEGIN
25 
28 @class OFArray OF_GENERIC(ObjectType);
29 @class OFData;
30 
34 typedef enum {
39 } OFDNSClass;
40 
44 typedef enum {
74 
81 {
82  OFString *_name;
83  OFDNSClass _DNSClass;
84  OFDNSRecordType _recordType;
85  uint32_t _TTL;
86  OF_RESERVE_IVARS(OFDNSResourceRecord, 4)
87 }
88 
92 @property (readonly, nonatomic) OFString *name;
93 
97 @property (readonly, nonatomic) OFDNSClass DNSClass;
98 
102 @property (readonly, nonatomic) OFDNSRecordType recordType;
108 @property (readonly, nonatomic) uint32_t TTL;
120 - (instancetype)initWithName: (OFString *)name
121  DNSClass: (OFDNSClass)DNSClass
122  recordType: (OFDNSRecordType)recordType
123  TTL: (uint32_t)TTL OF_DESIGNATED_INITIALIZER;
124 @end
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
129 
135 extern OFString *_Nonnull OFDNSClassName(OFDNSClass DNSClass);
136 
143 extern OFString *_Nonnull OFDNSRecordTypeName(OFDNSRecordType recordType);
144 
152 extern OFDNSClass OFDNSClassParseName(OFString *_Nonnull string);
153 
161 extern OFDNSRecordType OFDNSRecordTypeParseName(OFString *_Nonnull string);
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 OF_ASSUME_NONNULL_END
167 
168 #import "OFAAAADNSResourceRecord.h"
169 #import "OFADNSResourceRecord.h"
170 #import "OFCNAMEDNSResourceRecord.h"
171 #import "OFHINFODNSResourceRecord.h"
172 #import "OFLOCDNSResourceRecord.h"
173 #import "OFMXDNSResourceRecord.h"
174 #import "OFNSDNSResourceRecord.h"
175 #import "OFPTRDNSResourceRecord.h"
176 #import "OFRPDNSResourceRecord.h"
177 #import "OFSOADNSResourceRecord.h"
178 #import "OFSRVDNSResourceRecord.h"
179 #import "OFTXTDNSResourceRecord.h"
180 #import "OFURIDNSResourceRecord.h"
Definition: OFDNSResourceRecord.h:60
An abstract class for storing objects in an array.
Definition: OFArray.h:107
Definition: OFDNSResourceRecord.h:36
Definition: OFDNSResourceRecord.h:48
Definition: OFDNSResourceRecord.h:50
OFDNSClass
The DNS class.
Definition: OFDNSResourceRecord.h:34
Definition: OFDNSResourceRecord.h:72
Definition: OFDNSResourceRecord.h:52
A class representing a DNS resource record.
Definition: OFDNSResourceRecord.h:80
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
Definition: OFDNSResourceRecord.h:62
Definition: OFDNSResourceRecord.h:64
Definition: OFDNSResourceRecord.h:66
Definition: OFDNSResourceRecord.h:68
A class for handling strings.
Definition: OFString.h:142
OFString * OFDNSClassName(OFDNSClass DNSClass)
Returns the name for the specified OFDNSClass.
Definition: OFDNSResourceRecord.m:29
Definition: OFDNSResourceRecord.h:46
Definition: OFDNSResourceRecord.h:38
OFDNSRecordType
The type of a DNS resource record.
Definition: OFDNSResourceRecord.h:44
Definition: OFDNSResourceRecord.h:56
A protocol for the creation of copies.
Definition: OFObject.h:1350
A class for storing arbitrary data in an array.
Definition: OFData.h:45
OFDNSClass OFDNSClassParseName(OFString *string)
Parses the specified string as an OFDNSClass.
Definition: OFDNSResourceRecord.m:79
Definition: OFDNSResourceRecord.h:54
Definition: OFDNSResourceRecord.h:70
Definition: OFDNSResourceRecord.h:58
OFDNSRecordType OFDNSRecordTypeParseName(OFString *string)
Parses the specified string as an OFDNSRecordType.
Definition: OFDNSResourceRecord.m:99
OFString * OFDNSRecordTypeName(OFDNSRecordType recordType)
Returns the name for the specified OFDNSRecordType.
Definition: OFDNSResourceRecord.m:42