This file defines the response type. More...
#include "config.h"
#include "iterator/iter_resptype.h"
#include "iterator/iter_delegpt.h"
#include "iterator/iterator.h"
#include "services/cache/dns.h"
#include "util/net_help.h"
#include "util/data/dname.h"
#include "sldns/rrdef.h"
#include "sldns/pkthdr.h"
Functions | |
enum response_type | response_type_from_cache (struct dns_msg *msg, struct query_info *request) |
Classifies a response message from cache based on the current request. More... | |
enum response_type | response_type_from_server (int rdset, struct dns_msg *msg, struct query_info *request, struct delegpt *dp, int *empty_nodata_found) |
Classifies a response message (from the wire) based on the current request. More... | |
This file defines the response type.
DNS Responses can be classified as one of the response types.
enum response_type response_type_from_cache | ( | struct dns_msg * | msg, |
struct query_info * | request | ||
) |
Classifies a response message from cache based on the current request.
Note that this routine assumes that THROWAWAY or LAME responses will not occur. Also, it will not detect REFERRAL type messages, since those are (currently) automatically classified based on how they came from the cache (findDelegation() instead of lookup()).
msg | the message from the cache. |
request | the request that generated the response. |
References reply_info::flags, FLAGS_GET_RCODE, and dns_msg::rep.
enum response_type response_type_from_server | ( | int | rdset, |
struct dns_msg * | msg, | ||
struct query_info * | request, | ||
struct delegpt * | dp, | ||
int * | empty_nodata_found | ||
) |
Classifies a response message (from the wire) based on the current request.
NOTE: currently this routine uses the AA bit in the response to help distinguish between some non-standard referrals and answers. It also relies somewhat on the originating zone to be accurate (for lameness detection, mostly).
rdset | if RD bit was sent in query sent by unbound. |
msg | the message from the cache. |
request | the request that generated the response. |
dp | The delegation point that was being queried when the response was returned. |
empty_nodata_found | flag to keep track of empty nodata detection. |
Referenced by processPrimeResponse(), and processQueryResponse().