Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 34433c66 authored by Mike Yu's avatar Mike Yu
Browse files

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
parent 3e829060
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment