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} 42 43enum TransportType { 44 TT_UNKNOWN = 0; 45 // Indicates this network uses a Cellular transport 46 TT_CELLULAR = 1; 47 // Indicates this network uses a Wi-Fi transport 48 TT_WIFI = 2; 49 // Indicates this network uses a Bluetooth transport 50 TT_BLUETOOTH = 3; 51 // Indicates this network uses an Ethernet transport 52 TT_ETHERNET = 4; 53 // Indicates this network uses a Wi-Fi Aware transport 54 TT_WIFI_AWARE = 5; 55 // Indicates this network uses a LoWPAN transport 56 TT_LOWPAN = 6; 57 // Indicates this network uses a Cellular+VPN transport 58 TT_CELLULAR_VPN = 7; 59 // Indicates this network uses a Wi-Fi+VPN transport 60 TT_WIFI_VPN = 8; 61 // Indicates this network uses a Bluetooth+VPN transport 62 TT_BLUETOOTH_VPN = 9; 63 // Indicates this network uses an Ethernet+VPN transport 64 TT_ETHERNET_VPN = 10; 65 // Indicates this network uses a Wi-Fi+Cellular+VPN transport 66 TT_WIFI_CELLULAR_VPN = 11; 67 // Indicates this network uses for test only 68 TT_TEST = 12; 69} 70 71enum DhcpFeature { 72 DF_UNKNOWN = 0; 73 // DHCP INIT-REBOOT state 74 DF_INITREBOOT = 1; 75 // DHCP rapid commit option 76 DF_RAPIDCOMMIT = 2; 77 // Duplicate address detection 78 DF_DAD = 3; 79 // Fast initial Link setup 80 DF_FILS = 4; 81} 82 83enum HostnameTransResult { 84 HTR_UNKNOWN = 0; 85 HTR_SUCCESS = 1; 86 HTR_FAILURE = 2; 87 HTR_DISABLE = 3; 88} 89 90enum ProbeResult { 91 PR_UNKNOWN = 0; 92 PR_SUCCESS = 1; 93 PR_FAILURE = 2; 94 PR_PORTAL = 3; 95 // DNS query for the probe host returned a private IP address 96 PR_PRIVATE_IP_DNS = 4; 97} 98 99enum ValidationResult { 100 VR_UNKNOWN = 0; 101 VR_SUCCESS = 1; 102 VR_FAILURE = 2; 103 VR_PORTAL = 3; 104 VR_PARTIAL = 4; 105} 106 107enum ProbeType { 108 PT_UNKNOWN = 0; 109 PT_DNS = 1; 110 PT_HTTP = 2; 111 PT_HTTPS = 3; 112 PT_PAC = 4; 113 PT_FALLBACK = 5; 114 PT_PRIVDNS = 6; 115 PT_CAPPORT_API = 7; 116} 117 118// The Dhcp error code is defined in android.net.metrics.DhcpErrorEvent 119enum DhcpErrorCode { 120 ET_UNKNOWN = 0; 121 ET_L2_ERROR = 1; 122 ET_L3_ERROR = 2; 123 ET_L4_ERROR = 3; 124 ET_DHCP_ERROR = 4; 125 ET_MISC_ERROR = 5; 126 /* Reserve for error type 127 // ET_L2_ERROR_TYPE = ET_L2_ERROR << 8; 128 ET_L2_ERROR_TYPE = 256; 129 // ET_L3_ERROR_TYPE = ET_L3_ERROR << 8; 130 ET_L3_ERROR_TYPE = 512; 131 // ET_L4_ERROR_TYPE = ET_L4_ERROR << 8; 132 ET_L4_ERROR_TYPE = 768; 133 // ET_DHCP_ERROR_TYPE = ET_DHCP_ERROR << 8; 134 ET_DHCP_ERROR_TYPE = 1024; 135 // ET_MISC_ERROR_TYPE = ET_MISC_ERROR << 8; 136 ET_MISC_ERROR_TYPE = 1280; 137 */ 138 // ET_L2_TOO_SHORT = (ET_L2_ERROR_TYPE | 0x1) << 16; 139 ET_L2_TOO_SHORT = 16842752; 140 // ET_L2_WRONG_ETH_TYPE = (ET_L2_ERROR_TYPE | 0x2) << 16; 141 ET_L2_WRONG_ETH_TYPE = 16908288; 142 // ET_L3_TOO_SHORT = (ET_L3_ERROR_TYPE | 0x1) << 16; 143 ET_L3_TOO_SHORT = 33619968; 144 // ET_L3_NOT_IPV4 = (ET_L3_ERROR_TYPE | 0x2) << 16; 145 ET_L3_NOT_IPV4 = 33685504; 146 // ET_L3_INVALID_IP = (ET_L3_ERROR_TYPE | 0x3) << 16; 147 ET_L3_INVALID_IP = 33751040; 148 // ET_L4_NOT_UDP = (ET_L4_ERROR_TYPE | 0x1) << 16; 149 ET_L4_NOT_UDP = 50397184; 150 // ET_L4_WRONG_PORT = (ET_L4_ERROR_TYPE | 0x2) << 16; 151 ET_L4_WRONG_PORT = 50462720; 152 // ET_BOOTP_TOO_SHORT = (ET_DHCP_ERROR_TYPE | 0x1) << 16; 153 ET_BOOTP_TOO_SHORT = 67174400; 154 // ET_DHCP_BAD_MAGIC_COOKIE = (ET_DHCP_ERROR_TYPE | 0x2) << 16; 155 ET_DHCP_BAD_MAGIC_COOKIE = 67239936; 156 // ET_DHCP_INVALID_OPTION_LENGTH = (ET_DHCP_ERROR_TYPE | 0x3) << 16; 157 ET_DHCP_INVALID_OPTION_LENGTH = 67305472; 158 // ET_DHCP_NO_MSG_TYPE = (ET_DHCP_ERROR_TYPE | 0x4) << 16; 159 ET_DHCP_NO_MSG_TYPE = 67371008; 160 // ET_DHCP_UNKNOWN_MSG_TYPE = (ET_DHCP_ERROR_TYPE | 0x5) << 16; 161 ET_DHCP_UNKNOWN_MSG_TYPE = 67436544; 162 // ET_DHCP_NO_COOKIE = (ET_DHCP_ERROR_TYPE | 0x6) << 16; 163 ET_DHCP_NO_COOKIE = 67502080; 164 // ET_BUFFER_UNDERFLOW = (ET_MISC_ERROR_TYPE | 0x1) << 16; 165 ET_BUFFER_UNDERFLOW = 83951616; 166 // ET_RECEIVE_ERROR = (ET_MISC_ERROR_TYPE | 0x2) << 16; 167 ET_RECEIVE_ERROR = 84017152; 168 // ET_PARSING_ERROR = (ET_MISC_ERROR_TYPE | 0x3) << 16; 169 ET_PARSING_ERROR = 84082688; 170} 171 172enum NetworkQuirkEvent { 173 QE_UNKNOWN = 0; 174 QE_IPV6_PROVISIONING_ROUTER_LOST = 1; 175} 176 177message NetworkStackEventData { 178 179} 180 181