annotate uicc/cmdtab.c @ 103:3477438b5706 default tip

new fc-simtool command script: oper-sim-test
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 06 Aug 2022 16:34:43 +0000
parents 5560261fc516
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module contains the command table for fc-uicc-tool.
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include "cmdtab.h"
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 extern int cmd_apdu();
57
bccf028921bb apdu-checksw command added to both fc-simtool and fc-uicc-tool
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
8 extern int cmd_apdu_checksw();
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 extern int cmd_atr();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 extern int cmd_bfsearch_adf();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 extern int cmd_bfsearch_mf();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 extern int cmd_cd();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 extern int cmd_change_pin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 extern int cmd_create_file();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 extern int cmd_delete_file();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 extern int cmd_dir();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 extern int cmd_disable_pin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 extern int cmd_enable_pin();
92
5560261fc516 fc-uicc-tool: erase-file ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
19 extern int cmd_erase_file();
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 extern int cmd_exec();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 extern int cmd_exit();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 extern int cmd_get_response();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 extern int cmd_iccid();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 extern int cmd_pin_attempt_cnt();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 extern int cmd_puk_attempt_cnt();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 extern int cmd_readbin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 extern int cmd_readef();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 extern int cmd_readrec();
91
abef3d5668b9 fc-uicc-tool: restore-file ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 90
diff changeset
29 extern int cmd_restore_file();
90
3afa61d98961 fc-uicc-tool: savebin ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 86
diff changeset
30 extern int cmd_savebin();
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 extern int cmd_select();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 extern int cmd_select_aid();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 extern int cmd_select_isim();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 extern int cmd_select_usim();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 extern int cmd_sim_resp();
61
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
36 extern int cmd_sws_auth_adm1();
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
37 extern int cmd_sws_auth_pin1();
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
38 extern int cmd_sws_auth_pin2();
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
39 extern int cmd_sws_lookup();
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 extern int cmd_unblock_pin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 extern int cmd_update_bin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 extern int cmd_update_bin_imm();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 extern int cmd_update_rec();
86
de23872796cb fc-uicc-tool: update-rec-imm and update-rec-fill ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 61
diff changeset
44 extern int cmd_update_rec_fill();
de23872796cb fc-uicc-tool: update-rec-imm and update-rec-fill ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 61
diff changeset
45 extern int cmd_update_rec_imm();
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 extern int cmd_verify_hex();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 extern int cmd_verify_pin();
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 struct cmdtab cmdtab[] = {
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 {"apdu", 1, 1, 0, cmd_apdu},
57
bccf028921bb apdu-checksw command added to both fc-simtool and fc-uicc-tool
Mychaela Falconia <falcon@freecalypso.org>
parents: 15
diff changeset
51 {"apdu-checksw", 2, 2, 0, cmd_apdu_checksw},
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 {"atr", 0, 0, 0, cmd_atr},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 {"bfsearch-adf", 0, 0, 1, cmd_bfsearch_adf},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 {"bfsearch-mf", 0, 0, 1, cmd_bfsearch_mf},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 {"cd", 1, 1, 0, cmd_cd},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 {"change-pin", 3, 3, 0, cmd_change_pin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 {"create-file", 1, 1, 0, cmd_create_file},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 {"delete-file", 1, 1, 0, cmd_delete_file},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 {"dir", 0, 0, 1, cmd_dir},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 {"disable-pin", 2, 2, 0, cmd_disable_pin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 {"enable-pin", 2, 2, 0, cmd_enable_pin},
92
5560261fc516 fc-uicc-tool: erase-file ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 91
diff changeset
62 {"erase-file", 1, 2, 0, cmd_erase_file},
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 {"exec", 1, 1, 0, cmd_exec},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 {"exit", 0, 1, 0, cmd_exit},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 {"get-response", 1, 1, 1, cmd_get_response},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 {"iccid", 0, 0, 1, cmd_iccid},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 {"pin-attempt-cnt", 1, 1, 0, cmd_pin_attempt_cnt},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 {"puk-attempt-cnt", 1, 1, 0, cmd_puk_attempt_cnt},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 {"quit", 0, 1, 0, cmd_exit},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 {"readbin", 2, 2, 1, cmd_readbin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 {"readef", 1, 1, 1, cmd_readef},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 {"readrec", 1, 2, 1, cmd_readrec},
91
abef3d5668b9 fc-uicc-tool: restore-file ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 90
diff changeset
73 {"restore-file", 2, 2, 0, cmd_restore_file},
90
3afa61d98961 fc-uicc-tool: savebin ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 86
diff changeset
74 {"savebin", 2, 2, 0, cmd_savebin},
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 {"select", 1, 1, 1, cmd_select},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 {"select-aid", 1, 1, 1, cmd_select_aid},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 {"select-isim", 0, 0, 1, cmd_select_isim},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 {"select-usim", 0, 0, 1, cmd_select_usim},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 {"sim-resp", 0, 0, 1, cmd_sim_resp},
61
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
80 {"sws-auth-adm1", 0, 0, 0, cmd_sws_auth_adm1},
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
81 {"sws-auth-pin1", 0, 0, 0, cmd_sws_auth_pin1},
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
82 {"sws-auth-pin2", 0, 0, 0, cmd_sws_auth_pin2},
97646b363eaa fc-uicc-tool: sws-lookup and sws-auth-* commands ported over
Mychaela Falconia <falcon@freecalypso.org>
parents: 57
diff changeset
83 {"sws-lookup", 1, 18, 1, cmd_sws_lookup},
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 {"unblock-pin", 3, 3, 0, cmd_unblock_pin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 {"update-bin", 2, 2, 0, cmd_update_bin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 {"update-bin-imm", 2, 2, 0, cmd_update_bin_imm},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 {"update-rec", 2, 2, 0, cmd_update_rec},
86
de23872796cb fc-uicc-tool: update-rec-imm and update-rec-fill ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 61
diff changeset
88 {"update-rec-fill", 2, 2, 0, cmd_update_rec_fill},
de23872796cb fc-uicc-tool: update-rec-imm and update-rec-fill ported over from fc-simtool
Mychaela Falconia <falcon@freecalypso.org>
parents: 61
diff changeset
89 {"update-rec-imm", 2, 2, 0, cmd_update_rec_imm},
15
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 {"verify-ext", 2, 2, 0, cmd_verify_pin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 {"verify-hex", 2, 2, 0, cmd_verify_hex},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 {"verify-pin", 2, 2, 0, cmd_verify_pin},
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 {0, 0, 0, 0, 0}
b70d35f5476f fc-uicc-tool ported over
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 };