3 #include <boost/tuple/tuple.hpp>
4 #include <boost/tuple/tuple_comparison.hpp>
6 #include <netinet/ip.h>
7 #include <netinet/udp.h>
8 #include "dnsparser.hh"
10 #include "namespaces.hh"
12 struct QuestionIdentifier
17 bool operator<(const QuestionIdentifier& rhs) const
20 tie(d_source, d_dest, d_qname, d_qtype, d_id) <
21 tie(rhs.d_source, rhs.d_dest, rhs.d_qname, rhs.d_qtype, rhs.d_id);
24 // the canonical direction is that of the question
25 static QuestionIdentifier create(const ComboAddress& src, const ComboAddress& dst, const MOADNSParser& mdp)
27 QuestionIdentifier ret;
37 ret.d_qname=mdp.d_qname;
38 ret.d_qtype=mdp.d_qtype;
39 ret.d_id=mdp.d_header.id;
43 ComboAddress d_source, d_dest;
50 inline ostream& operator<<(ostream &s, const QuestionIdentifier& qi)
52 s<< "'"<<qi.d_qname<<"|"<<DNSRecordContent::NumberToType(qi.d_qtype)<<"', with id " << qi.d_id <<" from "<<qi.d_source.toStringWithPort();
54 s<<" to " << qi.d_dest.toStringWithPort();