aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-10-28Don't link osmo-bsc_nat against libosmoabisHarald Welte1-2/+0
This fixes the following dpkg-shlibdeps warning: Change-Id: Iea00c209652e8070a59942504bef660db0999e86 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc-nat/usr/bin/osmo-bsc_nat was not linked against libosmoabis.so.6 (it uses none of the library's symbols)
2017-10-28osmo-bsc_nat: Don't link against libosmonetifHarald Welte1-2/+0
This fixes the following dpkg-shlibdeps warning: Change-Id: I31af5fb8b52ef1fd5effb139d9cdea1ebe9a41b4 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bsc/usr/bin/osmo-bsc_nat was not linked against libosmonetif.so.4 (it uses none of the library's symbols)
2017-10-26log: output hexdump of transmitted sccp messagesPhilipp Maier1-2/+2
We output a hexdump for each sccp message we receive, but not when sending. Also log the hexdump of sccp messages when sending. Change-Id: Ibfe52a0b7dbca4c569c603a008d73d0d99d1c345
2017-10-26log: log the sccp message type of messages sentPhilipp Maier1-0/+16
We already log the message type of sccp messages we receive, but for transmitting the log output is missing. Also log the message type for tramsitted sccp messages. Change-Id: I6736f15ddc03e5f70c3504abffbae6cbf766c9d7
2017-10-24Rename osmo_fsm to avoid illegal space in name + more meaningful nameHarald Welte2-4/+4
A FSM doesn't need "FSM" in its name, as it is obvious that it is a FSM. Also, having two that are called RESET is confusing, so let's try to come up with better names. Also, after Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2 in libosmocore, we now enforce that no FSM identifiers contain spaces or other illegal characters. Change-Id: I1b44d26cebc4a47094d7b8b3983e5737b88bf003
2017-10-24osmo-bsc: Initialize logging before initializing rate_ctrHarald Welte1-3/+3
The library code for rate counter initialization, which is called from the descendants of bsc_network_alloc() might already want to log something (particularly after Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the logging framework must be initialized before. Change-Id: I1e893c97e023e63489fe8c46539b5e507d3cec8f
2017-10-23bsc_vty: Improve description of mid-call-text cmdPau Espin Pedrol1-1/+2
Change-Id: I367b7734390daf39160de6462e9b2210368666f4
2017-10-23libbsc: Use correct printf formatting for uint64_tPau Espin Pedrol1-4/+4
unsigned long can be 32 bits on some arch/OS, while "current" field is always 64 bit because it's a uint64_t. Change-Id: Ibad1e4f09cf912cb654dbe3687a3f2182e2060f5
2017-10-17bsc_api: Fix NULL secondary_lchan access in handle_ass_failPau Espin Pedrol1-2/+4
Related: OW#3893 Program terminated with signal SIGSEGV, Segmentation fault. 0 gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342 (gdb) bt 0 gsm_lchan_name (lchan=lchan@entry=0x0) at gsm_data_shared.c:342 1 0x0805ab80 in lchan_release (lchan=0x0, sacch_deact=sacch_deact@entry=0, mode=mode@entry=RSL_REL_LOCAL_END) at chan_alloc.c:410 2 0x0805c1dd in handle_ass_fail (msg=0x94142b8, conn=0x9251048) at bsc_api.c:459 3 dispatch_dtap (msg=0x94142b8, link_id=0 '\000', conn=0x9251048) at bsc_api.c:598 4 gsm0408_rcvmsg (msg=msg@entry=0x94142b8, link_id=0 '\000') at bsc_api.c:658 5 0x08058ca2 in abis_rsl_rx_rll (msg=0x94142b8) at abis_rsl.c:1686 6 abis_rsl_rcvmsg (msg=0x94142b8) at abis_rsl.c:2097 7 0xb7e8cf9a in handle_ts1_read (bfd=0x94e8e08) at input/ipaccess.c:271 8 ipaccess_fd_cb (bfd=0x94e8e08, what=1) at input/ipaccess.c:386 9 0xb7ee8434 in osmo_select_main (polling=polling@entry=0) at select.c:158 10 0x0804bd7c in main (argc=6, argv=0xbfc27144) at osmo_bsc_main.c:272 (gdb) print lchan $2 = (const struct gsm_lchan *) 0x0 Possible scenario in which this crash can appear: 1- gsm0808_assign_req() calls handle_new_assignment() which sends an CHAN ACTIVATE msg and arms T10 timer. 2- ACTIVATE ACK is received (handle_chan_ack), which calls gsm48_send_rr_ass_cmd() which sends an ASSIGNMENT CMD, and doesn't disable/modify T10 timer. 3- T10 timeout is triggered (assignment_t10_timeout()), which sets conn->secondary_lchan = NULL 4- Immediately after, the ASSIGNMENT FAILURE message (which might have been already queued) is processed in handle_ass_fail, and then the crash occurs. This race condition is not an issue for handle_ass_compl() path because there's this check there which would trigger most probably if secondary_lchan is NULL: "if (conn->secondary_lchan != msg->lchan)" Change-Id: I3798b36c628f75d4e8bc7b0996c27d695d53fbb1
2017-10-11SI1q: fix EARFCN appenderMax1-5/+20
Previously if we ran out of space while adding EARFCN, we simply return which might result in malformed SI2q. Fix it by proper rollback of entire EARFCN. While at it, let's be paranoid and introduce extra checks against integer overflow in budget calculations. Change-Id: I4b2aa3825e9affb6dfeadecdf24dd1a43a92b7b7 Related: OS#2357
2017-10-11ctrl: add oml-uptime commandMax3-13/+41
Expose OML link uptime available via vts's "sh bts 0" command with the new "bts.0.oml-uptime" ctrl command. To avoid code duplication, move uptime computation into separate function and use it for both. Change-Id: Iec405aa949d6a38a9c8e64cd7ee4b49fd416835d Related: OS#2486
2017-10-10SI2q: fix generation for multiple UARFCNsMax2-13/+11
* fix insert routine to keep the list sorted by UARFCN * fix rest octets generator to properly account for offset * adjust test results accordingly Change-Id: I443c5c5f937b490578354f3c8a0c5b92629f2794 Related: OS#2357
2017-10-09OML: consider RSL link stateMax5-6/+35
OML link state is available via vty ("sh bts 0" command) and ctrl ("oml-connection-state" RO variable). When showing OML link state, take into consideration RSL link state as well: if OML is up but RSL is missing show it as degraded. That's implemented via BTS model-specific functions (currently Sysmo- and Nano- BTS only) Change-Id: I5952fc59e4d82e0aa627ad91d20f964d9559a4c4 Related: OS#2486
2017-10-09SI2q: cleanup UARFCN additionMax2-88/+90
* expand comments, fix typos * constify parameter * move try-add-adjust routine into separate function to facilitate further modifications * remove excessive checks and unnecessary return values * move (UARFCN, Scrambling Code) tuple uniqueness check into separate function and use it early Change-Id: Ia72f848dec40723510ca56868e08081804227d47 Related: OS#2357
2017-10-05add ';' after OSMO_ASSERT()Neels Hofmeyr1-1/+1
Currently, OSMO_ASSERT() is defined such that it ends in a semicolon, hence an added ';' is redundant. However, the usual way this kind of macro should be defined is #define OSMO_ASSERT(x) do { ... } while(0) so that the compiler requires a trailing semicolon. To prepare for such a change possibly coming up in libosmocore, add ';' to all OSMO_ASSERT() users. Change-Id: If6dce81faee9177737a6e1b572a871aaf7e37138
2017-10-01Make sure BA-IND in all SI2xxx is '0' and in all SI5xxx is '1'Harald Welte2-3/+21
In masurement reports sent by the MS, this can then be used to correlate if a given measurement report was in response to a BCCH/neighbor list received on BCCH (SI2xxx) or on dowlink SACCH (SI5xxx). Closes: OS#2525 Change-Id: I1cd0dc51026dcd0e508e63eea4e333e6b184787a
2017-10-01libbsc: document arguments of generate_bcch_chan_list()Harald Welte1-1/+7
Change-Id: I5afc6e6a5a1d6b6a8ee73fdb60cc28074cf8585b
2017-09-27Show OML link uptime in vtyMax3-3/+29
Save the time when OML link to BTS was established and show it in vty. That's useful when troubleshooting issues like periodic/sporadic BTS restart. Related: SYS#3889 Change-Id: I9e4e8504afe8ca467b68d41826f61654e24d9600
2017-09-25CTRL: cleanup write-only command functionsMax1-31/+3
Remove trivial functions by using more specific defines for CTRL commands. Change-Id: I10d6d18663aed87324d60472a0fc3bd1d0961dea
2017-09-25Further cleanup leftovers from BSC/MSC splitMax1-1/+0
* drop unused header * fix name of jenkins test * remove dead code Change-Id: I986904864741995910b6ba92173b9f7b1b03e2f1
2017-09-23Wrap channel state assignment in macroMax2-5/+6
Previously we've used function so debug print always pointed to the same place which is not very useful. Wrap it with macro so proper file:line is printed. Also, make sure that we always change state only through this wrapper and log only when the state has changed. Change-Id: I21789f8021290965b61a54a2b23177ccbbfe8321
2017-09-14SI13: drop PBCCH-related bitsMax2-44/+16
According to 3GPP TS 44.018 §1.8 the "network shall never enable PBCCH and PCCCH". Change-Id: I319e71a4b0c682361529e9c21377398a826b934b Related: OS#2400
2017-09-08Make TRX rf locking more visibleMax3-7/+11
* log administrative state transitions * log what's caused it * while at it, mark boolean variable as such Change-Id: I3e25a19fac4d0b4886d825c9876771b1f66efe58 Related: SYS#3864
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr85-442/+442
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-09-06drop files unrelated to osmo-bscNeels Hofmeyr2-413/+0
These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-bsc. Empty out contrib: remove things that are either obviously unrelated to osmo-bsc, or seem old and/or esoteric. osmoappdesc.py: drop nitb_e1_configs (and some ws) Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a
2017-09-03configure.ac: remove smpp_mirror, which has no relation to a BSCHarald Welte2-377/+0
smpp_mirror is maintained in osmo-msc.git, so let's remove it (and the associated libsmpp34 build requirement). Change-Id: Ia7b242cc52cf261b1a5dd3c287da2868e1a2b9a8
2017-09-03configure.ac: remove --enable-osmo-bsc, --enable-natHarald Welte1-12/+1
This is the OsmoBSC project. Disabling the build of the BSC would be somewhat odd, so let's remove the option. Also, OsmoBSC depends on libosmo-sccp now, so we must unconditionally depend on it. As a result, we can remove the --enable-nat option, as this was only to avoid a mandatory libosmo-sccp requirement in historical times. Change-Id: Icfee8a904d33b7c13ab8d185d64fb5c2337d8640
2017-08-30split off osmo-bsc: remove files, apply buildNeels Hofmeyr109-45634/+45
Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca
2017-08-30add msg type to SMS rx loggingNeels Hofmeyr1-1/+3
Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077
2017-08-30gsup client: move not-connected to error loglevelNeels Hofmeyr1-10/+2
Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031
2017-08-30move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcpNeels Hofmeyr26-7296/+22
Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
2017-08-30move libiu to osmo-iuh/libosmo-ranapNeels Hofmeyr23-1029/+129
Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-08-30mgcp: add VTY Option to force-realloc endpointsPhilipp Maier4-2/+18
Currently the force_realloc feature is turnd on and of in a hardcoded way. This patch makes the option available via VTY. Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
2017-08-30Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier38-650/+3617
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-27Treat SIGTERM just like SIGINT in our programsHarald Welte5-0/+10
When somebody kills the process, it's best to handle the signal and to use the opportunity for some cleanup. We always did this in the NITB on SIGINT, but never on SIGTERM. Let's change it. Change-Id: Iea6804325a6575ceab5edfd28dd20249462f143b
2017-08-27NITB: remove 'help' output about '-a' option that is removed for agesHarald Welte1-2/+0
This option was present in very early versions of the NITB, but at least since 2011 it is no longer supported. It's still listed in --help output, which is wrong. Change-Id: I1d2cceb588ec5fb34ec5e2c05a7d8c93310bee88
2017-08-27libmsc: Use actual delivery time in delivery reports.Keith2-2/+3
Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8
2017-08-27gbproxy: log signal value as textMax1-6/+4
Change-Id: I6ed923f5c60a8d64305f4b8e90d1362d6510e1c5
2017-08-27gbproxy: log unhandled BSSGP PDU as textMax1-2/+1
Change-Id: Ibe3c8bd353b3a178e26b0936f25b2e1959f9990c
2017-08-27libmsc: Fix wrong handling of user_message_reference parameterPau Espin Pedrol1-2/+2
libsmpp34 already converts received TLV integer values to native endianess in libsmpp34_(un)pack. Converting them again at receive time swaps the 2 bytes of user_message_reference, then using a wrong value. As GSM03.40 spec uses only 1 byte for the id, then only the high byte of the initial value is used and eventually sent back to the ESME. Again, at that time, htons() is not needed because libsmpp34 already handles that part. See OS-#2429 for more details. Change-Id: If748548a4a223e529a1110c89e483b599b406e8b
2017-08-27smpp: Fix compilation warningPau Espin Pedrol1-1/+1
I already stumbled into 2 compilation environments which had Werror enabled for -Wmaybe-uninitialized and the build failed, so let's workaround this warning. | smpp_openbsc.c: In function 'handle_smpp_submit': | smpp_openbsc.c:216:9: error: 'sms_msg_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] | memcpy(sms->user_data, sms_msg, sms_msg_len); | ^ | smpp_openbsc.c:100:15: note: 'sms_msg_len' was declared here | unsigned int sms_msg_len; | ^ | cc1: some warnings being treated as errors Change-Id: I0901ddadb5f72e1585cb1797ac22c8ab95e83146
2017-08-27LIBMSC: Use sms->text, not sms->user_data to construct report bodyKeith1-1/+1
gsm_04_11.c sms_report_alloc() Use the sms->text, not the sms->user_data to construct the report body. This also prevents the potential output of non printable characters to the log and or vty. Change-Id: Id51bc9483ad6f52d6da74135605cfd12434c7c96
2017-08-27LIBMSC: Place correct dst address in status reportKeith1-1/+1
gsm_04_11.c: gsm340_gen_sms_status_report_tpdu() When we construct the status report PDU, use sms->src instead of sms->dst as the destination address This way we tell the MS that the message was delivered to the destination and not to itself. This is relevant for phones that display a textual representation of the delivery report. Change-Id: I2d4f87ac777465de9bfb5a775a789a2691755ee9
2017-08-27libmsc: use SMPP34_DELIVERY_RECEIPT_* in libsmpp34Pablo Neira Ayuso1-7/+1
Use new definitions in libsmpp34 to set the registered_delivery field accordingly, as provided by I5b3afff1b3b77cccd949e0606914c7ac3ba6114c. Moreover, do not set this header field to zero if status reports are off, the deliver_t structure has been already zeroed so this not required. Change-Id: Ie78e17323796120f576b9c0e1bc5ccc32da8ee12
2017-08-27Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str()Harald Welte8-51/+17
In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9
2017-08-27sgsn_vty: Don't assume pdp->lib is always validHarald Welte1-14/+16
We can only print libgtp pdp information if a library context is attached to this pdp context. This is not always the case, particuarly during some teardown scenarios. Change-Id: Ia3184877f9709db65f5f93a98403f2ef5b04a8ca
2017-08-27Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCHHarald Welte2-2/+5
When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280
2017-08-27SGSN: Fix RAN information exposed on GTP during PDP CTX CREATEHarald Welte1-7/+18
In the PDP Context Create from SGSN to GGSN, we include information about the RAN type (GERAN/UTRAN) and the Cell of the MS. This was all hard-coded to GERAN, and wasn't updated when we added UTRAN support to the SGSN. Change-Id: I6c79e42c5e08b28fe8182555302a5505fbbaa313
2017-08-27mgcp: Fix uplink activation of Osmux streamPau Espin Pedrol1-2/+4
Commit 575420637981828b64c1292ada015d7170b89390 introduced OSMUX_STATE_NEGOTIATING to fix a race condition present in osmo-bsc_nat. However, after this change osmo-bsc_mgcp cannot switch to OSMUX_STATE_ACTIVATING anymore, which means during osmux_send_dummy time it won't call osmux_enable_endpoint(), which in turn won't set endp type to MGCP_OSMUX_BSC. If MGCP_OSMUX_BSC is not set, uplink streams are sent using regular RTP instead of Osmux not matter it is enabled in config or not. Change-Id: Ibcb59aa1ca25408f82cc88c2d5b81177b5f276dc
2017-08-27handover_logic: set correct link to bts for subscriber_connection in case of ↵Ivan Kluchnikov1-0/+1
moving this connection to another bts In case of successful completion of handover gsm_subscriber_connection could be moved from one bts to another, so connection link to bts should be replaced by link to bts, which owns new_lchan. This bug was detected, because conn->bts->nr is used in call control log messages and wrong number of bts was observed in these messages after handover. Change-Id: Idc7dd412b7580c451e716b73ef7549826c60b0d9