@@ -31,33 +31,45 @@ * * @brief A class storing a response from @ref OFDNSResolver. */ @interface OFDNSResponse: OFObject { - of_dns_response_records_t _Nullable _answerRecords; - of_dns_response_records_t _Nullable _authorityRecords; - of_dns_response_records_t _Nullable _additionalRecords; + OFString *_domainName; + of_dns_response_records_t _answerRecords; + of_dns_response_records_t _authorityRecords; + of_dns_response_records_t _additionalRecords; OF_RESERVE_IVARS(4) } +/*! + * @brief The domain name of the response. + */ +@property (readonly, nonatomic) OFString *domainName; + /*! * @brief The answer records of the response. + * + * This is a dictionary with the key being the domain name and the value being + * an array of @ref OFDNSResourceRecord. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_dns_response_records_t answerRecords; +@property (readonly, nonatomic) of_dns_response_records_t answerRecords; /*! * @brief The authority records of the response. + * + * This is a dictionary with the key being the domain name and the value being + * an array of @ref OFDNSResourceRecord. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_dns_response_records_t authorityRecords; +@property (readonly, nonatomic) of_dns_response_records_t authorityRecords; /*! * @brief The additional records of the response. + * + * This is a dictionary with the key being the domain name and the value being + * an array of @ref OFDNSResourceRecord. */ -@property OF_NULLABLE_PROPERTY (readonly, nonatomic) - of_dns_response_records_t additionalRecords; +@property (readonly, nonatomic) of_dns_response_records_t additionalRecords; /*! * @brief Creates a new, autoreleased OFDNSResponse. * * @param answerRecords The answer records of the response @@ -64,15 +76,14 @@ * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return A new, autoreleased OFDNSResponse */ + (instancetype) - responseWithAnswerRecords: (nullable of_dns_response_records_t)answerRecords - authorityRecords: (nullable of_dns_response_records_t) - authorityRecords - additionalRecords: (nullable of_dns_response_records_t) - additionalRecords; + responseWithDomainName: (OFString *)domainName + answerRecords: (of_dns_response_records_t)answerRecords + authorityRecords: (of_dns_response_records_t)authorityRecords + additionalRecords: (of_dns_response_records_t)additionalRecords; /*! * @brief Initializes an already allocated OFDNSResponse. * * @param answerRecords The answer records of the response @@ -79,14 +90,15 @@ * @param authorityRecords The authority records of the response * @param additionalRecords The additional records of the response * @return An initialized OFDNSResponse */ - (instancetype) - initWithAnswerRecords: (nullable of_dns_response_records_t)answerRecords - authorityRecords: (nullable of_dns_response_records_t)authorityRecords - additionalRecords: (nullable of_dns_response_records_t)additionalRecords + initWithDomainName: (OFString *)domainName + answerRecords: (of_dns_response_records_t)answerRecords + authorityRecords: (of_dns_response_records_t)authorityRecords + additionalRecords: (of_dns_response_records_t)additionalRecords OF_DESIGNATED_INITIALIZER; - (instancetype)init OF_UNAVAILABLE; @end OF_ASSUME_NONNULL_END