January 2014 - OpenBSC - lists.osmocom.org (2024)

openbsc@lists.osmocom.org

  • 33 participants
  • 50 discussions

Start a nNew thread

January 2014 - OpenBSC - lists.osmocom.org (1)

[PATCH] sms_queue,smpp: Refactor MO SUBMIT code to make further changes easier.

by Alexander Chemeris

This is required to implement normal prefix/regexp routing in addition tothe current "if unroutable" model.--- openbsc/src/libmsc/gsm_04_11.c | 63 +++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 26 deletions(-)diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.cindex e554b74..7e8ede8 100644--- a/openbsc/src/libmsc/gsm_04_11.c+++ b/openbsc/src/libmsc/gsm_04_11.c@@ -279,6 +279,39 @@ static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms) return msg->len - old_msg_len; } +static int sms_queue_try_deliver(struct gsm_subscriber_connection *conn,+ struct msgb *msg, struct gsm_sms *gsms)+{+/* determine gsms->receiver based on dialled number */+gsms->receiver = subscr_get_by_extension(conn->bts->network, gsms->dst.addr);+if (!gsms->receiver) {+rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;+goto out;+}++switch (sms_mti) {+case GSM340_SMS_SUBMIT_MS2SC:+/* MS is submitting a SMS */+rc = gsm340_rx_sms_submit(msg, gsms);+break;+case GSM340_SMS_COMMAND_MS2SC:+case GSM340_SMS_DELIVER_REP_MS2SC:+LOGP(DLSMS, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti);+rc = GSM411_RP_CAUSE_IE_NOTEXIST;+break;+default:+LOGP(DLSMS, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti);+rc = GSM411_RP_CAUSE_IE_NOTEXIST;+break;+}++if (!rc && !gsms->receiver)+rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;++out:+return rc;+}+ /* process an incoming TPDU (called from RP-DATA) * return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *msg)@@ -393,44 +426,22 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m /* FIXME: This looks very wrong */ send_signal(0, NULL, gsms, 0); -/* determine gsms->receiver based on dialled number */-gsms->receiver = subscr_get_by_extension(conn->bts->network, gsms->dst.addr);-if (!gsms->receiver) {+rc = sms_queue_try_deliver(conn, msg, gsms);+if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { #ifdef BUILD_SMPP rc = smpp_try_deliver(gsms, conn);-if (rc == 1) {-rc = 1; /* cause 1: unknown subscriber */+if (rc == GSM411_RP_CAUSE_MO_NUM_UNASSIGNED) { osmo_counter_inc(conn->bts->network->stats.sms.no_receiver); } else if (rc < 0) {-rc = 21; /* cause 21: short message transfer rejected */+rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED; /* FIXME: handle the error somehow? */ } #else-rc = 1; /* cause 1: unknown subscriber */ osmo_counter_inc(conn->bts->network->stats.sms.no_receiver); #endif goto out; } -switch (sms_mti) {-case GSM340_SMS_SUBMIT_MS2SC:-/* MS is submitting a SMS */-rc = gsm340_rx_sms_submit(msg, gsms);-break;-case GSM340_SMS_COMMAND_MS2SC:-case GSM340_SMS_DELIVER_REP_MS2SC:-LOGP(DLSMS, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti);-rc = GSM411_RP_CAUSE_IE_NOTEXIST;-break;-default:-LOGP(DLSMS, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti);-rc = GSM411_RP_CAUSE_IE_NOTEXIST;-break;-}--if (!rc && !gsms->receiver)-rc = GSM411_RP_CAUSE_MO_NUM_UNASSIGNED;- out: sms_free(gsms); -- 1.7.9.5

10years, 2months

  • 1
  • 1

January 2014 - OpenBSC - lists.osmocom.org (2)

[PATCH] Use generic osmocom auth api

by ☎

Hi.Attached is a small patch which replaces direct call to comp128 from libosmocore toauth api call. This will help to remove comp128 from libosmocore public api and touse other auth functions in openbsc in future.-- best regards,Max, http://fairwaves.ru

10years, 2months

  • 4
  • 7

January 2014 - OpenBSC - lists.osmocom.org (3)

LAPDm code issues (ladpm.c)

by Jacob Erlbeck

Hi LAPDm guys,while I was digging into the LAPDm code to find out, why a broken SABMmessage is sent on a SAPI3 establish SACCH request during an activecall (leading to a delay of 3s between RSL EST request and response), Istumbled over the following:The initial SABM message (not the retransmitted one after T200) has anon-zero length and ends with 3 bytes that have been taken from the endof the RSL EST REQ message. The MS does not answer to this.Interestingly the second SABM message that gets sent after T200 (2s) hasa length field of 0 and no trailing garbage.The difference lies in the way the msgb is handled. Inrslms_rx_rll_est_req() the msg buffer passed from RSL is being used.In the case of IPA, the l2h is prepended by the 3 byte IPA header.Since all code in lapdm.c that handles RSL message seem to assume,that msg->data == msg->l2h, length computation is done based on thatassumption in some places. In addition, msgb_pull() is used in a waythat would also lead to undefined results in this case, e.g. inmsgb_pull_l2h() just the difference between l2h and l3h is pulled fromthe beginning (msg->data).The main difficulty to find this, was that much msgb handling is doneby manual access to the msgb fields. I'd really favor the use of thepredefined macros/inlines instead of meddling around with the fields.I've added a function msgb_pull_to_l3() to msgb.h which just skips overeverything in front of l3 (and therefore invalidates l2h and l1h) andreplaced all calls to msgb_pull_l2h() by calls to msgb_pull_to_l3().In addition, I replaced manual l3 length adjustment by calls tomsgb_trim(). That alone fixed the SABM issue described above. See thejerlbeck/fixes/lapd-sms branch for details.But AFAICS there is still something to do:- The remaining msgb_pull() need to be checked (at least the one inl2_ph_data_ind() looks suspicious to me.- L3 length computation should be done with the macros, how it is donein lapdm_send_ph_data_req() is broken.- Why does lapd_msg_ctx have a length field that is not used?- ladp_test.c should be extended to check other execution paths, too.I've tried it for dummy packets and I didn't get it working withoutfailing assertions (see below)- How l2/data/.. in a msg are expected to be used/set should bedocumented somewhere.- It should be clarified, whether all abis driver should reset the msgto start with l2.CheersJacob======The following patch still breaks the assertions, at least changing thel3len computation in lapdm_send_ph_data_req() influences but doesn't fixit.--- a/tests/lapd/lapd_test.c+++ b/tests/lapd/lapd_test.c@@ -123,8 +123,10 @@ static struct msgb *create_empty_msg(void) static struct msgb *create_dummy_data_req(void) { struct msgb *msg;+ const int dummy_l1len = 3; msg = msgb_from_array(dummy1, sizeof(dummy1));+ msgb_push(msg, dummy_l1len); rsl_rll_push_l3(msg, RSL_MT_DATA_REQ, 0, 0, 1); return msg; }

10years, 3months

  • 3
  • 5

January 2014 - OpenBSC - lists.osmocom.org (4)

Unbounded AGCH queue in OsmoBTS

by Alexander Chemeris

Hi all,We're moving this discussion to the mailing list, as it seems it ismore generic and complex than we've thought initially.The issue arose when I started doing load testing of the OsmoTRXtransceiver and disabled all gating in it. As a result, all incomingnoise was processed as valid Normal Bursts and Access Bursts and sentup to OsmoBTS. This leads to a situation, similar to a RACH flood,when there are more RACH requests coming, than a BTS could reasonablyprocess. And this leads to an unbounded increase of the AGCH queue inthe BTS - it consumes a few Mb per minute.I think that this is the root cause of the issue we've seen at aNetherlands festival installation, when 20K phones suddenly startedconnecting to our station after official networks went down. When theamount of RACH requests exceeded available CCCH capacity (took <5seconds), mobile phones stopped answering out IMM.ASS messages.Hypothesis is that the AGCH queue became so long, requests were senttoo late for a phone to receive it. And thus no phones answered to ourIMM.ASS messages. Unfortunately, I wasn't able to collect enough datato check this hypothesis during that time and we don't have anotherbig festival on hands atm.An attached is a quick fix for the unbounded queue growth. It uses ahardcoded value for the maximum queue length, which is fine for ourload testing, but not flexible enough for the real life usage. Weshould make the AGCH queue long enough to keep high performance. Atthe same time, it must not exceed MS timeout or _all_ IMM.ASS messageswill miss their target MS's.We could make this parameter user-configurable on a BTS side, but itseems more reasonable to automatically calculate it, depending on thechannel combination and timeout values. But this should be done on theBSC side. So the questions are:1) what is a good way to calculate it?2) should we configure this queue length over OML, or move the queuefrom BTS to BSC?-- Regards,Alexander Chemeris.CEO, Fairwaves LLC / ООО УмРадиоhttp://fairwaves.ru

10years, 3months

  • 5
  • 23

January 2014 - OpenBSC - lists.osmocom.org (5)

osmoSGSN

by Michal Grznár

Hi, I am trying to use osmoSGSN in topology with openGGSN and sim-bss,which is simulator of BSS made by company Alcatel-Lucent. I have a problemthat my osmoSGSN can not communicate with sim-BSS and it can not connectcorrectly. It is caused by non function bssgp. I would like to ask you, howcan I configure bssgp on osmoSGSN? I can configure ns states also from vtyon osmoSGSN but I can not bssgp states such as bvci etc...Please could youhelp me? I hope you will reply me soon.Thank you very muchBest regards, Michal Grznár

10years, 3months

  • 2
  • 3

January 2014 - OpenBSC - lists.osmocom.org (6)

[PATCH 1/5] mgcp/test: Only include conn_mode into test output

by Jacob Erlbeck

Currently the conn_mode and the output_enabled flags are printed tostdout.This patch modifies this to print the output_enabled flags to stderrinstead. The bits in conn_mode are shown as RECV, SEND, and LOOP.This does not reduce the significance of the test, since there is anassertion already that verifies the values of the output_enabledflags with respect to the conn_mode.Sponsored-by: On-Waves ehf--- openbsc/tests/mgcp/mgcp_test.c | 21 +++++++++++++++------ openbsc/tests/mgcp/mgcp_test.ok | 18 +++++++++--------- 2 files changed, 24 insertions(+), 15 deletions(-)diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.cindex fa68867..5f69072 100644--- a/openbsc/tests/mgcp/mgcp_test.c+++ b/openbsc/tests/mgcp/mgcp_test.c@@ -399,13 +399,22 @@ static void test_messages(void) else printf("Requested packetization period not set\n"); -if ((endp->conn_mode & CONN_UNMODIFIED) == 0)-printf("Connection mode: %d, "- "BTS output %sabled, NET output %sabled\n",+if ((endp->conn_mode & CONN_UNMODIFIED) == 0) {+printf("Connection mode: %d:%s%s%s%s\n", endp->conn_mode,- endp->bts_end.output_enabled ? "en" : "dis",- endp->net_end.output_enabled ? "en" : "dis");-else+ !endp->conn_mode ? " NONE" : "",+ endp->conn_mode & MGCP_CONN_SEND_ONLY ?+ " SEND" : "",+ endp->conn_mode & MGCP_CONN_RECV_ONLY ?+ " RECV" : "",+ endp->conn_mode & MGCP_CONN_LOOPBACK &+ ~MGCP_CONN_RECV_SEND ?+ " LOOP" : "");+fprintf(stderr,+"BTS output %sabled, NET output %sabled\n",+endp->bts_end.output_enabled ? "en" : "dis",+endp->net_end.output_enabled ? "en" : "dis");+} else printf("Connection mode not set\n"); OSMO_ASSERT(endp->net_end.output_enabled ==diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/openbsc/tests/mgcp/mgcp_test.okindex fbe2566..76806f9 100644--- a/openbsc/tests/mgcp/mgcp_test.ok+++ b/openbsc/tests/mgcp/mgcp_test.ok@@ -19,7 +19,7 @@ Testing CRCX Dummy packets: 1 Detected packet duration: 40 Requested packetetization period: 20-20-Connection mode: 1, BTS output enabled, NET output disabled+Connection mode: 1: RECV Testing MDCX3 Dummy packets: 1 Packet duration not set@@ -29,35 +29,35 @@ Testing MDCX4 Dummy packets: 1 Detected packet duration: 40 Requested packetetization period: 20-20-Connection mode: 3, BTS output enabled, NET output enabled+Connection mode: 3: SEND RECV Testing MDCX4_PT1 Dummy packets: 1 Detected packet duration: 40 Requested packetetization period: 20-40-Connection mode: 3, BTS output enabled, NET output enabled+Connection mode: 3: SEND RECV Testing MDCX4_PT2 Dummy packets: 1 Detected packet duration: 40 Requested packetetization period: 20-20-Connection mode: 3, BTS output enabled, NET output enabled+Connection mode: 3: SEND RECV Testing MDCX4_PT3 Dummy packets: 1 Detected packet duration: 40 Requested packetization period not set-Connection mode: 3, BTS output enabled, NET output enabled+Connection mode: 3: SEND RECV Testing MDCX4_SO Detected packet duration: 40 Requested packetetization period: 20-20-Connection mode: 2, BTS output disabled, NET output enabled+Connection mode: 2: SEND Testing DLCX Detected packet duration: 20 Requested packetization period not set-Connection mode: 0, BTS output disabled, NET output disabled+Connection mode: 0: NONE Testing CRCX_ZYN Dummy packets: 1 Packet duration not set Requested packetization period not set-Connection mode: 1, BTS output enabled, NET output disabled+Connection mode: 1: RECV Testing EMPTY Testing SHORT1 Testing SHORT2@@ -68,7 +68,7 @@ Testing RQNT2 Testing DLCX Detected packet duration: 20 Requested packetization period not set-Connection mode: 0, BTS output disabled, NET output disabled+Connection mode: 0: NONE Testing CRCX Re-transmitting CRCX Testing RQNT1-- 1.7.9.5

10years, 3months

  • 2
  • 9

January 2014 - OpenBSC - lists.osmocom.org (7)

[PATCH 1/9] Complete definitions for all speech traffic frames at MNCC interface

by Andreas Eversberg

The new definitions are: half rate and AMRChange of definition name for bad frame, because it applies to all types oftraffic, not only TCH/F.Increase MNCC interface version to 4.--- openbsc/include/openbsc/mncc.h | 6 ++++-- openbsc/src/libmsc/mncc.c | 6 +++++- openbsc/src/libtrau/trau_mux.c | 2 +- openbsc/tests/trau/trau_test.c | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-)diff --git a/openbsc/include/openbsc/mncc.h b/openbsc/include/openbsc/mncc.hindex ffc247b..c61f6b8 100644--- a/openbsc/include/openbsc/mncc.h+++ b/openbsc/include/openbsc/mncc.h@@ -95,7 +95,9 @@ struct gsm_call { #define GSM_TCHF_FRAME0x0300 #define GSM_TCHF_FRAME_EFR0x0301-#define GSM_TCHF_BAD_FRAME0x03ff+#define GSM_TCHH_FRAME0x0302+#define GSM_TCH_FRAME_AMR0x0303+#define GSM_BAD_FRAME0x03ff #define MNCC_SOCKET_HELLO0x0400 @@ -161,7 +163,7 @@ struct gsm_data_frame { unsigned chardata[0]; }; -#define MNCC_SOCK_VERSION2+#define MNCC_SOCK_VERSION4 struct gsm_mncc_hello { uint32_tmsg_type; uint32_tversion;diff --git a/openbsc/src/libmsc/mncc.c b/openbsc/src/libmsc/mncc.cindex b484772..73db5f0 100644--- a/openbsc/src/libmsc/mncc.c+++ b/openbsc/src/libmsc/mncc.c@@ -84,7 +84,11 @@ static struct mncc_names { {"MNCC_FRAME_DROP",0x0202}, {"MNCC_LCHAN_MODIFY",0x0203}, -{"GSM_TCH_FRAME",0x0300},+{"GSM_TCHF_FRAME",0x0300},+{"GSM_TCHF_FRAME_EFR",0x0301},+{"GSM_TCHH_FRAME",0x0302},+{"GSM_TCH_FRAME_AMR",0x0303},+{"GSM_BAD_FRAME",0x03ff}, {NULL, 0} }; diff --git a/openbsc/src/libtrau/trau_mux.c b/openbsc/src/libtrau/trau_mux.cindex 7b9bac0..fd1895f 100644--- a/openbsc/src/libtrau/trau_mux.c+++ b/openbsc/src/libtrau/trau_mux.c@@ -314,7 +314,7 @@ struct msgb *trau_decode_efr(uint32_t callref, return msg; bad_frame:-frame->msg_type = GSM_TCHF_BAD_FRAME;+frame->msg_type = GSM_BAD_FRAME; return msg; }diff --git a/openbsc/tests/trau/trau_test.c b/openbsc/tests/trau/trau_test.cindex f8a48db..b95f1e8 100644--- a/openbsc/tests/trau/trau_test.c+++ b/openbsc/tests/trau/trau_test.c@@ -57,7 +57,7 @@ void test_trau_fr_efr(unsigned char *data) msg = trau_decode_efr(1, &tf); OSMO_ASSERT(msg != NULL); frame = (struct gsm_data_frame *)msg->data;-OSMO_ASSERT(frame->msg_type == GSM_TCHF_BAD_FRAME);+OSMO_ASSERT(frame->msg_type == GSM_BAD_FRAME); msgb_free(msg); } -- 1.8.1.5--------------060708050209070502020504Content-Type: text/x-diff; name="0002-Use-helper-function-to-check-if-an-MNCC-frame-is-dat.patch"Content-Transfer-Encoding: 7bitContent-Disposition: attachment; filename*0="0002-Use-helper-function-to-check-if-an-MNCC-frame-is-dat.pa"; filename*1="tch"

10years, 3months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (8)

[PATCH] sms/dtap: Add log messages to analyse SMS message loss

by Jacob Erlbeck

Incoming DTAP messages from MS are discarded during silent calls,which leads to the repeated delivery of SMS since the ACKs are notbeing processed.This patch adds some log messages that have been helpful to trackthis down.Sponsored-by: On-Waves ehf--- openbsc/src/libmsc/gsm_04_08.c | 1 + openbsc/src/libmsc/osmo_msc.c | 4 ++++ openbsc/src/libmsc/silent_call.c | 5 +++++ 3 files changed, 10 insertions(+)diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.cindex bc4a9c3..cd2a0b5 100644--- a/openbsc/src/libmsc/gsm_04_08.c+++ b/openbsc/src/libmsc/gsm_04_08.c@@ -3303,6 +3303,7 @@ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) uint8_t pdisc = gh->proto_discr & 0x0f; int rc = 0; +LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message, pdisc=%d\n", pdisc); if (silent_call_reroute(conn, msg)) return silent_call_rx(conn, msg); diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.cindex 31b72b9..f3badb7 100644--- a/openbsc/src/libmsc/osmo_msc.c+++ b/openbsc/src/libmsc/osmo_msc.c@@ -59,6 +59,8 @@ static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg return BSC_API_CONN_POL_ACCEPT; if (trans_has_conn(conn)) return BSC_API_CONN_POL_ACCEPT;++LOGP(DRR, LOGL_INFO, "MSC Complete L3: Rejecting connection.\n"); return BSC_API_CONN_POL_REJECT; } @@ -71,11 +73,13 @@ static void msc_assign_compl(struct gsm_subscriber_connection *conn, uint8_t rr_cause, uint8_t chosen_channel, uint8_t encr_alg_id, uint8_t speec) {+LOGP(DRR, LOGL_DEBUG, "MSC assign complete (do nothing).\n"); } static void msc_assign_fail(struct gsm_subscriber_connection *conn, uint8_t cause, uint8_t *rr_cause) {+LOGP(DRR, LOGL_DEBUG, "MSC assign failure (do nothing).\n"); } static void msc_classmark_chg(struct gsm_subscriber_connection *conn,diff --git a/openbsc/src/libmsc/silent_call.c b/openbsc/src/libmsc/silent_call.cindex cdc82b5..4462dfc 100644--- a/openbsc/src/libmsc/silent_call.c+++ b/openbsc/src/libmsc/silent_call.c@@ -76,6 +76,7 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event, int silent_call_rx(struct gsm_subscriber_connection *conn, struct msgb *msg) { /* FIXME: do something like sending it through a UDP port */+LOGP(DLSMS, LOGL_NOTICE, "Discarding L3 message from a silent call.\n"); return 0; } @@ -109,6 +110,7 @@ int silent_call_reroute(struct gsm_subscriber_connection *conn, struct msgb *msg } /* otherwise, reroute */+LOGP(DLSMS, LOGL_INFO, "Rerouting L3 message from a silent call.\n"); return 1; } @@ -136,6 +138,9 @@ int gsm_silent_call_stop(struct gsm_subscriber *subscr) if (!conn->silent_call) return -EINVAL; +DEBUGPC(DLSMS, "Stopping silent call using Timeslot %u on ARFCN %u\n",+conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn);+ conn->silent_call = 0; msc_release_connection(conn); -- 1.7.9.5

10years, 3months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (9)

Re: RF power problems with current master of osmo-trx

by Tom Tsou

On Sat, Jan 25, 2014 at 2:57 AM, Andreas Eversberg <andreas(a)eversberg.eu> wrote:> so when i stop sending the bursts, the filler table will continue to> transmit bursts. do i understand it correctly: if i send a single idle burst> (frame??) after sending bursts, the filler table is disabled until new> bursts are sent?Sorry, I misspoke about disabling transmission. The filler tableresends the last burst in the multiframe, so the idle burst is usuallyjust a dummy burst, which does not actually stop physicaltransmission. To fully turn off the downlink signal on a particularslot requires disabling the slot by the channel combination.That said, I agree with Alexander that the retransmission portion ofthe filler table should be turned off because the behavior isincorrect. With a few exceptions (e.g. FCCH), bursts should *not* beretransmitted at L1 and doing so generates an invalid signal.Note that the filler table cannot be completely disabled because it ispart of the real-time loop that drives the device I/O. If the upperlayer does not send a burst for a particular slot, or that burstarrives late (stale burst), something still must be transmitted.Currently, in that case, the burst comes from the filler table if theslot is active or zeros if the slot is turned off. Again, I do notthink the current implementation is entirely correct, but that dependson expectations of the upper layers. -TT

10years, 3months

  • 3
  • 10

January 2014 - OpenBSC - lists.osmocom.org (10)

SMPP fixes

by Daniel Willmann

Hello,I have found a couple bugs in the read callback of smpp_smsc.c with regards toguarding against malformed packets.Please see attached patches for fixes. They are also published in openbsc branchdaniel/smpp-fixesRegarding the last fix I don't think it is necessary to receive messages up toSSIZE_MAX, but since I don't have/know a value for the maximum sensible size Ileft it like that for now.Regards,Daniel-- - Daniel Willmann <dwillmann(a)sysmocom.de> http://www.sysmocom.de/=======================================================================* sysmocom - systems for mobile communications GmbH* Schivelbeiner Str. 5* 10439 Berlin, Germany* Sitz / Registered office: Berlin, HRB 134158 B* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte

10years, 3months

  • 3
  • 12

January 2014 - OpenBSC - lists.osmocom.org (11)

[PATCH 1/9] Add function to update TRAU muxer after assignment orhandover

by Andreas Eversberg

From: Andreas Eversberg <andreas(a)eversberg.eu>E1 based BTS use TRAU muxer to decode TRAU frames. After changingchannel from one timeslot to another (due to handover or assignment),the TRAU muxer must be updated. The call reference of the call isdisconnected from the old channel and connected to the new channel.--- openbsc/include/openbsc/gsm_data.h | 14 ++++++++++++++ openbsc/include/openbsc/trau_mux.h | 3 +++ openbsc/src/libbsc/bsc_api.c | 5 +++++ openbsc/src/libbsc/handover_logic.c | 7 +++++-- openbsc/src/libmsc/gsm_04_08.c | 12 +++++++++--- openbsc/src/libtrau/trau_mux.c | 18 ++++++++++++++++++ 6 files changed, 54 insertions(+), 5 deletions(-)diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.hindex 7c3ca84..41fe328 100644--- a/openbsc/include/openbsc/gsm_data.h+++ b/openbsc/include/openbsc/gsm_data.h@@ -382,6 +382,20 @@ static inline int is_nokia_bts(struct gsm_bts *bts) return 0; } +static inline int is_e1_bts(struct gsm_bts *bts)+{+switch (bts->type) {+case GSM_BTS_TYPE_BS11:+case GSM_BTS_TYPE_RBS2000:+case GSM_BTS_TYPE_NOKIA_SITE:+return 1;+default:+break;+}++return 0;+}+ enum gsm_auth_policy gsm_auth_policy_parse(const char *arg); const char *gsm_auth_policy_name(enum gsm_auth_policy policy); diff --git a/openbsc/include/openbsc/trau_mux.h b/openbsc/include/openbsc/trau_mux.hindex 3de50f7..d211d8d 100644--- a/openbsc/include/openbsc/trau_mux.h+++ b/openbsc/include/openbsc/trau_mux.h@@ -51,6 +51,9 @@ int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref); /* send trau from application */ int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); +/* switch trau muxer to new lchan */+int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan);+ /* callback invoked if we receive TRAU frames */ int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv); diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.cindex 86d2493..e567038 100644--- a/openbsc/src/libbsc/bsc_api.c+++ b/openbsc/src/libbsc/bsc_api.c@@ -31,6 +31,7 @@ #include <openbsc/handover.h> #include <openbsc/debug.h> #include <openbsc/gsm_04_08.h>+#include <openbsc/trau_mux.h> #include <osmocom/gsm/protocol/gsm_08_08.h> @@ -419,6 +420,10 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn, return; } +/* switch TRAU muxer for E1 based BTS from one channel to another */+if (is_e1_bts(conn->bts))+switch_trau_mux(conn->lchan, conn->secondary_lchan);+ /* swap channels */ osmo_timer_del(&conn->T10); diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.cindex 9cf26af..36a758b 100644--- a/openbsc/src/libbsc/handover_logic.c+++ b/openbsc/src/libbsc/handover_logic.c@@ -39,6 +39,7 @@ #include <openbsc/signal.h> #include <osmocom/core/talloc.h> #include <openbsc/transaction.h>+#include <openbsc/trau_mux.h> struct bsc_handover { struct llist_head list;@@ -264,6 +265,10 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) osmo_timer_del(&ho->T3103); +/* switch TRAU muxer for E1 based BTS from one channel to another */+if (is_e1_bts(new_lchan->conn->bts))+switch_trau_mux(ho->old_lchan, new_lchan);+ /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n");@@ -278,8 +283,6 @@ static int ho_gsm48_ho_compl(struct gsm_lchan *new_lchan) rsl_lchan_set_state(ho->old_lchan, LCHAN_S_INACTIVE); lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); -/* do something to re-route the actual speech frames ! */- llist_del(&ho->list); talloc_free(ho); diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.cindex 0c6b100..dbb30ec 100644--- a/openbsc/src/libmsc/gsm_04_08.c+++ b/openbsc/src/libmsc/gsm_04_08.c@@ -1648,6 +1648,9 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) lchan = trans->conn->lchan; bts = lchan->ts->trx->bts; +/* store receive state */+trans->tch_recv = enable;+ switch (bts->type) { case GSM_BTS_TYPE_NANOBTS: case GSM_BTS_TYPE_OSMO_SYSMO:@@ -1655,10 +1658,8 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) LOGP(DCC, LOGL_ERROR, "Error: RTP proxy is disabled\n"); return -EINVAL; }-/* in case, we don't have a RTP socket yet, we note this- * in the transaction and try later */+/* in case, we don't have a RTP socket yet, we try later */ if (!lchan->abis_ip.rtp_socket) {-trans->tch_recv = enable; DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable); return 0; }@@ -1677,6 +1678,11 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable) case GSM_BTS_TYPE_BS11: case GSM_BTS_TYPE_RBS2000: case GSM_BTS_TYPE_NOKIA_SITE:+/* in case we don't have a TCH with correct mode, we try later */+if (lchan->tch_mode == GSM48_CMODE_SIGN) {+DEBUGP(DCC, "queue tch_recv_mncc request (%d)\n", enable);+return 0;+} if (enable) return trau_recv_lchan(lchan, callref); return trau_mux_unmap(NULL, callref);diff --git a/openbsc/src/libtrau/trau_mux.c b/openbsc/src/libtrau/trau_mux.cindex c9d77cf..7b9bac0 100644--- a/openbsc/src/libtrau/trau_mux.c+++ b/openbsc/src/libtrau/trau_mux.c@@ -31,6 +31,7 @@ #include <osmocom/core/talloc.h> #include <openbsc/trau_upqueue.h> #include <osmocom/core/crcgen.h>+#include <openbsc/transaction.h> /* this corresponds to the bit-lengths of the individual codec * parameters as indicated in Table 1.1 of TS 06.10 */@@ -518,3 +519,20 @@ int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame) return subchan_mux_enqueue(mx, dst_e1_ss->e1_ts_ss, trau_bits_out, TRAU_FRAME_BITS); }++/* switch trau muxer to new lchan */+int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan)+{+struct gsm_network *net = old_lchan->ts->trx->bts->network;+struct gsm_trans *trans;++/* look up transaction with TCH frame receive enabled */+llist_for_each_entry(trans, &net->trans_list, entry) {+if (trans->conn && trans->conn->lchan == old_lchan && trans->tch_recv) {+/* switch */+trau_recv_lchan(new_lchan, trans->callref);+}+}++return 0;+}-- 1.8.1.5

10years, 3months

  • 6
  • 37

January 2014 - OpenBSC - lists.osmocom.org (12)

GPRS, EDGE support

by Sipos Csaba

Hi Guys,I just wanted to ask a few questions about packet dataavailability/support, because I did not find the specifics on thesite.1. Is there a working GPRS/EDGE implementation in the moment? If not,what is the plan or the state of the development process?2. Which hardware should I buy, if I want to play with GPRS/EDGE? I amthinking about USRP or BladeRF, but maybe there is a betteralternative. I am willing to spend more in order to get a morefuture proof unit (for example: to have a unit which is capable ofdoing EDGE if and when it is going to be supported).3. This is not related to packet data. I wonder if I buy a USRP unit, it is possible to configure and use one USRP device with more than one TRX?In general, I think a lot of people are interested in packet data andOpenBSC/OpenBTS, it would be nice to clarify these informations on thesite.BR,Csaba

10years, 3months

  • 10
  • 32

January 2014 - OpenBSC - lists.osmocom.org (13)

Control interface and counters

by Holger Hans Peter Freyther

Dear Ivan,I noticed that you added a lot of commands to query counters. Whenwe are designing the interface we made sure to add wildcard commands.So most counters can be already read without adding a special commandfor that.holger

10years, 4months

  • 2
  • 2

January 2014 - OpenBSC - lists.osmocom.org (14)

Re: RF power problems with current master of osmo-trx

by Alexander Chemeris

Hi Thomas,I'm moving this discussion to the OpenBSC mailing list, as it hasnothing to do with UmTRX, but rather with OsmoTRX.On Sat, Jan 25, 2014 at 11:36 AM, Tom Tsou <tom(a)tsou.cc> wrote:> On Sat, Jan 25, 2014 at 1:22 AM, Andreas Eversberg <andreas(a)eversberg.eu> wrote:>> once a channel was activeated,>> there will be RF power on the specific TS, even when osmo-bts does not send>> bursts anymore. i guess that some filler table of osmo-trx causes it. i>> think it would be nice if osmo-trx would stop transmitting, when there are>> no more bursts comming from osmo-bts. (at least after a while.)>> Yes, this is the behaviour of the filler table, which will resend the> previous frame until a new frame arrives. Sending an idle frame will> disable output, which is how the filler table is managed in OpenBTS.> You can disable the filler table with this patch.Could you make this configurable from the command line or from thesocket control interface?I believe we should leave filler table as the default option, butallow one to disable it when OsmoTRX is used with OsmoBTS.-- Regards,Alexander Chemeris.CEO, Fairwaves LLC / ООО УмРадиоhttp://fairwaves.ru

10years, 4months

  • 3
  • 3

January 2014 - OpenBSC - lists.osmocom.org (15)

OsmoBTS branch for network_from_scratch.

by Andrew Back

Hello,When following the network_from_scratch instructions with a LinaroUbuntu 12.11 host, I encountered a build error when it came toOsmoBTS:linaro-ubuntu-desktop:~/osmocom/osmo-bts> makeMaking all in includemake[1]: Entering directory `/home/linaro/osmocom/osmo-bts/include'Making all in osmo-btsmake[2]: Entering directory `/home/linaro/osmocom/osmo-bts/include/osmo-bts'make[2]: Nothing to be done for `all'.make[2]: Leaving directory `/home/linaro/osmocom/osmo-bts/include/osmo-bts'make[2]: Entering directory `/home/linaro/osmocom/osmo-bts/include'make[2]: Nothing to be done for `all-am'.make[2]: Leaving directory `/home/linaro/osmocom/osmo-bts/include'make[1]: Leaving directory `/home/linaro/osmocom/osmo-bts/include'Making all in srcmake[1]: Entering directory `/home/linaro/osmocom/osmo-bts/src'Making all in commonmake[2]: Entering directory `/home/linaro/osmocom/osmo-bts/src/common' CC gsm_data_shared.o CC sysinfo.o CC logging.o CC abis.oabis.c: In function ‘abis_sock_cb’:abis.c:360:2: warning: #warning HACK [-Wcpp] CC oml.ooml.c: In function ‘rx_oml_ipa_rsl_connect’:oml.c:1049:17: warning: assignment from incompatible pointer type[enabled by default]oml.c:1053:2: warning: passing argument 1 of ‘abis_open’ fromincompatible pointer type [enabled by default]../../include/osmo-bts/abis.h:35:5: note: expected ‘struct ipabis_link*’ but argument is of type ‘struct e1inp_sign_link *’ CC bts.o CC rsl.orsl.c:140:2: warning: #warning merge lchan_lookup with OpenBSC [-Wcpp]rsl.c: In function ‘get_rsl_local_ip’:rsl.c:1265:32: error: ‘struct e1inp_sign_link’ has no member named ‘bfd’rsl.c: In function ‘rsl_rx_ipac_XXcx’:rsl.c:1398:5: warning: initialization from incompatible pointer type[enabled by default]make[2]: *** [rsl.o] Error 1make[2]: Leaving directory `/home/linaro/osmocom/osmo-bts/src/common'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/home/linaro/osmocom/osmo-bts/src'make: *** [all-recursive] Error 1linaro-ubuntu-desktop:~/osmocom/osmo-bts>This was resolved by building from branch jolly/trx_rebased instead ofjolly/trx. Should we now be using the rebased branch? If so I willupdate the wiki.Regards,Andrew-- Andrew Backhttp://carrierdetect.com

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (16)

Re: Re[2]: GPRS, EDGE support

by Don Fanning

Again, I can't speak to the USRP or BladeRF. OpenBTS is a completelydifferent project with a completely different scope. The projects sharevery little of a common code base therefore I would consider itincompatible as architecturally they are night and day. OpenBTS is a hackof GSM protocol while OpenBSC is a emulation of the GSM/GPRS mobile networkinfrastructure.If I had to recommend available compatible hardware, I would suggestcommunity based hardware like Harald's own sysmoBTS or Alexander's UmTRX.On Thu, Jan 23, 2014 at 9:37 AM, Sipos Csaba <dchardware(a)gmail.com> wrote:> Hi Don,>>> Thanks for the answer.>>> THe problem with nanobts that it is unaccessible, and even when it turns> up on ebay, it costs a fortune.>>> I'd rather pay that fortune for an USRP or half that fortune for a> bladerf, and I will have an SDR which I can use not only as a BTS.>>> So, at the moment GPRS/EDGE is only possible with nanoBTS? What about USRP> or BladeRF running OpenBTS?>>> BR,>> Csaba>>>> There has been a working GPRS stack for a while now:>> http://openbsc.osmocom.org/trac/wiki/OpenBSC_GPRS>>> As for USRP or OpenBTS, I cannot comment upon having never used either> platform.>

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (17)

[PATCH] lapd/test: Add test case for RSL EST REQ -> LAPD

by Jacob Erlbeck

This test case processes RSL establish requests for SMS (SAPI 3)on the SDCCH and the SACCH channels. The TX queues are checkedafter processing each message.Ticket: #225Sponsored-by: On-Waves ehf--- tests/lapd/lapd_test.c | 120 +++++++++++++++++++++++++++++++++++++++++------ tests/lapd/lapd_test.ok | 7 +++ 2 files changed, 112 insertions(+), 15 deletions(-)diff --git a/tests/lapd/lapd_test.c b/tests/lapd/lapd_test.cindex 37c0db8..b4594de 100644--- a/tests/lapd/lapd_test.c+++ b/tests/lapd/lapd_test.c@@ -80,6 +80,14 @@ static const uint8_t rel_req[] = { 0x02, 0x07, 0x01, 0x0a, 0x02, 0x40, 0x14, 0x01 }; +static const uint8_t est_req_sdcch_sapi3[] = {+0x02, 0x04, 0x01, 0x20, 0x02, 0x03+};++static const uint8_t est_req_sacch_sapi3[] = {+0x02, 0x04, 0x01, 0x0b, 0x02, 0x43+};+ static struct msgb *create_cm_serv_req(void) { struct msgb *msg;@@ -131,6 +139,16 @@ static struct msgb *create_rel_req(void) return msg; } +static struct msgb *create_est_req(const uint8_t *est_req, size_t est_req_size)+{+struct msgb *msg;++msg = msgb_from_array(est_req, est_req_size);+msg->l2h = msg->data;+msg->l3h = msg->l2h + sizeof(struct abis_rsl_rll_hdr);+return msg;+}+ static int send(struct msgb *in_msg, struct lapdm_channel *chan) { struct osmo_phsap_prim pp;@@ -350,6 +368,52 @@ static void test_lapdm_polling() lapdm_channel_exit(&ms_to_bts_channel); } +static void test_lapdm_contention_resolution()+{+printf("I test contention resultion by having two mobiles collide and "+"first mobile repeating SABM.\n");++int rc;+struct lapdm_polling_state test_state;+struct osmo_phsap_prim pp;++/* Configure LAPDm on both sides */+struct lapdm_channel bts_to_ms_channel;+memset(&bts_to_ms_channel, 0, sizeof(bts_to_ms_channel));++memset(&test_state, 0, sizeof(test_state));+test_state.bts = &bts_to_ms_channel;++/* BTS to MS in polling mode */+lapdm_channel_init(&bts_to_ms_channel, LAPDM_MODE_BTS);+lapdm_channel_set_flags(&bts_to_ms_channel, LAPDM_ENT_F_POLLING_ONLY);+lapdm_channel_set_l1(&bts_to_ms_channel, NULL, &test_state);+lapdm_channel_set_l3(&bts_to_ms_channel, bts_to_ms_tx_cb, &test_state);++/* Send SABM MS 1, we must get UA */+send_sabm(&bts_to_ms_channel, 0);+rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);+CHECK_RC(rc);+OSMO_ASSERT(memcmp(pp.oph.msg->l2h, ua, ARRAY_SIZE(ua)) == 0);++/* Send SABM MS 2, we must get nothing, due to collision */+send_sabm(&bts_to_ms_channel, 1);+rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);+OSMO_ASSERT(rc == -ENODEV);++/* Send SABM MS 1 again, we must get UA gain */+send_sabm(&bts_to_ms_channel, 0);+rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);+CHECK_RC(rc);+OSMO_ASSERT(memcmp(pp.oph.msg->l2h, ua, ARRAY_SIZE(ua)) == 0);++/* clean up */+lapdm_channel_exit(&bts_to_ms_channel);++/* idempotent */+lapdm_channel_exit(&bts_to_ms_channel);+}+ static void test_lapdm_early_release() { printf("I test RF channel release of an unestablished channel.\n");@@ -381,14 +445,13 @@ static void test_lapdm_early_release() lapdm_channel_exit(&bts_to_ms_channel); } -static void test_lapdm_contention_resolution()+static void lapdm_establish(const uint8_t *est_req, size_t est_req_size) {-printf("I test contention resultion by having two mobiles collide and "-"first mobile repeating SABM.\n");- int rc; struct lapdm_polling_state test_state; struct osmo_phsap_prim pp;+struct msgb *msg;+const char *queue_name; /* Configure LAPDm on both sides */ struct lapdm_channel bts_to_ms_channel;@@ -403,22 +466,39 @@ static void test_lapdm_contention_resolution() lapdm_channel_set_l1(&bts_to_ms_channel, NULL, &test_state); lapdm_channel_set_l3(&bts_to_ms_channel, bts_to_ms_tx_cb, &test_state); -/* Send SABM MS 1, we must get UA */-send_sabm(&bts_to_ms_channel, 0);+/* Send the release request */+msg = create_est_req(est_req, est_req_size);+rc = lapdm_rslms_recvmsg(msg, &bts_to_ms_channel);+fprintf(stderr, "recvmsg: got rc %d: %s\n", rc, rc <= 0 ? strerror(-rc) : "???");+OSMO_ASSERT(rc == 0);++/* Take message from queue */ rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);+if (rc >= 0)+queue_name = "DCCH";+else {+rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_acch, &pp);+if (rc >= 0)+queue_name = "ACCH";+}++fprintf(stderr, "dequeue: got rc %d: %s\n", rc,+rc <= 0 ? strerror(-rc) : "-"); CHECK_RC(rc);-OSMO_ASSERT(memcmp(pp.oph.msg->l2h, ua, ARRAY_SIZE(ua)) == 0); -/* Send SABM MS 2, we must get nothing, due to collision */-send_sabm(&bts_to_ms_channel, 1);-rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);-OSMO_ASSERT(rc == -ENODEV);+printf("Took message from %s queue: L2 header size %d, "+ "SAP %#x, %d/%d, Link 0x%02x\n",+ queue_name, msgb_l2len(pp.oph.msg) - msgb_l3len(pp.oph.msg),+ pp.oph.sap, pp.oph.primitive, pp.oph.operation,+ pp.u.data.link_id);+printf("Message: %s\n", osmo_hexdump(pp.oph.msg->data, pp.oph.msg->len));++OSMO_ASSERT(pp.oph.msg->data == msgb_l2(pp.oph.msg)); -/* Send SABM MS 1 again, we must get UA gain */-send_sabm(&bts_to_ms_channel, 0); rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_dcch, &pp);-CHECK_RC(rc);-OSMO_ASSERT(memcmp(pp.oph.msg->l2h, ua, ARRAY_SIZE(ua)) == 0);+OSMO_ASSERT(rc < 0);+rc = lapdm_phsap_dequeue_prim(&bts_to_ms_channel.lapdm_acch, &pp);+OSMO_ASSERT(rc < 0); /* clean up */ lapdm_channel_exit(&bts_to_ms_channel);@@ -427,6 +507,15 @@ static void test_lapdm_contention_resolution() lapdm_channel_exit(&bts_to_ms_channel); } +static void test_lapdm_establishment()+{+printf("I test RF channel establishment.\n");+printf("Testing SAPI3/SDCCH\n");+lapdm_establish(est_req_sdcch_sapi3, sizeof(est_req_sdcch_sapi3));+printf("Testing SAPI3/SACCH\n");+lapdm_establish(est_req_sacch_sapi3, sizeof(est_req_sacch_sapi3));+}+ int main(int argc, char **argv) { osmo_init_logging(&info);@@ -434,6 +523,7 @@ int main(int argc, char **argv) test_lapdm_polling(); test_lapdm_early_release(); test_lapdm_contention_resolution();+test_lapdm_establishment(); printf("Success.\n"); return 0;diff --git a/tests/lapd/lapd_test.ok b/tests/lapd/lapd_test.okindex 27389bf..e4b1359 100644--- a/tests/lapd/lapd_test.ok+++ b/tests/lapd/lapd_test.ok@@ -21,4 +21,11 @@ I test RF channel release of an unestablished channel. I test contention resultion by having two mobiles collide and first mobile repeating SABM. bts_to_ms_tx_cb: MS->BTS(us) message 25 BTS: Verifying CM request.+I test RF channel establishment.+Testing SAPI3/SDCCH+Took message from DCCH queue: L2 header size 3, SAP 0x1000000, 0/0, Link 0x03+Message: 0f 3f 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Testing SAPI3/SACCH+Took message from ACCH queue: L2 header size 5, SAP 0x1000000, 0/0, Link 0x43+Message: 00 00 0f 3f 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Success.-- 1.7.9.5

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (18)

RE: Re[2]: GPRS, EDGE support

by Ralph A. Schmid, dk5ras

OpenBTS supports GPRS, but at least for me it does not work very reliably, I consider this only a proof of concept. While voice/SMS range is up to 200m, GPRS breaks down after 5m (!) distance, and the connection stalls after a while, requiring a restart of OpenBTS. I am using an USRP1 with WBX board. Ralph. From: openbsc-bounces(a)lists.osmocom.org [mailto:openbsc-bounces@lists.osmocom.org] On Behalf Of Sipos CsabaSent: Thursday, 23 January, 2014 18:37To: Don FanningCc: openbsc(a)lists.osmocom.orgSubject: Re[2]: GPRS, EDGE support Hi Don, Thanks for the answer. THe problem with nanobts that it is unaccessible, and even when it turns up on ebay, it costs a fortune. I'd rather pay that fortune for an USRP or half that fortune for a bladerf, and I will have an SDR which I can use not only as a BTS. So, at the moment GPRS/EDGE is only possible with nanoBTS? What about USRP or BladeRF running OpenBTS? BR,Csaba There has been a working GPRS stack for a while now:http://openbsc.osmocom.org/trac/wiki/OpenBSC_GPRS As for USRP or OpenBTS, I cannot comment upon having never used either platform.

10years, 4months

  • 2
  • 2

January 2014 - OpenBSC - lists.osmocom.org (19)

RE: Re[4]: GPRS, EDGE support

by Ralph A. Schmid, dk5ras

Well, at least voice and SMS is not affected and works just great. GPRS uses only an open power control, no closed loop, maybe it has to do with this? At the moment I do not have other hardware for comparison, so digging deeper into this may be not so useful. The issue is discussed on the OpenBTS mailing list, with no clear results at the moment.Ralph. From: Sipos Csaba [mailto:dchardware@gmail.com] Sent: Thursday, 23 January, 2014 22:01To: Ralph A. Schmid, dk5rasCc: 'Don Fanning'; openbsc(a)lists.osmocom.orgSubject: Re[4]: GPRS, EDGE support Thanks for the info! At least now I know, that the GPRS/EDGE is part of the OpenBTS code, so any hardware is OK for packet data which can run OpenBTS. That is good news. Anyway, it is just an educated guess, but don't you think your problem with GPRS is related to timing? My experience with real life networks clearly shows that even a slight timing related problem or inaccuracy can led to something like that. My other experience is with R&S CMW500, which I used with a little external antenna and encountered the same problem. After a few meters even the voice calls started to drop with -60 RSSI. The reason was obvious: the device lacks any filters on the input chain (it is designed for production mode), and when all the received RF energy hits the receiver from all the bands, it causes problems like that. And the packet data was way more sensitive to this than voice calls. After installing proper filters, the problem is gone. BR,Csaba OpenBTS supports GPRS, but at least for me it does not work very reliably, I consider this only a proof of concept. While voice/SMS range is up to 200m, GPRS breaks down after 5m (!) distance, and the connection stalls after a while, requiring a restart of OpenBTS. I am using an USRP1 with WBX board. Ralph.

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (20)

Re: Re[4]: GPRS, EDGE support

by Alexander Chemeris

Csaba,We use UmTRX routinely to develop GPRS code for OpenBSC and it works well.I can't say much about other SDR equipment, but we have some timing relatedbugs with USRP1 based devices of one of our customers.Regarding the official OpenBTS GPRS code - we've never tried to run it, butlooking into the code, it lacks quite a few features the OpenBSCimplementation has.On Fri, Jan 24, 2014 at 1:01 AM, Sipos Csaba <dchardware(a)gmail.com> wrote:> Thanks for the info!>>> At least now I know, that the GPRS/EDGE is part of the OpenBTS code, so> any hardware is OK for packet data which can run OpenBTS. That is good news.>>> Anyway, it is just an educated guess, but don't you think your problem> with GPRS is related to timing? My experience with real life networks> clearly shows that even a slight timing related problem or inaccuracy can> led to something like that.>>> My other experience is with R&S CMW500, which I used with a little> external antenna and encountered the same problem. After a few meters even> the voice calls started to drop with -60 RSSI. The reason was obvious: the> device lacks any filters on the input chain (it is designed for production> mode), and when all the received RF energy hits the receiver from all the> bands, it causes problems like that. And the packet data was way more> sensitive to this than voice calls. After installing proper filters, the> problem is gone.>>> BR,>> Csaba>>>> OpenBTS supports GPRS, but at least for me it does not work very> reliably, I consider this only a proof of concept. While voice/SMS range is> up to 200m, GPRS breaks down after 5m (!) distance, and the connection> stalls after a while, requiring a restart of OpenBTS. I am using an USRP1> with WBX board.>>>> Ralph.>-- Regards,Alexander Chemeris.CEO, Fairwaves LLC / ООО УмРадиоhttp://fairwaves.ru

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (21)

[PATCH] Support of multiple RSL connections for ABIS/ipaccess (BTSside)

by Andreas Eversberg

hi,while re-basing the osmo-bts-trx code with master, i saw that the ABIScode has been replaced by libosmo-abis. libosmo-abis is not capable ofhandling multiple RSL connections, so the multi-TRX support is brokenow. the attached patch will add multiple RSL connection support tolibosmo-abis.regards,andreas

10years, 4months

  • 2
  • 10

January 2014 - OpenBSC - lists.osmocom.org (22)

Re: Openbsc support for new BTS

by Harald Welte

Hi Jason,On Fri, Nov 08, 2013 at 01:21:46PM +0000, Jason DSouza wrote:> But I'm waiting at Opstart for Obj Class - RADIO_CARRIER to trigger> trx-init() which is never received from BSC. That is where I'm struck> now. All this so far is similar to sysmobts interface, something> similar to bts_model_opstart() function in osmo-bts-sysmo.Please see the following code from bts_ipaccess_nanobts.c:==============/* Callback function to be called whenever we get a GSM 12.21 state change event */static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd){[...]case NM_OC_RADIO_CARRIER:trx = obj;if (new_state->operational == NM_OPSTATE_DISABLED && new_state->availability == NM_AVSTATE_OK)abis_nm_opstart(trx->bts, obj_class, trx->bts->bts_nr,trx->nr, 0xff);break;==============So the opstrart for the RADIO_CARRIER is sent in response to an incomingNM_MT_STATECHG_EVENT_REP withe the operational state set to DISABLED andthe availability set to OK.My guess is that you are not sending such a state event from the BTS tothe BSC. I can also not see that in the pcap file you have sent. AllOML messages in there relate to the Site MAnager or the BTS objectclass, but there are no messages related to any other MOs.As indicated, it is best to start from a known-working setup with asupported BTS model, or at least from a protocol trace of an existingsupported configuration.Please also make sure to set your 'bts model' to nanobts, I _think_ the'bts model sysmobts' is still broken.Regards,Harald-- - Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/============================================================================"Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)

10years, 4months

  • 4
  • 8

January 2014 - OpenBSC - lists.osmocom.org (23)

[PATCH] Support for multiple RSL connections with ABIS/ipaccess (BTS side)

by Andreas Eversberg

In order to support multiple TRX, multiple RSL connections can beestablised. e1inp_ipa_bts_rsl_connect() requires an additional parameterto set the TRX number.The ts[] array (member of struct e1inp_line) refers to OML and RSL.ts[0] refers to OML link, ts[1] to RSL link of first TRX, ts[2] toRSL link of second TRX (if exists) and so on.The code was successfully tested with osmobts-trx and UmTRX with twotransceivers.The user of e1inp_ipa_bts_rsl_connect() (which is osmo-bts) must beupgraded after applying the patch.src/common/oml.c-rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port);+rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port,+trx->nr);--- include/osmocom/abis/e1_input.h | 3 ++- src/input/ipaccess.c | 30 +++++++++++++++++++++++------- tests/e1inp_ipa_bts_test.c | 2 +- 3 files changed, 26 insertions(+), 9 deletions(-)diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.hindex 9b77893..7fbffe9 100644--- a/include/osmocom/abis/e1_input.h+++ b/include/osmocom/abis/e1_input.h@@ -265,7 +265,8 @@ struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); /* on an IPA BTS, the BTS needs to establish the RSL connection much * later than the OML connection. */ int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port);+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_id); void e1inp_sign_link_destroy(struct e1inp_sign_link *link); int e1inp_line_update(struct e1inp_line *line);diff --git a/src/input/ipaccess.c b/src/input/ipaccess.cindex 07b47b2..4091d09 100644--- a/src/input/ipaccess.c+++ b/src/input/ipaccess.c@@ -774,7 +774,7 @@ err_line: #define IPA_STRING_MAX 64 static struct msgb *-ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len)+ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) { struct msgb *nmsg; char str[IPA_STRING_MAX];@@ -795,7 +795,7 @@ ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len) switch (data[1]) { case IPAC_IDTAG_UNIT: snprintf(str, sizeof(str), "%u/%u/%u",-dev->site_id, dev->bts_id, dev->trx_id);+dev->site_id, dev->bts_id, trx_nr); break; case IPAC_IDTAG_MACADDR: snprintf(str, sizeof(str),@@ -895,6 +895,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) struct e1inp_sign_link *sign_link; uint8_t *data = msgb_l2(msg); int len = msgb_l2len(msg);+int trx_nr = 0; LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); if (!link->line->ops->sign_link_up) {@@ -904,8 +905,10 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) ret = -EINVAL; goto err; }+if (link->ofd->priv_nr >= E1INP_SIGN_RSL)+trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL; rmsg = ipa_bts_id_resp(link->line->ops->cfg.ipa.dev,-data + 1, len - 1);+data + 1, len - 1, trx_nr); ret = ipaccess_send(link->ofd->fd, rmsg->data, rmsg->len); if (ret != rmsg->len) {@@ -942,7 +945,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) } else if (link->port == IPA_TCP_PORT_OML) e1i_ts = &link->line->ts[0]; else if (link->port == IPA_TCP_PORT_RSL)-e1i_ts = &link->line->ts[1];+e1i_ts = &link->line->ts[link->ofd->priv_nr-1]; OSMO_ASSERT(e1i_ts != NULL); @@ -1073,13 +1076,26 @@ static int ipaccess_line_update(struct e1inp_line *line) } int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port)+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_nr) { struct ipa_client_conn *rsl_link; +if (E1INP_SIGN_RSL+trx_nr-1 >= NUM_E1_TS) {+LOGP(DLINP, LOGL_ERROR, "cannot create RSL BTS link: "+"trx_nr (%d) out of range\n", trx_nr);+return -EINVAL;+}+if (line->ts[E1INP_SIGN_RSL+trx_nr-1].type != E1INP_TS_TYPE_SIGN) {+LOGP(DLINP, LOGL_ERROR, "cannot create RSL BTS link: "+"trx_nr (%d) does not refer to a signalling link\n",+trx_nr);+return -EINVAL;+}+ rsl_link = ipa_client_conn_create(tall_ipa_ctx,- &line->ts[E1INP_SIGN_RSL-1],- E1INP_SIGN_RSL,+ &line->ts[E1INP_SIGN_RSL+trx_nr-1],+ E1INP_SIGN_RSL+trx_nr, rem_addr, rem_port, ipaccess_bts_updown_cb, ipaccess_bts_read_cb,diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.cindex 02a4cb3..a43dba3 100644--- a/tests/e1inp_ipa_bts_test.c+++ b/tests/e1inp_ipa_bts_test.c@@ -70,7 +70,7 @@ sign_link_up(void *unit, struct e1inp_line *line, enum e1inp_sign_type type) /* Now we can send OML messages to the BSC. */ bts_state = BTS_TEST_OML_SIGN_LINK_UP; }-e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL);+e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL, 0); break; case E1INP_SIGN_RSL: LOGP(DBTSTEST, LOGL_NOTICE, "RSL link up request received.\n");-- 1.8.1.5--------------050208090707040108050104--

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (24)

[PATCH] ABIS: Support for multiple RSL connections

by Andreas Eversberg

--- include/osmo-bts/abis.h | 2 +- src/common/abis.c | 57 ++++++++++++++++++++++++++++++++++------------- src/common/oml.c | 7 +++--- src/osmo-bts-sysmo/main.c | 2 +- 4 files changed, 47 insertions(+), 21 deletions(-)diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.hindex fb0fbd7..ceda736 100644--- a/include/osmo-bts/abis.h+++ b/include/osmo-bts/abis.h@@ -17,7 +17,7 @@ enum { }; struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,- const char *model_name);+ const char *model_name, int num_trx); int abis_oml_sendmsg(struct msgb *msg);diff --git a/src/common/abis.c b/src/common/abis.cindex 37e82f3..4c4699d 100644--- a/src/common/abis.c+++ b/src/common/abis.c@@ -34,6 +34,7 @@ #include <osmocom/core/timer.h> #include <osmocom/core/msgb.h> #include <osmocom/core/signal.h>+#include <osmocom/core/talloc.h> #include <osmocom/abis/abis.h> #include <osmocom/abis/e1_input.h> #include <osmocom/abis/ipaccess.h>@@ -68,6 +69,8 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, enum e1inp_sign_type type) { struct e1inp_sign_link *sign_link = NULL;+struct gsm_bts_trx *trx;+uint8_t trx_id; switch (type) { case E1INP_SIGN_OML:@@ -79,17 +82,22 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, sign_link->trx = g_bts->c0; bts_link_estab(g_bts); break;-case E1INP_SIGN_RSL:-LOGP(DABIS, LOGL_INFO, "RSL Signalling link up\n");-e1inp_ts_config_sign(&line->ts[E1INP_SIGN_RSL-1], line);-sign_link = g_bts->c0->rsl_link =-e1inp_sign_link_create(&line->ts[E1INP_SIGN_RSL-1],-E1INP_SIGN_RSL, NULL, 0, 0);-/* FIXME: This assumes there is only one TRX! */-sign_link->trx = g_bts->c0;-trx_link_estab(sign_link->trx);-break; default:+trx_id = type - E1INP_SIGN_RSL;+LOGP(DABIS, LOGL_INFO, "RSL Signalling link for TRX %d up\n",+trx_id);+trx = gsm_bts_trx_num(g_bts, trx_id);+if (!trx) {+LOGP(DABIS, LOGL_ERROR, "TRX ID %d does not exits\n",+trx_id);+break;+}+e1inp_ts_config_sign(&line->ts[type-1], line);+sign_link = trx->rsl_link =+e1inp_sign_link_create(&line->ts[type-1],+E1INP_SIGN_RSL, NULL, 0, 0);+sign_link->trx = trx;+trx_link_estab(trx); break; } @@ -98,12 +106,16 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line, static void sign_link_down(struct e1inp_line *line) {+struct gsm_bts_trx *trx;+ LOGP(DABIS, LOGL_ERROR, "Signalling link down\n"); -if (g_bts->c0->rsl_link) {-e1inp_sign_link_destroy(g_bts->c0->rsl_link);-g_bts->c0->rsl_link = NULL;-trx_link_estab(g_bts->c0);+llist_for_each_entry(trx, &g_bts->trx_list, list) {+if (trx->rsl_link) {+e1inp_sign_link_destroy(trx->rsl_link);+trx->rsl_link = NULL;+trx_link_estab(trx);+} } if (g_bts->oml_link)@@ -212,7 +224,6 @@ static struct e1inp_line_ops line_ops = { .cfg = { .ipa = { .role= E1INP_LINE_R_BTS,-.dev= &bts_dev_info, }, }, .sign_link_up= sign_link_up,@@ -224,9 +235,11 @@ static struct e1inp_line_ops line_ops = { * global initialization as well as the actual opening of the A-bis link * */ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host,- const char *model_name)+ const char *model_name, int num_trx) { struct e1inp_line *line;+struct ipaccess_unit *units;+int i; g_bts = bts; @@ -236,6 +249,13 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, osmo_signal_register_handler(SS_L_INPUT, &inp_s_cbfn, bts); +/* allocate list of ipaccess dev info (OML and each RSL connection) */+units = talloc_zero_array(tall_bts_ctx, struct ipaccess_unit,+ num_trx+1);+if (!units)+return NULL;+line_ops.cfg.ipa.dev = units;+ /* patch in various data from VTY and othe sources */ line_ops.cfg.ipa.addr = dst_host; get_mac_addr("eth0", bts_dev_info.mac_addr);@@ -250,6 +270,11 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, if (!line) return NULL; e1inp_line_bind_ops(line, &line_ops);+memcpy(&units[0], &bts_dev_info, sizeof(*units));+for (i = 0; i < num_trx; i++) {+memcpy(&units[i+1], &bts_dev_info, sizeof(*units));+units[i+1].trx_id = i;+} /* This is what currently starts both the outbound OML and RSL * connections, which is wrong.diff --git a/src/common/oml.c b/src/common/oml.cindex bf174b5..acde230 100644--- a/src/common/oml.c+++ b/src/common/oml.c@@ -1018,10 +1018,11 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg, } in.s_addr = htonl(ip);-LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", -inet_ntoa(in), port, stream_id);+LOGP(DOML, LOGL_INFO, "Rx IPA RSL CONNECT TRX=%d IP=%s PORT=%u "+"STREAM=0x%02x\n", trx->nr, inet_ntoa(in), port, stream_id); -rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port);+rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port,+trx->nr); if (rc < 0) { LOGP(DOML, LOGL_ERROR, "Error in abis_open(RSL): %d\n", rc); return oml_fom_ack_nack(msg, NM_NACK_CANT_PERFORM);diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.cindex 74ee47f..f85748f 100644--- a/src/osmo-bts-sysmo/main.c+++ b/src/osmo-bts-sysmo/main.c@@ -365,7 +365,7 @@ int main(int argc, char **argv) exit(1); } -line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS");+line = abis_open(bts, btsb->bsc_oml_host, "sysmoBTS", 1); if (!line) { fprintf(stderr, "unable to connect to BSC\n"); exit(1);-- 1.8.1.5--------------030007020209040104000503--

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (25)

[PATCH] doc/examples: osmo-nitb: Fix no voice when using sysmobts

by Alvaro Neira

From: Álvaro Neira Ayuso <alvaroneay(a)gmail.com>If the default codec is not specified, I get no voice in my calls.This patch adds the parameters default-codec tch-f and tch-h to getthe voice working.Signed-off-by: Alvaro Neira Ayuso <alvaroneay(a)gmail.com>--- openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg | 3 +++ 1 file changed, 3 insertions(+)diff --git a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfgindex 7a44308..0eda9f6 100644--- a/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg+++ b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg@@ -75,3 +75,6 @@ network phys_chan_config TCH/F timeslot 7 phys_chan_config TCH/F+mncc-int+ default-codec tch-f amr+ default-codec tch-h amr

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (26)

[PATCH] openbsc: Fix coverity issues

by Jacob Erlbeck

This patch (hopefully) fixes the new defects reported by coverity.Addresses:** CID 1156986: Negative array index read (NEGATIVE_RETURNS)/tests/gsm0408/gsm0408_test.c: 419 in test_si_range_helpers()/tests/gsm0408/gsm0408_test.c: 423 in test_si_range_helpers()/tests/gsm0408/gsm0408_test.c: 427 in test_si_range_helpers()** CID 1156987: Unchecked return value from library(CHECKED_RETURN)/src/libmgcp/mgcp_protocol.c: 1150 in mgcp_keepalive_timer_cb()** CID 1156988: Unchecked return value from library(CHECKED_RETURN)/src/libmgcp/mgcp_protocol.c: 983 in handle_modify_con()Sponsored-by: On-Waves ehf--- openbsc/src/libmgcp/mgcp_network.c | 19 ++++++++++++++++--- openbsc/tests/gsm0408/gsm0408_test.c | 6 +++--- 2 files changed, 19 insertions(+), 6 deletions(-)diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.cindex 0cc2041..b55ac04 100644--- a/openbsc/src/libmgcp/mgcp_network.c+++ b/openbsc/src/libmgcp/mgcp_network.c@@ -134,11 +134,24 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp) rc = mgcp_udp_send(endp->net_end.rtp.fd, &endp->net_end.addr, endp->net_end.rtp_port, buf, 1); -if (rc == -1 || endp->tcfg->omit_rtcp)+if (rc == -1)+goto failed;++if (endp->tcfg->omit_rtcp)+return rc;++rc = mgcp_udp_send(endp->net_end.rtcp.fd, &endp->net_end.addr,+ endp->net_end.rtcp_port, buf, 1);++if (rc >= 0) return rc; -return mgcp_udp_send(endp->net_end.rtcp.fd, &endp->net_end.addr,- endp->net_end.rtcp_port, buf, 1);+failed:+LOGP(DMGCP, LOGL_ERROR,+ "Failed to send dummy packet: %s on: 0x%x to %s\n",+ strerror(errno), ENDPOINT_NUMBER(endp), inet_ntoa(endp->net_end.addr));++return -1; } static int32_t compute_timestamp_aligment_error(struct mgcp_rtp_stream_state *sstate,diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.cindex 894eb0f..38c1a6a 100644--- a/openbsc/tests/gsm0408/gsm0408_test.c+++ b/openbsc/tests/gsm0408/gsm0408_test.c@@ -416,15 +416,15 @@ static void test_si_range_helpers() memset(&ws[0], 0x23, sizeof(ws)); i = range_enc_find_index(1023, freqs1, ARRAY_SIZE(freqs1));-printf("Element is: %d => freqs[i] = %d\n", i, freqs1[i]);+printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs1[i] : -1); VERIFY(i, ==, 2); i = range_enc_find_index(511, freqs2, ARRAY_SIZE(freqs2));-printf("Element is: %d => freqs[i] = %d\n", i, freqs2[i]);+printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs2[i] : -1); VERIFY(i, ==, 2); i = range_enc_find_index(511, freqs3, ARRAY_SIZE(freqs3));-printf("Element is: %d => freqs[i] = %d\n", i, freqs3[i]);+printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs3[i] : -1); VERIFY(i, ==, 0); i = range_enc_arfcns(1023, freqs1, ARRAY_SIZE(freqs1), ws, 0);-- 1.7.9.5

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (27)

[PATCH 1/3] mgcp: Disable output enabled on initialisation

by Jacob Erlbeck

Currently RTP output_enabled is set to 1 on initialisation, whichdoes not semantically match the initial value of conn_mode(MGCP_CONN_NONE).This patch changes this initial value to 0.Sponsored-by: On-Waves ehf--- openbsc/src/libmgcp/mgcp_protocol.c | 2 +- openbsc/tests/mgcp/mgcp_test.ok | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.cindex 9996ba7..9055bdb 100644--- a/openbsc/src/libmgcp/mgcp_protocol.c+++ b/openbsc/src/libmgcp/mgcp_protocol.c@@ -1258,7 +1258,7 @@ static void mgcp_rtp_end_reset(struct mgcp_rtp_end *end) end->frames_per_packet = 0; /* unknown */ end->packet_duration_ms = DEFAULT_RTP_AUDIO_PACKET_DURATION_MS; end->rate = DEFAULT_RTP_AUDIO_DEFAULT_RATE;-end->output_enabled= 1;+end->output_enabled= 0; } static void mgcp_rtp_end_init(struct mgcp_rtp_end *end)diff --git a/openbsc/tests/mgcp/mgcp_test.ok b/openbsc/tests/mgcp/mgcp_test.okindex 7e8aa5c..3b645e6 100644--- a/openbsc/tests/mgcp/mgcp_test.ok+++ b/openbsc/tests/mgcp/mgcp_test.ok@@ -51,7 +51,7 @@ Connection mode: 2, BTS output disabled, NET output enabled Testing DLCX Detected packet duration: 20 Requested packetization period not set-Connection mode: 0, BTS output enabled, NET output enabled+Connection mode: 0, BTS output disabled, NET output disabled Testing CRCX_ZYN Dummy packets: 1 Packet duration not set@@ -67,7 +67,7 @@ Testing RQNT2 Testing DLCX Detected packet duration: 20 Requested packetization period not set-Connection mode: 0, BTS output enabled, NET output enabled+Connection mode: 0, BTS output disabled, NET output disabled Testing CRCX Re-transmitting CRCX Testing RQNT1-- 1.7.9.5

10years, 4months

  • 2
  • 4

January 2014 - OpenBSC - lists.osmocom.org (28)

Feedback on l1sap-parts

by Holger Hans Peter Freyther

Dear Andreas,I noticed you rebased the code and I have further comments and requestsfor general changes.Magic Numbers:Please avoid magic numbers where you can. There is no runtime overheadby using a define and little pre-processing overhead.E.g. in here#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == 0x40)Make your methods smaller:Please compare this with the work Daniel and me to in cleaning up yourcode in the osmo-pcu. By splitting up the alloc_algorithm_b code westarted to notice various defects just by looking at the code.Remove copy and paste:I think I saw the msgb in-place changing in at least two places. Avoidcopy and paste (code cloning).Avoid putting logic in deeply nested constructs:if (a)if (b)if (c)important_stuffkind regardsholger

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (29)

[PATCH] Remove obsolete check of conn and lchan pointers not beeingNULL

by Andreas Eversberg

The check is removed from gsm48_cc_rx_setup() and gsm48_cc_rx_call_conf().Receiving a layer 3 message implies that the transaction has a subscriberconnection and a logical channel.This patch fixes the Coverity issues with CID 115311 and CID 1155312.--- openbsc/src/libmsc/gsm_04_08.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.cindex 54f5f70..0c6b100 100644--- a/openbsc/src/libmsc/gsm_04_08.c+++ b/openbsc/src/libmsc/gsm_04_08.c@@ -1803,8 +1803,7 @@ static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg) memset(&setup, 0, sizeof(struct gsm_mncc)); setup.callref = trans->callref;-if (trans->conn && trans->conn->lchan)-setup.lchan_type = trans->conn->lchan->type;+setup.lchan_type = trans->conn->lchan->type; tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); /* emergency setup is identified by msg_type */ if (msg_type == GSM48_MT_CC_EMERG_SETUP)@@ -1961,8 +1960,7 @@ static int gsm48_cc_rx_call_conf(struct gsm_trans *trans, struct msgb *msg) memset(&call_conf, 0, sizeof(struct gsm_mncc)); call_conf.callref = trans->callref;-if (trans->conn && trans->conn->lchan)-call_conf.lchan_type = trans->conn->lchan->type;+call_conf.lchan_type = trans->conn->lchan->type; tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); #if 0 /* repeat */-- 1.7.3.4

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (30)

[PATCH 1/4] Each BTS can be configured for speech support (other thanGSM full rate)

by Andreas Eversberg

Speech codings which are not supported by BTS will be removed from thebearer capability information element after parsing. This way it is notrequired for the MNCC application to consider support of each BTS.Only GSM full rate is supported by default.--- openbsc/include/openbsc/gsm_data_shared.h | 9 ++++ openbsc/src/libbsc/bsc_vty.c | 72 +++++++++++++++++++++++++++++ openbsc/src/libmsc/gsm_04_08.c | 28 +++++++++++ 3 files changed, 109 insertions(+), 0 deletions(-)diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.hindex 84d15ef..4a41498 100644--- a/openbsc/include/openbsc/gsm_data_shared.h+++ b/openbsc/include/openbsc/gsm_data_shared.h@@ -143,6 +143,12 @@ struct bts_ul_meas { uint8_t inv_rssi; }; +struct bts_codec_conf {+uint8_t hr;+uint8_t efr;+uint8_t amr;+};+ struct amr_mode { uint8_t mode; uint8_t threshold;@@ -704,6 +710,9 @@ struct gsm_bts { /* exclude the BTS from the global RF Lock handling */ int excl_from_rf_lock;++/* supported codecs beside FR */+struct bts_codec_conf codec; #endif /* ROLE_BSC */ void *role; };diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.cindex b034981..f444427 100644--- a/openbsc/src/libbsc/bsc_vty.c+++ b/openbsc/src/libbsc/bsc_vty.c@@ -629,6 +629,15 @@ static void config_write_bts_single(struct vty *vty, struct gsm_bts *bts) } } +vty_out(vty, " codec-support fr");+if (bts->codec.hr)+vty_out(vty, " hr");+if (bts->codec.efr)+vty_out(vty, " efr");+if (bts->codec.amr)+vty_out(vty, " amr");+vty_out(vty, "%s", VTY_NEWLINE);+ config_write_bts_gprs(vty, bts); if (bts->excl_from_rf_lock)@@ -2635,6 +2644,65 @@ DEFUN(cfg_bts_no_excl_rf_lock, return CMD_SUCCESS; } +static void _get_codec_from_arg(struct vty *vty, int argc, const char *argv[])+{+struct gsm_bts *bts = vty->index;+struct bts_codec_conf *codec = &bts->codec;+int i;++codec->hr = 0;+codec->efr = 0;+codec->amr = 0;+for (i = 0; i < argc; i++) {+if (!strcmp(argv[i], "hr"))+codec->hr = 1;+if (!strcmp(argv[i], "efr"))+codec->efr = 1;+if (!strcmp(argv[i], "amr"))+codec->amr = 1;+}+}++#define CODEC_PAR_STR" (fr|hr|efr|amr)"+#define CODEC_HELP_STR"Full Rate (mandatory)\nHalf Rate\n" \+"Enhanced Full Rate\nAdaptive Multirate\n"++DEFUN(cfg_bts_codec1, cfg_bts_codec1_cmd,+"codec-support" CODEC_PAR_STR,+"Codec Support settings\n"+CODEC_HELP_STR)+{+_get_codec_from_arg(vty, 1, argv);+return CMD_SUCCESS;+}++DEFUN(cfg_bts_codec2, cfg_bts_codec2_cmd,+"codec-support" CODEC_PAR_STR CODEC_PAR_STR,+"Codec Support settings\n"+CODEC_HELP_STR CODEC_HELP_STR)+{+_get_codec_from_arg(vty, 2, argv);+return CMD_SUCCESS;+}++DEFUN(cfg_bts_codec3, cfg_bts_codec3_cmd,+"codec-support" CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR,+"Codec Support settings\n"+CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR)+{+_get_codec_from_arg(vty, 3, argv);+return CMD_SUCCESS;+}++DEFUN(cfg_bts_codec4, cfg_bts_codec4_cmd,+"codec-support" CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR CODEC_PAR_STR,+"Codec Support settings\n"+CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR CODEC_HELP_STR)+{+_get_codec_from_arg(vty, 4, argv);+return CMD_SUCCESS;+}+ #define TRX_TEXT "Radio Transceiver\n" /* per TRX configuration */@@ -3231,6 +3299,10 @@ int bsc_vty_init(const struct log_info *cat) install_element(BTS_NODE, &cfg_bts_si5_neigh_cmd); install_element(BTS_NODE, &cfg_bts_excl_rf_lock_cmd); install_element(BTS_NODE, &cfg_bts_no_excl_rf_lock_cmd);+install_element(BTS_NODE, &cfg_bts_codec1_cmd);+install_element(BTS_NODE, &cfg_bts_codec2_cmd);+install_element(BTS_NODE, &cfg_bts_codec3_cmd);+install_element(BTS_NODE, &cfg_bts_codec4_cmd); install_element(BTS_NODE, &cfg_trx_cmd); install_node(&trx_node, dummy_config_write);diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.cindex 3cfc455..dec97f2 100644--- a/openbsc/src/libmsc/gsm_04_08.c+++ b/openbsc/src/libmsc/gsm_04_08.c@@ -79,6 +79,29 @@ struct gsm_lai { uint16_t lac; }; +static int apply_codec_restrictions(struct gsm_bts *bts,+struct gsm_mncc_bearer_cap *bcap)+{+int i, j;++/* remove unsupported speech versions from list */+for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) {+if (bcap->speech_ver[i] == GSM48_BCAP_SV_FR)+bcap->speech_ver[j++] = GSM48_BCAP_SV_FR;+if (bcap->speech_ver[i] == GSM48_BCAP_SV_EFR && bts->codec.efr)+bcap->speech_ver[j++] = GSM48_BCAP_SV_EFR;+if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_F && bts->codec.amr)+bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_F;+if (bcap->speech_ver[i] == GSM48_BCAP_SV_HR && bts->codec.hr)+bcap->speech_ver[j++] = GSM48_BCAP_SV_HR;+if (bcap->speech_ver[i] == GSM48_BCAP_SV_AMR_H && bts->codec.amr)+bcap->speech_ver[j++] = GSM48_BCAP_SV_AMR_H;+}+bcap->speech_ver[j] = -1;++return 0;+}+ static uint32_t new_callref = 0x80000001; void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg)@@ -1763,6 +1786,7 @@ static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg) setup.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&setup.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1);+apply_codec_restrictions(trans->conn->bts, &setup.bearer_cap); } /* facility */ if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) {@@ -1916,6 +1940,7 @@ static int gsm48_cc_rx_call_conf(struct gsm_trans *trans, struct msgb *msg) call_conf.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&call_conf.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1);+apply_codec_restrictions(trans->conn->bts, &call_conf.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) {@@ -2604,6 +2629,7 @@ static int gsm48_cc_rx_modify(struct gsm_trans *trans, struct msgb *msg) modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1);+apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY);@@ -2646,6 +2672,7 @@ static int gsm48_cc_rx_modify_complete(struct gsm_trans *trans, struct msgb *msg modify.fields |= MNCC_F_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1);+apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } new_cc_state(trans, GSM_CSTATE_ACTIVE);@@ -2686,6 +2713,7 @@ static int gsm48_cc_rx_modify_reject(struct gsm_trans *trans, struct msgb *msg) modify.fields |= GSM48_IE_BEARER_CAP; gsm48_decode_bearer_cap(&modify.bearer_cap, TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1);+apply_codec_restrictions(trans->conn->bts, &modify.bearer_cap); } /* cause */ if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) {-- 1.7.3.4

10years, 4months

  • 4
  • 14

January 2014 - OpenBSC - lists.osmocom.org (31)

[PATCH 1/9] si: Add a hack to disable SI2ter/SI2bis/SI5ter/SI5bismessages

by Jacob Erlbeck

From: Holger Hans Peter Freyther <zecke(a)selfish.org>The iPhone5 (US) appears to have some issues with the SIs generated,or the nanoBTS is not sending them correctly. Add a hack to put allbands into the SI2/SI5 message.This is a quick change without much reflection and watching for sideeffects. I have verfied that a network with ARFCN 134 and neighborsARFCN 130 and 512 do not get generate the SI2ter and announce everythinginside the SI2.--- openbsc/src/libbsc/system_information.c | 8 ++++++++ 1 file changed, 8 insertions(+)diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.cindex c901a4a..cb67011 100644--- a/openbsc/src/libbsc/system_information.c+++ b/openbsc/src/libbsc/system_information.c@@ -44,6 +44,7 @@ * array. DCS1800 and PCS1900 can not be used at the same time so conserve * memory and do the below. */+#if 0 static int band_compatible(const struct gsm_bts *bts, int arfcn) { enum gsm_band band = gsm_arfcn2band(arfcn);@@ -57,6 +58,7 @@ static int band_compatible(const struct gsm_bts *bts, int arfcn) return 0; }+#endif static int is_dcs_net(const struct gsm_bts *bts) {@@ -70,6 +72,11 @@ static int is_dcs_net(const struct gsm_bts *bts) static int use_arfcn(const struct gsm_bts *bts, const int bis, const int ter, const int pgsm, const int arfcn) {+if (bis || ter)+return 0;+return 1;+#if 0+Correct but somehow broken with either the nanoBTS or the iPhone5 if (!bis && !ter && band_compatible(bts, arfcn)) return 1; if (bis && pgsm && band_compatible(bts, arfcn) && (arfcn < 1 || arfcn > 124))@@ -77,6 +84,7 @@ static int use_arfcn(const struct gsm_bts *bts, const int bis, const int ter, if (ter && !band_compatible(bts, arfcn)) return 1; return 0;+#endif } /* Frequency Lists as per TS 04.08 10.5.2.13 */-- 1.7.9.5

10years, 4months

  • 2
  • 20

January 2014 - OpenBSC - lists.osmocom.org (32)

[PATCH 1/9] mgcp/rtp: Refactor mgcp_send to avoid code duplication

by Jacob Erlbeck

Currently there are two symmetric code paths which are selected bythe packet destination (NET or BTS).This patch introduces 3 variables that take the different valuesand unifies both code paths into one.Sponsored-by: On-Waves ehf--- openbsc/src/libmgcp/mgcp_network.c | 50 ++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 28 deletions(-)diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.cindex 657019e..1c7c3da 100644--- a/openbsc/src/libmgcp/mgcp_network.c+++ b/openbsc/src/libmgcp/mgcp_network.c@@ -537,6 +537,10 @@ static int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp, struct sockaddr_in *addr, char *buf, int rc) { struct mgcp_trunk_config *tcfg = endp->tcfg;+struct mgcp_rtp_end *rtp_end;+struct mgcp_rtp_state *rtp_state;+int tap_idx;+ /* For loop toggle the destination and then dispatch. */ if (tcfg->audio_loop) dest = !dest;@@ -546,35 +550,25 @@ static int mgcp_send(struct mgcp_endpoint *endp, int dest, int is_rtp, dest = !dest; if (dest == MGCP_DEST_NET) {-if (is_rtp) {-mgcp_patch_and_count(endp, &endp->bts_state,- &endp->net_end,- addr, buf, rc);-forward_data(endp->net_end.rtp.fd,- &endp->taps[MGCP_TAP_NET_OUT], buf, rc);-return mgcp_udp_send(endp->net_end.rtp.fd,- &endp->net_end.addr,- endp->net_end.rtp_port, buf, rc);-} else if (!tcfg->omit_rtcp) {-return mgcp_udp_send(endp->net_end.rtcp.fd,- &endp->net_end.addr,- endp->net_end.rtcp_port, buf, rc);-}+rtp_end = &endp->net_end;+rtp_state = &endp->bts_state;+tap_idx = MGCP_TAP_NET_OUT; } else {-if (is_rtp) {-mgcp_patch_and_count(endp, &endp->net_state,- &endp->bts_end,- addr, buf, rc);-forward_data(endp->bts_end.rtp.fd,- &endp->taps[MGCP_TAP_BTS_OUT], buf, rc);-return mgcp_udp_send(endp->bts_end.rtp.fd,- &endp->bts_end.addr,- endp->bts_end.rtp_port, buf, rc);-} else if (!tcfg->omit_rtcp) {-return mgcp_udp_send(endp->bts_end.rtcp.fd,- &endp->bts_end.addr,- endp->bts_end.rtcp_port, buf, rc);-}+rtp_end = &endp->bts_end;+rtp_state = &endp->net_state;+tap_idx = MGCP_TAP_BTS_OUT;+}++if (is_rtp) {+mgcp_patch_and_count(endp, rtp_state, rtp_end, addr, buf, rc);+forward_data(rtp_end->rtp.fd, &endp->taps[tap_idx], buf, rc);+return mgcp_udp_send(rtp_end->rtp.fd,+ &rtp_end->addr,+ rtp_end->rtp_port, buf, rc);+} else if (!tcfg->omit_rtcp) {+return mgcp_udp_send(rtp_end->rtcp.fd,+ &rtp_end->addr,+ rtp_end->rtcp_port, buf, rc); } return 0;-- 1.7.9.5

10years, 4months

  • 2
  • 19

January 2014 - OpenBSC - lists.osmocom.org (33)

[RFC] [ADMIN] Making lists subscriber-only?

by Harald Welte

Dear all,so far the osmocom.org mailing lists have always been in a 'non-membersare manually moderated' mode. This has created a lot of work for manuallist moderation, where a lot of the messages caught are simply spam, andonly the occasional valid message is being received.I'd like to thank the list moderators for taking care of this.However, in more recent discussions, we were considering to move thelists to a completely closed mode, i.e. postings would automatically berejected from non-members.The automatic response would contain a description of how to subscribein 'nomail' mode, i.e. to subscribe in a way to be able to post to thelist, while still not receiving any incoming traffic. The latter shouldbe fine for occasional posters who don't want the bulk e-mail that goeswith a full/regular subscription.Please provide feedback in case you disagree with that change. Unlessthere is major opposition, we will likely transition to the 'closed'mode within one month.Thanks,Harald-- - Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/============================================================================"Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)

10years, 4months

  • 7
  • 7

January 2014 - OpenBSC - lists.osmocom.org (34)

[PATCH] Support of multiple RSL connections for ABIS/ipaccess (BTS side)

by Andreas Eversberg

In order to support multiple TRX, multiple RSL connections can beestablised. e1inp_ipa_bts_rsl_connect() requires an additional parameterto set the TRX number.The code was tested with osmobts-trx.The user of e1inp_ipa_bts_rsl_connect() (which is osmo-bts) must beupgraded after applying the patch.src/common/oml.c- rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port);+ rc = e1inp_ipa_bts_rsl_connect(oml_link->ts->line, inet_ntoa(in), port, 0);--- include/osmocom/abis/e1_input.h | 3 ++- src/input/ipaccess.c | 18 +++++++++++------- tests/e1inp_ipa_bts_test.c | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-)diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.hindex 0abf0b8..2a9890c 100644--- a/include/osmocom/abis/e1_input.h+++ b/include/osmocom/abis/e1_input.h@@ -258,7 +258,8 @@ struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); /* on an IPA BTS, the BTS needs to establish the RSL connection much * later than the OML connection. */ int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port);+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_id); void e1inp_sign_link_destroy(struct e1inp_sign_link *link); int e1inp_line_update(struct e1inp_line *line);diff --git a/src/input/ipaccess.c b/src/input/ipaccess.cindex 9722b2f..20894e4 100644--- a/src/input/ipaccess.c+++ b/src/input/ipaccess.c@@ -717,7 +717,7 @@ err_line: #define IPA_STRING_MAX 64 static struct msgb *-ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len)+ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) { struct msgb *nmsg; char str[IPA_STRING_MAX];@@ -738,7 +738,7 @@ ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len) switch (data[1]) { case IPAC_IDTAG_UNIT: snprintf(str, sizeof(str), "%u/%u/%u",-dev->site_id, dev->bts_id, dev->trx_id);+dev->site_id, dev->bts_id, trx_nr); break; case IPAC_IDTAG_MACADDR: snprintf(str, sizeof(str),@@ -838,6 +838,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) struct e1inp_sign_link *sign_link; uint8_t *data = msgb_l2(msg); int len = msgb_l2len(msg);+int trx_nr = 0; LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); if (!link->line->ops->sign_link_up) {@@ -847,8 +848,10 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) ret = -EINVAL; goto err; }+if (link->ofd->priv_nr >= E1INP_SIGN_RSL)+trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL; rmsg = ipa_bts_id_resp(link->line->ops->cfg.ipa.dev,-data + 1, len - 1);+data + 1, len - 1, trx_nr); ret = ipaccess_send(link->ofd->fd, rmsg->data, rmsg->len); if (ret != rmsg->len) {@@ -885,7 +888,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) } else if (link->port == IPA_TCP_PORT_OML) e1i_ts = &link->line->ts[0]; else if (link->port == IPA_TCP_PORT_RSL)-e1i_ts = &link->line->ts[1];+e1i_ts = &link->line->ts[link->ofd->priv_nr-1]; OSMO_ASSERT(e1i_ts != NULL); @@ -1016,13 +1019,14 @@ static int ipaccess_line_update(struct e1inp_line *line) } int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port)+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_id) { struct ipa_client_conn *rsl_link; rsl_link = ipa_client_conn_create(tall_ipa_ctx,- &line->ts[E1INP_SIGN_RSL-1],- E1INP_SIGN_RSL,+ &line->ts[E1INP_SIGN_RSL+trx_id-1],+ E1INP_SIGN_RSL+trx_id, rem_addr, rem_port, ipaccess_bts_updown_cb, ipaccess_bts_read_cb,diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.cindex 02a4cb3..a43dba3 100644--- a/tests/e1inp_ipa_bts_test.c+++ b/tests/e1inp_ipa_bts_test.c@@ -70,7 +70,7 @@ sign_link_up(void *unit, struct e1inp_line *line, enum e1inp_sign_type type) /* Now we can send OML messages to the BSC. */ bts_state = BTS_TEST_OML_SIGN_LINK_UP; }-e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL);+e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL, 0); break; case E1INP_SIGN_RSL: LOGP(DBTSTEST, LOGL_NOTICE, "RSL link up request received.\n");-- 1.8.1.5--------------080608010203010806040100--

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (35)

[PATCH] Support for multiple RSL connections with ABIS/ipaccess (BTS side)

by Andreas Eversberg

In order to support multiple TRX, multiple RSL connections can beestablised. e1inp_ipa_bts_rsl_connect() requires an additional parameterto set the TRX number.The code was successfully tested with osmobts-trx and UmTRX with twotransceivers.The user of e1inp_ipa_bts_rsl_connect() and e1inp_line_bind_ops()(which is osmo-bts) must be upgraded after applying the patch.--- include/osmocom/abis/e1_input.h | 3 ++- src/input/ipaccess.c | 16 ++++++++++------ tests/e1inp_ipa_bts_test.c | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-)diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.hindex 0abf0b8..2a9890c 100644--- a/include/osmocom/abis/e1_input.h+++ b/include/osmocom/abis/e1_input.h@@ -258,7 +258,8 @@ struct subch_mux *e1inp_get_mux(uint8_t e1_nr, uint8_t ts_nr); /* on an IPA BTS, the BTS needs to establish the RSL connection much * later than the OML connection. */ int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port);+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_id); void e1inp_sign_link_destroy(struct e1inp_sign_link *link); int e1inp_line_update(struct e1inp_line *line);diff --git a/src/input/ipaccess.c b/src/input/ipaccess.cindex 9722b2f..86ddd3a 100644--- a/src/input/ipaccess.c+++ b/src/input/ipaccess.c@@ -838,6 +838,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) struct e1inp_sign_link *sign_link; uint8_t *data = msgb_l2(msg); int len = msgb_l2len(msg);+struct ipaccess_unit *unit_data; LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); if (!link->line->ops->sign_link_up) {@@ -847,7 +848,9 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) ret = -EINVAL; goto err; }-rmsg = ipa_bts_id_resp(link->line->ops->cfg.ipa.dev,+unit_data = (struct ipaccess_unit *)+link->line->ops->cfg.ipa.dev;+rmsg = ipa_bts_id_resp(&unit_data[link->ofd->priv_nr-1], data + 1, len - 1); ret = ipaccess_send(link->ofd->fd, rmsg->data, rmsg->len);@@ -869,7 +872,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) } msgb_free(rmsg); -sign_link = link->line->ops->sign_link_up(msg,+sign_link = link->line->ops->sign_link_up(unit_data, link->line, link->ofd->priv_nr); if (sign_link == NULL) {@@ -885,7 +888,7 @@ static int ipaccess_bts_read_cb(struct ipa_client_conn *link, struct msgb *msg) } else if (link->port == IPA_TCP_PORT_OML) e1i_ts = &link->line->ts[0]; else if (link->port == IPA_TCP_PORT_RSL)-e1i_ts = &link->line->ts[1];+e1i_ts = &link->line->ts[link->ofd->priv_nr-1]; OSMO_ASSERT(e1i_ts != NULL); @@ -1016,13 +1019,14 @@ static int ipaccess_line_update(struct e1inp_line *line) } int e1inp_ipa_bts_rsl_connect(struct e1inp_line *line,- const char *rem_addr, uint16_t rem_port)+ const char *rem_addr, uint16_t rem_port,+ uint8_t trx_id) { struct ipa_client_conn *rsl_link; rsl_link = ipa_client_conn_create(tall_ipa_ctx,- &line->ts[E1INP_SIGN_RSL-1],- E1INP_SIGN_RSL,+ &line->ts[E1INP_SIGN_RSL+trx_id-1],+ E1INP_SIGN_RSL+trx_id, rem_addr, rem_port, ipaccess_bts_updown_cb, ipaccess_bts_read_cb,diff --git a/tests/e1inp_ipa_bts_test.c b/tests/e1inp_ipa_bts_test.cindex 02a4cb3..a43dba3 100644--- a/tests/e1inp_ipa_bts_test.c+++ b/tests/e1inp_ipa_bts_test.c@@ -70,7 +70,7 @@ sign_link_up(void *unit, struct e1inp_line *line, enum e1inp_sign_type type) /* Now we can send OML messages to the BSC. */ bts_state = BTS_TEST_OML_SIGN_LINK_UP; }-e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL);+e1inp_ipa_bts_rsl_connect(line, "127.0.0.1", IPA_TCP_PORT_RSL, 0); break; case E1INP_SIGN_RSL: LOGP(DBTSTEST, LOGL_NOTICE, "RSL link up request received.\n");-- 1.8.1.5--------------030007020209040104000503Content-Type: text/x-diff; name="osmo-bts_Support-for-multiple-RSL-connections.patch"Content-Transfer-Encoding: 7bitContent-Disposition: attachment; filename="osmo-bts_Support-for-multiple-RSL-connections.patch"

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (36)

[PATCH] libabis: Enable TCP keepalive by default on all BTSconnections

by Jacob Erlbeck

From: Daniel Willmann <daniel(a)totalueberwachung.de>This way we can find out fast if the connection is broken.Ticket: OW#1060--- src/input/ipaccess.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-)diff --git a/src/input/ipaccess.c b/src/input/ipaccess.cindex 4a56569..371b21c 100644--- a/src/input/ipaccess.c+++ b/src/input/ipaccess.c@@ -28,6 +28,7 @@ #include <stdlib.h> #include <stdbool.h> #include <errno.h>+#include <netinet/tcp.h> #include <string.h> #include <time.h> #include <sys/fcntl.h>@@ -50,6 +51,10 @@ static void *tall_ipa_ctx; #define TS1_ALLOC_SIZE900 +#define DEFAULT_TCP_KEEPALIVE_IDLE_TIMEOUT 30+#define DEFAULT_TCP_KEEPALIVE_INTERVAL 3+#define DEFAULT_TCP_KEEPALIVE_RETRY_COUNT 10+ /* * Common propietary IPA messages: * - PONG: in reply to PING.@@ -605,7 +610,7 @@ static int ipaccess_bsc_oml_cb(struct ipa_server_link *link, int fd) { int ret; int idx = 0;-int i;+int i, val; struct e1inp_line *line; struct e1inp_ts *e1i_ts; struct osmo_fd *bfd;@@ -638,6 +643,34 @@ static int ipaccess_bsc_oml_cb(struct ipa_server_link *link, int fd) goto err_line; } +/* Enable TCP keepalive to find out if the connection is gone */+val = 1;+ret = setsockopt(bfd->fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val));+if (ret < 0)+LOGP(DLINP, LOGL_NOTICE, "Failed to set keepalive: %s\n",+ strerror(errno));+else+LOGP(DLINP, LOGL_NOTICE, "Keepalive is set: %i\n", ret);++#if defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)+/* The following options are not portable! */+val = DEFAULT_TCP_KEEPALIVE_IDLE_TIMEOUT;+ret = setsockopt(bfd->fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val));+if (ret < 0)+LOGP(DLINP, LOGL_NOTICE, "Failed to set keepalive idle time: %s\n",+ strerror(errno));+val = DEFAULT_TCP_KEEPALIVE_INTERVAL;+ret = setsockopt(bfd->fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val));+if (ret < 0)+LOGP(DLINP, LOGL_NOTICE, "Failed to set keepalive interval: %s\n",+ strerror(errno));+val = DEFAULT_TCP_KEEPALIVE_RETRY_COUNT;+ret = setsockopt(bfd->fd, IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val));+if (ret < 0)+LOGP(DLINP, LOGL_NOTICE, "Failed to set keepalive count: %s\n",+ strerror(errno));+#endif+ /* Request ID. FIXME: request LOCATION, HW/SW VErsion, Unit Name, Serno */ ret = ipaccess_send_id_req(bfd->fd); if (ret < 0) {-- 1.7.9.5

10years, 4months

  • 3
  • 15

January 2014 - OpenBSC - lists.osmocom.org (37)

1 OpenBSC moderator request(s) waiting

by openbsc-bounces@lists.osmocom.org

The OpenBSC(a)lists.osmocom.org mailing list has 1 request(s) waitingfor your consideration at:https://lists.osmocom.org/mailman/admindb/openbscPlease attend to this at your earliest convenience. This notice ofpending requests, if any, will be sent out daily.Pending posts:From: edoardo.rispoli(a)gmail.com on Mon Jan 13 23:46:56 2014Subject: Re: [RFC] [ADMIN] Making lists subscriber-only?Cause: Post by non-member to a members-only list

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (38)

OsmoBTS on RAD1

by Kurtis Heimerl

Hey OpenBSC, Tom,I've been working on getting OsmoBTS running on the recently open-sourcedRange Networks RAD1 radio. The code is available here:https://github.com/kheimerl/vbts-openbts/tree/osmotrx. I am stuck now and Iwas hoping the mailing list might be able to provide some perspective.With the RAD1, the system is beaconing correctly. However, phones areunable to camp. I logged a phone trying to camp on both the RAD1 and a B100to compare the output and see if anything jumps out. The osmoBTS/osmo-nitblogs are seemingly identical, but the transceiver outputs are different.Both of the transceiver outputs are attached. The only big difference I seeis in the "underflows" on the RAD1, which in my experience is adeal-breaker; that's not usually an easy fix.Does anyone have a different perspective on what might be going on in here?Thanks!

10years, 4months

  • 2
  • 3

January 2014 - OpenBSC - lists.osmocom.org (39)

[PATCH] gsm/gsm48ie: Fix range 256 W[i] decoding

by Jacob Erlbeck

Currently w[14]/w[15] and w[18]/w[19] are swapped in range 256 formatdecoding in gsm48_decode_freq_list().This patch fixes this.Sponsored-by: On-Waves ehf--- src/gsm/gsm48_ie.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.cindex 78619b9..2cc0645 100644--- a/src/gsm/gsm48_ie.c+++ b/src/gsm/gsm48_ie.c@@ -985,17 +985,17 @@ int gsm48_decode_freq_list(struct gsm_sysinfo_freq *f, uint8_t *cd, if (len >= 12) w[13] = r->w13; if (len >= 13)-w[14] = r->w15;+w[14] = (r->w14_hi << 2) | r->w14_lo; if (len >= 13)-w[15] = (r->w14_hi << 2) | r->w14_lo;+w[15] = r->w15; if (len >= 14) w[16] = (r->w16_hi << 3) | r->w16_lo; if (len >= 14) w[17] = r->w17; if (len >= 15)-w[18] = r->w19;+w[18] = (r->w18_hi << 3) | r->w18_lo; if (len >= 15)-w[19] = (r->w18_hi << 3) | r->w18_lo;+w[19] = r->w19; if (len >= 16) w[20] = (r->w20_hi << 3) | r->w20_lo; if (len >= 16)-- 1.7.9.5

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (40)

3 OpenBSC moderator request(s) waiting

by openbsc-bounces@lists.osmocom.org

The OpenBSC(a)lists.osmocom.org mailing list has 3 request(s) waitingfor your consideration at:https://lists.osmocom.org/mailman/admindb/openbscPlease attend to this at your earliest convenience. This notice ofpending requests, if any, will be sent out daily.Pending posts:From: kheimerl(a)cs.berkeley.edu on Thu Jan 9 21:27:04 2014Subject: OsmoBTS on RAD1Cause: Message body is too big: 5402368 bytes with a limit of 400 KBFrom: kaber(a)trash.net on Sun Jan 12 20:39:11 2014Subject: Re: [RFC] [ADMIN] Making lists subscriber-only?Cause: Too many recipients to the messageFrom: holger(a)freyther.de on Sun Jan 12 20:55:56 2014Subject: Re: [RFC] [ADMIN] Making lists subscriber-only?Cause: Too many recipients to the message

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (41)

abis_nm_pchan4chcomb API and return value

by Holger Hans Peter Freyther

Dear Harald,there is an open coverity issue in osmo-bts (CID 1040768) and it is aboutmixing enum types. enum abis_nm_chan_comb abis_nm_pchan4chcomb(uint8_t chcomb)

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (42)

RFC fix last coverity report with SI handling in osmo-bts

by Holger Hans Peter Freyther

Hi,the coverity tools points out that it might be possible to accessthe si.buf atfer _MAX_SYSINFO_TYPE and before < 32. Looking at thecode I also notice that:osmo_rsl2sitype takes an uint8_t but makes no range checking, samegoes for osmo_sitype2rsl.I plan to apply the below patch for osmo-bts. This would resolve thelast open Coverity report for osmo-bts. It would be nice if we couldadd range checking to osmo_rsl2sitype or check it in common/rsl.c ofosmo-bts.diff --git a/src/common/sysinfo.c b/src/common/sysinfo.cindex 62d2af9..9e2d4bb 100644--- a/src/common/sysinfo.c+++ b/src/common/sysinfo.c@@ -135,7 +135,7 @@ uint8_t *lchan_sacch_get(struct gsm_lchan *lchan, struct gsm_time *g_time) { uint32_t tmp; - for (tmp = lchan->si.last + 1; tmp != lchan->si.last; tmp = (tmp + 1) % 32) {+ for (tmp = lchan->si.last + 1; tmp != lchan->si.last; tmp = (tmp + 1) % _MAX_SYSINFO_TYPE) { if (lchan->si.valid & (1 << tmp)) { lchan->si.last = tmp; return lchan->si.buf[tmp];

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (43)

Support for Flexi BTS

by Andreas Eversberg

hi,we managed to run a nokia flexi bts with openbsc. the bts type is "nokia-site".on channel request, the bts nacks the channel activation with cause 0x65 (protocol error, optional information element). by removing the Channel Identification IE from the channel activation message, everything worked, so we assume that this IE causes this error. we tried to modify it:- no zero-length Mobile Allocation included in Channel Identification IE- TLV instead of TV for Channel Description in Channel Identification IE- Channel Description in Channel Identification IE with type 0x62 instead of 0x64all of these modifications result in the same error. so we came to the conclusion to remove the Channel Identification IE, since it is not really required. attached is the preview patch.does anyone have ABIS traces of a real network, to check how the IE is encoded there? is there any way to get more information from nokia bts why it rejects the channel when using this IE?regards,andreas

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (44)

[PATCH] nitb/vty: Add test for E1 input keep-alive

by Jacob Erlbeck

This test checks, whether the configuration of e1_line keepaliveworks. It does not check, whether keep-alive is correctly implementedby the drivers.If the e1_line keepalive command is not provided by the libosmo-abis,this test will be skipped.Sponsored-by: On-Waves ehf--- openbsc/tests/vty_test_runner.py | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.pyindex 08c94b1..16eb213 100644--- a/openbsc/tests/vty_test_runner.py+++ b/openbsc/tests/vty_test_runner.py@@ -230,6 +230,61 @@ class TestVTYNITB(TestVTYGenericBSC): res = self.vty.command("show paging-group 0 1234567") self.assertEquals(res, "%Paging group for IMSI 1234567 on BTS #0 is 7") + def testE1InputKeepAlive(self):+ self.vty.enable()+ self.vty.command("configure terminal")+ self.vty.command("e1_input")++ self.assertEquals(self.vty.node(), 'config-e1_input')++ # Check for keepalive command+ res = self.vty.command("list")+ if not res.find(' e1_line <0-255> keepalive\r') > 0:+ print("Skipping the E1 input keep-alive test")+ return++ # Test invalid input+ self.vty.verify("e1_line 200 keepalive", ["% Line 200 doesn't exist"])+ self.vty.verify("e1_line 200 keepalive 1", ["% Command incomplete."])+ self.vty.verify("e1_line 200 keepalive 1 2", ["% Command incomplete."])+ self.vty.verify("no e1_line 200 keepalive 1 2 3", ["% Unknown command."])++ # Setup driver+ self.vty.verify("e1_line 201 driver misdn", [''])+ self.vty.verify("e1_line 202 driver misdn_lapd", [''])+ self.vty.verify("e1_line 204 driver ipa", [''])++ # Test misdn+ self.vty.verify("e1_line 201 keepalive", ["% Driver 'misdn' does not support keep alive"])+ res = self.vty.command("write terminal")+ self.assert_(res.find("no e1_line 201 keepalive\r") > 0)++ self.vty.verify("no e1_line 201 keepalive", [""])++ # Test misdn_lapd+ self.vty.verify("e1_line 202 keepalive", ["% Driver 'misdn_lapd' does not support keep alive"])+ res = self.vty.command("write terminal")+ self.assert_(res.find("no e1_line 202 keepalive\r") > 0)++ self.vty.verify("no e1_line 202 keepalive", [""])++ # Test ipa+ self.vty.verify("e1_line 204 keepalive", [""])+ res = self.vty.command("write terminal")+ self.assert_(res.find("e1_line 204 keepalive\r") > 0)++ self.vty.verify("e1_line 204 keepalive 10 1 2", [""])+ res = self.vty.command("write terminal")+ self.assert_(res.find("e1_line 204 keepalive 10 1 2\r") > 0)++ self.vty.verify("no e1_line 204 keepalive", [""])++ # Check whether keep alive is disabled again on each line+ res = self.vty.command("write terminal")+ self.assert_(res.find("no e1_line 201 keepalive\r") > 0)+ self.assert_(res.find("no e1_line 202 keepalive\r") > 0)+ self.assert_(res.find("no e1_line 204 keepalive\r") > 0)+ class TestVTYBSC(TestVTYGenericBSC): def vty_command(self):-- 1.7.9.5

10years, 4months

  • 1
  • 0

January 2014 - OpenBSC - lists.osmocom.org (45)

Potential bug in trx_if.c

by Kurtis Heimerl

Hey all,I've been working on getting the Range Networks RAD1 working with OsmoBTS.I *think* I've found a bug in trx_if.c. Basically, tsc checks the bsicvariable and bsic checks the tsc variable. It *may* be intentional but Idoubt that and I wanted to note it before I moved on. Patch is attached.Thanks!

10years, 4months

  • 2
  • 1

January 2014 - OpenBSC - lists.osmocom.org (46)

[PATCH] sms: Fix gsm_7bit legacy functions return value

by Jacob Erlbeck

The legacy 7bit conversion functions (those without the '_n_' in thename) gave wrong return values on 64 bit platforms due to unpropersigned/unsigned conversions and the usage of SIZE_MAX.This patch fixes this by using a smaller max size (seeGSM_7BIT_LEGACY_MAX_BUFFER_SIZE, currently set to 64k) for the legacywrappers and by using unsigned int for max_septets.In addition, there are tests now that check the return values oflegacy encoding and decoding.Sponsored-by: On-Waves ehf--- include/osmocom/gsm/gsm_utils.h | 3 +++ src/gsm/gsm_utils.c | 17 +++++++++++------ tests/sms/sms_test.c | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-)diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.hindex f412e3e..02bfe4c 100644--- a/include/osmocom/gsm/gsm_utils.h+++ b/include/osmocom/gsm/gsm_utils.h@@ -195,6 +195,9 @@ enum gsm_chan_t { }; /* Deprectated functions */+/* Limit encoding and decoding to use no more than this amount of buffer bytes */+#define GSM_7BIT_LEGACY_MAX_BUFFER_SIZE 0x10000+ int gsm_7bit_decode(char *decoded, const uint8_t *user_data, uint8_t length) OSMO_DEPRECATED("Use gsm_7bit_decode_n() instead"); int gsm_7bit_decode_ussd(char *decoded, const uint8_t *user_data, uint8_t length) OSMO_DEPRECATED("Use gsm_7bit_decode_n_ussd() instead"); int gsm_7bit_encode(uint8_t *result, const char *data) OSMO_DEPRECATED("Use gsm_7bit_encode_n() instead");diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.cindex 5241c91..198ec69 100644--- a/src/gsm/gsm_utils.c+++ b/src/gsm/gsm_utils.c@@ -273,7 +273,7 @@ int gsm_7bit_encode_n(uint8_t *result, size_t n, const char *data, int *octets) { int y = 0; int o;-int max_septets = n * 8 / 7;+size_t max_septets = n * 8 / 7; /* prepare for the worst case, every character expanding to two bytes */ uint8_t *rdata = calloc(strlen(data) * 2, sizeof(uint8_t));@@ -683,7 +683,8 @@ uint32_t gprs_tmsi2tlli(uint32_t p_tmsi, enum gprs_tlli_type type) int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t septet_l) {-gsm_7bit_decode_n(text, SIZE_MAX, user_data, septet_l);+gsm_7bit_decode_n(text, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,+ user_data, septet_l); /* Mimic the original behaviour. */ return septet_l;@@ -691,21 +692,25 @@ int gsm_7bit_decode(char *text, const uint8_t *user_data, uint8_t septet_l) int gsm_7bit_decode_ussd(char *text, const uint8_t *user_data, uint8_t length) {-return gsm_7bit_decode_n_ussd(text, SIZE_MAX, user_data, length);+return gsm_7bit_decode_n_ussd(text, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,+ user_data, length); } int gsm_7bit_encode(uint8_t *result, const char *data) { int out;-return gsm_7bit_encode_n(result, SIZE_MAX, data, &out);+return gsm_7bit_encode_n(result, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,+ data, &out); } int gsm_7bit_encode_ussd(uint8_t *result, const char *data, int *octets) {-return gsm_7bit_encode_n_ussd(result, SIZE_MAX, data, octets);+return gsm_7bit_encode_n_ussd(result, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,+ data, octets); } int gsm_7bit_encode_oct(uint8_t *result, const char *data, int *octets) {-return gsm_7bit_encode_n(result, SIZE_MAX, data, octets);+return gsm_7bit_encode_n(result, GSM_7BIT_LEGACY_MAX_BUFFER_SIZE,+ data, octets); }diff --git a/tests/sms/sms_test.c b/tests/sms/sms_test.cindex 2c9d8d8..755b321 100644--- a/tests/sms/sms_test.c+++ b/tests/sms/sms_test.c@@ -280,6 +280,17 @@ int main(int argc, char** argv) /* test 7-bit encoding */ for (i = 0; i < ARRAY_SIZE(test_encode); ++i) {+/* Test legacy function (return value only) */+septet_length = gsm_7bit_encode(coded,+(const char *) test_encode[i].input);+printf("Legacy encode case %d: "+ "septet length %d (expected %d)\n"+ , i+ , septet_length, test_encode[i].expected_septet_length+ );+OSMO_ASSERT (septet_length == test_encode[i].expected_septet_length);++/* Test new function */ memset(coded, 0x42, sizeof(coded)); septet_length = gsm_7bit_encode_n(coded, sizeof(coded), (const char *) test_encode[i].input,@@ -296,6 +307,7 @@ int main(int argc, char** argv) OSMO_ASSERT (octets_written == test_encode[i].expected_octet_length); OSMO_ASSERT (octets_written == computed_octet_length); OSMO_ASSERT (memcmp(coded, test_encode[i].expected, octets_written) == 0);+OSMO_ASSERT (septet_length == test_encode[i].expected_septet_length); /* check buffer limiting */ memset(coded, 0xaa, sizeof(coded));@@ -357,6 +369,16 @@ int main(int argc, char** argv) /* test 7-bit decoding */ for (i = 0; i < ARRAY_SIZE(test_decode); ++i) {+/* Test legacy function (return value only) */+if (!test_decode[i].ud_hdr_ind) {+nchars = gsm_7bit_decode(result, test_decode[i].input,+ test_decode[i].expected_septet_length);+printf("Legacy decode case %d: "+ "return value %d (expected %d)\n",+ i, nchars, test_decode[i].expected_septet_length);+}++/* Test new function */ memset(result, 0x42, sizeof(result)); nchars = gsm_7bit_decode_n_hdr(result, sizeof(result), test_decode[i].input, test_decode[i].expected_septet_length, test_decode[i].ud_hdr_ind);-- 1.7.9.5

10years, 4months

  • 2
  • 4

January 2014 - OpenBSC - lists.osmocom.org (47)

[PATCH] nitb: Set the DST field in generated MM info messages

by Jacob Erlbeck

Currently the NET_DST information element (see GSM 24.008) is notincluded in generated MM info messages even when the DST field in thetimezone info has been set via the VTY or the control interface.This patch modifies gsm48_tx_mm_info() to append this informationelement if (and only if) a non-zero DST has been configured. TheDST IE is not part of GSM 4.8. Therefore it will only be sent, if theDST offset is configured to a value != 0.Sponsored-by: On-Waves ehf--- openbsc/src/libmsc/gsm_04_08.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.cindex 3cfc455..0d1ba7b 100644--- a/openbsc/src/libmsc/gsm_04_08.c+++ b/openbsc/src/libmsc/gsm_04_08.c@@ -656,6 +656,7 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn) struct tm* gmt_time; struct tm* local_time; int tzunits;+int dst = 0; msg->lchan = conn->lchan; @@ -749,6 +750,9 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn) tzunits = tzunits + (bts->tz.mn/15); ptr8[7] = bcdify(tzunits); }+/* Convert DST value */+if (bts->tz.dst >= 0 && bts->tz.dst <= 2)+dst = bts->tz.dst; } else { /* Need to get GSM offset and convert into 15 min units */@@ -768,8 +772,19 @@ int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn) } else ptr8[7] = bcdify(tzunits);++/* Does not support DST +2 */+if (local_time->tm_isdst)+dst = 1; } +#ifdef GSM48_IE_NET_DST+ptr8 = msgb_put(msg, 3);+ptr8[0] = GSM48_IE_NET_DST;+ptr8[1] = 1;+ptr8[2] = dst;+#endif+ DEBUGP(DMM, "-> MM INFO\n"); return gsm48_conn_sendmsg(msg, conn, NULL);-- 1.7.9.5

10years, 4months

  • 2
  • 2

January 2014 - OpenBSC - lists.osmocom.org (48)

Making jolly/testing ready to be merged?

by Holger Hans Peter Freyther

Dear Andreas,going through the patchset of jolly/testing in OpenBSC it would be niceto get most of the things merged (having TCH/H support for something likethe 31C3 is a nice goal).I wanted to start with merging the Connection Failure Criteria code butI am confused about the conversion. When parsing the criteria value fromfrom the VTY you divide by four and subtract (so 4 becomes 0). You ondothis when saving the config and patching it in the nanoBTS attributearray.Wouldn't it be more easy to not doing the conversion?holger

10years, 4months

  • 2
  • 2

January 2014 - OpenBSC - lists.osmocom.org (49)

OsmoDevCon 2014 / Date / Venue

by Harald Welte

Hi all,time is moving fast, and I want to start some initial discussion andplanning for OsmoDevCon 2014.There are basically four questions which I'm raising below. Pleaseprovide your feedback to the osmocom-event-orga mailing list only, toavoid cross-posting over all the project lists.= Who? =My intention is to keep it an 'active developer/contributer only' event,like we had it before. I would also want to keep the group relativelysmall, to keep the 'Osmocom family' atmosphere.If desired, we could have one half or full day of public prsentations ina larger auditorium, but the developer meeting should be a close group,as known so far.= Where? =If we keep the number of attendees within the same range as this year,then I'm sure we could again hold it at the same venue. I know it isnot perfect, but it is a place that we have access to, 24 hours per day,and free of cost for community projects like osmocom.org.If the community wants a larger event, then this is something that wouldrequire more funds and much more time organizing. And that is somethingthat I personally could not offer to take care of, sorry. I'm happy toattend and support any larger events, but I'm unable to take care offundraising and venue research.= When? =Q1/2014. In January, I'm not aware of any 'blocker' events. February,there is Fosdem (Feb 1 + Feb 2), and MWC from Feb 24 through Feb 27. InMarch there is CeBIT (March 10-14) and Easter holidays (with EasterHeggMarch 17-21). Did I miss any other FOSS / mobile event that might clashin Q1?So my preference woudl be to do it either late January (23-26) or inFebruary (6-9 or 13-16). Any preferences regarding preferred schedule?Once we have some concencus here on the list [and we want to do it inthe same size / venue], I'll talk to IN-Berlin.= What? =I think that question is easy to answer, if we have the above threefigured out... There's no shortage of topics, I suppose.You can start adding your suggestions tohttp://openbsc.osmocom.org/trac/wiki/OsmoDevCon2014Regards,Harald-- - Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/============================================================================"Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6)

10years, 4months

  • 1
  • 1

January 2014 - OpenBSC - lists.osmocom.org (50)

RFC adding another debug log statement

by Holger Hans Peter Freyther

Good Morning,during the 30C3 we had some "broken channels" because the BTS didn'trespond within four seconds to a Channel Activation/Deactivation. Istarted to look at it with perf and "snprintf" appears to be called alot and did show up in the top.snprintf is mostly called from within osmo_hexdump and gsm_lchan_name.Both of these function calls are used in our logging calls throughoutthe code.Going forward I think we can do* Remove some LOGP/DEBUG with osmo_hexdump (I did so for some call sites in the osmo-bts)* Start handlin -DNDEBUG inside logging.h and undefine/not define 'DEBUG' in logging.h. But this would take away some code paths that would be nice to look at.* gsm_lchan_name could 'cache' the last lchan and then not call snprintf. I did this once but it didn't appear to be much help. I will have another look.* Introduce a DEBUGQ, 'Q' for quick and check if the output would be enabled and then log. This can be useful when the cost of checking all targets twice is smaller than the cost of snprintf.comments?holgerdiff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.hindex 1d57e22..a8476d2 100644--- a/include/osmocom/core/logging.h+++ b/include/osmocom/core/logging.h@@ -27,6 +27,10 @@ #define DEBUGPC(ss, fmt, args...) #endif +#define DEBUGQ(ss, fmt, args)\+if (log_would_log(ss, LOGL_DEBUG))\+logp(ss, __FILE__, __LINE__, 0, fmt ## args);+ void osmo_vlogp(int subsys, int level, const char *file, int line, int cont, const char *format, va_list ap);@@ -215,6 +219,9 @@ const char *log_vty_command_description(const struct log_info *info); struct log_target *log_target_find(int type, const char *fname); extern struct llist_head osmo_log_target_list; +/* helper to check if it would log without using filter_fn */+int log_would_log(int subsys, unsigned int level);+ /*! @} */ #endif /* _OSMOCORE_LOGGING_H */diff --git a/src/logging.c b/src/logging.cindex 2e3a80a..1e64ba5 100644--- a/src/logging.c+++ b/src/logging.c@@ -268,6 +268,26 @@ err: target->output(target, level, buf); } ++static int cat_enabled(const struct log_target *tar,+const struct log_category *category, int level)+{+/* subsystem is not supposed to be logged */+if (!category->enabled)+return 0;++/* Check the global log level */+if (tar->loglevel != 0 && level < tar->loglevel)+return 0;++/* Check the category log level */+if (tar->loglevel == 0 && category->loglevel != 0 &&+ level < category->loglevel)+return 0;++return 1;+}+ /*! \brief vararg version of logging function */ void osmo_vlogp(int subsys, int level, const char *file, int line, int cont, const char *format, va_list ap)@@ -286,17 +306,8 @@ void osmo_vlogp(int subsys, int level, const char *file, int line, va_list bp; category = &tar->categories[subsys];-/* subsystem is not supposed to be logged */-if (!category->enabled)-continue; -/* Check the global log level */-if (tar->loglevel != 0 && level < tar->loglevel)-continue;--/* Check the category log level */-if (tar->loglevel == 0 && category->loglevel != 0 &&- level < category->loglevel)+if (!cat_enabled(tar, category, level)) continue; /* Apply filters here... if that becomes messy we will@@ -799,4 +810,19 @@ int log_init(const struct log_info *inf, void *ctx) return 0; } +int log_would_log(int subsys, unsigned int level)+{+struct log_target *tar;++llist_for_each_entry(tar, &osmo_log_target_list, entry) {+if (!cat_enabled(tar, &tar->categories[subsys], level))+continue;++if ((tar->filter_map & LOG_FILTER_ALL) != 0)+return 1;+}++return 0;+}+ /*! @} */

10years, 4months

  • 2
  • 2
January 2014 - OpenBSC - lists.osmocom.org (2024)

References

Top Articles
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 5795

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.