#include <llares.h>
Public Member Functions | |
LLQueryResponder () | |
bool | valid () const |
int | result () const |
const std::string & | query () const |
const dns_rrs_t & | answers () const |
const dns_rrs_t & | authorities () const |
const dns_rrs_t & | additional () const |
Protected Member Functions | |
int | parseRR (const char *buf, size_t len, const char *&pos, LLPointer< LLDnsRecord > &r) |
int | parseSection (const char *buf, size_t len, size_t count, const char *&pos, dns_rrs_t &rrs) |
void | queryResult (const char *buf, size_t len) |
virtual void | queryResult () |
Protected Attributes | |
int | mResult |
std::string | mQuery |
LLResType | mType |
dns_rrs_t | mAnswers |
dns_rrs_t | mAuthorities |
dns_rrs_t | mAdditional |
This class parses a DNS response and represents it in a friendly manner.
Definition at line 465 of file llares.h.
LLQueryResponder::LLQueryResponder | ( | ) |
Definition at line 164 of file llares.cpp.
int LLQueryResponder::parseRR | ( | const char * | buf, | |
size_t | len, | |||
const char *& | pos, | |||
LLPointer< LLDnsRecord > & | r | |||
) | [protected] |
Parse a single RR.
Definition at line 171 of file llares.cpp.
References LLAres::expandName(), llendl, llinfos, NULL, RES_A, RES_AAAA, RES_CNAME, RES_NS, RES_PTR, and RES_SRV.
Referenced by parseSection().
int LLQueryResponder::parseSection | ( | const char * | buf, | |
size_t | len, | |||
size_t | count, | |||
const char *& | pos, | |||
dns_rrs_t & | rrs | |||
) | [protected] |
Parse one section of a response.
Definition at line 248 of file llares.cpp.
References i, parseRR(), and r.
Referenced by queryResult().
void LLQueryResponder::queryResult | ( | const char * | buf, | |
size_t | len | |||
) | [protected, virtual] |
Reimplemented from LLAres::QueryResponder.
Definition at line 268 of file llares.cpp.
References LLAres::expandName(), i, llendl, llinfos, mAdditional, mAnswers, mAuthorities, mQuery, mResult, mType, parseSection(), LLAres::QueryResponder::queryError(), queryResult(), RES_A, RES_AAAA, RES_CNAME, RES_NS, RES_PTR, and RES_SRV.
void LLQueryResponder::queryResult | ( | ) | [protected, virtual] |
Reimplemented in LLAres::SrvResponder, and LLAres::UriRewriteResponder.
Definition at line 351 of file llares.cpp.
References llendl, and llinfos.
Referenced by queryResult().
bool LLQueryResponder::valid | ( | ) | const [inline] |
int LLQueryResponder::result | ( | ) | const [inline] |
const std::string& LLQueryResponder::query | ( | ) | const [inline] |
const dns_rrs_t& LLQueryResponder::answers | ( | ) | const [inline] |
const dns_rrs_t& LLQueryResponder::authorities | ( | ) | const [inline] |
Return the contents of the "authorities" section of the response.
Definition at line 517 of file llares.h.
References mAuthorities.
const dns_rrs_t& LLQueryResponder::additional | ( | ) | const [inline] |
Return the contents of the "additional records" section of the response.
Definition at line 523 of file llares.h.
References mAdditional.
int LLQueryResponder::mResult [protected] |
std::string LLQueryResponder::mQuery [protected] |
LLResType LLQueryResponder::mType [protected] |
Definition at line 470 of file llares.h.
Referenced by LLAres::UriRewriteResponder::queryResult(), LLAres::SrvResponder::queryResult(), and queryResult().
dns_rrs_t LLQueryResponder::mAnswers [protected] |
Definition at line 472 of file llares.h.
Referenced by answers(), LLAres::UriRewriteResponder::queryResult(), LLAres::SrvResponder::queryResult(), and queryResult().
dns_rrs_t LLQueryResponder::mAuthorities [protected] |
dns_rrs_t LLQueryResponder::mAdditional [protected] |