FreeCalypso > hg > fc-pcsc-tools
annotate simtool/usersum.c @ 84:51f26fd967e2
lnd-erase command implemented
| author | Mychaela Falconia <falcon@freecalypso.org> | 
|---|---|
| date | Wed, 17 Feb 2021 06:15:15 +0000 | 
| parents | 633033af6fb8 | 
| children | b89bc690dec4 | 
| rev | line source | 
|---|---|
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 1 /* | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 2 * This module implements the user-sum (summary info) command. | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 3 */ | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 4 | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 5 #include <sys/types.h> | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 6 #include <stdio.h> | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 7 #include <stdlib.h> | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 8 #include <string.h> | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 9 #include <strings.h> | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 10 #include "simresp.h" | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 11 #include "curfile.h" | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 12 #include "file_id.h" | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 13 | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 14 #define SST_BYTES_USED 15 | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 15 | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 16 static | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 17 read_sst(sstbuf) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 18 u_char *sstbuf; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 19 { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 20 int rc; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 21 unsigned rdlen; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 22 | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 23 rc = select_op(DF_GSM); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 24 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 25 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 26 rc = select_op(EF_SST); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 27 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 28 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 29 rc = parse_ef_select_response(); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 30 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 31 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 32 if (curfile_structure != 0x00) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 33 fprintf(stderr, "error: EF_SST is not transparent\n"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 34 return(-1); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 35 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 36 if (curfile_total_size < 2) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 37 fprintf(stderr, | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 38 "error: EF_SST is shorter than spec minimum of 2 bytes\n"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 39 return(-1); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 40 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 41 rdlen = curfile_total_size; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 42 if (rdlen > SST_BYTES_USED) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 43 rdlen = SST_BYTES_USED; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 44 rc = readbin_op(0, rdlen); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 45 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 46 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 47 bcopy(sim_resp_data, sstbuf, rdlen); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 48 if (rdlen < SST_BYTES_USED) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 49 bzero(sstbuf + rdlen, SST_BYTES_USED - rdlen); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 50 return(0); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 51 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 52 | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 53 static | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 54 do_phonebook_file(file_id, ef_name, book_name) | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 55 unsigned file_id; | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 56 char *ef_name, *book_name; | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 57 { | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 58 int rc; | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 59 | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 60 rc = select_op(file_id); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 61 if (rc < 0) | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 62 return(rc); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 63 rc = parse_ef_select_response(); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 64 if (rc < 0) | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 65 return(rc); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 66 if (curfile_structure != 0x01 && curfile_structure != 0x03) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 67 fprintf(stderr, "error: %s is not record-structured\n", | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 68 ef_name); | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 69 return(-1); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 70 } | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 71 if (curfile_record_len < 14) { | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 72 fprintf(stderr, | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 73 "error: %s has record length of %u bytes, less than minimum 14\n", | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 74 ef_name, curfile_record_len); | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 75 return(-1); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 76 } | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 77 printf("%s: %u entries, %u bytes of alpha tag\n", book_name, | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 78 curfile_record_count, curfile_record_len - 14); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 79 return(0); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 80 } | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 81 | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 82 static | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 83 do_sms_store() | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 84 { | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 85 int rc; | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 86 | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 87 rc = select_op(EF_SMS); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 88 if (rc < 0) | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 89 return(rc); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 90 rc = parse_ef_select_response(); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 91 if (rc < 0) | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 92 return(rc); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 93 if (curfile_structure != 0x01 || curfile_record_len != 176) { | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 94 fprintf(stderr, | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 95 "error: EF_SMS is not linear fixed with 176-byte records\n"); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 96 return(-1); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 97 } | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 98 printf("SMS store: %u entries\n", curfile_record_count); | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 99 return(0); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 100 } | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 101 | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 102 static | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 103 do_smsp_store() | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 104 { | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 105 int rc; | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 106 | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 107 rc = select_op(EF_SMSP); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 108 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 109 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 110 rc = parse_ef_select_response(); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 111 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 112 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 113 if (curfile_structure != 0x01) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 114 fprintf(stderr, "error: EF_SMSP is not linear fixed\n"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 115 return(-1); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 116 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 117 if (curfile_record_len < 28) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 118 fprintf(stderr, | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 119 "error: EF_SMSP has record length of %u bytes, less than minimum 14\n", | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 120 curfile_record_len); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 121 return(-1); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 122 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 123 printf("SMS parameter store: %u entries, %u bytes of alpha tag\n", | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 124 curfile_record_count, curfile_record_len - 28); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 125 return(0); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 126 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 127 | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 128 cmd_user_sum() | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 129 { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 130 int rc; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 131 u_char sst[SST_BYTES_USED]; | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 132 | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 133 rc = read_sst(sst); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 134 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 135 return(rc); | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 136 rc = select_op(DF_TELECOM); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 137 if (rc < 0) | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 138 return(rc); | 
| 61 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 139 if ((sst[0] & 0x0C) == 0x0C) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 140 rc = do_phonebook_file(EF_ADN, "EF_ADN", "ADN phonebook"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 141 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 142 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 143 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 144 if ((sst[0] & 0x30) == 0x30) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 145 rc = do_phonebook_file(EF_FDN, "EF_FDN", "FDN phonebook"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 146 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 147 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 148 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 149 if ((sst[0] & 0xC0) == 0xC0) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 150 rc = do_sms_store(); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 151 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 152 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 153 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 154 if ((sst[1] & 0x03) == 0x03) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 155 printf("AoC service present\n"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 156 if ((sst[2] & 0x03) == 0x03) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 157 rc = do_phonebook_file(EF_MSISDN, "EF_MSISDN", "MSISDN record"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 158 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 159 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 160 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 161 if ((sst[2] & 0xC0) == 0xC0) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 162 rc = do_smsp_store(); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 163 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 164 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 165 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 166 if ((sst[3] & 0x03) == 0x03) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 167 rc = do_phonebook_file(EF_LND, "EF_LND", "LND cyclic store"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 168 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 169 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 170 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 171 if ((sst[4] & 0x0C) == 0x0C) { | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 172 rc = do_phonebook_file(EF_SDN, "EF_SDN", "SDN phonebook"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 173 if (rc < 0) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 174 return(rc); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 175 } | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 176 if ((sst[13] & 0x03) == 0x03) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 177 printf("MBDN present\n"); | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 178 if ((sst[13] & 0x0C) == 0x0C) | 
| 
633033af6fb8
fc-simtool user-sum command implemented,
 Mychaela Falconia <falcon@freecalypso.org> parents: 
1diff
changeset | 179 printf("MWIS present\n"); | 
| 1 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 180 return(0); | 
| 
2071b28cd0c7
simtool: first refactored version
 Mychaela Falconia <falcon@freecalypso.org> parents: diff
changeset | 181 } | 
