1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.net;
18 
19 /**
20  * The statistics of tethering interface
21  *
22  * {@hide}
23  */
24 parcelable TetherStatsParcel {
25     /**
26      * Parcel representing tethering interface statistics.
27      *
28      * This parcel is used by tetherGetStats, tetherOffloadGetStats and
29      * tetherOffloadGetAndClearStats in INetd.aidl. tetherGetStats uses this parcel to return the
30      * tethering statistics since netd startup and presents the interface via its interface name.
31      * Both tetherOffloadGetStats and tetherOffloadGetAndClearStats use this parcel to return
32      * the tethering statistics since tethering was first started. They present the interface via
33      * its interface index. Note that the interface must be presented by either interface name
34      * |iface| or interface index |ifIndex| in this parcel. The unused interface name is set to
35      * an empty string "" by default and the unused interface index is set to 0 by default.
36      */
37 
38     /** The interface name. */
39     @utf8InCpp String iface;
40 
41     /** Total number of received bytes. */
42     long rxBytes;
43 
44     /** Total number of received packets. */
45     long rxPackets;
46 
47     /** Total number of transmitted bytes. */
48     long txBytes;
49 
50     /** Total number of transmitted packets. */
51     long txPackets;
52 
53     /** The interface index. */
54     int ifIndex = 0;
55 }
56