Work on Mobility Management: MM information procedure
[osmocom-bb.git] / src / host / gsm48-andreas / subscriber.h
1 /*
2  * (C) 2010 by Andreas Eversberg <jolly@eversberg.eu>
3  *
4  * All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  */
21
22 /* GSM 04.08 4.1.2.2 SIM update status */
23 #define GSM_SIM_U0_NULL         0
24 #define GSM_SIM_U1_UPDATED      1
25 #define GSM_SIM_U2_NOT_UPDATED  2
26 #define GSM_SIM_U3_ROAMING_NA   3
27
28 struct gsm_plmn_na {
29         struct llist_head       entry;
30         uint16_t                mcc, mnc;
31 }
32
33 struct gsm_subsriber {
34         /* status */
35         uint8_t                 sim_valid;
36         uint8_t                 ustate;
37
38         /* IMSI */
39         uint16_t                mcc, mnc;
40         char                    imsi[GSM_IMSI_LENGTH];
41
42         /* TMSI */
43         uint8_t                 tmsi_valid;
44         u_int32_t               tmsi;
45         u_int16_t               tmsi_mcc, tmsi_mnc, tmsi_lac;
46
47         /* key */
48         u_int8_t                key_seq; /* ciphering key sequence number */
49         u_int8_t                key[how much];
50
51         /* PLMN last registered */
52         uint8_t                 plmn_valid;
53         uint16_t                plmn_mcc, plmn_mnc, plmn_lac;
54         struct llist_head       plmn_na;
55
56         /* our access */
57         uint8_t                 barred_access;
58         uint8_t                 class_access[16];
59
60 }
61
62