From be128741e3bc429d0ba843a43c007b33f8a6de50 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 27 Jul 2021 16:08:20 +0300 Subject: [PATCH] add cli parser option --- client/src/mifare/desfirecore.c | 9 +++++++++ client/src/mifare/desfirecore.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/client/src/mifare/desfirecore.c b/client/src/mifare/desfirecore.c index e21180957..379862226 100644 --- a/client/src/mifare/desfirecore.c +++ b/client/src/mifare/desfirecore.c @@ -103,6 +103,15 @@ const CLIParserOption DesfireValueFileOperOpts[] = { {0, NULL}, }; +const CLIParserOption DesfireReadFileTypeOpts[] = { + {RFTAuto, "auto"}, + {RFTData, "data"}, + {RFTValue, "value"}, + {RFTRecord, "record"}, + {RFTMAC, "mac"}, + {0, NULL}, +}; + static const char *getstatus(uint16_t *sw) { if (sw == NULL) return "--> sw argument error. This should never happen !"; if (((*sw >> 8) & 0xFF) == 0x91) { diff --git a/client/src/mifare/desfirecore.h b/client/src/mifare/desfirecore.h index 14453993b..28dffccc8 100644 --- a/client/src/mifare/desfirecore.h +++ b/client/src/mifare/desfirecore.h @@ -28,6 +28,14 @@ typedef struct { const bool mayHaveISOfid; } DesfireCreateFileCommandsS; +typedef enum { + RFTAuto, + RFTData, + RFTValue, + RFTRecord, + RFTMAC, +} DesfireReadOpFileType; + extern const CLIParserOption DesfireAlgoOpts[]; extern const CLIParserOption DesfireKDFAlgoOpts[]; extern const CLIParserOption DesfireCommunicationModeOpts[]; @@ -35,6 +43,7 @@ extern const CLIParserOption DesfireCommandSetOpts[]; extern const CLIParserOption DesfireSecureChannelOpts[]; extern const CLIParserOption DesfireFileAccessModeOpts[]; extern const CLIParserOption DesfireValueFileOperOpts[]; +extern const CLIParserOption DesfireReadFileTypeOpts[]; const char *DesfireGetErrorString(int res, uint16_t *sw); uint32_t DesfireAIDByteToUint(uint8_t *data);