Skip to content
Snippets Groups Projects
Commit 080c1495 authored by Robert Edmonds's avatar Robert Edmonds
Browse files

pkt: new function to return original wire format QNAME

This commit adds a new function knot_pkt_wire_qname() that returns the
QNAME in the wire format buffer. This is implemented the same as the
original knot_pkt_qname() function before this branch, but now that we
no longer modify the QNAME in the wire format buffer in-place, this
should now be the "original" QNAME as seen off the wire (if the packet
was parsed from a socket buffer).
parent 4520fca7
No related merge requests found
......@@ -188,6 +188,15 @@ static inline const knot_dname_t *knot_pkt_qname(const knot_pkt_t *pkt)
return pkt->lower_qname;
}
static inline const knot_dname_t *knot_pkt_wire_qname(const knot_pkt_t *pkt)
{
if (pkt == NULL || pkt->qname_size == 0) {
return NULL;
}
return pkt->wire + KNOT_WIRE_HEADER_SIZE;
}
static inline uint16_t knot_pkt_qtype(const knot_pkt_t *pkt)
{
if (pkt == NULL || pkt->qname_size == 0) {
......
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