aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_08.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 19:39:27 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 19:39:27 +0800
commit2c0f16699e80ab492e3b7f8ad3de181ca90e5ef1 (patch)
tree39db270faf2221618758c9564bb01b7f8c7d0aef /openbsc/src/gsm_04_08.c
parent580cb83ae38882a5106de1a9c1bd35bf25bf9bda (diff)
gsm48: Separate CM Service Reject sending and creation.
Split out the msg generation from the sending, this will be used by the nat to send a refusal message.
Diffstat (limited to 'openbsc/src/gsm_04_08.c')
-rw-r--r--openbsc/src/gsm_04_08.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index e3eafe6a5..21bdfc51a 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -709,19 +709,17 @@ static int gsm48_tx_mm_serv_ack(struct gsm_lchan *lchan)
static int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
enum gsm48_reject_value value)
{
- struct msgb *msg = gsm48_msgb_alloc();
- struct gsm48_hdr *gh;
+ struct msgb *msg;
- gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+ msg = gsm48_create_mm_serv_rej(value);
+ if (!msg) {
+ LOGP(DMM, LOGL_ERROR, "Failed to allocate CM Service Reject.\n");
+ return -1;
+ }
+ DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value);
msg->lchan = conn->lchan;
use_subscr_con(conn);
-
- gh->proto_discr = GSM48_PDISC_MM;
- gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
- gh->data[0] = value;
- DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value);
-
return gsm48_conn_sendmsg(msg, conn, NULL);
}