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 17 package com.android.server.wifi; 18 19 import android.annotation.IntDef; 20 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 24 /** 25 * MBO-OCE related constants 26 */ 27 public class MboOceConstants { 28 29 public static final int MBO_OCE_ATTRIBUTE_NOT_PRESENT = -1; 30 31 /** MBO-OCE attribute Ids */ 32 public static final int MBO_OCE_AID_MBO_AP_CAPABILITY_INDICATION = 0x01; 33 public static final int MBO_OCE_AID_NON_PREFERRED_CHANNEL_REPORT = 0x02; 34 public static final int MBO_OCE_AID_CELLULAR_DATA_CAPABILITIES = 0x03; 35 public static final int MBO_OCE_AID_ASSOCIATION_DISALLOWED = 0x04; 36 public static final int MBO_OCE_AID_CELLULAR_DATA_CONNECTION_PREFERENCE = 0x05; 37 public static final int MBO_OCE_AID_TRANSITION_REASON_CODE = 0x06; 38 public static final int MBO_OCE_AID_TRANSITION_REJECTION_REASON_CODE = 0x07; 39 public static final int MBO_OCE_AID_ASSOCIATION_RETRY_DELAY = 0x08; 40 public static final int MBO_OCE_AID_OCE_AP_CAPABILITY_INDICATION = 0x65; 41 public static final int MBO_OCE_AID_RSSI_BASED_ASSOCIATION_REJECTION = 0x66; 42 public static final int MBO_OCE_AID_REDUCED_WAN_METRICS = 0x67; 43 public static final int MBO_OCE_AID_RNR_COMPLETENESS = 0x68; 44 public static final int MBO_OCE_AID_PROBE_SUPPRESSION_BSSIDS = 0x69; 45 public static final int MBO_OCE_AID_PROBE_SUPPRESSION_SSIDS = 0x6A; 46 47 @IntDef(prefix = { "MBO_OCE_AID_" }, value = { 48 MBO_OCE_AID_MBO_AP_CAPABILITY_INDICATION, 49 MBO_OCE_AID_NON_PREFERRED_CHANNEL_REPORT, 50 MBO_OCE_AID_CELLULAR_DATA_CAPABILITIES, 51 MBO_OCE_AID_ASSOCIATION_DISALLOWED, 52 MBO_OCE_AID_CELLULAR_DATA_CONNECTION_PREFERENCE, 53 MBO_OCE_AID_TRANSITION_REASON_CODE, 54 MBO_OCE_AID_TRANSITION_REJECTION_REASON_CODE, 55 MBO_OCE_AID_ASSOCIATION_RETRY_DELAY, 56 MBO_OCE_AID_OCE_AP_CAPABILITY_INDICATION, 57 MBO_OCE_AID_RSSI_BASED_ASSOCIATION_REJECTION, 58 MBO_OCE_AID_REDUCED_WAN_METRICS, 59 MBO_OCE_AID_RNR_COMPLETENESS, 60 MBO_OCE_AID_PROBE_SUPPRESSION_BSSIDS, 61 MBO_OCE_AID_PROBE_SUPPRESSION_SSIDS 62 }) 63 @Retention(RetentionPolicy.SOURCE) 64 @interface MboOceAid{} 65 66 /** MBO spec v1.2, 4.2.1 Table 7: MBO AP Capability indication - Cellular data aware */ 67 public static final int MBO_AP_CAP_IND_ATTR_CELL_DATA_AWARE = 0x40; 68 69 /** 70 * IEEE Std 802.11-2016 - Table 9-357. 71 * BTM status code filled in BSS transition management response frame. 72 */ 73 public static final int BTM_RESPONSE_STATUS_INVALID = -1; 74 public static final int BTM_RESPONSE_STATUS_ACCEPT = 0; 75 public static final int BTM_RESPONSE_STATUS_REJECT_UNSPECIFIED = 1; 76 public static final int BTM_RESPONSE_STATUS_REJECT_INSUFFICIENT_BEACON = 2; 77 public static final int BTM_RESPONSE_STATUS_REJECT_INSUFFICIENT_CAPABITY = 3; 78 public static final int BTM_RESPONSE_STATUS_REJECT_BSS_TERMINATION_UNDESIRED = 4; 79 public static final int BTM_RESPONSE_STATUS_REJECT_BSS_TERMINATION_DELAY_REQUEST = 5; 80 public static final int BTM_RESPONSE_STATUS_REJECT_STA_CANDIDATE_LIST_PROVIDED = 6; 81 public static final int BTM_RESPONSE_STATUS_REJECT_NO_SUITABLE_CANDIDATES = 7; 82 public static final int BTM_RESPONSE_STATUS_REJECT_LEAVING_ESS = 8; 83 public static final int BTM_RESPONSE_STATUS_REJECT_RESERVED = 254; 84 85 @IntDef(prefix = { "BTM_RESPONSE_STATUS_" }, value = { 86 BTM_RESPONSE_STATUS_INVALID, 87 BTM_RESPONSE_STATUS_ACCEPT, 88 BTM_RESPONSE_STATUS_REJECT_UNSPECIFIED, 89 BTM_RESPONSE_STATUS_REJECT_INSUFFICIENT_BEACON, 90 BTM_RESPONSE_STATUS_REJECT_INSUFFICIENT_CAPABITY, 91 BTM_RESPONSE_STATUS_REJECT_BSS_TERMINATION_UNDESIRED, 92 BTM_RESPONSE_STATUS_REJECT_BSS_TERMINATION_DELAY_REQUEST, 93 BTM_RESPONSE_STATUS_REJECT_STA_CANDIDATE_LIST_PROVIDED, 94 BTM_RESPONSE_STATUS_REJECT_NO_SUITABLE_CANDIDATES, 95 BTM_RESPONSE_STATUS_REJECT_LEAVING_ESS, 96 BTM_RESPONSE_STATUS_REJECT_RESERVED 97 }) 98 @Retention(RetentionPolicy.SOURCE) 99 @interface BtmResponseStatus{} 100 101 /** WNM request mode: Preferred candidate list included */ 102 public static final int BTM_DATA_FLAG_PREFERRED_CANDIDATE_LIST_INCLUDED = 1 << 0; 103 /** WNM request mode: Abridged */ 104 public static final int BTM_DATA_FLAG_MODE_ABRIDGED = 1 << 1; 105 /** WNM request mode: Disassociation Imminent */ 106 public static final int BTM_DATA_FLAG_DISASSOCIATION_IMMINENT = 1 << 2; 107 /** WNM request mode: BSS termination included */ 108 public static final int BTM_DATA_FLAG_BSS_TERMINATION_INCLUDED = 1 << 3; 109 /** WNM request mode: ESS Disassociation Imminent */ 110 public static final int BTM_DATA_FLAG_ESS_DISASSOCIATION_IMMINENT = 1 << 4; 111 /** MBO transition reason code included */ 112 public static final int BTM_DATA_FLAG_MBO_TRANSITION_REASON_CODE_INCLUDED = 1 << 5; 113 /** MBO transition reason code included */ 114 public static final int BTM_DATA_FLAG_MBO_ASSOC_RETRY_DELAY_INCLUDED = 1 << 6; 115 /** MBO cellular data connection preference value included */ 116 public static final int BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED = 1 << 7; 117 118 @IntDef(flag = true, prefix = { "BTM_DATA_FLAG_" }, value = { 119 BTM_DATA_FLAG_PREFERRED_CANDIDATE_LIST_INCLUDED, 120 BTM_DATA_FLAG_MODE_ABRIDGED, 121 BTM_DATA_FLAG_DISASSOCIATION_IMMINENT, 122 BTM_DATA_FLAG_BSS_TERMINATION_INCLUDED, 123 BTM_DATA_FLAG_ESS_DISASSOCIATION_IMMINENT, 124 BTM_DATA_FLAG_MBO_TRANSITION_REASON_CODE_INCLUDED, 125 BTM_DATA_FLAG_MBO_ASSOC_RETRY_DELAY_INCLUDED, 126 BTM_DATA_FLAG_MBO_CELL_DATA_CONNECTION_PREFERENCE_INCLUDED 127 }) 128 @Retention(RetentionPolicy.SOURCE) 129 @interface BtmDataFlag{} 130 131 /** MBO spec v1.2, 4.2.6 Table 18: MBO transition reason attribute */ 132 public static final int MBO_TRANSITION_REASON_INVALID = -1; 133 public static final int MBO_TRANSITION_REASON_UNSPECIFIED = 0; 134 public static final int MBO_TRANSITION_REASON_EXCESSIVE_FRAME_LOSS = 1; 135 public static final int MBO_TRANSITION_REASON_EXCESSIVE_TRAFFIC_DELAY = 2; 136 public static final int MBO_TRANSITION_REASON_INSUFFICIENT_BANDWIDTH = 3; 137 public static final int MBO_TRANSITION_REASON_LOAD_BALANCING = 4; 138 public static final int MBO_TRANSITION_REASON_LOW_RSSI = 5; 139 public static final int MBO_TRANSITION_REASON_RX_EXCESSIVE_RETRIES = 6; 140 public static final int MBO_TRANSITION_REASON_HIGH_INTERFERENCE = 7; 141 public static final int MBO_TRANSITION_REASON_GRAY_ZONE = 8; 142 public static final int MBO_TRANSITION_REASON_TRANSITION_TO_PREMIUM_AP = 9; 143 public static final int MBO_TRANSITION_REASON_RESERVED = 254; 144 145 @IntDef(prefix = { "MBO_TRANSITION_REASON_" }, value = { 146 MBO_TRANSITION_REASON_INVALID, 147 MBO_TRANSITION_REASON_UNSPECIFIED, 148 MBO_TRANSITION_REASON_EXCESSIVE_FRAME_LOSS, 149 MBO_TRANSITION_REASON_EXCESSIVE_TRAFFIC_DELAY, 150 MBO_TRANSITION_REASON_INSUFFICIENT_BANDWIDTH, 151 MBO_TRANSITION_REASON_LOAD_BALANCING, 152 MBO_TRANSITION_REASON_LOW_RSSI, 153 MBO_TRANSITION_REASON_RX_EXCESSIVE_RETRIES, 154 MBO_TRANSITION_REASON_HIGH_INTERFERENCE, 155 MBO_TRANSITION_REASON_GRAY_ZONE, 156 MBO_TRANSITION_REASON_TRANSITION_TO_PREMIUM_AP, 157 MBO_TRANSITION_REASON_RESERVED 158 }) 159 @Retention(RetentionPolicy.SOURCE) 160 @interface MboTransitionReason{} 161 162 /** MBO spec v1.2, 4.2.5 Table 16: MBO Cellular data connection preference attribute values */ 163 public static final int MBO_CELLULAR_DATA_CONNECTION_INVALID = -1; 164 public static final int MBO_CELLULAR_DATA_CONNECTION_EXCLUDED = 0; 165 public static final int MBO_CELLULAR_DATA_CONNECTION_NOT_PREFERRED = 1; 166 public static final int MBO_CELLULAR_DATA_CONNECTION_RESERVED = 254; 167 public static final int MBO_CELLULAR_DATA_CONNECTION_PREFERRED = 255; 168 169 @IntDef(prefix = { "MBO_CELLULAR_DATA_CONNECTION_" }, value = { 170 MBO_CELLULAR_DATA_CONNECTION_INVALID, 171 MBO_CELLULAR_DATA_CONNECTION_EXCLUDED, 172 MBO_CELLULAR_DATA_CONNECTION_NOT_PREFERRED, 173 MBO_CELLULAR_DATA_CONNECTION_RESERVED, 174 MBO_CELLULAR_DATA_CONNECTION_PREFERRED 175 }) 176 @Retention(RetentionPolicy.SOURCE) 177 @interface MboCellularDataConnectionPreference{} 178 179 /** default Blacklist duration when AP doesn't advertise it */ 180 public static final long DEFAULT_BLACKLIST_DURATION_MS = 300_000; // 5 minutes 181 182 } 183