diff options
Diffstat (limited to 'Tethering/src')
| -rw-r--r-- | Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java | 8 | ||||
| -rw-r--r-- | Tethering/src/com/android/networkstack/tethering/metrics/stats.proto | 32 |
2 files changed, 40 insertions, 0 deletions
diff --git a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java index 225bd5830e..f8a10941b2 100644 --- a/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java +++ b/Tethering/src/com/android/networkstack/tethering/BpfCoordinator.java @@ -2033,5 +2033,13 @@ public class BpfCoordinator { return mBpfConntrackEventConsumer; } + // Return tethering client information. This is used for testing only. + @NonNull + @VisibleForTesting + final HashMap<IpServer, HashMap<Inet4Address, ClientInfo>> + getTetherClientsForTesting() { + return mTetherClients; + } + private static native String[] getBpfCounterNames(); } diff --git a/Tethering/src/com/android/networkstack/tethering/metrics/stats.proto b/Tethering/src/com/android/networkstack/tethering/metrics/stats.proto new file mode 100644 index 0000000000..46a47af83a --- /dev/null +++ b/Tethering/src/com/android/networkstack/tethering/metrics/stats.proto @@ -0,0 +1,32 @@ +/* + * 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. + */ + +syntax = "proto2"; +option java_multiple_files = true; + +package com.android.networkstack.tethering.metrics; + +import "frameworks/proto_logging/stats/enums/stats/connectivity/tethering.proto"; + +/** + * Logs Tethering events + */ +message NetworkTetheringReported { + optional .android.stats.connectivity.ErrorCode error_code = 1; + optional .android.stats.connectivity.DownstreamType downstream_type = 2; + optional .android.stats.connectivity.UpstreamType upstream_type = 3; + optional .android.stats.connectivity.UserType user_type = 4; +} |
