Add DnsSvcbRecord
This change is an initial implementation of DNS SVCB Record. It
can parse an SVCB Record in wire format.
The RDATA field of a SVCB Record is formatted as follows:
- SvcPriority: 2-byte field
- TargetName: a domain name that follows RFC1035 section 5.1
- SvcParams (optional): a list of SvcParam
This initial implementation focuses on the SvcParams related to DDR,
including alpn, port, ipv4hint, ipv6hint, and dohpath. For the other
SvcParams, such as mandatory and ech, this change doesn't check
whether their value is valid.
Bug: 240259333
Test: atest ConnectivityCoverageTests
Test: No test for DnsSvcbRecord for now. will add some tests in a
follow-up change
Change-Id: Icfe9b623eda8390c40b106123a718cdd2af3af99
diff --git a/staticlibs/Android.bp b/staticlibs/Android.bp
index 0bcb757..25a9291 100644
--- a/staticlibs/Android.bp
+++ b/staticlibs/Android.bp
@@ -96,12 +96,16 @@
srcs: [
"framework/**/DnsPacket.java",
"framework/**/DnsPacketUtils.java",
+ "framework/**/DnsSvcbRecord.java",
+ "framework/**/HexDump.java",
+ "framework/**/NetworkStackConstants.java",
],
sdk_version: "module_current",
visibility: [
"//packages/services/Iwlan:__subpackages__",
],
libs: [
+ "androidx.annotation_annotation",
"framework-annotations-lib",
"framework-connectivity.stubs.module_lib",
],