summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-01-07layer23/include/Makefile.am: add missing headerVadim Yanitskiy1-1/+2
Change-Id: I0a379718eeb7db63696cabd5689e0625fb85d85e
2019-01-07layer23/sap_interface.c: avoid using 'osmo' prefixVadim Yanitskiy5-18/+18
The 'osmo' prefix is usually used by libosmo-* symbols. Change-Id: Id37d8553c2f2c20012fb1b729967b92a9a03f612
2019-01-07layer23/sap_interface.c: define missing enums and use themVadim Yanitskiy2-24/+55
Change-Id: I4ba5a8a42bf25d04b152ac3f1f0e4d7eac7f068f
2019-01-07layer23/sap_interface.c: terminate value_string definitionsVadim Yanitskiy1-0/+5
Change-Id: I0776bc43360dfa2229243fb022cd318242ca6400
2019-01-07layer23/sap_interface.c: prettify value_string definitionsVadim Yanitskiy2-54/+58
Change-Id: Ib3aa81986987027718e2a8b461afd28787bda4c2
2019-01-07layer23/sap_interface.c: fix: properly call sap_msg_free()Vadim Yanitskiy1-6/+8
Passing NULL to sap_msg_free() is not only meaningless, but also would result in NULL pointer dereference. We should call it in successful case only, so let's fix this. Change-Id: Icf868c4299e292a17c4b7aad1f9e728ea3653494
2019-01-02trxcon/scheduler: fix RSSI -> RX level conversionVadim Yanitskiy1-1/+11
Due to a mistake, average RSSI value of received bursts was not converted to GSM RX level (range 0..63), so trxcon has been sending incorrect values to the higher layers. Let's fix this, and also prevent possible division by zero. Change-Id: Id4659de899411ec1ba1718fdcb40aec562dbfd65
2018-12-26layer23/sap_interface.c: use LOGP() instead of fprintf()Vadim Yanitskiy1-3/+3
Change-Id: I054be24666fcd5eb8a70cfcac0e7ed566e909b90
2018-12-26layer23/sap_interface.c: use int for rc in sap_open()Vadim Yanitskiy1-1/+1
Change-Id: I683f87ae09393c45377c39317b08c613055ceb16
2018-12-26layer23/sap_interface.c: remove redundant socket_path argumentVadim Yanitskiy3-5/+6
Change-Id: I408b3e1fa40e9b5daf88fa6ed5f3930b83dffe6f
2018-12-26layer23/sap_interface.c: drop unused osmosap_sapsocket()Vadim Yanitskiy2-10/+0
Change-Id: Ie3040c75bb61094b9b601aef9d699db603d292f4
2018-12-26layer23/sap_interface.c: return rc from osmosap_send_apdu()Vadim Yanitskiy1-7/+10
Change-Id: I3965843c4d49e31b1b5156d9ee8439eef6ecaab1
2018-12-26layer23/include/sap_interface.h: use #pragma onceVadim Yanitskiy1-5/+1
Change-Id: I98e407c2b6604438d2495700cb62753ad55369ea
2018-12-26mobile/subscriber.c: consider GSM_SIM_TYPE_SAP tooVadim Yanitskiy2-5/+7
There are several SIM card interfaces, two of which: - GSM_SIM_TYPE_L1PHY (using built-in SIM reader of the L1 PHY), - GSM_SIM_TYPE_SAP (using remote reader via (BT)SAP protocol), can actually deal with a physical SIM card. But, for some reason, only GSM_SIM_TYPE_L1PHY was considered as such. Let's also get along with GSM_SIM_TYPE_SAP for the following procedures: - PIN management and verification, - FPLMN / LOCI updating, - A3 authentication. Change-Id: I4b3080fa7a5332467a449a314ba3cc3a07a9b7df
2018-12-26host/layer23: rename GSM_SIM_TYPE_READER to GSM_SIM_TYPE_L1PHYVadim Yanitskiy5-10/+10
Since we have two ways to interact with a physical SIM: - using built-in SIM reader of the L1 PHY (via L1CTL), - using remote reader via (BT)SAP protocol, name 'GSM_SIM_TYPE_READER' looks quite confusing. Let's rename it in order to explicitly indicate the role of L1 PHY. Change-Id: I0f83f365ed50cfd658fdd3a9d6866ed76c8c4009
2018-12-26layer23/common/sim.c: don't ignore rc of sim_apdu_send()Vadim Yanitskiy1-3/+5
Change-Id: I8cab7cc72f026947859cc607f65d925803424cf7
2018-12-23mobile: Use new VTY telnet API to allow binding to random portHolger Hans Peter Freyther1-2/+1
Change-Id: I5a6214aec2dcb92495038ea8311c0df22fa8d07b
2018-12-19layer23/mobile: drop dead SAP initialization codeVadim Yanitskiy1-10/+0
SAP connection can be initialized upon request. Change-Id: Ic89089c4850ab2c9252bfd43a05d5271e2e3a160
2018-12-18host/layer23/sap_interface.c: cosmetic: use ARRAY_SIZE()Vadim Yanitskiy1-1/+1
Change-Id: I3a2908bf11300ec681beddb5a54f9a62ca5430ae
2018-12-18host/layer23: don't init SAP interface by defaultVadim Yanitskiy1-4/+0
Almost all layer23 applications, excluding mobile, have nothing to do with SAP interface. Moreover, the current implementation does initialize SAP connection automatically, as soon as the first message is sent. Change-Id: I62cc69c06fa15468a55bb0a9d408267d0745174c
2018-12-18trx_toolkit/fake_trx.py: refactor global class hierarchyVadim Yanitskiy7-790/+663
This change is a big step towards handling of multiple transceivers in a single process, i.e. multiple MS and multiple BTS connections. The old class hierarchy wasn't flexible enough, because initially fake_trx was designed as a bridge between OsmocomBB and OsmoBTS, but not as the burst router. There were two separate, but 90% similar implementations of the CTRL interface, two variations of each simulation parameter - one for UL, another for DL. The following new classes are introduced: - Transceiver - represents a single transceiver, that can be used as for the BTS side, as for the MS side. Each instance has its own CTRL, DATA, and (optionally) CLCK interfaces, among with basic state variables, such as both RX / TX freq., power state (running or idle) and list of active timeslots. - CTRLInterfaceTRX - unified control interface handler for common transceiver management commands, such as POWERON, RXTUNE, and SETSLOT. Deprecates both CTRLInterface{BB|BTS}. - FakeTRX - basically, a child of Transceiver, extended with RF path (burst loss, RSSI, TA, ToA) simulation. Implements a custom CTRL command handler for CTRLInterfaceTRX. The following classes were refactored: - BurstForwarder - still performs burst forwarding, but now it doesn't store any simulation parameters, and doesn't know who is BTS, and who is MS. Actually, BurstForwarder transforms each L12TRX message into a TRX2L1 message, and dispatches it between running transceivers with matching RX frequency and matching timeslot. - FakePM - still generates random RSSI values, but doesn't distinguish between MS and BTS anymore. As soon as a measurement request is received, it attempts to find at least one running TRX on a given frequency. Please note that fake_trx.py still does handle only a single pair of MS and BTS. No regressions have been observed. Both new and refactored classes were documented. Change-Id: Ice44e2b22566b3652ef6d43896055963b13ab185 Related: OS#3667
2018-12-18trx_toolkit/data_if.py: add optional legacy message coding flagVadim Yanitskiy1-2/+2
In I6b9a8b611ea1e9badc4d9ddf13aa9e237028e39a an optional legacy message coding mode was introduced. Let's add the corresponding argument to send_msg() and pass it to gen_msg(). Change-Id: I6b9a8b611ea1e9badc4d9ddf13aa9e237028e39a
2018-12-18trx_toolkit/data_msg.py: add optional legacy message coding flagVadim Yanitskiy1-1/+14
Some transceivers (e.g. OsmoTRX) have inherited a rudiment from OpenBTS - two dummy bytes at the end of TRX2L1 messages. Despite they are absolutely useless, some L1 implementations, such as trxcon and OpenBTS, still do expect them when checking the message length. Let's add an optional (disabled by default) argument to gen_msg(), that would enable adding those two dummy bytes. Change-Id: I0cf1314c399411886420176704cadd6e6d84787f
2018-12-18trx_toolkit/data_msg.py: use struct API for fn and toa256 codingVadim Yanitskiy1-16/+4
The built-in struct module is already used for toa256 decoding, so let's use it for toa256 encoding, and TDMA frame number coding too - no need to (re)implement the wheel! Change-Id: I10d2e15ac57a0524e9bc1c80ed6a0f6f5a263436
2018-12-16trx_toolkit/ctrl_if_bb.py: drop meaningless warningsVadim Yanitskiy1-8/+0
A timeslot can be reconfigured at runtime, this is normal. We should neither complain nor reject such commands. Change-Id: I0a69ebceed5aa724093e6d1b23faad8c16705055
2018-12-16trx_toolkit/burst_send.py: exit if DATA dump parsing failedVadim Yanitskiy1-1/+2
False is not iterable, so we should properly handle the case when parsing of the whole DATA dump was failed (e.g. due to incorrect offset specified). Change-Id: I5443efb39bb9d3377290ce7ec5e34016cae0edb2
2018-12-16trx_toolkit/burst_send.py: fix: use proper argparse groupVadim Yanitskiy1-3/+3
Found using Flake8, F841 "local variable 'pf_group' is assigned to but never used". The filtering related options should be defined in 'pf_group' group, not in 'cnt_group'. Change-Id: I15d17c134cbbbd54d761113a56c1f83910ab6407
2018-12-16trx_toolkit: fix missing / useless importsVadim Yanitskiy4-4/+2
Found using Flake8: - data_if.py:57:4: F405 'log' may be undefined, or defined from star imports: data_msg - clck_gen.py:29:1: F401 'time' imported but unused - clck_gen.py:30:1: F401 'sys' imported but unused - trx_sniff.py:28:1: F401 'signal' imported but unused Change-Id: Id0c42319b445db218b77fd5e99a9a0a89724281d
2018-12-12contrib/jenkins.sh: build and publish manualsOliver Smith1-0/+17
Add new environment variables WITH_MANUALS and PUBLISH to control if the manuals should be built and uploaded. Describe all environment vars on top of the file. Related: OS#3385 Change-Id: I856e4bc71e1b648de5f27d4044aa60bd0b45e0f5
2018-12-12trx_toolkit/data_if.py: add message parsing methodsVadim Yanitskiy1-0/+33
This change extends DATAInterface class with new methods: - recv_raw_data() - read raw data from socket; - recv_l12trx_msg() - read raw data and parse as L12TRX; - recv_trx2l1_msg() - read raw data and parse as TRX2L1; which would simplify the further usage of this class. Change-Id: I761c4e63864622d3882b8f9c80ea43b58f092cb1
2018-12-11trx_toolkit/ctrl_if.py: read data from socket in handle_rx()Vadim Yanitskiy2-5/+7
It makes much more sense to read data from socket in handle_rx(), instead of expecting a buffer with received data from caller. Change-Id: I83479c60c54e36a2a7582714a6043090585957ae
2018-12-11trx_toolkit/ctrl_if_*.py: transparently pass UDPLink argumentsVadim Yanitskiy2-4/+4
There is no need to (re)define the arguments of UDPLink's constructor. Let's use non-keyworded variable length argument list (*args). Change-Id: Ia312a5e15ce88d5f7e8d76c4ea8c93c59d91be5a
2018-12-10trx_toolkit/ctrl_if_bb.py: fix SETTA command handlingVadim Yanitskiy1-1/+1
Since I8fd2a2ab7784b38bde5ebcfd0359b7e2cb53f5a7, SETTA command handling was broken, because the range limitation was removed together with argument parsing. Let's fix this. Change-Id: If582af3849359866de129504cc5b2dc6d64edbd5
2018-12-08trx_toolkit: merge copyright.py into app_common.pyVadim Yanitskiy8-32/+25
Since we have introduced ApplicationBase class, that are used by all existing applications, let's merge the copyright printing helper into it. Change-Id: I8b70ec2dd08cb2ffed733d2c4e1215b094f8d3d5
2018-12-08trx_toolkit: introduce logging configuration argumentsVadim Yanitskiy6-15/+97
Before this change, it was impossible to configure logging parameters from command line, such as log level and format. This change introduces the following optional arguments: --log-level - logging level for stderr (by default, DEBUG); --log-format - logging message format for stderr; --log-file-name - enable logging to a given file; --log-file-level - logging level for file (by default, DEBUG); --log-file-format - logging message format for file; which are defined in a new class called ApplicationBase, so all existing applications should inherit them now. Change-Id: Ic3b0440cd73946ad444bd7e48feb7a92d45f6488
2018-12-07trx_toolkit/fake_trx.py: migrate from getopt to argparseVadim Yanitskiy1-90/+44
Change-Id: I0218a328671c591b20b0666dc7c39ba865892acc
2018-12-07trx_toolkit/trx_sniff.py: migrate from getopt to argparseVadim Yanitskiy1-121/+65
Change-Id: Id1dacaa32134bfa68344e6c48310390cdd85cdc9
2018-12-07trx_toolkit/ctrl_cmd.py: migrate from getopt to argparseVadim Yanitskiy1-59/+27
Change-Id: Ib9bf5ed7384c4f34478975cefe03880eb2fc8069
2018-12-07trx_toolkit/burst_send.py: migrate from getopt to argparseVadim Yanitskiy1-131/+63
Change-Id: I1be66aa022a79aa1683f0e6cfebaed568b1736b1
2018-12-07trx_toolkit/burst_gen.py: migrate from getopt to argparseVadim Yanitskiy1-145/+88
Change-Id: I7eb3f2e2713f1f97293bd47a2eae3b140f63fb59
2018-12-07trx_toolkit/burst_gen.py: fix short version of --burst-typeVadim Yanitskiy1-3/+3
Both '--bind-addr' and '--burst-type' had the same short '-b'. Let's use the upper case version for '--burst-type'. Change-Id: Ib8a46e25cbc6266c3e147582f9e8045362270151
2018-12-07trx_toolkit: use generic logging module instead of print()Vadim Yanitskiy12-95/+145
There are multiple advantages of using Python's logging module: - advanced message formatting (file name, line number, etc.), - multiple logging targets (e.g. stderr, file, socket), - logging levels (e.g. DEBUG, INFO, ERROR), - the pythonic way ;) so, let's replace multiple print() calls by logging calls, add use the following logging message format by default: [%(levelname)s] %(filename)s:%(lineno)d %(message)s Examples: [INFO] ctrl_if_bts.py:57 Starting transceiver... [DEBUG] clck_gen.py:87 IND CLOCK 26826 [DEBUG] ctrl_if_bts.py:71 Recv POWEROFF cmd [INFO] ctrl_if_bts.py:73 Stopping transceiver... [INFO] fake_trx.py:127 Shutting down... Please note that there is no way to filter messages by logging level yet. This is to be introduced soon, together with argparse. Change-Id: I7fcafabafe8323b58990997a47afdd48b6d1f357
2018-12-07trx_toolkit/fake_trx.py: drop randomization related cmd optionsVadim Yanitskiy2-42/+6
The randomization of both UL/DL RSSI and ToA values is optional, and can be configured from the control interface (see both FAKE_RSSI and FAKE_TOA commands). The command line options for enabling / disabling the randomization were redundant, so let's get rid of them and check if the corresponding treshold value is set. Change-Id: I6adc13b8989ade2fab895673525c0ca17bf9b3f2
2018-12-07trx_toolkit/burst_fwd.py: also pass-filter UL bursts by time-slotVadim Yanitskiy1-0/+5
For some reason, the time-slot pass-filtering was only done for DL bursts, but not for UL bursts. BurstForwarder shall not pass UL bursts for unconfigured time-slots too. Let's also print a warning if an UL burst is sent on a not configured time-slot, i.e. before sending SETSLOT command. Change-Id: Idb7f5b212e5814aeff8ca8bc875ad066674267cd
2018-12-07trx_toolkit/burst_fwd.py: properly pass-filter multiple time-slotsVadim Yanitskiy2-8/+19
Previously it was only possible to configure a single time-slot that would be pass-filtered by a BurstForwarder instance. In some applications it would be useful to configure multiple time-slots, so let's refactor the time-slot pass-filtering algorithm. Change-Id: Ie1490adaf7a7c62c966aeb60c1898eaf3b5a1e84
2018-12-06trx_toolkit/burst_fwd.py: document and refactor BurstForwarderVadim Yanitskiy1-48/+126
Instead of having all configuration variables of BurstForwarder initialized in the class heading, let's introduce two functions for initialization (resetting to defaults) of both UL/DL params. This would allow to reset a BurstForwarder instance from the control interface in follow-up patches. Let's also introduce some basic documentation for the class fields, which were defined in the heading previously. Change-Id: I6b1bf41cf22f01a7e7ecc91c625fb0d2bf4bfeac
2018-12-04doc/manuals: integrate into this repositoryOliver Smith3-4/+38
Update .gitignore and make the manuals build without a toplevel configure.ac file from autotools: $ cd doc/manuals $ make Related: OS#3385 Change-Id: Ifc2349bc2855b55cc1e603b79dc769c55a110aa1
2018-11-29trxcon/l1ctl.c: handle hopping channels from L1CTL_DM_EST_REQVadim Yanitskiy1-21/+62
Change-Id: I8617b5808748bc4df3d7cc9862ed8cf12613f270
2018-11-29trxcon/trx_if.c: add SETFH CTRL command supportVadim Yanitskiy2-0/+46
The idea of SETFH command is to instruct transceiver to enable frequency hopping mode using the following parameters: CMD SETFH <HSN> <MAIO> <CH1> <CH2> [... <CHN>] Note: since the length of a CTRL command is limited to 128 symbols (BTW: why?), the amount of channels is also limited. Change-Id: Id3d44e6a2796f1ce8523a49dedd5d484052a5c7f
2018-11-28build manuals moved here from osmo-gsm-manuals.gitOliver Smith3-15/+18
Moved to doc/manuals/, with full commit history, in preceding merge commit. Now incorporate in the build system. Build with: $ autoreconf -fi $ ./configure --enable-manuals $ make Shared files from osmo-gsm-manuals.git are found automatically if - the repository is checked out in ../osmo-gsm-manuals; or - if it osmo-gsm-manuals was installed with "make install"; or - OSMO_GSM_MANUALS_DIR is set. Related: OS#3385 Change-Id: I7d1226d3865da9595b730b716a8d4ba07be1e0d5