Commit c23c0da9 authored by Lubos Slovak's avatar Lubos Slovak

Getters for QNAME, QTYPE, QCLASS.

refs #5
parent 10ad03ed
......@@ -667,6 +667,27 @@ int dnslib_response_parse_query(dnslib_response_t *resp,
/*----------------------------------------------------------------------------*/
const dnslib_dname_t *dnslib_response_qname(const dnslib_response_t *response)
{
return response->question.qname;
}
/*----------------------------------------------------------------------------*/
const uint16_t dnslib_response_qtype(const dnslib_response_t *response)
{
return response->question.qtype;
}
/*----------------------------------------------------------------------------*/
const uint16_t dnslib_response_qclass(const dnslib_response_t *response)
{
return response->question.qclass;
}
/*----------------------------------------------------------------------------*/
int dnslib_response_add_rrset_answer(dnslib_response_t *response,
const dnslib_rrset_t *rrset, int tc)
{
......
......@@ -188,6 +188,33 @@ dnslib_response_t *dnslib_response_new_empty(const uint8_t *edns_wire,
int dnslib_response_parse_query(dnslib_response_t *response,
const uint8_t *query_wire, size_t query_size);
/*!
* \brief Returns the QNAME from the response.
*
* \param response Response to get the QNAME from.
*
* \return QNAME stored in the response.
*/
const dnslib_dname_t *dnslib_response_qname(const dnslib_response_t *response);
/*!
* \brief Returns the QTYPE from the response.
*
* \param response Response to get the QTYPE from.
*
* \return QTYPE stored in the response.
*/
const uint16_t dnslib_response_qtype(const dnslib_response_t *response);
/*!
* \brief Returns the QCLASS from the response.
*
* \param response Response to get the QCLASS from.
*
* \return QCLASS stored in the response.
*/
const uint16_t dnslib_response_qclass(const dnslib_response_t *response);
/*!
* \brief Adds a RRSet to the Answer section of the response.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment