summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include/osmocom/subscriber.h
diff options
context:
space:
mode:
authorAndreas Eversberg2010-04-25 18:28:24 +0200
committerAndreas Eversberg2010-04-25 18:28:24 +0200
commitf1278ad9da228145925fd613d28c082dbf2806d6 (patch)
tree7c8268c920f57e05911dfb8ed0e86442bbd8fabd /src/host/layer23/include/osmocom/subscriber.h
parentRemoved the code from gsm48-andreas. (diff)
downloadosmocom-f1278ad9da228145925fd613d28c082dbf2806d6.tar.gz
osmocom-f1278ad9da228145925fd613d28c082dbf2806d6.tar.xz
osmocom-f1278ad9da228145925fd613d28c082dbf2806d6.zip
Added new application "mobile" to layer23.
This is the current status of the layer 3 protocols. Everything compiles, radio ressource layer is partly complete. Everything is untested, so don't expect that it runs and does something usefull. The next step for me is running and debugging it. Here is the list of files that are added / modified: new file: ../include/osmocom/gsm322.h new file: ../include/osmocom/gsm48_cc.h new file: ../include/osmocom/gsm48_mm.h new file: ../include/osmocom/gsm48_rr.h modified: ../include/osmocom/l23_app.h modified: ../include/osmocom/logging.h new file: ../include/osmocom/mncc.h modified: ../include/osmocom/osmocom_data.h new file: ../include/osmocom/subscriber.h new file: ../include/osmocom/support.h new file: ../include/osmocom/sysinfo.h new file: ../include/osmocom/transaction.h modified: Makefile.am new file: app_mobile.c new file: gsm322.c new file: gsm48_cc.c new file: gsm48_mm.c new file: gsm48_rr.c modified: main.c new file: mnccms.c new file: subscriber.c new file: support.c new file: sysinfo.c new file: transaction.c
Diffstat (limited to 'src/host/layer23/include/osmocom/subscriber.h')
-rw-r--r--src/host/layer23/include/osmocom/subscriber.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/host/layer23/include/osmocom/subscriber.h b/src/host/layer23/include/osmocom/subscriber.h
new file mode 100644
index 0000000..7b6c6e3
--- /dev/null
+++ b/src/host/layer23/include/osmocom/subscriber.h
@@ -0,0 +1,73 @@
+#ifndef _SUBSCRIBER_H
+#define _SUBSCRIBER_H
+
+/* GSM 04.08 4.1.2.2 SIM update status */
+#define GSM_SIM_U0_NULL 0
+#define GSM_SIM_U1_UPDATED 1
+#define GSM_SIM_U2_NOT_UPDATED 2
+#define GSM_SIM_U3_ROAMING_NA 3
+
+struct gsm_sub_plmn_list {
+ struct llist_head entry;
+ uint16_t mcc, mnc;
+};
+
+struct gsm_sub_plmn_na {
+ struct llist_head entry;
+ uint16_t mcc, mnc;
+ uint8_t cause;
+};
+
+#define GSM_IMSI_LENGTH 16
+
+struct gsm_subscriber {
+ struct osmocom_ms *ms;
+
+ /* status */
+ uint8_t sim_valid; /* sim inserted and valid */
+ uint8_t ustate; /* update status */
+ uint8_t sim_att; /* attached state */
+
+ /* LAI */
+ uint8_t lai_valid;
+ uint16_t lai_mcc, lai_mnc, lai_lac;
+
+ /* IMSI */
+ uint16_t mcc, mnc;
+ char imsi[GSM_IMSI_LENGTH];
+
+ /* TMSI */
+ uint8_t tmsi_valid;
+ uint32_t tmsi;
+
+ /* key */
+ uint8_t key_seq; /* ciphering key sequence number */
+ uint8_t key[32]; /* up to 256 bit */
+
+ /* other */
+ struct llist_head plmn_list; /* PLMN Selector field */
+ struct llist_head plmn_na; /* not allowed PLMNs */
+ uint8_t t6m_hplmn; /* timer for hplmn search */
+
+ /* special things */
+ uint8_t always_search_hplmn;
+ /* search hplmn in other countries also (for test cards) */
+ char sim_name[32]; /* name to load/save sim */
+
+ /* PLMN last registered */
+ uint8_t plmn_valid;
+ uint16_t plmn_mcc, plmn_mnc;
+
+ /* our access */
+ uint8_t acc_barr; /* if we may access, if cell barred */
+ uint16_t acc_class; /* bitmask of what we may access */
+};
+
+int gsm_subscr_init(struct osmocom_ms *ms);
+int gsm_subscr_exit(struct osmocom_ms *ms);
+int gsm_subscr_testcard(struct osmocom_ms *ms, int mcc, int mnc, char *msin);
+int gsm_subscr_remove(struct osmocom_ms *ms);
+void new_sim_ustate(struct gsm_subscriber *subscr, int state);
+
+#endif /* _SUBSCRIBER_H */
+