comparison simtool/names.c @ 87:2a0d1d5b9313

fc-simtool: symbolic file names implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 Jan 2021 03:43:01 +0000
parents
children 7e7eab9ea7c5
comparison
equal deleted inserted replaced
86:54c444eb084b 87:2a0d1d5b9313
1 /*
2 * This module contains the table of user-friendly file names
3 * and a function for searching this table.
4 */
5
6 #include <string.h>
7 #include <strings.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include "file_id.h"
11
12 static struct nametab {
13 char *name;
14 int file_id;
15 } name_table[] = {
16 {"MF", FILEID_MF},
17 {"DF_GSM", DF_GSM},
18 {"DF_DCS1800", DF_DCS1800},
19 {"DF_TELECOM", DF_TELECOM},
20 {"gsm", DF_GSM},
21 {"telecom", DF_TELECOM},
22 /* EFs under MF */
23 {"EF_ICCID", EF_ICCID},
24 /* EFs under DF_GSM */
25 {"EF_LP", EF_LP},
26 {"EF_IMSI", EF_IMSI},
27 {"EF_Kc", EF_Kc},
28 {"EF_PLMNsel", EF_PLMNsel},
29 {"EF_HPLMN", EF_HPLMN},
30 {"EF_ACMmax", EF_ACMmax},
31 {"EF_SST", EF_SST},
32 {"EF_ACM", EF_ACM},
33 {"EF_GID1", EF_GID1},
34 {"EF_GID2", EF_GID2},
35 {"EF_PUCT", EF_PUCT},
36 {"EF_CBMI", EF_CBMI},
37 {"EF_SPN", EF_SPN},
38 {"EF_CBMID", EF_CBMID},
39 {"EF_CBMIR", EF_CBMIR},
40 {"EF_BCCH", EF_BCCH},
41 {"EF_ACC", EF_ACC},
42 {"EF_FPLMN", EF_FPLMN},
43 {"EF_LOCI", EF_LOCI},
44 {"EF_AD", EF_AD},
45 {"EF_PHASE", EF_PHASE},
46 {"EF_ECC", EF_ECC},
47 /* EFs under DF_TELECOM */
48 {"EF_ADN", EF_ADN},
49 {"EF_FDN", EF_FDN},
50 {"EF_SMS", EF_SMS},
51 {"EF_CCP", EF_CCP},
52 {"EF_MSISDN", EF_MSISDN},
53 {"EF_SMSP", EF_SMSP},
54 {"EF_SMSS", EF_SMSS},
55 {"EF_LND", EF_LND},
56 {"EF_SDN", EF_SDN},
57 {"EF_EXT1", EF_EXT1},
58 {"EF_EXT2", EF_EXT2},
59 {"EF_EXT3", EF_EXT3},
60 /* table search terminator */
61 {0, -1}
62 };
63
64 find_symbolic_file_name(soughtname)
65 char *soughtname;
66 {
67 struct nametab *tp;
68
69 for (tp = name_table; tp->name; tp++)
70 if (!strcmp(tp->name, soughtname))
71 break;
72 return tp->file_id;
73 }