Stop depend on libnetd_client_header am: 829511c71b

Change-Id: Iaca2ff8ac64d3ba21e428c2b34d4d7e81e37da07
diff --git a/Android.bp b/Android.bp
index f392e14..03af8d4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -10,6 +10,11 @@
     export_include_dirs: ["."],
 }
 
+cc_library_headers {
+    name: "dnsproxyd_protocol_headers",
+    export_include_dirs: ["include/dnsproxyd_protocol"],
+}
+
 aidl_interface {
     name: "dnsresolver_aidl_interface",
     local_include_dir: "binder",
@@ -148,7 +153,7 @@
         "libssl",
     ],
     header_libs: [
-        "libnetd_client_headers",
+        "libnetdbinder_utils_headers",
     ],
     runtime_libs: [
         // Causes the linkerconfig to create a namespace link from resolv to the
diff --git a/Dns64Configuration.cpp b/Dns64Configuration.cpp
index 115fc51..77a27e7 100644
--- a/Dns64Configuration.cpp
+++ b/Dns64Configuration.cpp
@@ -24,7 +24,6 @@
 #include <netdutils/DumpWriter.h>
 #include <netdutils/InternetAddresses.h>
 #include <netdutils/ThreadUtil.h>
-#include <netid_client.h>
 #include <thread>
 #include <utility>
 
diff --git a/DnsProxyListener.cpp b/DnsProxyListener.cpp
index f7e4852..c13b627 100644
--- a/DnsProxyListener.cpp
+++ b/DnsProxyListener.cpp
@@ -34,7 +34,6 @@
 #include <algorithm>
 #include <vector>
 
-#include <NetdClient.h>  // NETID_USE_LOCAL_NAMESERVERS
 #include <android-base/stringprintf.h>
 #include <android/multinetwork.h>  // ResNsendFlags
 #include <cutils/misc.h>           // FIRST_APPLICATION_UID
@@ -53,6 +52,7 @@
 #include "NetdPermissions.h"
 #include "PrivateDnsConfiguration.h"
 #include "ResolverEventReporter.h"
+#include "dnsproxyd_protocol/DnsProxydProtocol.h"  // NETID_USE_LOCAL_NAMESERVERS
 #include "getaddrinfo.h"
 #include "gethnamaddr.h"
 #include "res_send.h"
diff --git a/include/dnsproxyd_protocol/DnsProxydProtocol.h b/include/dnsproxyd_protocol/DnsProxydProtocol.h
new file mode 100644
index 0000000..5e6b16b
--- /dev/null
+++ b/include/dnsproxyd_protocol/DnsProxydProtocol.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#pragma once
+
+/*
+ * This value should not be changed.
+ * It's a flag used in both DnsProxyListener.cpp and NetdClient.cpp
+ * to identify if bypassing DoT is available.
+ * This flag must be kept in sync with the Network#getNetIdForResolv() usage.
+ */
+#define NETID_USE_LOCAL_NAMESERVERS 0x80000000
diff --git a/tests/Android.bp b/tests/Android.bp
index aa66c41..6d4422d 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -153,6 +153,7 @@
         "resolv_integration_test.cpp",
     ],
     header_libs: [
+        "dnsproxyd_protocol_headers",
         "libnetd_resolv_headers",
     ],
     // TODO: make static link libc++ work.
diff --git a/tests/resolv_integration_test.cpp b/tests/resolv_integration_test.cpp
index 5d05eb3..bf26174 100644
--- a/tests/resolv_integration_test.cpp
+++ b/tests/resolv_integration_test.cpp
@@ -53,6 +53,7 @@
 #include <numeric>
 #include <thread>
 
+#include <DnsProxydProtocol.h>  // NETID_USE_LOCAL_NAMESERVERS
 #include <aidl/android/net/IDnsResolver.h>
 #include <android/binder_manager.h>
 #include <android/binder_process.h>