FreeCalypso > hg > fc-pcsc-tools
changeset 183:2545dd27ca38
fc-simtool write-imsi-sh command implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 06 Mar 2021 05:24:26 +0000 |
parents | f4edccd4b583 |
children | 8d073ff62c48 |
files | simtool/dispatch.c simtool/miscadm.c |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/simtool/dispatch.c Sat Mar 06 05:07:46 2021 +0000 +++ b/simtool/dispatch.c Sat Mar 06 05:24:26 2021 +0000 @@ -98,6 +98,7 @@ extern int cmd_write_iccid_sh18(); extern int cmd_write_iccid_sh19(); extern int cmd_write_imsi(); +extern int cmd_write_imsi_sh(); extern int current_ef_inval(); extern int current_ef_rehab(); @@ -224,6 +225,7 @@ {"write-iccid-sh18", 1, 1, 0, cmd_write_iccid_sh18}, {"write-iccid-sh19", 1, 1, 0, cmd_write_iccid_sh19}, {"write-imsi", 1, 1, 0, cmd_write_imsi}, + {"write-imsi-sh", 1, 1, 0, cmd_write_imsi_sh}, {0, 0, 0, 0, 0} };
--- a/simtool/miscadm.c Sat Mar 06 05:07:46 2021 +0000 +++ b/simtool/miscadm.c Sat Mar 06 05:24:26 2021 +0000 @@ -120,3 +120,18 @@ pack_reversed_nibbles(nibbles, binrec + 1, 8); return write_imsi_bin(binrec); } + +cmd_write_imsi_sh(argc, argv) + char **argv; +{ + int rc; + u_char nibbles[16], binrec[9]; + + rc = parse_decimal_shorthand(argv[1], nibbles + 1, 15); + if (rc < 0) + return(rc); + nibbles[0] = 9; + binrec[0] = 8; + pack_reversed_nibbles(nibbles, binrec + 1, 8); + return write_imsi_bin(binrec); +}