From 07b625dd2c2d939c861d45d5838bc9bb32a00e30 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 23 Jan 2012 10:02:58 +0100 Subject: GSM 08.08: change gsm0808_create_classmark_update() prototype The caller explicitly specifies CM2 and CM3, rather than one blob containing both. --- src/gsm/gsm0808.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 6c10177b..30098278 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -143,7 +143,8 @@ struct msgb *gsm0808_create_cipher_reject(uint8_t cause) return msg; } -struct msgb *gsm0808_create_classmark_update(const uint8_t *classmark_data, uint8_t length) +struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, + const uint8_t *cm3, uint8_t cm3_len) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "classmark-update"); @@ -151,8 +152,10 @@ struct msgb *gsm0808_create_classmark_update(const uint8_t *classmark_data, uint return NULL; msgb_v_put(msg, BSS_MAP_MSG_CLASSMARK_UPDATE); - msg->l4h = msgb_put(msg, length); - memcpy(msg->l4h, classmark_data, length); + msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T2, cm2_len, cm2); + if (cm3) + msgb_tlv_put(msg, GSM0808_IE_CLASSMARK_INFORMATION_T3, + cm3_len, cm3); msg->l3h = msgb_tv_push(msg, BSSAP_MSG_BSS_MANAGEMENT, msgb_length(msg)); -- cgit v1.2.3