axl_bool ext_dns_message_add_answer ( extDnsCtx ctx,
extDnsMessage message,
extDnsType  type,
extDnsClass  class,
const char *  name,
int  ttl,
const char *  content 
)

Allows to add an additional answer record to the provided message.

The message must be a reply (ext_dns_message_is_query).

Parameters
ctxThe context where the message to buffer will take place.
messageThe reply to be updated with the provided values.
typeThe answer record type.
classThe answer record class.
nameThe answer record name.
ttlThe record ttl value.
contentThe record content to be configured. The following are supported formats for content:
Record type Content
A ipv4
AAAA ipv6
CNAME host domain name
SOA <mname> <rname> <serial> <retry> <expire>
; check RFC1035, page 19 for more information.
MX <preference>
; where <preference> is a number and <mailer> is the mailer hostname
NS host domain name
Returns
axl_true if the answer was added to the reply, otherwise, axl_false is returned. The function also returns axl_false when the value provided doesn't match the type. For example, if extDnsTypeA is provided, content must have a valid IPv4 value.

References _extDnsHeader::answer_count, _extDnsMessage::answers, _extDnsResourceRecord::class, extDnsTypeA, extDnsTypeMX, extDnsTypeSOA, _extDnsMessage::header, _extDnsResourceRecord::mname, _extDnsResourceRecord::name, _extDnsResourceRecord::name_content, _extDnsResourceRecord::preference, _extDnsResourceRecord::rdata, _extDnsResourceRecord::rdlength, _extDnsResourceRecord::target, _extDnsResourceRecord::ttl, and _extDnsResourceRecord::type.

Referenced by ext_dns_message_add_answer_from_msg(), ext_dns_message_add_cname_reply(), ext_dns_message_add_ipv4_reply(), ext_dns_message_add_mx_reply(), ext_dns_message_add_ns_reply(), and ext_dns_message_add_soa_reply().