|
@@ -54,7 +54,6 @@ private:
|
|
|
bool req_is_sig0_; // signed with valid SIG(0)
|
|
|
bool req_is_badsig_; // signed but bad signature
|
|
|
// response attributes
|
|
|
- bool answer_sent_; // DNS message has sent
|
|
|
bool res_is_truncated_; // DNS message is truncated
|
|
|
public:
|
|
|
/// \brief The constructor.
|
|
@@ -62,120 +61,76 @@ public:
|
|
|
/// This constructor is mostly exception free. But it may still throw
|
|
|
/// a standard exception if memory allocation fails inside the method.
|
|
|
///
|
|
|
- inline QRAttributes();
|
|
|
+ inline QRAttributes() :
|
|
|
+ req_ip_version_(0), req_transport_protocol_(0),
|
|
|
+ req_opcode_(0),
|
|
|
+ req_is_edns_0_(false), req_is_edns_badver_(false),
|
|
|
+ req_is_dnssec_ok_(false),
|
|
|
+ req_is_tsig_(false), req_is_sig0_(false), req_is_badsig_(false),
|
|
|
+ res_is_truncated_(false)
|
|
|
+ {};
|
|
|
|
|
|
/// \brief The destructor.
|
|
|
///
|
|
|
/// This method never throws an exception.
|
|
|
///
|
|
|
- inline ~QRAttributes();
|
|
|
-
|
|
|
+ inline ~QRAttributes() {};
|
|
|
/// \brief Set query opcode.
|
|
|
/// \throw None
|
|
|
- inline void setQueryOpCode(const int opcode);
|
|
|
-
|
|
|
+ inline void setQueryOpCode(const int opcode) {
|
|
|
+ req_opcode_ = opcode;
|
|
|
+ };
|
|
|
/// \brief Set IP version carrying a query.
|
|
|
/// \throw None
|
|
|
- inline void setQueryIPVersion(const int ip_version);
|
|
|
-
|
|
|
+ inline void setQueryIPVersion(const int ip_version) {
|
|
|
+ req_ip_version_ = ip_version;
|
|
|
+ };
|
|
|
/// \brief Set transport protocol carrying a query.
|
|
|
/// \throw None
|
|
|
- inline void setQueryTransportProtocol(const int transport_protocol);
|
|
|
-
|
|
|
+ inline void setQueryTransportProtocol(const int transport_protocol) {
|
|
|
+ req_transport_protocol_ = transport_protocol;
|
|
|
+ };
|
|
|
/// \brief Set query EDNS attributes.
|
|
|
/// \throw None
|
|
|
- inline void setQueryEDNS(const bool is_edns_0, const bool is_edns_badver);
|
|
|
-
|
|
|
+ inline void setQueryEDNS(const bool is_edns_0, const bool is_edns_badver) {
|
|
|
+ req_is_edns_0_ = is_edns_0;
|
|
|
+ req_is_edns_badver_ = is_edns_badver;
|
|
|
+ };
|
|
|
/// \brief Set query DO bit.
|
|
|
/// \throw None
|
|
|
- inline void setQueryDO(const bool is_dnssec_ok);
|
|
|
-
|
|
|
+ inline void setQueryDO(const bool is_dnssec_ok) {
|
|
|
+ req_is_dnssec_ok_ = is_dnssec_ok;
|
|
|
+ };
|
|
|
/// \brief Set query TSIG attributes.
|
|
|
/// \throw None
|
|
|
inline void setQuerySig(const bool is_tsig, const bool is_sig0,
|
|
|
- const bool is_badsig);
|
|
|
-
|
|
|
- /// \brief Set zone origin.
|
|
|
- /// \throw None
|
|
|
- inline void setOrigin(const std::string& origin);
|
|
|
-
|
|
|
+ const bool is_badsig)
|
|
|
+ {
|
|
|
+ req_is_tsig_ = is_tsig;
|
|
|
+ req_is_sig0_ = is_sig0;
|
|
|
+ req_is_badsig_ = is_badsig;
|
|
|
+ };
|
|
|
/// \brief Set if the response is truncated.
|
|
|
/// \throw None
|
|
|
- inline void setResponseTruncated(const bool is_truncated);
|
|
|
-
|
|
|
+ inline void setResponseTruncated(const bool is_truncated) {
|
|
|
+ res_is_truncated_ = is_truncated;
|
|
|
+ };
|
|
|
/// \brief Reset attributes.
|
|
|
/// \throw None
|
|
|
- inline void reset();
|
|
|
+ inline void reset() {
|
|
|
+ req_ip_version_ = 0;
|
|
|
+ req_transport_protocol_ = 0;
|
|
|
+ req_opcode_ = 0;
|
|
|
+ req_is_edns_0_ = false;
|
|
|
+ req_is_edns_badver_ = false;
|
|
|
+ req_is_dnssec_ok_ = false;
|
|
|
+ req_is_tsig_ = false;
|
|
|
+ req_is_sig0_ = false;
|
|
|
+ req_is_badsig_ = false;
|
|
|
+ res_is_truncated_ = false;
|
|
|
+ };
|
|
|
};
|
|
|
|
|
|
-inline QRAttributes::QRAttributes() :
|
|
|
- req_ip_version_(0), req_transport_protocol_(0),
|
|
|
- req_opcode_(0),
|
|
|
- req_is_edns_0_(false), req_is_edns_badver_(false),
|
|
|
- req_is_dnssec_ok_(false),
|
|
|
- req_is_tsig_(false), req_is_sig0_(false), req_is_badsig_(false),
|
|
|
- answer_sent_(false),
|
|
|
- res_is_truncated_(false)
|
|
|
-{}
|
|
|
-
|
|
|
-inline QRAttributes::~QRAttributes()
|
|
|
-{}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQueryIPVersion(const int ip_version) {
|
|
|
- req_ip_version_ = ip_version;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQueryTransportProtocol(const int transport_protocol) {
|
|
|
- req_transport_protocol_ = transport_protocol;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQueryOpCode(const int opcode) {
|
|
|
- req_opcode_ = opcode;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQueryEDNS(const bool is_edns_0, const bool is_edns_badver) {
|
|
|
- req_is_edns_0_ = is_edns_0;
|
|
|
- req_is_edns_badver_ = is_edns_badver;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQueryDO(const bool is_dnssec_ok) {
|
|
|
- req_is_dnssec_ok_ = is_dnssec_ok;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setQuerySig(const bool is_tsig, const bool is_sig0,
|
|
|
- const bool is_badsig)
|
|
|
-{
|
|
|
- req_is_tsig_ = is_tsig;
|
|
|
- req_is_sig0_ = is_sig0;
|
|
|
- req_is_badsig_ = is_badsig;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::setResponseTruncated(const bool is_truncated) {
|
|
|
- res_is_truncated_ = is_truncated;
|
|
|
-}
|
|
|
-
|
|
|
-inline void
|
|
|
-QRAttributes::reset() {
|
|
|
- req_ip_version_ = 0;
|
|
|
- req_transport_protocol_ = 0;
|
|
|
- req_opcode_ = 0;
|
|
|
- req_is_edns_0_ = false;
|
|
|
- req_is_edns_badver_ = false;
|
|
|
- req_is_dnssec_ok_ = false;
|
|
|
- req_is_tsig_ = false;
|
|
|
- req_is_sig0_ = false;
|
|
|
- req_is_badsig_ = false;
|
|
|
- answer_sent_ = false;
|
|
|
- res_is_truncated_ = false;
|
|
|
-}
|
|
|
-
|
|
|
/// \brief Set of query counters.
|
|
|
///
|
|
|
/// \c Counters is set of query counters class. It holds query counters
|