Commit 5ae344a5 authored by Daniel Salzman's avatar Daniel Salzman

libknot/pkt: make knot_pkt_parse_question public (for Knot Resolver)

parent 72e17a2d
......@@ -561,9 +561,12 @@ int knot_pkt_put_rotate(knot_pkt_t *pkt, uint16_t compr_hint, const knot_rrset_t
return KNOT_EOK;
}
static int parse_question(knot_pkt_t *pkt)
_public_
int knot_pkt_parse_question(knot_pkt_t *pkt)
{
assert(pkt);
if (pkt == NULL) {
return KNOT_EINVAL;
}
/* Check at least header size. */
if (pkt->size < KNOT_WIRE_HEADER_SIZE) {
......@@ -759,7 +762,7 @@ int knot_pkt_parse(knot_pkt_t *pkt, unsigned flags)
/* Reset parse state. */
sections_reset(pkt);
int ret = parse_question(pkt);
int ret = knot_pkt_parse_question(pkt);
if (ret == KNOT_EOK) {
ret = parse_payload(pkt, flags);
}
......
......@@ -304,6 +304,11 @@ static inline uint16_t knot_pkt_rr_offset(const knot_pktsection_t *section,
*/
int knot_pkt_parse(knot_pkt_t *pkt, unsigned flags);
/*!
* \brief Parse packet header and a QUESTION section.
*/
int knot_pkt_parse_question(knot_pkt_t *pkt);
/*!
* \brief Get packet extended RCODE.
*
......
......@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
ok(in != NULL, "pkt: create packet for parsing");
/* Read packet header. */
ret = parse_question(in);
ret = knot_pkt_parse_question(in);
is_int(KNOT_EOK, ret, "pkt: read header");
/* Read packet payload. */
......
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