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

dt_message_fill(): support AUTH_QUERY, AUTH_RESPONSE

parent da5feec3
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,6 @@ int dt_message_fill(Dnstap__Message *m,
memset(m, 0, sizeof(*m));
m->base.descriptor = &dnstap__message__descriptor;
if (type != DNSTAP__MESSAGE__TYPE__TOOL_QUERY &&
type != DNSTAP__MESSAGE__TYPE__TOOL_RESPONSE)
{
return KNOT_EINVAL;
}
// Message.type
m->type = type;
......@@ -92,12 +86,16 @@ int dt_message_fill(Dnstap__Message *m,
}
m->has_socket_protocol = 1;
if (type == DNSTAP__MESSAGE__TYPE__TOOL_QUERY) {
if (type == DNSTAP__MESSAGE__TYPE__AUTH_QUERY ||
type == DNSTAP__MESSAGE__TYPE__TOOL_QUERY)
{
// Message.query_message
m->query_message.len = len_wire;
m->query_message.data = (uint8_t *)wire;
m->has_query_message = 1;
} else if (type == DNSTAP__MESSAGE__TYPE__TOOL_RESPONSE) {
} else if (type == DNSTAP__MESSAGE__TYPE__AUTH_RESPONSE ||
type == DNSTAP__MESSAGE__TYPE__TOOL_RESPONSE)
{
// Message.response_message
m->response_message.len = len_wire;
m->response_message.data = (uint8_t *)wire;
......
......@@ -36,14 +36,10 @@
/*!
* \brief Fill a Dnstap__Message structure with the given parameters.
*
* Supported message types:
* \c DNSTAP__MESSAGE__TYPE__TOOL_QUERY
* \c DNSTAP__MESSAGE__TYPE__TOOL_RESPONSE
*
* \param[out] m
* Dnstap__Message structure to fill. Will be zeroed first.
* \param type
* One of the supported message type values.
* One of the DNSTAP__MESSAGE__TYPE__* values.
* \param response_sa
* sockaddr_in or sockaddr_in6 to use when filling the 'socket_family',
* 'response_address', 'response_port' fields.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment