aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-15 23:32:44 +0200
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-15 23:32:44 +0200
commit6eef564e2dc44048685105331382039267e90bed (patch)
tree9541d8d0ecbf4eda65ebd8f506fb8fd050736df9 /openbsc
parentdb552c56bb276a0105b1b1377d2eee2e4ed39b88 (diff)
add support for APPLICATION INFO RR messages
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h2
-rw-r--r--openbsc/src/gsm_04_08.c42
2 files changed, 44 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index 1ca1ccdb8..161364cbf 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -705,6 +705,8 @@ int gsm48_sendmsg(struct msgb *msg, struct gsm_trans *trans);
int generate_mid_from_tmsi(u_int8_t *buf, u_int32_t tmsi);
int gsm48_send_rr_release(struct gsm_lchan *lchan);
+int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
+ u_int8_t apdu_len, u_int8_t *apdu);
int bsc_upqueue(struct gsm_network *net);
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index e5ab49d76..9d9cde70d 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1825,6 +1825,24 @@ static int gsm48_rx_rr_meas_rep(struct msgb *msg)
return 0;
}
+static int gsm48_rx_rr_app_info(struct msgb *msg)
+{
+ struct gsm48_hdr *gh = msgb_l3(msg);
+ u_int8_t apdu_id_flags;
+ u_int8_t apdu_len;
+ u_int8_t *apdu_data;
+
+ apdu_id_flags = gh->data[0];
+ apdu_len = gh->data[1];
+ apdu_data = gh->data+2;
+
+ DEBUGP(DNM, "RX APPLICATION INFO id/flags=0x%02x apdu_len=%u apdu=%s",
+ apdu_id_flags, apdu_len, hexdump(apdu_data, apdu_len));
+
+ return 0;
+}
+
+
/* Receive a GSM 04.08 Radio Resource (RR) message */
static int gsm0408_rcv_rr(struct msgb *msg)
{
@@ -1854,6 +1872,9 @@ static int gsm0408_rcv_rr(struct msgb *msg)
case GSM48_MT_RR_MEAS_REP:
rc = gsm48_rx_rr_meas_rep(msg);
break;
+ case GSM48_MT_RR_APP_INFO:
+ rc = gsm48_rx_rr_app_info(msg);
+ break;
default:
fprintf(stderr, "Unimplemented GSM 04.08 RR msg type 0x%02x\n",
gh->msg_type);
@@ -1888,6 +1909,27 @@ int gsm48_send_rr_release(struct gsm_lchan *lchan)
return rsl_deact_sacch(lchan);
}
+int gsm48_send_rr_app_info(struct gsm_lchan *lchan, u_int8_t apdu_id,
+ u_int8_t apdu_len, u_int8_t *apdu)
+{
+ struct msgb *msg = gsm48_msgb_alloc();
+ struct gsm48_hdr *gh;
+
+ msg->lchan = lchan;
+
+ DEBUGP(DRR, "TX APPLICATION INFO id=0x%02x, len=%u\n",
+ apdu_id, apdu_len);
+
+ gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 2 + apdu_len);
+ gh->proto_discr = GSM48_PDISC_RR;
+ gh->msg_type = GSM48_MT_RR_APP_INFO;
+ gh->data[0] = apdu_id;
+ gh->data[1] = apdu_len;
+ memcpy(gh->data+2, apdu, apdu_len);
+
+ return gsm48_sendmsg(msg, NULL);
+}
+
/* Call Control */
/* The entire call control code is written in accordance with Figure 7.10c