aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-12-02 17:33:01 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-02-07 14:47:30 +0100
commitbc93adaf4b9e6b26fb90960eee4c896385de281c (patch)
tree73ab8720a34ca5c9e338fff6b89ba0be5f73dbdc
parent5a91319bab1a273f8575957c4b69bdebafcbd084 (diff)
libbsc: add rsl_ericsson_imm_assign_cmd() which reply with a confirmation message
ericsson can handle a reference at the end of the message which is used in the confirm message. The confirm message is only sent if the trailer is present. Change-Id: I88560291b5a3a3d7a0bac4d3c089b45f1f6b297f
-rw-r--r--openbsc/include/openbsc/abis_rsl.h3
-rw-r--r--openbsc/src/libbsc/abis_rsl.c23
2 files changed, 24 insertions, 2 deletions
diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index 692b464e0..e61d4eafd 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -57,6 +57,9 @@ int rsl_data_request(struct msgb *msg, uint8_t link_id);
int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id);
int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id);
+/* Ericcson vendor specific RSL extensions */
+int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val);
+
/* Siemens vendor-specific RSL extensions */
int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci);
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 4d296e1c9..505553407 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -1051,7 +1051,7 @@ int imsi_str2bcd(uint8_t *bcd_out, const char *str_in)
}
/* Chapter 8.5.6 */
-int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val)
+struct msgb *rsl_imm_assign_cmd_common(struct gsm_bts *bts, uint8_t len, uint8_t *val)
{
struct msgb *msg = rsl_msgb_alloc();
struct abis_rsl_dchan_hdr *dh;
@@ -1073,8 +1073,27 @@ int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val)
}
msg->dst = bts->c0->rsl_link;
+ return msg;
+}
+
+/* Chapter 8.5.6 */
+int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val)
+{
+ struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
+ if (!msg)
+ return 1;
+ return abis_rsl_sendmsg(msg);
+}
+
+/* Chapter 8.5.6 */
+int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val)
+{
+ struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val);
+
+ /* ericsson can handle a reference at the end of the message which is used in
+ * the confirm message. The confirm message is only sent if the trailer is present */
msgb_put_u8(msg, 0xf1);
- msgb_put_u32(msg, random());
+ msgb_put_u32(msg, tlli);
return abis_rsl_sendmsg(msg);
}