iter_scrub.h File Reference

This file has routine(s) for cleaning up incoming DNS messages from possible useless or malicious junk in it. More...

Functions

int scrub_message (struct sldns_buffer *pkt, struct msg_parse *msg, struct query_info *qinfo, uint8_t *zonename, struct regional *regional, struct module_env *env, struct module_qstate *qstate, struct iter_env *ie)
 Cleanup the passed dns message. More...
 

Detailed Description

This file has routine(s) for cleaning up incoming DNS messages from possible useless or malicious junk in it.

Function Documentation

◆ scrub_message()

int scrub_message ( struct sldns_buffer pkt,
struct msg_parse msg,
struct query_info qinfo,
uint8_t *  zonename,
struct regional regional,
struct module_env env,
struct module_qstate qstate,
struct iter_env ie 
)

Cleanup the passed dns message.

Parameters
pktthe packet itself, for resolving name compression pointers. the packet buffer is unaltered.
msgthe parsed packet, this structure is cleaned up.
qinfothe query info that was sent to the server. Checked.
zonenamethe name of the last delegation point. Used to determine out of bailiwick information.
regionalwhere to allocate (new) parts of the message.
envmodule environment with config settings and cache.
qstatefor setting errinf for EDE error messages.
ieiterator module environment data.
Returns
: false if the message is total waste. true if scrubbed with success.

References BIT_AD, BIT_QR, BIT_Z, msg_parse::flags, FLAGS_GET_RCODE, LDNS_RR_TYPE_NS, log_nametypeclass(), query_info::qclass, msg_parse::qdcount, and VERB_ALGO.