FreeCalypso > hg > fc-sim-tools
comparison simtool/cmdtab.c @ 14:b7ee2e85686b
command dispatch and scripting factored out into libcommon
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Mar 2021 07:34:35 +0000 |
parents | simtool/dispatch.c@ddd767f6e15b |
children | 25530c262137 |
comparison
equal
deleted
inserted
replaced
13:7c26eac6ab00 | 14:b7ee2e85686b |
---|---|
1 /* | |
2 * This module contains the command table for fc-simtool. | |
3 */ | |
4 | |
5 #include "cmdtab.h" | |
6 | |
7 extern int cmd_a38(); | |
8 extern int cmd_apdu(); | |
9 extern int cmd_atr(); | |
10 extern int cmd_bfsearch(); | |
11 extern int cmd_bfsearch_full(); | |
12 extern int cmd_cd(); | |
13 extern int cmd_change_chv(); | |
14 extern int cmd_disable_chv1(); | |
15 extern int cmd_disable_chv1_rpt(); | |
16 extern int cmd_enable_chv1(); | |
17 extern int cmd_enable_chv1_rpt(); | |
18 extern int cmd_envelope(); | |
19 extern int cmd_envelope_imm(); | |
20 extern int cmd_erase_file(); | |
21 extern int cmd_exec(); | |
22 extern int cmd_exit(); | |
23 extern int cmd_fix_sysmo_msisdn(); | |
24 extern int cmd_fplmn_dump(); | |
25 extern int cmd_fplmn_erase(); | |
26 extern int cmd_fplmn_erase_all(); | |
27 extern int cmd_fplmn_write(); | |
28 extern int cmd_fplmn_write_list(); | |
29 extern int cmd_get_response(); | |
30 extern int cmd_grcard1_set_adm(); | |
31 extern int cmd_grcard1_set_ki(); | |
32 extern int cmd_grcard1_set_pin(); | |
33 extern int cmd_grcard2_set_adm5(); | |
34 extern int cmd_grcard2_set_adm5_hex(); | |
35 extern int cmd_grcard2_set_comp128(); | |
36 extern int cmd_grcard2_set_ki(); | |
37 extern int cmd_grcard2_set_pin(); | |
38 extern int cmd_grcard2_set_puk(); | |
39 extern int cmd_grcard2_set_super(); | |
40 extern int cmd_grcard2_set_super_hex(); | |
41 extern int cmd_iccid(); | |
42 extern int cmd_imsi(); | |
43 extern int cmd_imsi_raw(); | |
44 extern int cmd_inval_adn(); | |
45 extern int cmd_lnd_dump(); | |
46 extern int cmd_lnd_erase(); | |
47 extern int cmd_lnd_restore(); | |
48 extern int cmd_lnd_write(); | |
49 extern int cmd_opl_dump(); | |
50 extern int cmd_opl_erase(); | |
51 extern int cmd_opl_write(); | |
52 extern int cmd_pb_dump(); | |
53 extern int cmd_pb_dump_rec(); | |
54 extern int cmd_pb_erase(); | |
55 extern int cmd_pb_erase_one(); | |
56 extern int cmd_pb_erase_range(); | |
57 extern int cmd_pb_restore(); | |
58 extern int cmd_pb_update(); | |
59 extern int cmd_pb_update_imm(); | |
60 extern int cmd_pb_update_imm_hex(); | |
61 extern int cmd_plmnsel_dump(); | |
62 extern int cmd_plmnsel_erase(); | |
63 extern int cmd_plmnsel_erase_all(); | |
64 extern int cmd_plmnsel_write(); | |
65 extern int cmd_plmnsel_write_list(); | |
66 extern int cmd_pnn_dump(); | |
67 extern int cmd_pnn_erase(); | |
68 extern int cmd_pnn_write(); | |
69 extern int cmd_readbin(); | |
70 extern int cmd_readef(); | |
71 extern int cmd_readrec(); | |
72 extern int cmd_rehab_adn(); | |
73 extern int cmd_rehab_imsi(); | |
74 extern int cmd_rehab_loci(); | |
75 extern int cmd_restore_file(); | |
76 extern int cmd_savebin(); | |
77 extern int cmd_save_sms_bin(); | |
78 extern int cmd_select(); | |
79 extern int cmd_sim_resp(); | |
80 extern int cmd_sms_erase_all(); | |
81 extern int cmd_sms_erase_one(); | |
82 extern int cmd_sms_erase_range(); | |
83 extern int cmd_smsp_dump(); | |
84 extern int cmd_smsp_erase_all(); | |
85 extern int cmd_smsp_erase_one(); | |
86 extern int cmd_smsp_erase_range(); | |
87 extern int cmd_smsp_restore(); | |
88 extern int cmd_smsp_set(); | |
89 extern int cmd_smsp_set_tag(); | |
90 extern int cmd_spn(); | |
91 extern int cmd_sst(); | |
92 extern int cmd_telecom_sum(); | |
93 extern int cmd_terminal_profile(); | |
94 extern int cmd_uicc_dir(); | |
95 extern int cmd_unblock_chv(); | |
96 extern int cmd_update_bin(); | |
97 extern int cmd_update_bin_imm(); | |
98 extern int cmd_update_rec(); | |
99 extern int cmd_update_rec_fill(); | |
100 extern int cmd_update_rec_imm(); | |
101 extern int cmd_user_sum(); | |
102 extern int cmd_verify_chv(); | |
103 extern int cmd_verify_ext(); | |
104 extern int cmd_verify_hex(); | |
105 extern int cmd_verify_sjs1_adm1(); | |
106 extern int cmd_write_acc(); | |
107 extern int cmd_write_iccid(); | |
108 extern int cmd_write_iccid_sh18(); | |
109 extern int cmd_write_iccid_sh19(); | |
110 extern int cmd_write_imsi(); | |
111 extern int cmd_write_imsi_sh(); | |
112 extern int cmd_write_spn(); | |
113 extern int cmd_write_sst(); | |
114 | |
115 extern int current_ef_inval(); | |
116 extern int current_ef_rehab(); | |
117 | |
118 struct cmdtab cmdtab[] = { | |
119 {"a38", 1, 1, 1, cmd_a38}, | |
120 {"apdu", 1, 1, 0, cmd_apdu}, | |
121 {"atr", 0, 0, 0, cmd_atr}, | |
122 {"bfsearch", 1, 18, 1, cmd_bfsearch}, | |
123 {"bfsearch-full", 0, 0, 1, cmd_bfsearch_full}, | |
124 {"bfsearch-mf", 0, 0, 1, cmd_bfsearch_full}, | |
125 {"cd", 1, 1, 0, cmd_cd}, | |
126 {"change-chv1", 2, 2, 0, cmd_change_chv}, | |
127 {"change-chv2", 2, 2, 0, cmd_change_chv}, | |
128 {"change-pin1", 2, 2, 0, cmd_change_chv}, | |
129 {"change-pin2", 2, 2, 0, cmd_change_chv}, | |
130 {"cur-ef-inval", 0, 0, 0, current_ef_inval}, | |
131 {"cur-ef-rehab", 0, 0, 0, current_ef_rehab}, | |
132 {"disable-chv1", 1, 1, 0, cmd_disable_chv1}, | |
133 {"disable-chv1-rpt", 1, 1, 0, cmd_disable_chv1_rpt}, | |
134 {"disable-pin1", 1, 1, 0, cmd_disable_chv1}, | |
135 {"disable-pin1-rpt", 1, 1, 0, cmd_disable_chv1_rpt}, | |
136 {"enable-chv1", 1, 1, 0, cmd_enable_chv1}, | |
137 {"enable-chv1-rpt", 1, 1, 0, cmd_enable_chv1_rpt}, | |
138 {"enable-pin1", 1, 1, 0, cmd_enable_chv1}, | |
139 {"enable-pin1-rpt", 1, 1, 0, cmd_enable_chv1_rpt}, | |
140 {"envelope", 1, 1, 0, cmd_envelope}, | |
141 {"envelope-imm", 1, 1, 0, cmd_envelope_imm}, | |
142 {"erase-file", 1, 2, 0, cmd_erase_file}, | |
143 {"exec", 1, 1, 0, cmd_exec}, | |
144 {"exit", 0, 1, 0, cmd_exit}, | |
145 {"fix-sysmo-msisdn", 0, 0, 0, cmd_fix_sysmo_msisdn}, | |
146 {"fplmn-dump", 0, 0, 1, cmd_fplmn_dump}, | |
147 {"fplmn-erase", 1, 2, 0, cmd_fplmn_erase}, | |
148 {"fplmn-erase-all", 0, 0, 0, cmd_fplmn_erase_all}, | |
149 {"fplmn-write", 2, 2, 0, cmd_fplmn_write}, | |
150 {"fplmn-write-list", 1, 1, 0, cmd_fplmn_write_list}, | |
151 {"get-response", 1, 1, 1, cmd_get_response}, | |
152 {"grcard1-set-adm1", 2, 2, 0, cmd_grcard1_set_adm}, | |
153 {"grcard1-set-adm2", 2, 2, 0, cmd_grcard1_set_adm}, | |
154 {"grcard1-set-ki", 1, 1, 0, cmd_grcard1_set_ki}, | |
155 {"grcard1-set-pin1", 2, 2, 0, cmd_grcard1_set_pin}, | |
156 {"grcard1-set-pin2", 2, 2, 0, cmd_grcard1_set_pin}, | |
157 {"grcard2-set-adm5", 1, 1, 0, cmd_grcard2_set_adm5}, | |
158 {"grcard2-set-adm5-hex", 1, 1, 0, cmd_grcard2_set_adm5_hex}, | |
159 {"grcard2-set-comp128", 1, 1, 0, cmd_grcard2_set_comp128}, | |
160 {"grcard2-set-ki", 1, 1, 0, cmd_grcard2_set_ki}, | |
161 {"grcard2-set-pin1", 1, 1, 0, cmd_grcard2_set_pin}, | |
162 {"grcard2-set-pin2", 1, 1, 0, cmd_grcard2_set_pin}, | |
163 {"grcard2-set-puk1", 1, 1, 0, cmd_grcard2_set_puk}, | |
164 {"grcard2-set-puk2", 1, 1, 0, cmd_grcard2_set_puk}, | |
165 {"grcard2-set-super", 1, 1, 0, cmd_grcard2_set_super}, | |
166 {"grcard2-set-super-hex", 1, 1, 0, cmd_grcard2_set_super_hex}, | |
167 {"iccid", 0, 0, 1, cmd_iccid}, | |
168 {"imsi", 0, 0, 1, cmd_imsi}, | |
169 {"imsi-raw", 0, 0, 1, cmd_imsi_raw}, | |
170 {"inval-adn", 0, 0, 0, cmd_inval_adn}, | |
171 {"lnd-dump", 0, 0, 1, cmd_lnd_dump}, | |
172 {"lnd-erase", 0, 0, 0, cmd_lnd_erase}, | |
173 {"lnd-restore", 1, 1, 0, cmd_lnd_restore}, | |
174 {"lnd-write", 1, 2, 0, cmd_lnd_write}, | |
175 {"opl-dump", 0, 0, 1, cmd_opl_dump}, | |
176 {"opl-erase", 1, 2, 0, cmd_opl_erase}, | |
177 {"opl-write", 5, 5, 0, cmd_opl_write}, | |
178 {"pb-dump", 1, 1, 1, cmd_pb_dump}, | |
179 {"pb-dump-rec", 2, 3, 1, cmd_pb_dump_rec}, | |
180 {"pb-erase", 1, 1, 0, cmd_pb_erase}, | |
181 {"pb-erase-one", 2, 2, 0, cmd_pb_erase_one}, | |
182 {"pb-erase-range", 3, 3, 0, cmd_pb_erase_range}, | |
183 {"pb-restore", 2, 2, 0, cmd_pb_restore}, | |
184 {"pb-update", 2, 2, 0, cmd_pb_update}, | |
185 {"pb-update-imm", 3, 4, 0, cmd_pb_update_imm}, | |
186 {"pb-update-imm-hex", 4, 4, 0, cmd_pb_update_imm_hex}, | |
187 {"plmnsel-dump", 0, 0, 1, cmd_plmnsel_dump}, | |
188 {"plmnsel-erase", 1, 2, 0, cmd_plmnsel_erase}, | |
189 {"plmnsel-erase-all", 0, 0, 0, cmd_plmnsel_erase_all}, | |
190 {"plmnsel-write", 2, 2, 0, cmd_plmnsel_write}, | |
191 {"plmnsel-write-list", 1, 1, 0, cmd_plmnsel_write_list}, | |
192 {"pnn-dump", 0, 0, 1, cmd_pnn_dump}, | |
193 {"pnn-erase", 1, 2, 0, cmd_pnn_erase}, | |
194 {"pnn-write", 2, 3, 0, cmd_pnn_write}, | |
195 {"quit", 0, 1, 0, cmd_exit}, | |
196 {"readbin", 2, 2, 1, cmd_readbin}, | |
197 {"readef", 1, 1, 1, cmd_readef}, | |
198 {"readrec", 1, 2, 1, cmd_readrec}, | |
199 {"rehab-adn", 0, 0, 0, cmd_rehab_adn}, | |
200 {"rehab-imsi", 0, 0, 0, cmd_rehab_imsi}, | |
201 {"rehab-loci", 0, 0, 0, cmd_rehab_loci}, | |
202 {"restore-file", 2, 2, 0, cmd_restore_file}, | |
203 {"savebin", 2, 2, 0, cmd_savebin}, | |
204 {"save-sms-bin", 1, 1, 0, cmd_save_sms_bin}, | |
205 {"select", 1, 1, 1, cmd_select}, | |
206 {"sim-resp", 0, 0, 1, cmd_sim_resp}, | |
207 {"sms-erase-all", 0, 0, 0, cmd_sms_erase_all}, | |
208 {"sms-erase-one", 1, 1, 0, cmd_sms_erase_one}, | |
209 {"sms-erase-range", 2, 2, 0, cmd_sms_erase_range}, | |
210 {"smsp-dump", 0, 0, 1, cmd_smsp_dump}, | |
211 {"smsp-erase-all", 0, 0, 0, cmd_smsp_erase_all}, | |
212 {"smsp-erase-one", 1, 1, 0, cmd_smsp_erase_one}, | |
213 {"smsp-erase-range", 2, 2, 0, cmd_smsp_erase_range}, | |
214 {"smsp-restore", 1, 1, 0, cmd_smsp_restore}, | |
215 {"smsp-set", 2, 6, 0, cmd_smsp_set}, | |
216 {"smsp-set-tag", 3, 7, 0, cmd_smsp_set_tag}, | |
217 {"spn", 0, 0, 1, cmd_spn}, | |
218 {"sst", 0, 0, 1, cmd_sst}, | |
219 {"telecom-sum", 0, 0, 0, cmd_telecom_sum}, | |
220 {"terminal-profile", 1, 1, 0, cmd_terminal_profile}, | |
221 {"uicc-dir", 0, 0, 1, cmd_uicc_dir}, | |
222 {"unblock-chv1", 2, 2, 0, cmd_unblock_chv}, | |
223 {"unblock-chv2", 2, 2, 0, cmd_unblock_chv}, | |
224 {"unblock-pin1", 2, 2, 0, cmd_unblock_chv}, | |
225 {"unblock-pin2", 2, 2, 0, cmd_unblock_chv}, | |
226 {"update-bin", 2, 2, 0, cmd_update_bin}, | |
227 {"update-bin-imm", 2, 2, 0, cmd_update_bin_imm}, | |
228 {"update-rec", 2, 2, 0, cmd_update_rec}, | |
229 {"update-rec-fill", 2, 2, 0, cmd_update_rec_fill}, | |
230 {"update-rec-imm", 2, 2, 0, cmd_update_rec_imm}, | |
231 {"user-sum", 0, 0, 1, cmd_user_sum}, | |
232 {"verify-chv1", 1, 1, 0, cmd_verify_chv}, | |
233 {"verify-chv2", 1, 1, 0, cmd_verify_chv}, | |
234 {"verify-ext", 2, 2, 0, cmd_verify_ext}, | |
235 {"verify-hex", 2, 2, 0, cmd_verify_hex}, | |
236 {"verify-pin1", 1, 1, 0, cmd_verify_chv}, | |
237 {"verify-pin2", 1, 1, 0, cmd_verify_chv}, | |
238 {"verify-sjs1-adm1", 1, 1, 0, cmd_verify_sjs1_adm1}, | |
239 {"write-acc", 1, 1, 0, cmd_write_acc}, | |
240 {"write-iccid", 1, 1, 0, cmd_write_iccid}, | |
241 {"write-iccid-sh18", 1, 1, 0, cmd_write_iccid_sh18}, | |
242 {"write-iccid-sh19", 1, 1, 0, cmd_write_iccid_sh19}, | |
243 {"write-imsi", 1, 1, 0, cmd_write_imsi}, | |
244 {"write-imsi-sh", 1, 1, 0, cmd_write_imsi_sh}, | |
245 {"write-spn", 2, 2, 0, cmd_write_spn}, | |
246 {"write-sst", 1, 1, 0, cmd_write_sst}, | |
247 {0, 0, 0, 0, 0} | |
248 }; |