blob: 5840886a721cb7382af1b63a02f2b09da6f052d9 [file] [log] [blame]
Daniel Willmann8b3390e2008-12-28 00:31:09 +00001/* Point-to-Point (PP) Short Message Service (SMS)
2 * Support on Mobile Radio Interface
3 * 3GPP TS 04.11 version 7.1.0 Release 1998 / ETSI TS 100 942 V7.1.0 */
4
5/* (C) 2008 by Daniel Willmann <daniel@totalueberwachung.de>
6 *
7 * All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 *
23 */
24
25
26#include <stdio.h>
27#include <stdlib.h>
28#include <string.h>
29#include <errno.h>
30#include <netinet/in.h>
31
32#include <openbsc/msgb.h>
33#include <openbsc/debug.h>
34#include <openbsc/gsm_04_11.h>
35#include <openbsc/gsm_04_08.h>
36#include <openbsc/abis_rsl.h>
37
38static int gsm411_cp_data(struct msgb *msg)
39{
40 struct gsm48_hdr *gh = msgb_l3(msg);
41 int rc = 0;
42
43 struct gsm411_rp_data_hdr *rp_data = (struct gsm411_rp_data_hdr*)msg->data;
44 u_int8_t msg_type = rp_data->msg_type & 0x07;
45
46 switch (msg_type) {
47 case GSM411_MT_RP_DATA_MO:
48 DEBUGP(DSMS, "SMS RP-DATA (MO)\n");
49 break;
50 default:
51 DEBUGP(DSMS, "Unimplemented RP type 0x%02x\n", msg_type);
52 break;
53 }
54
55 return rc;
56}
57
58int gsm0411_rcv_sms(struct msgb *msg)
59{
60 struct gsm48_hdr *gh = msgb_l3(msg);
61 u_int8_t msg_type = gh->msg_type;
62 int rc = 0;
63
64 DEBUGP(DSMS, "SMS Message\n");
65
66 switch(msg_type) {
67 case GSM411_MT_CP_DATA:
68 DEBUGP(DSMS, "SMS CP-DATA\n");
69 rc = gsm411_cp_data(msg);
70 break;
71 case GSM411_MT_CP_ACK:
72 case GSM411_MT_CP_ERROR:
73 default:
74 DEBUGP(DSMS, "Unimplemented CP msg_type: 0x%02x\n", msg_type);
75 break;
76 }
77
78
79 return rc;
80}
81