ObjFW
Loading...
Searching...
No Matches
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
24OF_ASSUME_NONNULL_BEGIN
25
28@class OFArray OF_GENERIC(ObjectType);
29@class OFData;
30
34typedef enum {
40
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;
97@property (readonly, nonatomic) OFDNSClass DNSClass;
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
127extern "C" {
128#endif
135extern OFString *_Nonnull OFDNSClassName(OFDNSClass DNSClass);
136
143extern OFString *_Nonnull OFDNSRecordTypeName(OFDNSRecordType recordType);
144
152extern OFDNSClass OFDNSClassParseName(OFString *_Nonnull string);
153
161extern OFDNSRecordType OFDNSRecordTypeParseName(OFString *_Nonnull string);
162#ifdef __cplusplus
163}
164#endif
165
166OF_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"
OFDNSRecordType
The type of a DNS resource record.
Definition OFDNSResourceRecord.h:44
@ OFDNSRecordTypeAll
Definition OFDNSResourceRecord.h:70
@ OFDNSRecordTypeTXT
Definition OFDNSResourceRecord.h:60
@ OFDNSRecordTypeLOC
Definition OFDNSResourceRecord.h:66
@ OFDNSRecordTypeSOA
Definition OFDNSResourceRecord.h:52
@ OFDNSRecordTypeCNAME
Definition OFDNSResourceRecord.h:50
@ OFDNSRecordTypePTR
Definition OFDNSResourceRecord.h:54
@ OFDNSRecordTypeA
Definition OFDNSResourceRecord.h:46
@ OFDNSRecordTypeRP
Definition OFDNSResourceRecord.h:62
@ OFDNSRecordTypeMX
Definition OFDNSResourceRecord.h:58
@ OFDNSRecordTypeAAAA
Definition OFDNSResourceRecord.h:64
@ OFDNSRecordTypeSRV
Definition OFDNSResourceRecord.h:68
@ OFDNSRecordTypeURI
Definition OFDNSResourceRecord.h:72
@ OFDNSRecordTypeHINFO
Definition OFDNSResourceRecord.h:56
@ OFDNSRecordTypeNS
Definition OFDNSResourceRecord.h:48
OFString * OFDNSClassName(OFDNSClass DNSClass)
Returns the name for the specified OFDNSClass.
Definition OFDNSResourceRecord.m:29
OFDNSClass OFDNSClassParseName(OFString *string)
Parses the specified string as an OFDNSClass.
Definition OFDNSResourceRecord.m:79
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
OFDNSClass
The DNS class.
Definition OFDNSResourceRecord.h:34
@ OFDNSClassAny
Definition OFDNSResourceRecord.h:38
@ OFDNSClassIN
Definition OFDNSResourceRecord.h:36
An abstract class for storing objects in an array.
Definition OFArray.h:109
A class representing a DNS resource record.
Definition OFDNSResourceRecord.h:82
A class for storing arbitrary data in an array.
Definition OFData.h:46
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:139
A protocol for the creation of copies.
Definition OFObject.h:1350