From a3f05d86095e5f67ca5b62702b0c4ba0324411a3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 27 Oct 2010 11:49:24 +0200 Subject: gsm0808: Add a method to create a clear command message. Use the msgb_tv_put functions for putting the data into the message. Do not support the extended error reports. --- src/gsm0808.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/gsm0808.c b/src/gsm0808.c index 636c2117..2424d8cb 100644 --- a/src/gsm0808.c +++ b/src/gsm0808.c @@ -108,6 +108,18 @@ struct msgb *gsm0808_create_clear_complete(void) return msg; } +struct msgb *gsm0808_create_clear_command(uint8_t reason) +{ + struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, + "bssmap: clear command"); + if (!msg) + return NULL; + + msg->l3h = msgb_tv_put(msg, BSSAP_MSG_BSS_MANAGEMENT, 2); + msgb_tv_put(msg, BSS_MAP_MSG_CLEAR_CMD, reason); + return msg; +} + struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, -- cgit v1.2.3