unleashed-firmware/applications/external/pacs_fuzzer/lib/worker/protocol.h

77 lines
1.5 KiB
C
Raw Normal View History

2023-06-02 17:48:21 +03:00
#pragma once
#include <stdint.h>
2023-06-03 14:24:27 +03:00
// #define RFID_125_PROTOCOL
2023-06-05 14:10:51 +03:00
typedef struct FuzzerPayload FuzzerPayload;
2023-06-03 14:24:27 +03:00
2023-06-05 14:10:51 +03:00
typedef enum {
2023-06-03 14:24:27 +03:00
#if defined(RFID_125_PROTOCOL)
EM4100,
HIDProx,
PAC,
H10301,
#else
2023-06-02 17:48:21 +03:00
DS1990,
Metakom,
Cyfral,
2023-06-03 14:24:27 +03:00
#endif
2023-06-05 14:10:51 +03:00
} FuzzerProtocolsID;
2023-06-03 14:24:27 +03:00
2023-06-05 14:10:51 +03:00
typedef enum {
FuzzerAttackIdDefaultValues = 0,
FuzzerAttackIdLoadFile,
FuzzerAttackIdLoadFileCustomUids,
FuzzerAttackIdBFCustomerID,
} FuzzerAttackId;
2023-06-05 14:10:51 +03:00
struct FuzzerPayload {
uint8_t* data;
uint8_t data_size;
2023-06-02 17:48:21 +03:00
};
2023-06-05 20:24:38 +03:00
/**
* Get maximum length of UID among all supported protocols
* @return Maximum length of UID
*/
2023-06-05 14:10:51 +03:00
uint8_t fuzzer_proto_get_max_data_size();
2023-06-02 17:48:21 +03:00
2023-06-06 15:13:50 +03:00
/**
* Get minimum time delay for protocols
* @return Minimum time delay
*/
uint8_t fuzzer_proto_get_min_delay();
2023-06-05 20:24:38 +03:00
/**
* Get protocol name based on its index
* @param index protocol index
* @return pointer to a string containing the name
*/
2023-06-05 14:10:51 +03:00
const char* fuzzer_proto_get_name(FuzzerProtocolsID index);
2023-06-05 20:24:38 +03:00
/**
* Get number of protocols
* @return number of protocols
*/
2023-06-05 14:10:51 +03:00
uint8_t fuzzer_proto_get_count_of_protocols();
2023-06-02 17:48:21 +03:00
2023-06-05 20:24:38 +03:00
/**
* Get menu label based on its index
* @param index menu index
* @return pointer to a string containing the menu label
*/
const char* fuzzer_proto_get_menu_label(uint8_t index);
/**
* Get FuzzerAttackId based on its index
* @param index menu index
* @return FuzzerAttackId
*/
FuzzerAttackId fuzzer_proto_get_attack_id_by_index(uint8_t index);
2023-06-02 17:48:21 +03:00
2023-06-05 20:24:38 +03:00
/**
* Get number of menu items
* @return number of menu items
*/
2023-06-05 14:10:51 +03:00
uint8_t fuzzer_proto_get_count_of_menu_items();