aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 08:15:40 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-05-16 08:15:40 +0800
commit9a3dec0c01c67fd6ee10e499fc2abb139d077a2c (patch)
tree8276da23417c6136b6db1770aa8c085c818be7ba
parent5dcef3c8b109bd2ff41cdf6ecf84e624291892e1 (diff)
gsm0808: Add API to wrap a GSM48 msg with a BSSMAP/DTAP msg.
-rw-r--r--include/osmocore/gsm0808.h2
-rw-r--r--src/gsm0808.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/include/osmocore/gsm0808.h b/include/osmocore/gsm0808.h
index a40713f..9166e54 100644
--- a/include/osmocore/gsm0808.h
+++ b/include/osmocore/gsm0808.h
@@ -36,6 +36,8 @@ struct msgb *gsm0808_create_assignment_completed(struct gsm_lchan *lchan, uint8_
uint8_t speech_mode);
struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause);
+void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);
+
const struct tlv_definition *gsm0808_att_tlvdef();
#endif
diff --git a/src/gsm0808.c b/src/gsm0808.c
index 114ddbf..1dc035b 100644
--- a/src/gsm0808.c
+++ b/src/gsm0808.c
@@ -266,6 +266,14 @@ struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause)
return msg;
}
+void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id)
+{
+ uint8_t *hh = msgb_push(msg, 3);
+ hh[0] = BSSAP_MSG_DTAP;
+ hh[1] = link_id;
+ hh[2] = msg->len - 3;
+}
+
static const struct tlv_definition bss_att_tlvdef = {
.def = {
[GSM0808_IE_IMSI] = { TLV_TYPE_TLV },