aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/bssap.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-11-11 11:48:31 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-20 17:35:46 +0100
commit71465c21f40369be62cfc6165994cfd4ebe5bdd3 (patch)
tree87ff651367ccb7d78c8f18df9f2f7a8607dc5867 /openbsc/src/bssap.c
parent16d0a833f86e04475769e22b4c18f1a8ca3ac4a7 (diff)
[bssap] Implement generating a classmark update message
Generate a classmark update message from a given payload this might need to be changed to get the version2 and version3 parameters
Diffstat (limited to 'openbsc/src/bssap.c')
-rw-r--r--openbsc/src/bssap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c
index 5e03da770..ffc549852 100644
--- a/openbsc/src/bssap.c
+++ b/openbsc/src/bssap.c
@@ -550,6 +550,26 @@ struct msgb *bssmap_create_cipher_reject(u_int8_t cause)
return msg;
}
+struct msgb *bssmap_create_classmark_update(const u_int8_t *classmark_data, u_int8_t length)
+{
+ struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM,
+ "classmark-update");
+ if (!msg)
+ return NULL;
+
+ msg->l3h = msgb_put(msg, 3);
+ msg->l3h[0] = BSSAP_MSG_BSS_MANAGEMENT;
+ msg->l3h[1] = 0xff;
+ msg->l3h[2] = BSS_MAP_MSG_CLASSMARK_UPDATE;
+
+ msg->l4h = msgb_put(msg, length);
+ memcpy(msg->l4h, classmark_data, length);
+
+ /* update the size */
+ msg->l3h[1] = msgb_l3len(msg) - 2;
+ return msg;
+}
+
struct msgb *bssmap_create_sapi_reject(u_int8_t link_id)
{
struct msgb *msg = msgb_alloc(30, "bssmap: sapi 'n' reject");