AgeCommit message (Collapse)AuthorFilesLines
2018-06-12osmocon: Do not exit on read return 0pespin/no-exitPau Espin Pedrol1-3/+4
Change-Id: Ifedfbc9742792b4f8d7850dc7ce84d5b3dbc0096
2018-06-08trf6151: Actually fix setting of uplink ARFCNSteve Markgraf1-1/+1
Some time ago a broken fix was committed which then has been reverted again in commit 17240037376169369b526ee8a8284961b85adbfa. The purpose of this line is to clear the uplink flag from the ARFCN. So far this worked because both gsm_arfcn2band() and gsm_arfcn2freq10() already do this internally. Change-Id: Ie8a05ffc0ddec53d7fd6a25e03ea285fb216df29 Signed-off-by: Steve Markgraf <>
2018-06-04mobile/sms: Make it optional to store the SMS on diskHolger Hans Peter Freyther4-4/+37
Disable storing the SMS on disk. This is useful when scripting mobile. Keep the default of attempting to store it to disk. Change-Id: I6353447343d98ebaa5e12ab63f995750f81c8500
2018-06-02mobile/sms: Simplify the string format routinesHolger Hans Peter Freyther1-4/+1
It seems the original code didn't allocate \0 for the string. Just use talloc_asprintf and get a new string... Change-Id: I8ffb50b04d2d6196caf0231711f3467abc8c5ea5
2018-06-02mobile/sms: Fix memory leak in case the storage can not be openedHolger Hans Peter Freyther1-1/+3
Before jumping to the failure handling code free the sms_file. Change-Id: Ifce2bc130fe3a5bd49ad457ee61002952dd496ba
2018-06-01mobile: Make time spent in c7 configurableHolger Hans Peter Freyther4-1/+26
When no cell was found during the PLMN search the camp on any cell state will be entered. LUs are prevented in this state and it will be left after the start_any_timer has timedout. Even if camping on the home network the state will not be left before the expiry of the timer. For systematic tests this is producing a too high upper bound. Make it configurable so we can succeed with a UL more quickly. Change-Id: I25bc985cd4360d5e37d05a7b16b39eefb75ce20f
2018-05-22osmocon: Fix build using different pathPau Espin Pedrol1-3/+3
Change-Id: I1a322e364612976f3d797f25e57ccc7c2354bd5e
2018-05-20Remove the patches for WiresharkVadim Yanitskiy2-1188/+0
GSMTAP support is already merged to the mainline, while the status of SMSCB support is unknown. In any case, OsmocomBB is not a good place for storing the patches for Wireshark, so let's remove them. Change-Id: I448dc5a3dba3ecc6fc041861239dc23cca72b70b
2018-05-20README.development: add brief info about the TRX ToolkitVadim Yanitskiy1-1/+9
Change-Id: I589a5e0a1b41439aabc59e97aca378d16f4e4cc5
2018-05-20README.development: cosmetic: correct/add wiki linksVadim Yanitskiy1-4/+10
Change-Id: Ib17196044f276d05269dbdb5a5a1444202fa0e07
2018-05-20README.building: cosmetic: correct wiki linksVadim Yanitskiy1-1/+3
Change-Id: I0fd8fdc7aecdf04266898eaadd05f1f0c705bb5c
2018-05-20include/osmocore: remove unused headersVadim Yanitskiy2-41/+0
Both removed headers are not used anywhere, and probably left from the time when there was no libosmocore as a shared library. Change-Id: I821e2958e07176c1031c636019dffd1cee62bb10
2018-04-15VIRT_PHY: add missing L1CTL_BURST_IND to l1ctlPrimNamesVadim Yanitskiy1-0/+1
Change-Id: I442305c034bbba5eaed080fb262a61895623eb4f
2018-04-15trxcon: Prefix SACCH fill frame with L1 headerHarald Welte1-2/+12
The main problem here is that the existing implementatin missing the L1 header in this message. A SACCH message doesn't have a 23byte LAPDm message, but only a 21 byte LAPDm message prefixed by a 2-byte Layer1 header. So on the receiver in the BTS, right now the first two bytes of the UL SACCH frame are misinterpreted as L1 header. This it what causes RLL ERROR INDICATION on the Abis side, which is why our BTS_Tests fail. Change-Id: Id7776bf3604d0e8a32e04547e01b8bd377903272 Related: OS#3170
2018-04-09host/trxcon: track talloc NULL contexts by defaultVadim Yanitskiy1-0/+3
In order to be able to introspect not only the root application context, but also all other contexts, e.g. allocated within libosmocore or other libraries, let's enable tracking the use of NULL contexts using the corresponding talloc API. Change-Id: Id21cd5ee340def443f7a5d0b2b8f37f41188dd87
2018-04-09host/trxcon: don't free root talloc contextVadim Yanitskiy1-2/+7
This is useless, and prevents us from finding potential memory leaks at exit. Let's print talloc report instead of that. Change-Id: Ibf04942070d654e97c3ed77d69ab19e44602758c
2018-04-09host/trxcon: use osmo_init_logging2()Vadim Yanitskiy1-1/+2
The osmo_init_logging() doesn't allow to specify a talloc context for libosmocore logging subsystem, so this is why the new version was introduced. Let's use it. Change-Id: I06c4a1f7f839f774bc428e89cfac30132bae904d
2018-04-07Merge 'fixeria/trx' into masterHarald Welte47-1/+10305
Change-Id: I5586fd8c9eb281285f4a59e63cb17dbc3641e1c1
2018-04-04trxcon/l1ctl.c: hexdump content of unhandled messagesPau Espin Pedrol1-1/+2
Change-Id: Iec8fc6d49d1e35fe101960dd969de559e37a6a75
2018-04-04trx_toolkit: Add cmdline arg to set bind addrPau Espin Pedrol8-36/+58
Previous hardcoded default of was inappropiate in some scenarios, as it sets the SRC addr of the packets sent through the socket based on the routing. For instance, if iface IF1 has assigned two IP addresses A and B, A being the first addr of the interface, and osmo-bts-trx is configured with "osmotrx ip local A" and "osmotrx ip remote B", the following happens: CMD POWER OFF src=A:5801 dst=B:5701 RSP POWER OFF src=A:5701 dst=A:5701 <-- A is assigned as src addr. But osmo-bts-trx is waiting for packets from B:5701, and the packet is dropped with ICMP Unreachable. If addr binding is forced in fake_trx to B, then everthing's fine. Let's extend the UDPLink in order to allow manual, but optional setting of bind address, and add a corresponding cmdline argument to all executables. Change-Id: I7be18fef40967fb7551f4115f22cbbd9cdb0840d
2018-04-02trxcon: Respect the tch_mode field of DM_EST_REQHarald Welte3-7/+8
the initial tch_mode is not always 0 (signalling) but can very well be directly a codec mode, if the initial activation of the channel is in speech mode as opposed to signalling Change-Id: I96e4c89da1165e9c5287d863e0e65d811460c606
2018-03-22trxcon/scheduler: add CHAN_IS_SACCH macroVadim Yanitskiy1-0/+3
Change-Id: I2fc90d4732433f221c628058c9812815edf9c8cb
2018-03-22trxcon/scheduler: share lchan link identifiersVadim Yanitskiy2-41/+41
Change-Id: Ie1632f274b2ae6147a8e918ebfea60eeeb6a234c
2018-03-22trxcon/sched_prim.c: fix: correct the first padding byteVadim Yanitskiy1-8/+9
According to TS 144.006, section 5.2, the first octet containing fill bits shall be set to the binary value "00101011" == 0x2b. Change-Id: I8f0304bf84613a2dc07cb78aff0cb8bb4c5adf6c
2018-03-21virt_phy: Add missing gprs related entries to l1ctlPrimNamesPau Espin Pedrol1-1/+6
Change-Id: Ia59e22cda9cf5e25b5e2b1fe38f8ec3937b16f80
2018-03-14common/l1ctl.c move TCH bit-ordering to the firmwareVadim Yanitskiy3-40/+54
Previously, TCH frames coming from L1 were reordered to the RTP format. Moreover, the implementation had a few problems: - L1CTL is not the best place for such manipulations; - payloads with other than FR codec were corrupted. Let's use RTP-ordered payloads on the L1CTL interface, performing TCH frame reordering at the firmware. Please note, that actual FR reordering was moved to the firmware as is, without any codec determination. This could be fixed in a separate change. Change-Id: I81ec8ed3c9e72a62b22c1720c299cdc68b733cf1
2018-03-14L1CTL/L1CTL_CRYPTO_REQ: add key length and channel infoVadim Yanitskiy5-11/+19
Previously, the L1CTL_CRYPTO_REQ message contained only a ciphering algorithm and actual Kc key to be used. The key length was calculated manually using the MSGB API. Let's avoid manual calculations here, as it may cause unexpected behavior if the message structure is changed. Also, let's fill the UL header with minimal information about a channel, which is going to be encrypted. Change-Id: I5fab079907c5276322d3ec2b46cab81f10c7ed09
2018-03-13Rename 'fake_trx' to 'trx_toolkit'Vadim Yanitskiy20-20/+19
This toolkit has branched out into several different tools for TRX interface hacking, and creating a virtual Um-interface (FakeTRX) is only one of its potential applications. Change-Id: I56bcbc76b9c273d6b469a2bb68ddc46f3980e835
2018-03-13fake_trx: unify the GPL license headerVadim Yanitskiy7-61/+41
There is no need to manually put the license header as a variable in each application in order to print it. Let's use a common one. Change-Id: I1a6e8716a9069e7ade3ae15f2c04fd45d18e223c
2018-03-11trxcon/sched_lchan_tchf.c: always send traffic indicationsVadim Yanitskiy1-17/+29
We shall always send traffic frame indications, even if received frame is incomplete or decoding was failed. This is required for proper Measurement Reporting. Change-Id: I99e134699796c7075299459e96b2f2d462636619
2018-03-11trxcon/sched_lchan_xcch.c: always send data indicationsVadim Yanitskiy1-6/+9
We shall always send data frame indications, even if received frame is incomplete or decoding was failed. This is required for proper Measurement Reporting. Change-Id: I7beee7e797f488d04c3b59bee9501ce823717092
2018-03-11trxcon/scheduler: enforce lchan handlers to set message typeVadim Yanitskiy4-21/+18
Since this change, each lchan handler shall manually indicate a type of both message indications and confirmations. Change-Id: I02e0b87d61c127d2f6f5b9532909af78332bf707
2018-03-11trxcon/sched_lchan_common.c: use static memory allocationVadim Yanitskiy1-28/+19
There is no need to allocate the DL header for each new message. Change-Id: Id7ad815c6b403f5c3d15fc02022397188f1d87fd
2018-03-11trxcon: clean up DATA / TRAFFIC indication APIVadim Yanitskiy3-27/+23
- change 'l1ctl_tx_data_ind' symbol to 'l1ctl_tx_dt_ind' in order to indicate that it's used for both DATA and TRAFFIC; - introduce a 'traffic' flag, which is used to define either TRAFFIC or DATA indication type; - pass L2 payload and its length separately from the Downlink info header. Change-Id: I9fe65ee9b2d772576b86b7bc85d53518530d1579
2018-03-11trxcon: clean up DATA / TRAFFIC confirmation APIVadim Yanitskiy3-16/+12
- change 'l1ctl_tx_data_conf' symbol to 'l1ctl_tx_dt_conf' in order to indicate that it's used for both DATA and TRAFFIC; - introduce a 'traffic' flag, which is used to define either TRAFFIC or DATA confirmation type; Change-Id: Iedd569086a264dc7d8740abea5c6e5ca21e299f6
2018-03-11trxcon/l1ctl.c: combine both DATA and TRAFFIC REQ handlersVadim Yanitskiy1-44/+16
Both functions are almost identical, and the only difference is the message type they set. Let's combine them into a single function and introduce a 'traffic' flag, which can be used to define a message type. Change-Id: I288f5d7b6cd242c4793973dcb3d2b1b6925d61a7
2018-03-11trxcon/l1ctl_link.c: allocate msgb after its length is readVadim Yanitskiy1-10/+8
Change-Id: I2b941c5ed91097c4ed2d859634bbe89f44546061
2018-03-11trxcon: clarify L1CTL message length fieldVadim Yanitskiy3-5/+19
Each L1CTL message gets its own length pushed in front before sending. This isn't specified in the 'l1ctl_proto.h', but assumed in the code. Let's clarify this. Change-Id: I118d00613aeaf5ff0bad1188fa5f7450d4ca8122
2018-03-11trxcon: use meaningful names for L1CTL messagesVadim Yanitskiy2-2/+2
There are two types of L1CTL messages: received and to be transmitted. Let's use proper names to indicate this. Change-Id: I7c17687579282fa389bca35dc7edbc3582e55701
2018-03-11trxcon/scheduler: transmit dummy frames on CBTX lchansVadim Yanitskiy4-0/+118
If at the moment of transmission there are no frames in TX buffer, then either a dummy LAPDm frame (0x01, 0x03, 0x01, 0x2b ...) or a silence frame (depending on a codec in use) shall be transmitted. This is required for proper measurements on the BTS side. Change-Id: Ie590990f2274ea476678f6b2079f90eeadab6501
2018-03-11trxcon/scheduler: introduce a new CBTX lchan flagVadim Yanitskiy2-30/+32
This new flag is intended to indicate that continuous burst transmission is assumed on particular logical channel. In other words, if a logical channel has this flag, but there is nothing to transmit in a TX buffer, then either a dummy LAPDm frame or a silence frame shall be sent. Change-Id: I25fcf9eeb787ffe5378d92532439e67d7d42fa65
2018-03-11trxcon/sched_trx.h: clarify lchan flags meaningVadim Yanitskiy1-1/+3
Change-Id: I51b663dd16e46a4523488c3d3000922a7c3640d1
2018-03-11trxcon/sched_trx.c: fix: omit inactive logical channelsVadim Yanitskiy1-0/+4
The sched_frame_clck_cb() is responsible for UL burst transmission. Iterating over each timeslot, it chooses a proper lchan handler according to a current frame number and a multiframe layout in use, takes a L2 UL frame from a TX buffer, and finally calls the chosen handler in order to to encode and transmit a taken frame. A handler should be called only for activated logical channels... but for some long time, there was a bug, so each lchan was processed, including inactive ones. It's time to fix this. Change-Id: I33e3ecc14be3ae64dfd02789c7f0970c945582c9
2018-03-11trxcon/sched_trx.c: fix: properly deallocate lchansVadim Yanitskiy1-2/+4
The llist_for_each_entry_safe() should be used instead of the llist_for_each_entry(), because it's safe against removal of llist entry. Found using Valgrind's memcheck tool. Change-Id: I65234971ec152df038c5388da537a503060c215b
2018-03-11trxcon/ add --enable-sanitize optionVadim Yanitskiy1-0/+11
Change-Id: I099de726f9d67213c56d996039b4207f80a727c6
2018-03-06fake_trx/ use a random bind port by defaultVadim Yanitskiy1-4/+13
Since it is not required to specify a bind port to the UDPLink constructor manually, let's use a random one by default, and also allow user to set it from command line. Change-Id: Ib4965ebeec83d9a99b2f026156eb5f5cb20875bf
2018-03-06fake_trx/ use a random bind port by defaultVadim Yanitskiy1-4/+5
This allows one to obtain a random available port from the OS, instead of enforcing to pick a static value manually. Change-Id: Ie8b60134239c5447d0b4373c6cca2f3a6ee3ec73
2018-03-06fake_trx/ remove incorrect isdigit() checkVadim Yanitskiy1-5/+0
Previously, we used to check if all arguments of a command are numeric. This was done in a wrong way, so parsing a *valid* command with at least one negative argument could fail. Let's remove this check, allowing the command handlers to deal with argument types themselves. Change-Id: If31295274a09102c414b5a7aec5dd85d88b2e514
2018-03-06fake_trx/ reduce code branch nastingVadim Yanitskiy1-8/+10
Let's use the inverted condition to avoid additional code nasting. Change-Id: I8a62b39d9d9a597c612f9a576e98dc05e37cd25b
2018-03-06fake_trx/ remove forgotten debug printVadim Yanitskiy1-1/+0
Change-Id: I4886828fb0f927c59c5eb1945a3c2873687de7b3