aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
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
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')
-rw-r--r--openbsc/include/openbsc/bssap.h1
-rw-r--r--openbsc/src/bssap.c20
2 files changed, 21 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bssap.h b/openbsc/include/openbsc/bssap.h
index 7b9a8d1a0..2ca2cac72 100644
--- a/openbsc/include/openbsc/bssap.h
+++ b/openbsc/include/openbsc/bssap.h
@@ -314,6 +314,7 @@ struct msgb *bssmap_create_cipher_reject(u_int8_t cause);
struct msgb *bssmap_create_sapi_reject(u_int8_t link_id);
struct msgb *bssmap_create_assignment_completed(struct gsm_lchan *lchan, u_int8_t rr_cause);
struct msgb *bssmap_create_assignment_failure(u_int8_t cause, u_int8_t *rr_cause);
+struct msgb *bssmap_create_classmark_update(const u_int8_t *classmark, u_int8_t length);
void gsm0808_send_assignment_failure(struct gsm_lchan *l, u_int8_t cause, u_int8_t *rr_value);
void gsm0808_send_assignment_compl(struct gsm_lchan *l, u_int8_t rr_value);
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");