• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2019 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
17syntax = "proto2";
18
19package android.stats.connectivity;
20option java_multiple_files = true;
21option java_outer_classname = "NetworkStackProto";
22
23enum DhcpRenewResult {
24    RR_UNKNOWN = 0;
25    RR_SUCCESS = 1;
26    RR_ERROR_NAK = 2;
27    RR_ERROR_IP_MISMATCH = 3;
28    RR_ERROR_IP_EXPIRE = 4;
29}
30
31enum DisconnectCode {
32    DC_NONE = 0;
33    DC_NORMAL_TERMINATION = 1;
34    DC_PROVISIONING_FAIL = 2;
35    DC_ERROR_STARTING_IPV4 = 4;
36    DC_ERROR_STARTING_IPV6 = 5;
37    DC_ERROR_STARTING_IPREACHABILITYMONITOR = 6;
38    DC_INVALID_PROVISIONING = 7;
39    DC_INTERFACE_NOT_FOUND = 8;
40    DC_PROVISIONING_TIMEOUT = 9;
41    DC_DHCP_ROAM_FAIL = 10;
42}
43
44enum TransportType {
45    TT_UNKNOWN = 0;
46    // Indicates this network uses a Cellular transport
47    TT_CELLULAR = 1;
48    // Indicates this network uses a Wi-Fi transport
49    TT_WIFI = 2;
50    // Indicates this network uses a Bluetooth transport
51    TT_BLUETOOTH = 3;
52    // Indicates this network uses an Ethernet transport
53    TT_ETHERNET = 4;
54    // Indicates this network uses a Wi-Fi Aware transport
55    TT_WIFI_AWARE = 5;
56    // Indicates this network uses a LoWPAN transport
57    TT_LOWPAN = 6;
58    // Indicates this network uses a Cellular+VPN transport
59    TT_CELLULAR_VPN = 7;
60    // Indicates this network uses a Wi-Fi+VPN transport
61    TT_WIFI_VPN = 8;
62    // Indicates this network uses a Bluetooth+VPN transport
63    TT_BLUETOOTH_VPN = 9;
64    // Indicates this network uses an Ethernet+VPN transport
65    TT_ETHERNET_VPN = 10;
66    // Indicates this network uses a Wi-Fi+Cellular+VPN transport
67    TT_WIFI_CELLULAR_VPN = 11;
68    // Indicates this network uses for test only
69    TT_TEST = 12;
70}
71
72enum DhcpFeature {
73    DF_UNKNOWN = 0;
74    // DHCP INIT-REBOOT state
75    DF_INITREBOOT = 1;
76    // DHCP rapid commit option
77    DF_RAPIDCOMMIT  = 2;
78    // Duplicate address detection
79    DF_DAD = 3;
80    // Fast initial Link setup
81    DF_FILS = 4;
82}
83
84enum HostnameTransResult {
85    HTR_UNKNOWN = 0;
86    HTR_SUCCESS = 1;
87    HTR_FAILURE = 2;
88    HTR_DISABLE = 3;
89}
90
91enum ProbeResult {
92    PR_UNKNOWN = 0;
93    PR_SUCCESS = 1;
94    PR_FAILURE = 2;
95    PR_PORTAL = 3;
96    // DNS query for the probe host returned a private IP address
97    PR_PRIVATE_IP_DNS = 4;
98}
99
100enum ValidationResult {
101    VR_UNKNOWN = 0;
102    VR_SUCCESS = 1;
103    VR_FAILURE = 2;
104    VR_PORTAL = 3;
105    VR_PARTIAL = 4;
106}
107
108enum ProbeType {
109    PT_UNKNOWN = 0;
110    PT_DNS       = 1;
111    PT_HTTP      = 2;
112    PT_HTTPS     = 3;
113    PT_PAC       = 4;
114    PT_FALLBACK  = 5;
115    PT_PRIVDNS   = 6;
116    PT_CAPPORT_API = 7;
117}
118
119// The Dhcp error code is defined in android.net.metrics.DhcpErrorEvent
120enum DhcpErrorCode {
121    ET_UNKNOWN = 0;
122    ET_L2_ERROR = 1;
123    ET_L3_ERROR = 2;
124    ET_L4_ERROR = 3;
125    ET_DHCP_ERROR = 4;
126    ET_MISC_ERROR = 5;
127    /* Reserve for error type
128    // ET_L2_ERROR_TYPE = ET_L2_ERROR << 8;
129    ET_L2_ERROR_TYPE = 256;
130    // ET_L3_ERROR_TYPE = ET_L3_ERROR << 8;
131    ET_L3_ERROR_TYPE = 512;
132    // ET_L4_ERROR_TYPE = ET_L4_ERROR << 8;
133    ET_L4_ERROR_TYPE = 768;
134    // ET_DHCP_ERROR_TYPE = ET_DHCP_ERROR << 8;
135    ET_DHCP_ERROR_TYPE = 1024;
136    // ET_MISC_ERROR_TYPE = ET_MISC_ERROR << 8;
137    ET_MISC_ERROR_TYPE = 1280;
138    */
139    // ET_L2_TOO_SHORT = (ET_L2_ERROR_TYPE | 0x1) << 16;
140    ET_L2_TOO_SHORT = 16842752;
141    // ET_L2_WRONG_ETH_TYPE = (ET_L2_ERROR_TYPE | 0x2) << 16;
142    ET_L2_WRONG_ETH_TYPE = 16908288;
143    // ET_L3_TOO_SHORT = (ET_L3_ERROR_TYPE | 0x1) << 16;
144    ET_L3_TOO_SHORT = 33619968;
145    // ET_L3_NOT_IPV4 = (ET_L3_ERROR_TYPE | 0x2) << 16;
146    ET_L3_NOT_IPV4 = 33685504;
147    // ET_L3_INVALID_IP = (ET_L3_ERROR_TYPE | 0x3) << 16;
148    ET_L3_INVALID_IP = 33751040;
149    // ET_L4_NOT_UDP = (ET_L4_ERROR_TYPE | 0x1) << 16;
150    ET_L4_NOT_UDP = 50397184;
151    // ET_L4_WRONG_PORT = (ET_L4_ERROR_TYPE | 0x2) << 16;
152    ET_L4_WRONG_PORT = 50462720;
153    // ET_BOOTP_TOO_SHORT = (ET_DHCP_ERROR_TYPE | 0x1) << 16;
154    ET_BOOTP_TOO_SHORT = 67174400;
155    // ET_DHCP_BAD_MAGIC_COOKIE = (ET_DHCP_ERROR_TYPE | 0x2) << 16;
156    ET_DHCP_BAD_MAGIC_COOKIE = 67239936;
157    // ET_DHCP_INVALID_OPTION_LENGTH = (ET_DHCP_ERROR_TYPE | 0x3) << 16;
158    ET_DHCP_INVALID_OPTION_LENGTH = 67305472;
159    // ET_DHCP_NO_MSG_TYPE = (ET_DHCP_ERROR_TYPE | 0x4) << 16;
160    ET_DHCP_NO_MSG_TYPE = 67371008;
161    // ET_DHCP_UNKNOWN_MSG_TYPE = (ET_DHCP_ERROR_TYPE | 0x5) << 16;
162    ET_DHCP_UNKNOWN_MSG_TYPE = 67436544;
163    // ET_DHCP_NO_COOKIE = (ET_DHCP_ERROR_TYPE | 0x6) << 16;
164    ET_DHCP_NO_COOKIE = 67502080;
165    // ET_BUFFER_UNDERFLOW = (ET_MISC_ERROR_TYPE | 0x1) << 16;
166    ET_BUFFER_UNDERFLOW = 83951616;
167    // ET_RECEIVE_ERROR = (ET_MISC_ERROR_TYPE | 0x2) << 16;
168    ET_RECEIVE_ERROR = 84017152;
169    // ET_PARSING_ERROR = (ET_MISC_ERROR_TYPE | 0x3) << 16;
170    ET_PARSING_ERROR = 84082688;
171}
172
173enum NetworkQuirkEvent {
174    QE_UNKNOWN = 0;
175    QE_IPV6_PROVISIONING_ROUTER_LOST = 1;
176}
177
178enum IpType {
179    // Unknown IP address type;
180    UNKNOWN = 0;
181    // IPv4 address;
182    IPV4 = 4;
183    // IPv6 address;
184    IPV6 = 6;
185}
186
187enum NudEventType {
188    // Unknown event type;
189    NUD_EVENT_UNKNOWN = 0;
190    // Forced nud probe after roaming from IpReachabilityMonitor, neighbor is unreachable;
191    NUD_POST_ROAMING_FAILED = 1;
192    // Forced nud probe after roaming from IpReachabilityMonitor, neighbor is unreachable and
193    // IP provisioning lost;
194    NUD_POST_ROAMING_FAILED_CRITICAL = 2;
195    // Forced nud probe after receiving CMD_CONFIRM from IpReachabilityMonitor, neighbor is
196    // unreachable;
197    NUD_CONFIRM_FAILED = 3;
198    // Forced nud probe after receiving CMD_CONFIRM from IpReachabilityMonitor, neighbor is
199    // unreachable and IP provisioning lost;
200    NUD_CONFIRM_FAILED_CRITICAL = 4;
201    // Neighbor unreachable notification from kernel;
202    NUD_ORGANIC_FAILED = 5;
203    // Neighbor unreachable notification from kernel, and IP provisioning is also lost;
204    NUD_ORGANIC_FAILED_CRITICAL = 6;
205    // NUD probe failure due to neighbor's MAC address has changed.
206    NUD_MAC_ADDRESS_CHANGED = 7 [deprecated=true];
207    // NUD probe failure due to neighbor's MAC address has changed after roaming.
208    NUD_POST_ROAMING_MAC_ADDRESS_CHANGED = 8;
209    // NUD probe failure due to neighbor's MAC address has changed after receiving CMD_CONFIRM.
210    NUD_CONFIRM_MAC_ADDRESS_CHANGED = 9;
211    // NUD probe failure due to neighbor's MAC address has changed during organic probes.
212    NUD_ORGANIC_MAC_ADDRESS_CHANGED = 10;
213}
214
215enum NudNeighborType {
216    // Unknown neighbor type;
217    NUD_NEIGHBOR_UNKNOWN = 0;
218    // Neighbor is default gateway;
219    NUD_NEIGHBOR_GATEWAY = 1;
220    // Neighbor is DNS server;
221    NUD_NEIGHBOR_DNS = 2;
222    // Neighbor is both the default gateway and DNS server;
223    NUD_NEIGHBOR_BOTH = 3;
224}
225
226message NetworkStackEventData {
227
228}
229
230