summaryrefslogtreecommitdiffstats
path: root/Src/osmolib/src/host/layer23/include
diff options
context:
space:
mode:
Diffstat (limited to 'Src/osmolib/src/host/layer23/include')
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/common/Makefile.am2
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/common/logging.h2
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/common/networks.h2
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/common/osmocom_data.h2
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/common/sim.h10
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/Makefile.am5
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h33
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm480_ss.h9
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h7
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h13
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/mncc.h11
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/settings.h4
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/subscriber.h4
-rw-r--r--Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/transaction.h19
14 files changed, 103 insertions, 20 deletions
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/Makefile.am b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/Makefile.am
index 26e63cf..945c73d 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/Makefile.am
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/Makefile.am
@@ -1,2 +1,2 @@
-noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h lapdm.h logging.h \
+noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h logging.h \
networks.h gps.h sysinfo.h osmocom_data.h
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/logging.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/logging.h
index 554b767..3efa57a 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/logging.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/logging.h
@@ -12,11 +12,11 @@ enum {
DNB,
DMM,
DCC,
+ DSS,
DSMS,
DMNCC,
DMEAS,
DPAG,
- DLAPDM,
DL1C,
DSAP,
DSUM,
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/networks.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/networks.h
index e681216..d34f316 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/networks.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/networks.h
@@ -10,7 +10,7 @@ struct gsm_networks {
};
int gsm_match_mcc(uint16_t mcc, char *imsi);
-int gsm_match_mnc(uint16_t mcc, uint8_t mnc, char *imsi);
+int gsm_match_mnc(uint16_t mcc, uint16_t mnc, char *imsi);
const char *gsm_print_mcc(uint16_t mcc);
const char *gsm_print_mnc(uint16_t mcc);
const char *gsm_get_mcc(uint16_t mcc);
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 8f15007..ab7c250 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -11,7 +11,7 @@ struct osmocom_ms;
#include <osmocom/bb/mobile/support.h>
#include <osmocom/bb/mobile/settings.h>
#include <osmocom/bb/mobile/subscriber.h>
-#include <osmocom/bb/common/lapdm.h>
+#include <osmocom/gsm/lapdm.h>
#include <osmocom/bb/common/sap_interface.h>
#include <osmocom/bb/mobile/gsm48_rr.h>
#include <osmocom/bb/common/sysinfo.h>
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/sim.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/sim.h
index a676b92..95d2147 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/common/sim.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/common/sim.h
@@ -266,6 +266,16 @@ struct gsm1111_ef_adn {
uint8_t ext_id;
} __attribute__ ((packed));
+/* Section 10.5.6 */
+struct gsm1111_ef_smsp {
+ uint8_t par_ind;
+ uint8_t tp_da[12];
+ uint8_t ts_sca[12];
+ uint8_t tp_proto;
+ uint8_t tp_dcs;
+ uint8_t tp_vp;
+} __attribute__ ((packed));
+
int sim_apdu_resp(struct osmocom_ms *ms, struct msgb *msg);
int gsm_sim_init(struct osmocom_ms *ms);
int gsm_sim_exit(struct osmocom_ms *ms);
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index 65b7ce7..b58b952 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,2 +1,3 @@
-noinst_HEADERS = gsm322.h gsm48_cc.h gsm48_mm.h gsm48_rr.h mncc.h settings.h \
- subscriber.h support.h transaction.h vty.h mncc_sock.h
+noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
+ gsm48_rr.h mncc.h settings.h subscriber.h support.h \
+ transaction.h vty.h mncc_sock.h
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
new file mode 100644
index 0000000..d14e6db
--- /dev/null
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm411_sms.h
@@ -0,0 +1,33 @@
+#ifndef _GSM411_SMS_H
+#define _GSM411_SMS_H
+
+#define SMS_HDR_SIZE 128
+#define SMS_TEXT_SIZE 256
+
+struct gsm_sms {
+ unsigned long validity_minutes;
+ uint8_t reply_path_req;
+ uint8_t status_rep_req;
+ uint8_t ud_hdr_ind;
+ uint8_t protocol_id;
+ uint8_t data_coding_scheme;
+ uint8_t msg_ref;
+ char address[20+1]; /* DA LV is 12 bytes max, i.e. 10 bytes
+ * BCD == 20 bytes string */
+ time_t time;
+ uint8_t user_data_len;
+ uint8_t user_data[SMS_TEXT_SIZE];
+
+ char text[SMS_TEXT_SIZE];
+};
+
+int gsm411_sms_init(struct osmocom_ms *ms);
+int gsm411_sms_exit(struct osmocom_ms *ms);
+struct gsm_sms *sms_alloc(void);
+void sms_free(struct gsm_sms *sms);
+struct gsm_sms *sms_from_text(const char *receiver, int dcs, const char *text);
+int gsm411_rcv_sms(struct osmocom_ms *ms, struct msgb *msg);
+int sms_send(struct osmocom_ms *ms, const char *sms_sca, const char *number,
+ const char *text);
+
+#endif /* _GSM411_SMS_H */
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm480_ss.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm480_ss.h
new file mode 100644
index 0000000..ecd778e
--- /dev/null
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm480_ss.h
@@ -0,0 +1,9 @@
+#ifndef _GSM480_SS_H
+#define _GSM480_SS_H
+
+int gsm480_ss_init(struct osmocom_ms *ms);
+int gsm480_ss_exit(struct osmocom_ms *ms);
+int gsm480_rcv_ss(struct osmocom_ms *ms, struct msgb *msg);
+int ss_send(struct osmocom_ms *ms, const char *code, int new_trans);
+
+#endif /* _GSM480_SS_H */
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
index afdcf02..fb62aae 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_mm.h
@@ -58,6 +58,7 @@ struct gsm48_mmxx_hdr {
int msg_type; /* MMxx_* primitive */
uint32_t ref; /* reference to transaction */
uint32_t transaction_id; /* transaction identifier */
+ uint8_t sapi; /* sapi */
uint8_t emergency; /* emergency type of call */
uint8_t cause; /* cause used for release */
};
@@ -193,6 +194,9 @@ struct gsm48_mmlayer {
uint8_t est_cause; /* cause of establishment msg */
int mr_substate; /* rem most recent substate */
uint8_t power_off_idle; /* waits for IDLE before po */
+
+ /* sapi 3 */
+ int sapi3_link;
};
/* MM connection entry */
@@ -204,6 +208,7 @@ struct gsm48_mm_conn {
uint32_t ref; /* reference to trans */
uint8_t protocol;
uint8_t transaction_id;
+ uint8_t sapi;
int state;
};
@@ -221,7 +226,7 @@ int gsm48_mmr_dequeue(struct osmocom_ms *ms);
int gsm48_mmevent_dequeue(struct osmocom_ms *ms);
int gsm48_mmxx_downmsg(struct osmocom_ms *ms, struct msgb *msg);
struct msgb *gsm48_mmxx_msgb_alloc(int msg_type, uint32_t ref,
- uint8_t transaction_id);
+ uint8_t transaction_id, uint8_t sapi);
const char *get_mmr_name(int value);
const char *get_mmxx_name(int value);
extern const char *gsm48_mm_state_names[];
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index 1af09f4..b7280fb 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -54,6 +54,7 @@
/* GSM 04.08 RR-SAP header */
struct gsm48_rr_hdr {
uint32_t msg_type; /* RR-* primitive */
+ uint8_t sapi;
uint8_t cause;
};
@@ -63,6 +64,12 @@ struct gsm48_rr_hdr {
#define GSM48_RR_ST_DEDICATED 2
#define GSM48_RR_ST_REL_PEND 3
+/* special states for SAPI 3 link */
+#define GSM48_RR_SAPI3ST_IDLE 0
+#define GSM48_RR_SAPI3ST_WAIT_EST 1
+#define GSM48_RR_SAPI3ST_ESTAB 2
+#define GSM48_RR_SAPI3ST_WAIT_REL 3
+
/* modify state */
#define GSM48_RR_MOD_NONE 0
#define GSM48_RR_MOD_IMM_ASS 1
@@ -79,7 +86,6 @@ struct gsm48_rr_cd {
uint8_t maio;
uint8_t hsn;
uint8_t chan_nr; /* type, slot, sub slot */
- uint8_t link_id;
uint8_t ind_tx_power; /* last indicated power */
uint8_t ind_ta; /* last indicated ta */
uint8_t mob_alloc_lv[9]; /* len + up to 64 bits */
@@ -133,6 +139,7 @@ struct gsm48_rrlayer {
uint8_t rr_est_req;
struct msgb *rr_est_msg;
uint8_t est_cause; /* cause used for establishment */
+ uint8_t paging_mi_type; /* how did we got paged? */
/* channel request states */
uint8_t wait_assign; /* waiting for assignment state */
@@ -175,6 +182,10 @@ struct gsm48_rrlayer {
/* audio flow */
uint8_t audio_mode;
+
+ /* sapi 3 */
+ uint8_t sapi3_state;
+ uint8_t sapi3_link_id;
};
const char *get_rr_name(int value);
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/mncc.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/mncc.h
index 1d7f779..cad1883 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/mncc.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/mncc.h
@@ -130,11 +130,11 @@ struct gsm_call {
struct gsm_mncc {
/* context based information */
- u_int32_t msg_type;
- u_int32_t callref;
+ uint32_t msg_type;
+ uint32_t callref;
/* which fields are present */
- u_int32_t fields;
+ uint32_t fields;
/* data derived informations (MNCC_F_ based) */
struct gsm_mncc_bearer_cap bearer_cap;
@@ -161,12 +161,13 @@ struct gsm_mncc {
int emergency;
char imsi[16];
+ unsigned char lchan_type;
unsigned char lchan_mode;
};
struct gsm_data_frame {
- u_int32_t msg_type;
- u_int32_t callref;
+ uint32_t msg_type;
+ uint32_t callref;
unsigned char data[0];
};
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/settings.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/settings.h
index cd1b800..6d44696 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/settings.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/settings.h
@@ -23,6 +23,9 @@ struct gsm_settings {
int sim_type; /* selects card on power on */
char emergency_imsi[16];
+ /* SMS */
+ char sms_sca[22];
+
/* test card simulator settings */
char test_imsi[16];
uint32_t test_tmsi;
@@ -84,6 +87,7 @@ struct gsm_settings {
/* radio */
uint16_t dsc_max;
+ uint8_t force_rekey;
/* dialing */
struct llist_head abbrev;
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/subscriber.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
index cc0cfac..3e50e29 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/subscriber.h
@@ -77,6 +77,9 @@ struct gsm_subscriber {
uint32_t sim_handle_query;
uint32_t sim_handle_update;
uint32_t sim_handle_key;
+
+ /* SMS */
+ char sms_sca[22];
};
int gsm_subscr_init(struct osmocom_ms *ms);
@@ -102,6 +105,7 @@ int gsm_subscr_dump_forbidden_plmn(struct osmocom_ms *ms,
void gsm_subscr_dump(struct gsm_subscriber *subscr,
void (*print)(void *, const char *, ...), void *priv);
char *gsm_check_imsi(const char *imsi);
+int gsm_subscr_get_key_seq(struct osmocom_ms *ms, struct gsm_subscriber *subscr);
#endif /* _SUBSCRIBER_H */
diff --git a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/transaction.h b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/transaction.h
index aa62f46..8c06d5d 100644
--- a/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/transaction.h
+++ b/Src/osmolib/src/host/layer23/include/osmocom/bb/mobile/transaction.h
@@ -2,6 +2,8 @@
#define _TRANSACT_H
#include <osmocom/core/linuxlist.h>
+#include <osmocom/gsm/gsm0411_smc.h>
+#include <osmocom/gsm/gsm0411_smr.h>
/* One transaction */
struct gsm_trans {
@@ -38,18 +40,21 @@ struct gsm_trans {
struct osmo_timer_list timer;
struct gsm_mncc msg; /* stores setup/disconnect/release message */
} cc;
-#if 0
struct {
- uint8_t link_id; /* RSL Link ID to be used for this trans */
- int is_mt; /* is this a MO (0) or MT (1) transfer */
- enum gsm411_cp_state cp_state;
- struct osmo_timer_list cp_timer;
+ /* current supp.serv. state */
+ int state;
+
+ uint8_t invoke_id;
+ struct msgb *msg;
+ } ss;
+ struct {
+ uint8_t sapi; /* SAPI to be used for this trans */
- enum gsm411_rp_state rp_state;
+ struct gsm411_smc_inst smc_inst;
+ struct gsm411_smr_inst smr_inst;
struct gsm_sms *sms;
} sms;
-#endif
};
};