summaryrefslogtreecommitdiff
path: root/service-t/src/com/android/server/net/StatsMapKey.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-02-04 23:39:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-02-04 23:39:29 +0000
commit4a53677d10c32529e4a0639fbd0bc9d96b6a89ae (patch)
tree1b5a5eba472b82522993914489b57f511d6c93fa /service-t/src/com/android/server/net/StatsMapKey.java
parenteac7dc0e8d1b25b344c47fdf53c5aa14799a0c7a (diff)
parentfc3b420236653939a09a9fd5ce3bf9785e1300a9 (diff)
Merge "Add key / value data structures for IBpfMaps"
Diffstat (limited to 'service-t/src/com/android/server/net/StatsMapKey.java')
-rw-r--r--service-t/src/com/android/server/net/StatsMapKey.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/service-t/src/com/android/server/net/StatsMapKey.java b/service-t/src/com/android/server/net/StatsMapKey.java
new file mode 100644
index 0000000000..ea8d836383
--- /dev/null
+++ b/service-t/src/com/android/server/net/StatsMapKey.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+package com.android.server.net;
+
+import com.android.net.module.util.Struct;
+import com.android.net.module.util.Struct.Field;
+import com.android.net.module.util.Struct.Type;
+
+/**
+ * Key for both stats maps.
+ */
+public class StatsMapKey extends Struct {
+ @Field(order = 0, type = Type.U32)
+ public final long uid;
+
+ @Field(order = 1, type = Type.U32)
+ public final long tag;
+
+ @Field(order = 2, type = Type.U32)
+ public final long counterSet;
+
+ @Field(order = 3, type = Type.U32)
+ public final long ifaceIndex;
+
+ public StatsMapKey(final long uid, final long tag, final long counterSet,
+ final long ifaceIndex) {
+ this.uid = uid;
+ this.tag = tag;
+ this.counterSet = counterSet;
+ this.ifaceIndex = ifaceIndex;
+ }
+}