return RCode::rcodes_s[rcode];
}
+std::string Opcode::to_s(uint8_t opcode) {
+ static std::vector<std::string> s_opcodes = { "Query", "IQuery", "Status", "3", "Notify", "Update" };
+
+ if (opcode >= s_opcodes.size()) {
+ return std::to_string(opcode);
+ }
+
+ return s_opcodes.at(opcode);
+}
+
class BoundsCheckingPointer
{
public:
{
public:
enum { Query=0, IQuery=1, Status=2, Notify=4, Update=5 };
+ static std::string to_s(uint8_t opcode);
};
// enum for policy decisions, used by both auth and recursor. Not all values supported everywhere.
std::multimap<struct timespec, string> out;
- boost::format fmt("%-7.1f %-47s %-12s %-5d %-25s %-5s %-6.1f %-2s %-2s %-2s %s\n");
+ boost::format fmt("%-7.1f %-47s %-12s %-5d %-25s %-5s %-6.1f %-2s %-2s %-2s %-s\n");
g_outputBuffer+= (fmt % "Time" % "Client" % "Server" % "ID" % "Name" % "Type" % "Lat." % "TC" % "RD" % "AA" % "Rcode").str();
if(msec==-1) {
dnmatch = c.name.isPartOf(*dn);
if(nmmatch && dnmatch) {
QType qt(c.qtype);
- out.insert(make_pair(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % "" % htons(c.dh.id) % c.name.toString() % qt.getName() % "" % (c.dh.tc ? "TC" : "") % (c.dh.rd? "RD" : "") % (c.dh.aa? "AA" : "") % "Question").str() )) ;
+ std::string extra;
+ if (c.dh.opcode != 0) {
+ extra = " (" + Opcode::to_s(c.dh.opcode) + ")";
+ }
+ out.insert(make_pair(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % "" % htons(c.dh.id) % c.name.toString() % qt.getName() % "" % (c.dh.tc ? "TC" : "") % (c.dh.rd? "RD" : "") % (c.dh.aa? "AA" : "") % ("Question" + extra)).str() )) ;
if(limit && *limit==++num)
break;