diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-04 12:42:50 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-04 12:42:50 +0100 |
commit | af270a41e37f897d7598fcff173bbaa4f6454afd (patch) | |
tree | 1d95af040deecdaea43af6f4b5c766935c35d8e8 | |
parent | c25c668106e932555770b26783c93afd748212a6 (diff) |
gsm0808: Move the clear request from bsc_msc_ip to here
This method should use the msgb_tlv_put routines instead
of the stuff it is doing. This will be cleaned up.
-rw-r--r-- | include/osmocore/gsm0808.h | 1 | ||||
-rw-r--r-- | src/gsm0808.c | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/osmocore/gsm0808.h b/include/osmocore/gsm0808.h index c6d11e10..1d853775 100644 --- a/include/osmocore/gsm0808.h +++ b/include/osmocore/gsm0808.h @@ -36,6 +36,7 @@ struct msgb *gsm0808_create_assignment_completed(uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speech_mode); struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause); +struct msgb *gsm0808_create_clear_rqst(uint8_t cause); struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id); void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id); diff --git a/src/gsm0808.c b/src/gsm0808.c index 7c9fa091..dc450cc4 100644 --- a/src/gsm0808.c +++ b/src/gsm0808.c @@ -284,6 +284,26 @@ struct msgb *gsm0808_create_assignment_failure(uint8_t cause, uint8_t *rr_cause) return msg; } +struct msgb *gsm0808_create_clear_rqst(uint8_t cause) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, + "bssmap: clear rqst"); + if (!msg) + return NULL; + + msg->l3h = msgb_put(msg, 2 + 4); + msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT; + msg->l3h[1] = 4; + + msg->l3h[2] = BSS_MAP_MSG_CLEAR_RQST; + msg->l3h[3] = GSM0808_IE_CAUSE; + msg->l3h[4] = 1; + msg->l3h[5] = cause; + return msg; +} + void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id) { uint8_t *hh = msgb_push(msg, 3); |