Add SVCB and HTTPS types and reduce code duplication

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-12-31 10:36:27 +01:00
parent cef3a25b71
commit fa2279d473
3 changed files with 47 additions and 37 deletions

View File

@@ -405,4 +405,45 @@ function returnError($message = "", $json = true)
}
}
function getQueryTypeStr($querytype)
{
$qtype = intval($querytype);
switch ($qtype) {
case 1:
return "A (IPv4)";
case 2:
return "AAAA (IPv6)";
case 3:
return "ANY";
case 4:
return "SRV";
case 5:
return "SOA";
case 6:
return "PTR";
case 7:
return "TXT";
case 8:
return "NAPTR";
case 9:
return "MX";
case 10:
return "DS";
case 11:
return "RRSIG";
case 12:
return "DNSKEY";
case 13:
return "NS";
case 14:
return "OTHER";
case 15:
return "SVCB";
case 16:
return "HTTPS";
default:
return "UNKN (".$qtype.")";
}
}
?>