diff options
-rw-r--r-- | include/osmocore/gsm0808.h | 1 | ||||
-rw-r--r-- | src/gsm0808.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/osmocore/gsm0808.h b/include/osmocore/gsm0808.h index 2d609c9e..39a439b2 100644 --- a/include/osmocore/gsm0808.h +++ b/include/osmocore/gsm0808.h @@ -26,6 +26,7 @@ struct msgb; struct msgb *gsm0808_create_layer3(struct msgb *msg, uint16_t netcode, uint16_t countrycode, int lac, uint16_t ci); struct msgb *gsm0808_create_reset(void); +struct msgb *gsm0808_create_clear_command(uint8_t reason); struct msgb *gsm0808_create_clear_complete(void); struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); struct msgb *gsm0808_create_cipher_reject(uint8_t cause); 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, |