FreeCalypso > hg > fc-pcsc-tools
annotate simtool/usersum.c @ 80:54cebab70c19
fc-simtool restore-file: add support for cyclic files
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Feb 2021 05:31:53 +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:
1
diff
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:
1
diff
changeset
|
8 #include <string.h> |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
14 #define SST_BYTES_USED 15 |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
17 read_sst(sstbuf) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
18 u_char *sstbuf; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
19 { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
20 int rc; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
21 unsigned rdlen; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
22 |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
23 rc = select_op(DF_GSM); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
24 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
25 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
26 rc = select_op(EF_SST); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
27 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
28 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
29 rc = parse_ef_select_response(); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
30 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
31 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
32 if (curfile_structure != 0x00) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
33 fprintf(stderr, "error: EF_SST is not transparent\n"); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
34 return(-1); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
35 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
36 if (curfile_total_size < 2) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
37 fprintf(stderr, |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
39 return(-1); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
40 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
41 rdlen = curfile_total_size; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
42 if (rdlen > SST_BYTES_USED) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
43 rdlen = SST_BYTES_USED; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
44 rc = readbin_op(0, rdlen); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
45 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
46 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
47 bcopy(sim_resp_data, sstbuf, rdlen); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
48 if (rdlen < SST_BYTES_USED) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
49 bzero(sstbuf + rdlen, SST_BYTES_USED - rdlen); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
50 return(0); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
51 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
52 |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
53 static |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
changeset
|
66 if (curfile_structure != 0x01 && curfile_structure != 0x03) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
67 fprintf(stderr, "error: %s is not record-structured\n", |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
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:
1
diff
changeset
|
102 static |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
107 rc = select_op(EF_SMSP); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
108 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
109 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
110 rc = parse_ef_select_response(); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
111 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
112 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
113 if (curfile_structure != 0x01) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
115 return(-1); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
116 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
117 if (curfile_record_len < 28) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
118 fprintf(stderr, |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
120 curfile_record_len); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
121 return(-1); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
122 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
124 curfile_record_count, curfile_record_len - 28); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
125 return(0); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
126 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
127 |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
128 cmd_user_sum() |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
129 { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
130 int rc; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
131 u_char sst[SST_BYTES_USED]; |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
132 |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
133 rc = read_sst(sst); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
134 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
139 if ((sst[0] & 0x0C) == 0x0C) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
141 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
142 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
143 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
144 if ((sst[0] & 0x30) == 0x30) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
146 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
147 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
148 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
149 if ((sst[0] & 0xC0) == 0xC0) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
150 rc = do_sms_store(); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
151 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
152 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
153 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
154 if ((sst[1] & 0x03) == 0x03) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
155 printf("AoC service present\n"); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
156 if ((sst[2] & 0x03) == 0x03) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
158 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
159 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
160 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
161 if ((sst[2] & 0xC0) == 0xC0) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
162 rc = do_smsp_store(); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
163 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
164 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
165 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
166 if ((sst[3] & 0x03) == 0x03) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
168 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
169 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
170 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
171 if ((sst[4] & 0x0C) == 0x0C) { |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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:
1
diff
changeset
|
173 if (rc < 0) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
174 return(rc); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
175 } |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
176 if ((sst[13] & 0x03) == 0x03) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
177 printf("MBDN present\n"); |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
178 if ((sst[13] & 0x0C) == 0x0C) |
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
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 } |