summaryrefslogtreecommitdiffstats
path: root/src/rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-04 10:32:09 +0100
committerHarald Welte <laforge@gnumonks.org>2010-03-04 10:32:09 +0100
commiteb8bf3915cb4733e4e4357252893686f0d9d9d72 (patch)
tree86b18107e764569495ddeb4531dec0b189fe8025 /src/rsl.c
parent098cd4b50328790ecbd2d6e12a53f0f3177c6386 (diff)
add 'transparent' argument to rsl_rll_push_l3() and rsl_rll_push_l3()
this is required to make those functions useful for OpenBSC, nut just OsmocomBB
Diffstat (limited to 'src/rsl.c')
-rw-r--r--src/rsl.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/rsl.c b/src/rsl.c
index 6ba1375f..58afc9de 100644
--- a/src/rsl.c
+++ b/src/rsl.c
@@ -1,7 +1,7 @@
/* GSM Radio Signalling Link messages on the A-bis interface
* 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
-/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
+/* (C) 2008-2010 by Harald Welte <laforge@gnumonks.org>
*
* All Rights Reserved
*
@@ -24,6 +24,9 @@
#include <osmocore/tlv.h>
#include <osmocore/rsl.h>
+#define RSL_ALLOC_SIZE 200
+#define RSL_ALLOC_HEADROOM 56
+
void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type)
{
dh->c.msg_discr = ABIS_RSL_MDISC_RLL;
@@ -239,8 +242,8 @@ int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf)
}
/* Push a RSL RLL header with L3_INFO IE */
-int rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type,
- uint8_t chan_nr, uint8_t link_id)
+void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
+ uint8_t link_id, int transparent)
{
uint8_t l3_len = msg->tail - (uint8_t *)msgb_l3(msg);
struct abis_rsl_rll_hdr *rh;
@@ -254,21 +257,23 @@ int rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type,
/* Then push the RSL header */
rh = (struct abis_rsl_rll_hdr *) msgb_push(msg, sizeof(*rh));
rsl_init_rll_hdr(rh, msg_type);
- rh->c.msg_discr |= ABIS_RSL_MDISC_TRANSP;
+ if (transparent)
+ rh->c.msg_discr |= ABIS_RSL_MDISC_TRANSP;
rh->chan_nr = chan_nr;
rh->link_id = link_id;
/* set the l2 header pointer */
msg->l2h = (uint8_t *)rh;
-
- return 0;
}
struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
- uint8_t link_id)
+ uint8_t link_id, int transparent)
{
struct abis_rsl_rll_hdr *rh;
- struct msgb *msg = msgb_alloc(sizeof(*rh), "rsl_rll_simple");
+ struct msgb *msg;
+
+ msg = msgb_alloc_headroom(RSL_ALLOC_SIZE+RSL_ALLOC_HEADROOM,
+ RSL_ALLOC_HEADROOM, "rsl_rll_simple");
if (!msg)
return NULL;
@@ -276,7 +281,8 @@ struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
/* put the RSL header */
rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh));
rsl_init_rll_hdr(rh, msg_type);
- rh->c.msg_discr |= ABIS_RSL_MDISC_TRANSP;
+ if (transparent)
+ rh->c.msg_discr |= ABIS_RSL_MDISC_TRANSP;
rh->chan_nr = chan_nr;
rh->link_id = link_id;