[layer23] Adding LAC and TMSI (both optional) to test card (rplmn)
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / mobile / settings.h
1 #ifndef _settings_h
2 #define _settings_h
3
4 /* type of test SIM key */
5 enum {
6         GSM_SIM_KEY_XOR = 0,
7         GSM_SIM_KEY_COMP128
8 };
9
10 struct gsm_settings {
11         char                    layer2_socket_path[128];
12         char                    sap_socket_path[128];
13
14         /* IMEI */
15         char                    imei[16];
16         char                    imeisv[17];
17         char                    imei_random;
18
19         /* network search */
20         int                     plmn_mode; /* PLMN_MODE_* */
21
22         /* SIM */
23         int                     sim_type; /* selects card on power on */
24         char                    emergency_imsi[20]; /* just in case... */
25
26         /* test card simulator settings */
27         char                    test_imsi[20]; /* just in case... */
28         uint32_t                test_tmsi;
29         uint8_t                 test_ki_type;
30         uint8_t                 test_ki[16]; /* 128 bit max */
31         uint8_t                 test_barr;
32         uint8_t                 test_rplmn_valid;
33         uint16_t                test_rplmn_mcc, test_rplmn_mnc;
34         uint16_t                test_lac;
35         uint8_t                 test_always; /* ...search hplmn... */
36
37         /* call related settings */
38         uint8_t                 cw; /* set if call-waiting is allowed */
39         uint8_t                 auto_answer;
40         uint8_t                 clip, clir;
41         uint8_t                 half, half_prefer;
42
43         /* changing default behavior */
44         uint8_t                 alter_tx_power;
45         uint8_t                 alter_tx_power_value;
46         int8_t                  alter_delay;
47         uint8_t                 stick;
48         uint16_t                stick_arfcn;
49         uint8_t                 no_lupd;
50
51         /* supported by configuration */
52         uint8_t                 cc_dtmf;
53         uint8_t                 sms_ptp;
54         uint8_t                 a5_1;
55         uint8_t                 a5_2;
56         uint8_t                 a5_3;
57         uint8_t                 a5_4;
58         uint8_t                 a5_5;
59         uint8_t                 a5_6;
60         uint8_t                 a5_7;
61         uint8_t                 p_gsm;
62         uint8_t                 e_gsm;
63         uint8_t                 r_gsm;
64         uint8_t                 dcs;
65         uint8_t                 class_900;
66         uint8_t                 class_dcs;
67         uint8_t                 full_v1;
68         uint8_t                 full_v2;
69         uint8_t                 full_v3;
70         uint8_t                 half_v1;
71         uint8_t                 half_v3;
72         uint8_t                 ch_cap; /* channel capability */
73         int8_t                  min_rxlev_db; /* min DB to access */
74
75         /* radio */
76         uint16_t                dsc_max;
77
78         /* dialing */
79         struct llist_head       abbrev;
80 };
81
82 struct gsm_settings_abbrev {
83         struct llist_head       list;
84         char                    abbrev[4];
85         char                    number[32];
86         char                    name[32];
87 };
88
89 int gsm_settings_init(struct osmocom_ms *ms);
90 int gsm_settings_exit(struct osmocom_ms *ms);
91 char *gsm_check_imei(const char *imei, const char *sv);
92 int gsm_random_imei(struct gsm_settings *set);
93
94 #endif /* _settings_h */
95