1syntax = "proto2"; 2 3message Session { 4 repeated Command commands = 1; 5 optional bytes data_provider = 2; 6 optional SimulatePacketArrival setup_packet = 3; 7 optional DtaMode dta_mode = 4; 8} 9 10enum DtaMode { 11 FUZZER_NFA_DTA_DEFAULT_MODE = 0x1; 12 FUZZER_NFA_DTA_LLCP_MODE = 0x2; 13 FUZZER_NFA_DTA_HCEF_MODE = 0x4; 14 FUZZER_NFA_DTA_CR8 = 0x80; 15} 16 17message Command { 18 oneof command { 19 // HAL Simulation Messages 20 SimulatePacketArrival simulate_packet_arrival = 1; 21 SimulateHALEvent simulate_hal_event = 2; 22 SimulateStructuredPacket simulate_structured_packet = 3; 23 bytes send_raw_frame = 4; 24 25 // Asynchronous task handling 26 EmptyMessage do_nci_messages = 5; 27 EmptyMessage do_nfa_tasks = 6; 28 EmptyMessage simulate_timer_event = 7; 29 EmptyMessage simulate_quick_timer_event = 8; 30 31 // Configuration APIs 32 Select select = 9; 33 ConfigureUiccListenTech configure_uicc_listen_tech = 10; 34 EmptyMessage register_t3t = 11; 35 EmptyMessage start_rf_discovery = 12; 36 EmptyMessage stop_rf_discovery = 13; 37 EmptyMessage set_iso_listen_tech = 14; 38 39 // RW APIs 40 EmptyMessage rw_format_tag = 15; 41 RwPresenceCheck rw_presence_check = 16; 42 bool rw_set_tag_read_only = 17; 43 44 // EE APIs 45 EmptyMessage ee_update_now = 18; 46 EeAddAidRouting ee_add_aid_routing = 19; 47 48 // NDEF APIs 49 EmptyMessage read_ndef = 20; 50 EmptyMessage detect_ndef = 21; 51 WriteNdef write_ndef = 22; 52 } 53} 54 55message ConfigureUiccListenTech { 56 optional int32 ee_handle = 1; 57 optional int32 tech_mask = 2; 58} 59 60message Select { 61 optional int32 rf_select_id = 1; 62 optional Protocol protocol = 2; 63 optional int32 rf_interface = 3; 64} 65 66message RwPresenceCheck { 67 enum PresChkOption { 68 FUZZING_NFA_RW_PRES_CHK_DEFAULT = 0; 69 FUZZING_NFA_RW_PRES_CHK_I_BLOCK = 1; 70 FUZZING_NFA_RW_PRES_CHK_ISO_DEP_NAK = 5; 71 } 72 optional PresChkOption option = 1; 73} 74 75message EeAddAidRouting { 76 optional int32 ee_handle = 1; 77 optional bytes aid = 2; 78 optional bool power_state = 3; 79 optional int32 aid_info = 4; 80} 81 82message EmptyMessage {} 83 84message SimulateStructuredPacket { 85 // Additional packet types, gids, and opcodes 86 // can be added here and in the child messages. 87 oneof packet { 88 MtNtf ntf = 1; 89 } 90} 91 92message MtNtf { 93 oneof gid { 94 RfManagementNtf rf_manage = 1; 95 } 96} 97 98message RfManagementNtf { 99 oneof opcode { 100 RfManageIntfActivated intf_activated = 1; 101 } 102} 103 104// RF_INTF_ACTIVATED_NTF message 105message RfManageIntfActivated { 106 optional int32 rf_discovery_id = 1; 107 optional Protocol rf_protocol = 2; 108 optional DiscoveryType data_mode = 3; 109 optional NfcBitRate tx_bitrate = 4; 110 optional NfcBitRate rx_bitrate = 5; 111 optional int32 buff_size = 6; 112 optional int32 num_buff = 7; 113 optional bytes rf_tech_param_buffer = 8; 114 optional bytes intf_param_buffer = 9; 115} 116 117enum NfcBitRate { 118 FUZZER_NCI_BIT_RATE_106 = 0x00; 119 FUZZER_NCI_BIT_RATE_212 = 0x01; 120 FUZZER_NCI_BIT_RATE_424 = 0x02; 121 FUZZER_NCI_BIT_RATE_848 = 0x03; 122 FUZZER_NCI_BIT_RATE_1696 = 0x04; 123 FUZZER_NCI_BIT_RATE_3392 = 0x05; 124 FUZZER_NCI_BIT_RATE_6784 = 0x06; 125} 126 127message NfcIntfFrame { 128 optional bytes param = 1; 129} 130 131message NfcIntfLaIsoDep { 132 optional int32 rats = 1; 133} 134 135message NfcIntfPaIsoDep { 136 optional bytes ats_res = 1; 137 optional bool nad_used = 2; 138 optional int32 fwi = 3; 139 optional int32 sfgi = 4; 140 optional bytes his_byte = 5; 141} 142 143message NfcIntfLbIsoDep { 144 optional bytes attrib_req = 1; 145 optional bytes hi_info = 2; 146 optional bytes nfcid0 = 3; 147} 148 149message NfcIntfPbIsoDep { 150 optional bytes attrib_res = 1; 151 optional bytes hi_info = 2; 152 optional int32 mbli = 3; 153} 154 155message NfcIntfLaNfcDep { 156 optional bytes atr_req = 1; 157 optional int32 max_payload_size = 2; 158 optional bytes gen_bytes = 3; 159} 160 161message NfcIntfPaNfcDep { 162 optional bytes atr_res = 1; 163 optional int32 max_payload_size = 2; 164 optional bytes gen_bytes = 3; 165 optional int32 waiting_time = 4; 166} 167 168message Protocol { 169 enum ProtocolValue { 170 FUZZER_PROTOCOL_UNKNOWN = 0; 171 FUZZER_PROTOCOL_T1T = 1; 172 FUZZER_PROTOCOL_T2T = 2; 173 FUZZER_PROTOCOL_T3T = 3; 174 FUZZER_PROTOCOL_T5T = 6; 175 FUZZER_PROTOCOL_ISO_DEP = 4; 176 FUZZER_PROTOCOL_NFC_DEP = 5; 177 // These are proprietary and must be converted at runtime 178 // based on the config. 179 // See src/include/vendor_cfg.h 180 FUZZER_PROTOCOL_MIFARE = 7; 181 FUZZER_PROTOCOL_ISO15693 = 8; 182 FUZZER_PROTOCOL_B_PRIME = 9; 183 FUZZER_PROTOCOL_KOVIO = 10; 184 } 185 // Only access this from within a helper function that 186 // does the runtime config-based conversion. 187 optional ProtocolValue value = 1; 188} 189 190message DiscoveryType { 191 enum DiscoveryTypeValue { 192 FUZZER_DISCOVERY_TYPE_POLL_A = 0x00; 193 FUZZER_DISCOVERY_TYPE_POLL_B = 0x01; 194 FUZZER_DISCOVERY_TYPE_POLL_F = 0x02; 195 FUZZER_DISCOVERY_TYPE_POLL_V = 0x06; 196 FUZZER_DISCOVERY_TYPE_LISTEN_A = 0x80; 197 FUZZER_DISCOVERY_TYPE_LISTEN_B = 0x81; 198 FUZZER_DISCOVERY_TYPE_LISTEN_F = 0x82; 199 FUZZER_DISCOVERY_TYPE_LISTEN_ISO15693 = 0x86; 200 // These are proprietary and must be converted at runtime 201 // based on the config. 202 FUZZER_DISCOVERY_TYPE_POLL_B_PRIME = 10; 203 FUZZER_DISCOVERY_TYPE_POLL_KOVIO = 11; 204 FUZZER_DISCOVERY_TYPE_LISTEN_B_PRIME = 12; 205 } 206 optional DiscoveryTypeValue value = 1; 207} 208 209message NfcRfPiso15693 { 210 optional int32 flag = 1; 211 optional bytes uid = 2; 212} 213 214message NfcRfPbParams { 215 optional bytes sensb_res = 1; 216 optional bytes nfcid0 = 2; 217} 218 219message NfcRfPfParams { 220 optional int32 bit_rate = 1; 221 optional bytes sensf_res = 2; 222 optional bytes nfcid2 = 3; 223 optional int32 mrti_check = 4; 224 optional int32 mrti_update = 5; 225} 226 227message NfcRfLfParams { 228 optional bytes nfcid2 = 1; 229} 230 231message NfcRfPiso15693Params { 232 optional int32 flag = 1; 233 optional int32 dsfid = 2; 234 optional bytes uid = 3; 235} 236 237message NfcRfPkovioParams { 238 optional bytes uid = 1; 239} 240 241message NfcRfAcmPParams { 242 optional bytes atr_res = 1; 243 optional int32 max_payload_size = 2; 244 optional bytes gen_bytes = 3; 245 optional int32 waiting_time = 4; 246} 247 248enum Mt { 249 FUZZER_NCI_MT_DATA = 0; 250 FUZZER_NCI_MT_CMD = 1; 251 FUZZER_NCI_MT_RSP = 2; 252 FUZZER_NCI_MT_NTF = 3; 253} 254 255enum Gid { 256 FUZZER_NCI_GID_CORE = 0x00; 257 FUZZER_NCI_GID_RF_MANAGE = 0x01; 258 FUZZER_NCI_GID_EE_MANAGE = 0x02; 259 FUZZER_NCI_GID_PROP = 0x0F; 260} 261 262enum Opcode { 263 option allow_alias = true; 264 FUZZER_NCI_MSG_CORE_RESET = 0; 265 FUZZER_NCI_MSG_CORE_INIT = 1; 266 FUZZER_NCI_MSG_CORE_SET_CONFIG = 2; 267 FUZZER_NCI_MSG_CORE_GET_CONFIG = 3; 268 FUZZER_NCI_MSG_CORE_CONN_CREATE = 4; 269 FUZZER_NCI_MSG_CORE_CONN_CLOSE = 5; 270 FUZZER_NCI_MSG_CORE_CONN_CREDITS = 6; 271 FUZZER_NCI_MSG_CORE_GEN_ERR_STATUS = 7; 272 FUZZER_NCI_MSG_CORE_INTF_ERR_STATUS = 8; 273 FUZZER_NCI_MSG_CORE_SET_POWER_SUB_STATE = 9; 274 FUZZER_NCI_MSG_RF_DISCOVER_MAP = 0; 275 FUZZER_NCI_MSG_RF_SET_ROUTING = 1; 276 FUZZER_NCI_MSG_RF_GET_ROUTING = 2; 277 FUZZER_NCI_MSG_RF_DISCOVER = 3; 278 FUZZER_NCI_MSG_RF_DISCOVER_SELECT = 4; 279 FUZZER_NCI_MSG_RF_INTF_ACTIVATED = 5; 280 FUZZER_NCI_MSG_RF_DEACTIVATE = 6; 281 FUZZER_NCI_MSG_RF_FIELD = 7; 282 FUZZER_NCI_MSG_RF_T3T_POLLING = 8; 283 FUZZER_NCI_MSG_RF_EE_ACTION = 9; 284 FUZZER_NCI_MSG_RF_EE_DISCOVERY_REQ = 10; 285 FUZZER_NCI_MSG_RF_PARAMETER_UPDATE = 11; 286 FUZZER_NCI_MSG_RF_ISO_DEP_NAK_PRESENCE = 16; 287 FUZZER_NCI_MSG_NFCEE_DISCOVER = 0; 288 FUZZER_NCI_MSG_NFCEE_MODE_SET = 1; 289 FUZZER_NCI_MSG_NFCEE_STATUS = 2; 290 FUZZER_NCI_MSG_NFCEE_POWER_LINK_CTRL = 3; 291} 292 293message SimulatePacketArrival { 294 optional bytes packet = 1; 295 optional Mt mt = 2; 296 optional Gid gid = 3; 297 optional Opcode opcode = 4; 298 optional bool pbf = 5; 299} 300 301enum HalEvent { 302 FUZZER_HAL_NFC_OPEN_CPLT_EVT = 0; 303 FUZZER_HAL_NFC_CLOSE_CPLT_EVT = 1; 304 FUZZER_HAL_NFC_POST_INIT_CPLT_EVT = 2; 305 FUZZER_HAL_NFC_PRE_DISCOVER_CPLT_EVT = 3; 306 FUZZER_HAL_NFC_REQUEST_CONTROL_EVT = 4; 307 FUZZER_HAL_NFC_RELEASE_CONTROL_EVT = 5; 308 FUZZER_HAL_NFC_ERROR_EVT = 6; 309} 310 311enum HalStatus { 312 FUZZER_HAL_NFC_STATUS_OK = 0; 313 FUZZER_HAL_NFC_STATUS_FAILED = 1; 314 FUZZER_HAL_NFC_STATUS_ERR_TRANSPORT = 2; 315 FUZZER_HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 3; 316 FUZZER_HAL_NFC_STATUS_REFUSED = 4; 317} 318 319message SimulateHALEvent { 320 optional HalEvent hal_event = 1; 321 optional HalStatus hal_status = 2; 322} 323 324message WriteNdef { 325 optional uint32 size = 1; 326} 327