Delete dump_bytes() and its helper functions
This change removes dump_bytes() as well as bprint_* functions
which are used for debugging purpose. Instead, use netdutils Slice
for hex dump since it's simpler and safer.
Log example from res_pquery():
V resolv : ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37806
V resolv : ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
V resolv : ;; QUERY SECTION:
V resolv : ;; google.com, type = A, class = IN
V resolv :
V resolv : ;; ANSWER SECTION:
V resolv : ;; google.com. 4m59s IN A X.X.X.X
V resolv :
V resolv :
V resolv : ;; ADDITIONAL SECTION:
V resolv : ; EDNS: version: 0, udp=512, flags=8000
V resolv :
V resolv : Hex dump:
V resolv : 93ae8180000100010000000106676f6f676c6503636f6d0000010001c00c0001
V resolv : 00010000012b0004acd9a06e0000290200000080000000
For debugging, we can use scapy to parse the hex dump:
pkt = "93ae8180000100010000000106676f6f676c6503636f6d0000010001c00c000100010000012b0004acd9a06e0000290200000080000000"
DNS(pkt.decode("hex")).show2()
Bug: 130686826
Bug: 139332724
Test: adb shell service call dnsresolver 10 i32 0 &&
atest --include-subdirs packages/modules/DnsResolver
Test: debugging logs were printed correctly
Test: No PII logs are revealed in default log severity
Change-Id: Ia298ff3e4ce5c9ff42a1a84cf3e34a7bda818519
diff --git a/res_query.cpp b/res_query.cpp
index f4289e4..4bfdf04 100644
--- a/res_query.cpp
+++ b/res_query.cpp
@@ -86,6 +86,7 @@
#include <android-base/logging.h>
+#include "res_debug.h"
#include "resolv_cache.h"
#include "resolv_private.h"