fixeria submitted this change.

View Change

Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
BSSMAP LE: handle optional LCS {Client Type, QoS} IEs

On receipt of the Perform Location Request message, the BSC needs
to forward it to the SMLC. If the abovementioned IEs are present
in the original message, they must be delivered to the SMLC too.

Change-Id: Ifeb359b0468845da0b4fed9e2e4b79256067fa81
Depends: libosmocore.git I8775a93cf4089b1752d040e43d2cba6b8997f955
Related: SYS#5891
---
M include/osmocom/bsc/lcs_loc_req.h
M src/osmo-bsc/lcs_loc_req.c
2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/include/osmocom/bsc/lcs_loc_req.h b/include/osmocom/bsc/lcs_loc_req.h
index 7b10b7e..78f9381 100644
--- a/include/osmocom/bsc/lcs_loc_req.h
+++ b/include/osmocom/bsc/lcs_loc_req.h
@@ -34,6 +34,12 @@
bool client_type_present;
enum bssmap_le_lcs_client_type client_type;

+ bool priority_present;
+ uint8_t priority;
+
+ bool qos_present;
+ struct osmo_bssmap_le_lcs_qos qos;
+
struct osmo_mobile_identity imsi;
struct osmo_mobile_identity imei;
} req;
diff --git a/src/osmo-bsc/lcs_loc_req.c b/src/osmo-bsc/lcs_loc_req.c
index 6978049..a658da8 100644
--- a/src/osmo-bsc/lcs_loc_req.c
+++ b/src/osmo-bsc/lcs_loc_req.c
@@ -134,6 +134,22 @@
} else if (lcs_loc_req->req.location_type.location_information == BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC)
PARSE_ERR("Missing LCS Client Type IE");

+ /* 3GPP TS 49.031, section 10.15 (O) "LCS Priority" */
+ if (TLVP_PRES_LEN(tp, GSM0808_IE_LCS_PRIORITY, 1)) {
+ lcs_loc_req->req.priority = *TLVP_VAL(tp, GSM0808_IE_LCS_PRIORITY);
+ lcs_loc_req->req.priority_present = true;
+ }
+
+ /* 3GPP TS 49.031, section 10.16 (C) "LCS QoS" */
+ if (TLVP_PRES_LEN(tp, GSM0808_IE_LCS_QOS, sizeof(lcs_loc_req->req.qos))) {
+ size_t qos_len = TLVP_LEN(tp, GSM0808_IE_LCS_QOS);
+ if (qos_len > sizeof(lcs_loc_req->req.qos))
+ qos_len = sizeof(lcs_loc_req->req.qos);
+ memcpy(&lcs_loc_req->req.qos, TLVP_VAL(tp, GSM0808_IE_LCS_QOS), qos_len);
+ lcs_loc_req->req.qos_present = true;
+ } else if (lcs_loc_req->req.location_type.location_information == BSSMAP_LE_LOC_INFO_CURRENT_GEOGRAPHIC)
+ PARSE_ERR("Missing LCS QoS IE");
+
if ((e = TLVP_GET(tp, GSM0808_IE_IMSI))) {
if (osmo_mobile_identity_decode(&lcs_loc_req->req.imsi, e->val, e->len, false)
|| lcs_loc_req->req.imsi.type != GSM_MI_TYPE_IMSI)
@@ -146,8 +162,6 @@
PARSE_ERR("Failed to parse IMEI IE");
}

- // FIXME LCS QoS IE is mandatory for requesting the location
-
/* A lot of IEs remain ignored... */

return true;
@@ -310,6 +324,14 @@

.lcs_client_type_present = lcs_loc_req->req.client_type_present,
.lcs_client_type = lcs_loc_req->req.client_type,
+
+ .more_items = true,
+
+ .lcs_priority_present = lcs_loc_req->req.priority_present,
+ .lcs_priority = lcs_loc_req->req.priority,
+
+ .lcs_qos_present = lcs_loc_req->req.qos_present,
+ .lcs_qos = lcs_loc_req->req.qos,
},
},
};

To view, visit change 27564. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ifeb359b0468845da0b4fed9e2e4b79256067fa81
Gerrit-Change-Number: 27564
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged