summaryrefslogtreecommitdiffstats
path: root/src/host/gsm48-andreas
diff options
context:
space:
mode:
authorAndreas Eversberg2010-03-31 20:42:38 +0200
committerAndreas Eversberg2010-03-31 20:42:38 +0200
commit194a7025178821976f2c14be8e67621fe97ef413 (patch)
tree9b275ab4b48c7a8fa39ab2846573cc2804555d91 /src/host/gsm48-andreas
parentWork on Mobility Management: Abort process (diff)
downloadosmocom-194a7025178821976f2c14be8e67621fe97ef413.tar.gz
osmocom-194a7025178821976f2c14be8e67621fe97ef413.tar.xz
osmocom-194a7025178821976f2c14be8e67621fe97ef413.zip
Work on Mobility Management: MM information procedure
Diffstat (limited to 'src/host/gsm48-andreas')
-rw-r--r--src/host/gsm48-andreas/gsm48_l3.h2
-rw-r--r--src/host/gsm48-andreas/gsm48_mm.c48
2 files changed, 30 insertions, 20 deletions
diff --git a/src/host/gsm48-andreas/gsm48_l3.h b/src/host/gsm48-andreas/gsm48_l3.h
index f2940a0..469e886 100644
--- a/src/host/gsm48-andreas/gsm48_l3.h
+++ b/src/host/gsm48-andreas/gsm48_l3.h
@@ -242,6 +242,8 @@ struct gsm48_mmlayer {
struct timer_list t3213;
int t3212_value;
struct llist_head mm_conn;
+ char name_short[32];
+ char name_long[32];
};
/* MM connection types */
diff --git a/src/host/gsm48-andreas/gsm48_mm.c b/src/host/gsm48-andreas/gsm48_mm.c
index e1c09d0..bccbcf6 100644
--- a/src/host/gsm48-andreas/gsm48_mm.c
+++ b/src/host/gsm48-andreas/gsm48_mm.c
@@ -578,6 +578,34 @@ static int gsm48_mm_rx_abort(struct osmocom_ms *ms, struct msgb *msg)
return 0;
}
+/* 4.3.6.2 MM INFORMATION is received */
+static int gsm48_mm_rx_info(struct osmocom_ms *ms, struct msgb *msg)
+{
+ struct gsm48_hdr *gh = msgb_l3(msg);
+ unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
+ struct tlv_parsed tp;
+
+ if (payload_len < 0)
+ short:
+ DEBUGP(DMM, "Short read of location updating accept message error.\n");
+ return -EINVAL;
+ }
+ tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0);
+
+ /* long name */
+ if (TLVP_PRESENT(&tp, GSM48_IE_NAME_LONG)) {
+ decode_network_name(mm->name_long, sizeof(mm->name_long),
+ TLVP_VAL(&tp, GSM48_IE_FACILITY)-1);
+ }
+ /* short name */
+ if (TLVP_PRESENT(&tp, GSM48_IE_NAME_SHORT)) {
+ decode_network_name(mm->name_short, sizeof(mm->name_short),
+ TLVP_VAL(&tp, GSM48_IE_FACILITY)-1);
+ }
+
+ return 0;
+}
+
@@ -1056,26 +1084,6 @@ static int decode_lai(struct gsm48_loc_area_id *lai, u_int16_t *mcc, u_int16_t *
*lac = ntohs(lai->lac);
}
-/* mm info is received from lower layer */
-static int gsm48_mm_rx_info(struct osmocom_ms *ms, struct msgb *msg)
-{
- struct gsm48_hdr *gh = msgb_l3(msg);
- unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
- struct tlv_parsed tp;
-
- tlv_parse(&tp, &rsl_att_tlvdef, gh->data, payload_len, 0, 0);
- /* long name */
- if (TLVP_PRESENT(&tp, GSM48_IE_NAME_LONG)) {
- decode_network_name(name_long, sizeof(name_long),
- TLVP_VAL(&tp, GSM48_IE_FACILITY)-1);
- }
- /* short name */
- if (TLVP_PRESENT(&tp, GSM48_IE_NAME_SHORT)) {
- decode_network_name(name_short, sizeof(name_short),
- TLVP_VAL(&tp, GSM48_IE_FACILITY)-1);
- }
-}
-
/* location updating accept is received from lower layer */
static int gsm48_mm_rx_loc_upd_acc(struct osmocom_ms *ms, struct msgb *msg)