diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-16 02:25:46 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-05-16 02:49:12 +0800 |
commit | abd0719f23b98ca818cf1f6b23140a22912751c3 (patch) | |
tree | 11ca084e3d13a340c931c744b4a8aa88834e8459 /openbsc/src/gsm_04_08.c | |
parent | 5bac62216e7096e11f846117a59f708a5fe9c59f (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.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index c98643883..005ee1cae 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -574,19 +574,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_sendmsg(msg, NULL); } |