25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
OFString *
of_dns_resource_record_class_to_string(
of_dns_resource_record_class_t recordClass)
{
switch (recordClass) {
case OF_DNS_RESOURCE_RECORD_CLASS_IN:
return @"IN";
default:
return [OFString stringWithFormat: @"%u", recordClass];
}
}
OFString *
of_dns_resource_record_type_to_string(of_dns_resource_record_type_t recordType)
|
>
>
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
OFString *
of_dns_resource_record_class_to_string(
of_dns_resource_record_class_t recordClass)
{
switch (recordClass) {
case OF_DNS_RESOURCE_RECORD_CLASS_IN:
return @"IN";
case OF_DNS_RESOURCE_RECORD_CLASS_ANY:
return @"any";
default:
return [OFString stringWithFormat: @"%u", recordClass];
}
}
OFString *
of_dns_resource_record_type_to_string(of_dns_resource_record_type_t recordType)
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
return @"PTR";
case OF_DNS_RESOURCE_RECORD_TYPE_MX:
return @"MX";
case OF_DNS_RESOURCE_RECORD_TYPE_TXT:
return @"TXT";
case OF_DNS_RESOURCE_RECORD_TYPE_AAAA:
return @"AAAA";
default:
return [OFString stringWithFormat: @"%u", recordType];
}
}
@implementation OFDNSResourceRecord
@synthesize name = _name, recordClass = _recordClass, recordType = _recordType;
|
>
>
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
return @"PTR";
case OF_DNS_RESOURCE_RECORD_TYPE_MX:
return @"MX";
case OF_DNS_RESOURCE_RECORD_TYPE_TXT:
return @"TXT";
case OF_DNS_RESOURCE_RECORD_TYPE_AAAA:
return @"AAAA";
case OF_DNS_RESOURCE_RECORD_TYPE_ALL:
return @"all";
default:
return [OFString stringWithFormat: @"%u", recordType];
}
}
@implementation OFDNSResourceRecord
@synthesize name = _name, recordClass = _recordClass, recordType = _recordType;
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
return hash;
}
- (OFString *)description
{
return [OFString stringWithFormat:
@"<OFDNSResourceRecord:\n"
@"\tName = %@,\n"
@"\tClass = %@\n"
@"\tType = %@\n"
@"\tData = %@\n"
@"\tTTL = %" PRIu32 "\n"
@">",
_name, of_dns_resource_record_class_to_string(_recordClass),
of_dns_resource_record_type_to_string(_recordType), _data, _TTL];
}
@end
|
|
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
return hash;
}
- (OFString *)description
{
return [OFString stringWithFormat:
@"<OFDNSResourceRecord:\n"
@"\tName = %@\n"
@"\tClass = %@\n"
@"\tType = %@\n"
@"\tData = %@\n"
@"\tTTL = %" PRIu32 "\n"
@">",
_name, of_dns_resource_record_class_to_string(_recordClass),
of_dns_resource_record_type_to_string(_recordType), _data, _TTL];
}
@end
|