FreeCalypso > hg > fc-pcsc-tools
annotate simtool/fplmn.c @ 103:9b2cb2b9c910
fc-simtool fplmn-* commands implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 18 Feb 2021 00:17:14 +0000 |
parents | simtool/plmnsel.c@9ce95d9c5c34 |
children | 8a27f45bc1e6 |
rev | line source |
---|---|
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
2 * This module implements commands for working with EF_FPLMN. |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdio.h> |
99
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
7 #include <stdlib.h> |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
8 #include <string.h> |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
9 #include <strings.h> |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include "simresp.h" |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include "curfile.h" |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include "file_id.h" |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 static |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
15 select_ef_fplmn() |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 { |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 int rc; |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 rc = select_op(DF_GSM); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 if (rc < 0) |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 return(rc); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
22 rc = select_op(EF_FPLMN); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 if (rc < 0) |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 return(rc); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 rc = parse_ef_select_response(); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 if (rc < 0) |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 return(rc); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 if (curfile_structure != 0x00) { |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
29 fprintf(stderr, "error: EF_FPLMN is not transparent\n"); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 return(-1); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 } |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
32 if (curfile_total_size != 12) { |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 fprintf(stderr, |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
34 "error: EF_FPLMN size does not equal 12 bytes\n"); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 return(-1); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 } |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 return(0); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 } |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
40 cmd_fplmn_dump(argc, argv) |
101
63c76f9d678a
plmnsel-dump can now write to file
Mychaela Falconia <falcon@freecalypso.org>
parents:
100
diff
changeset
|
41 char **argv; |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 { |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
43 int rc; |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
44 u_char *dp; |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 char ascbuf[8]; |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
46 unsigned idx; |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
48 rc = select_ef_fplmn(); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 if (rc < 0) |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 return(rc); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
51 rc = readbin_op(0, 12); |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
52 if (rc < 0) |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
53 return(rc); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 dp = sim_resp_data; |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
55 for (idx = 0; idx < 4; idx++, dp += 3) { |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
56 if (idx) |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
57 putchar(' '); |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
58 if (dp[0] == 0xFF && dp[1] == 0xFF && dp[2] == 0xFF) |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
59 fputs("-blank-", stdout); |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
60 else { |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
61 decode_plmn_3bytes(dp, ascbuf, 1); |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
62 fputs(ascbuf, stdout); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 } |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 } |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
65 putchar('\n'); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 return(0); |
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 } |
99
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
68 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
69 cmd_fplmn_write(argc, argv) |
99
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
70 char **argv; |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
71 { |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
72 int rc; |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
73 unsigned idx; |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
74 u_char rec[3]; |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
75 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
76 rc = select_ef_fplmn(); |
99
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
77 if (rc < 0) |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
78 return(rc); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
79 idx = strtoul(argv[1], 0, 0); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
80 if (idx >= 4) { |
99
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
81 fprintf(stderr, "error: specified index is out of range\n"); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
82 return(-1); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
83 } |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
84 rc = encode_plmn_3bytes(argv[2], rec); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
85 if (rc < 0) |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
86 return(rc); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
87 return update_bin_op(idx * 3, rec, 3); |
d2e800abd257
fc-simtool plmnsel-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
88 } |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
89 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
90 cmd_fplmn_erase(argc, argv) |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
91 char **argv; |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
92 { |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
93 int rc; |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
94 unsigned idx, start, end; |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
95 u_char rec[3]; |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
96 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
97 rc = select_ef_fplmn(); |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
98 if (rc < 0) |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
99 return(rc); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
100 start = strtoul(argv[1], 0, 0); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
101 if (start >= 4) { |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
102 fprintf(stderr, |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
103 "error: specified starting index is out of range\n"); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
104 return(-1); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
105 } |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
106 if (!argv[2]) |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
107 end = start; |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
108 else if (!strcmp(argv[2], "end")) |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
109 end = 3; |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
110 else { |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
111 end = strtoul(argv[1], 0, 0); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
112 if (end >= 4) { |
100
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
113 fprintf(stderr, |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
114 "error: specified ending index is out of range\n"); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
115 return(-1); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
116 } |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
117 if (start > end) { |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
118 fprintf(stderr, |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
119 "error: reverse index range specified\n"); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
120 return(-1); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
121 } |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
122 } |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
123 memset(rec, 0xFF, 3); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
124 for (idx = start; idx <= end; idx++) { |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
125 rc = update_bin_op(idx * 3, rec, 3); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
126 if (rc < 0) |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
127 return(rc); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
128 } |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
129 return(0); |
a75c0aafb367
plmnsel-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
99
diff
changeset
|
130 } |
102
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
131 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
132 cmd_fplmn_erase_all(argc, argv) |
102
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
133 char **argv; |
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
134 { |
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
135 int rc; |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
136 u_char ffbuf[12]; |
102
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
137 |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
138 rc = select_ef_fplmn(); |
102
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
139 if (rc < 0) |
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
140 return(rc); |
103
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
141 memset(ffbuf, 0xFF, 12); |
9b2cb2b9c910
fc-simtool fplmn-* commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
102
diff
changeset
|
142 return update_bin_op(0, ffbuf, 12); |
102
9ce95d9c5c34
plmnsel-erase-all command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
101
diff
changeset
|
143 } |