aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_08.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-12 22:56:50 +0200
committerHarald Welte <laforge@gnumonks.org>2009-08-12 22:56:50 +0200
commit7984d5c2604131f9e44cc5a23672b6790d41754f (patch)
tree3c723965006bd47b9cc4fe7072640119ffcb4991 /openbsc/src/gsm_04_08.c
parentf0b4cef137318fb7bdeff45a86f6b68064abc697 (diff)
add functions to send AUTH REQ and REJECT
Diffstat (limited to 'openbsc/src/gsm_04_08.c')
-rw-r--r--openbsc/src/gsm_04_08.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 0523538a8..f0ec3ff96 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1408,6 +1408,34 @@ int gsm48_tx_mm_info(struct gsm_lchan *lchan)
return gsm48_sendmsg(msg, NULL);
}
+/* Section 9.2.2 */
+int gsm48_tx_mm_auth_req(struct gsm_lchan *lchan, u_int8_t *rand)
+{
+ struct msgb *msg = gsm48_msgb_alloc();
+ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
+ u_int8_t *r;
+
+ DEBUGP(DMM, "-> AUTH REQ\n");
+
+ msg->lchan = lchan;
+ gh->proto_discr = GSM48_PDISC_MM;
+ gh->msg_type = GSM48_MT_MM_AUTH_REQ;
+
+ /* 16 bytes RAND parameters */
+ r = msgb_put(msg, 16);
+ if (rand)
+ memcpy(r, rand, 16);
+
+ return gsm48_sendmsg(msg, NULL);
+}
+
+/* Section 9.2.1 */
+int gsm48_tx_mm_auth_rej(struct gsm_lchan *lchan)
+{
+ DEBUGP(DMM, "-> AUTH REJECT\n");
+ return gsm48_tx_simple(lchan, GSM48_PDISC_MM, GSM48_MT_MM_AUTH_REJ);
+}
+
static int gsm48_tx_mm_serv_ack(struct gsm_lchan *lchan)
{
DEBUGP(DMM, "-> CM SERVICE ACK\n");