From eb8bf3915cb4733e4e4357252893686f0d9d9d72 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 4 Mar 2010 10:32:09 +0100 Subject: 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 --- src/rsl.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src') 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 +/* (C) 2008-2010 by Harald Welte * * All Rights Reserved * @@ -24,6 +24,9 @@ #include #include +#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; -- cgit v1.2.3