summaryrefslogtreecommitdiff
path: root/common/framework/com/android/net/module/util/NetworkStackConstants.java
diff options
context:
space:
mode:
authorAaron Huang <huangaaron@google.com>2021-03-10 18:15:55 +0800
committerAaron Huang <huangaaron@google.com>2021-03-16 00:02:50 +0800
commite0152d3458e850366a9d6a9bccb9872a365e0c9f (patch)
treeba53c8e420634f6efeced489b5b0a78c0636722a /common/framework/com/android/net/module/util/NetworkStackConstants.java
parent002ad52275d9aa810555dc291de1d850dc47bfb0 (diff)
downloadnet-e0152d3458e850366a9d6a9bccb9872a365e0c9f.tar.gz
Move some constants from TrafficStatsConstants to NetworkStackConstants
Keep the constants are only used by framework in TrafficStatsConstants and move the others to NetworkStackConstants which is in libs/net. Bug: 182349970 Test: FrameworksNetTests NetworkStackTests TetheringTests Ignore-AOSP-First: this topic needs to be cherry-picked manually to AOSP to avoid automerging differences. Change-Id: I7b3a6ba6283a72cc3f2a727001f0f581dce5a7c0
Diffstat (limited to 'common/framework/com/android/net/module/util/NetworkStackConstants.java')
-rw-r--r--common/framework/com/android/net/module/util/NetworkStackConstants.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/framework/com/android/net/module/util/NetworkStackConstants.java b/common/framework/com/android/net/module/util/NetworkStackConstants.java
index 499297c9..b7062e76 100644
--- a/common/framework/com/android/net/module/util/NetworkStackConstants.java
+++ b/common/framework/com/android/net/module/util/NetworkStackConstants.java
@@ -186,6 +186,27 @@ public final class NetworkStackConstants {
*/
public static final int VENDOR_SPECIFIC_IE_ID = 0xdd;
+
+ /**
+ * TrafficStats constants.
+ */
+ // These tags are used by the network stack to do traffic for its own purposes. Traffic
+ // tagged with these will be counted toward the network stack and must stay inside the
+ // range defined by
+ // {@link android.net.TrafficStats#TAG_NETWORK_STACK_RANGE_START} and
+ // {@link android.net.TrafficStats#TAG_NETWORK_STACK_RANGE_END}.
+ public static final int TAG_SYSTEM_DHCP = 0xFFFFFE01;
+ public static final int TAG_SYSTEM_NEIGHBOR = 0xFFFFFE02;
+ public static final int TAG_SYSTEM_DHCP_SERVER = 0xFFFFFE03;
+
+ // These tags are used by the network stack to do traffic on behalf of apps. Traffic
+ // tagged with these will be counted toward the app on behalf of which the network
+ // stack is doing this traffic. These values must stay inside the range defined by
+ // {@link android.net.TrafficStats#TAG_NETWORK_STACK_IMPERSONATION_RANGE_START} and
+ // {@link android.net.TrafficStats#TAG_NETWORK_STACK_IMPERSONATION_RANGE_END}.
+ public static final int TAG_SYSTEM_PROBE = 0xFFFFFF81;
+ public static final int TAG_SYSTEM_DNS = 0xFFFFFF82;
+
// TODO: Move to Inet4AddressUtils
// See aosp/1455936: NetworkStackConstants can't depend on it as it causes jarjar-related issues
// for users of both the net-utils-device-common and net-utils-framework-common libraries.