aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/abis_nm.c
AgeCommit message (Collapse)AuthorFilesLines
2018-11-21abis_nm: Introduce new signal S_NM_GET_ATTR_REPPau Espin Pedrol1-2/+7
This signal can be used for tools willing to request and parse Attribute Response and do something with the information. ipaccess-config tool will use this signal in later patch Change-Id Ida416a969a3309868d6f4e50f34b34f224c32dd6. Related: OS#3624 Change-Id: I9a121bbfe1b96904d4e16845abc90bb6ef20d2c9
2018-11-18add missing 'break' in switch statementStefan Sperling1-0/+2
Coverity points out that abis_nm_rcvmsg_sw() contains a switch statement with suspicious looking missing break statements. It is unclear to me if the code intends to process some types of messages in more than one state, or of all messages which affect a particular state already appear in the state's corresponding switch block. Can someone else tell what is supposed to happen here? If this code is falling through intentionally, I will suggest a patch adding /* fallthrough */ comments for clarity. Change-Id: I1ea4221fadf30074156e9d17d94a5cb065242584 Related: CID#57703 Related: CID#57704
2018-11-09abis_nm: parse_attr_resp_info_unreported: Fix offset calculationPau Espin Pedrol1-1/+1
See following specs for related information: * 3GPP TS 52.021 §8.11.3 Get Attribute Response * 3GPP TS 52.021 §9.4.64 Get Attribute Response Info Related: OS#3624 Change-Id: Ie61d70bc28427d5d879638516a36f590ce98bdc7
2018-11-09abis_nm: Support parsing nanoBTS format for Get Attributes InfoPau Espin Pedrol1-1/+9
Spec compliant format is defined in: * 3GPP TS 52.021 §8.11.3 "Get Attribute Response" * 3GPP TS 52.021 §9.4.64 "Get Attribute Response Info". On nanoBTS, however, reported attribute list is provided directly inside/after the foh header instead of being enveloped inside the Get Attributes Response Info. Furthermore, The Get Attributes Response Info can still appear and be at any position in the reported attribute list, and it only contains the unreported attribute ID list inside. Change-Id: I81a613d53bddf432a79fa5cb0bf9d847b4bdee37
2018-11-09abis_nm: Add support to parse OML IP and Unit Id in Get AttributesPau Espin Pedrol1-0/+47
Change-Id: Ia05e0b8fe3e28aaf2b2253d018f0614e83e23caa
2018-11-09abis_nm: Add support to parse some nanoBTS Attribute Response attributesPau Espin Pedrol1-1/+2
nanoBTS actually supports regular formatting. There are a few differences with spec though: * The attributes are listed directly in the message instead of being inside the Get Attributes Response Info after the unsupported attribute ID list. * The Get Attributes Response Info can be at any position in the attribute list, and it only contains the unsupported attribute ID list. As a result, parsing is currently split into 3 main parts or functions: * Parsing regular (per spec) Get Attributes Response Info attr and get a pointer to the list of attributes. * A function that parses the list of attributes, called directly in case of nanoBTS, and called by the former parser of Get Attributes Response Info for regular (per spec) OML endpoints. * A function to parse the unsupported attribute ID list, also used in the first function to get a pointer to the list of attributes. Related: OS#3624 Change-Id: I52e9f177c14fec1ec3f5c4ddb244594409008357
2018-11-09abis_nm: Allow sending and receiving Get Attributes (Response) against nanoBTSPau Espin Pedrol1-2/+5
* Allow sending Get Attributes message in abis_nm_get_attr. * Don't try to decode Get Attribute Response Info for nanoBTS, since it uses a different formatting than the one defined in specs. Related: OS#3624 Change-Id: I53d01e73791cf5450aa34b1ac8f051730e3a70f9
2018-11-09abis_nm: Split reported attr list parsing from Attribute Response Info into ↵Pau Espin Pedrol1-54/+42
its own func nanoBTS uses same format for the attribute list from Attribute Response Info, but without using the later as an evelope. By splitting we can later reuse the code handling the Attribute list. While at it, take the chance to remove functions parse_attr_resp_info_* which expect TLVs following an specific order, which is not mandatory. Related: OS#3624 Change-Id: Iec7a6e4d27639d0e5adc0d9a01cd3c3e7a46f558
2018-11-09abis_nm: Split handling of Attribute Response Info into its own funcPau Espin Pedrol1-12/+19
In future commits, nanoBTS support will be added, which implements its own format not exactly equal to specs Attribute Response Info. Related: OS#3624 Change-Id: I346dacc58faac70e6d224ca49484f9211cb8a046
2018-11-09abis_nm: Rename m_id_len to ease review of forthcoming patchesPau Espin Pedrol1-6/+6
This function will be merged into another using a "len" variable. This change makes diffs easier to follow in future patches. Change-Id: I1be03e31901ccf284e31237a04bb7448d1f22c07
2018-10-06nanoBTS: Allow BCCH with CBCH on TS0Harald Welte1-0/+1
Change-Id: I111c7f14e5f70ecbf6c660c1de24c6a5796b2eef Closes: OS#3630
2018-10-03abis_nm_get_ts: Return TS of correct TRX, not always TRX0Pau Espin Pedrol1-6/+6
Seen while operating a setup with 2 TRX (2 nanobts): DNM <0004> abis_nm.c:703 OC=CHANNEL(03) INST=(00,01,04): bts=0 trx=0 Opstart ACK DTS <0011> bts_ipaccess_nanobts.c:308 timeslot(0-0-4-TCH_F)[0x612000008aa0]{UNUSED}: Received Event TS_EV_OML_READY DTS <0011> bts_ipaccess_nanobts.c:308 timeslot(0-0-4-TCH_F)[0x612000008aa0]{UNUSED}: Event TS_EV_OML_READY not permitte As it can be seen, OML log header state correctly it comes from TRX1, but later content in line expresses TRX0, and that failure is forwarded up the stack and channels for TRX different than TRX0 are never initialized. Related: OS#3560 Fixes: f0ff9a67117dc22d838769fe6eef67778abd43b9 Change-Id: I27e992e419422051247777b048175b724c05323e
2018-09-28fix unaligned access in abis_nm_rx_ipacc()Stefan Sperling1-3/+2
Related: OS#3496 Change-Id: Ia9bdce39472719bfebec29e0a55a021ef45c8ea6
2018-08-23abis_nm_ipaccess_rsl_connect: Log bts and trx nrPau Espin Pedrol1-2/+2
Change-Id: I0c895a44527d5396d3dabb273e000acd86aece1c
2018-08-22abis_nm: Fix trailing whitespacingPau Espin Pedrol1-15/+15
Change-Id: Ia434b349e85019d2224a6f9a699058dccc6072dc
2018-08-22abis_nm: Fix heap-use-after-free in abis_nm_set_channel_attrPau Espin Pedrol1-1/+1
LOGPFOH uses the msgb through "foh", so we have to free msgb after calling it, not before. Fixes following ASAN report: 20180822120155990 DNM <0004> abis_nm.c:1889 OC=CHANNEL(03) INST=(00,01,06): Set Chan Attr (bts=0,trx=1,ts=6) ================================================================= ==16465==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a00002b3f0 at pc 0x7f587f44c0db bp 0x7ffc59e31df0 sp 0x7ffc59e31de8 READ of size 1 at 0x61a00002b3f0 thread T0 #0 0x7f587f44c0da in abis_nm_dump_foh libosmocore/src/gsm/abis_nm.c:937 #1 0x561e09e1532c in abis_nm_set_channel_attr osmo-bsc/src/osmo-bsc/abis_nm.c:1892 #2 0x561e09efd269 in nm_statechg_event osmo-bsc/src/osmo-bsc/bts_ipaccess_nanobts.c:168 #3 0x561e09efd269 in bts_ipa_nm_sig_cb osmo-bsc/src/osmo-bsc/bts_ipaccess_nanobts.c:335 #4 0x7f587efb3d16 in osmo_signal_dispatch libosmocore/src/signal.c:120 #5 0x561e09e18e31 in abis_nm_rx_statechg_rep osmo-bsc/src/osmo-bsc/abis_nm.c:255 #6 0x561e09e18e31 in abis_nm_rcvmsg_report osmo-bsc/src/osmo-bsc/abis_nm.c:380 #7 0x561e09e18e31 in abis_nm_rcvmsg_fom osmo-bsc/src/osmo-bsc/abis_nm.c:778 #8 0x561e09e1dc19 in abis_nm_rcvmsg osmo-bsc/src/osmo-bsc/abis_nm.c:926 #9 0x7f587ec90cc2 in handle_ts1_read input/ipaccess.c:274 #10 0x7f587ec90cc2 in ipaccess_fd_cb input/ipaccess.c:389 #11 0x7f587efb1ca8 in osmo_fd_disp_fds libosmocore/src/select.c:217 #12 0x7f587efb1ca8 in osmo_select_main libosmocore/src/select.c:257 #13 0x561e09e049d6 in main osmo-bsc/src/osmo-bsc/osmo_bsc_main.c:922 #14 0x7f587d53a2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #15 0x561e09e054e9 in _start (/bin/osmo-bsc+0x34d4e9) Fixes: OS#3494 Change-Id: I030117abfdcee387516a4dea7e1e6a9bae8055f6
2018-07-23various logging: fix missing/extra newlinesNeels Hofmeyr1-5/+5
Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe
2018-06-15fix dyn TS init: properly identify BTS on OML OPSTART ACKNeels Hofmeyr1-2/+27
Commit "dyn ts, bts_ipaccess_nanobts.c: init PDCH on Chan OPSTART ACK" bf7099262adf0f27e71a08387747c5cb0d459360 Icf6e25ff068e8a2600562d52726ead65e864ec02 introduced signal S_NM_OPSTART_ACK and passed the FOM header to identify the BTS by. But the FOM header's BTS number is zero on each Abis/IP link, and the BTS and TRX are actually identified by msgb->dst == e1inp_sign_link, member trx. So the initial implementation associated *all* Channel OPSTART ACKs with BTS 0. Pass the entire msgb as S_NM_OPSTART_ACK signal argument, implement a abis_nm_get_ts() to retrieve the proper timeslot and use that during timeslot init. Related: OS#3351 OS#3205 Change-Id: I45ce5c24cb62d00f350df1af1be6c11104d74193
2018-06-07dissolve libbsc: move all to src/osmo-bsc, link .o filesNeels Hofmeyr1-0/+2971
Move all of libbsc/ into osmo-bsc/, and separate/move some implementations to allow linking from utils/* and ipaccess/* without pulling in unccessary dependencies. Some utilities use gsm_network and gsm_bts structs, which already include data structures for fairly advanced uses. Move initialization that only osmo-bsc needs into new bsc_network_init() and bsc_bts_alloc_register() functions, so that the leaner tools can use the old gsm_* versions without the need to link everything (e.g. handover and lchan alloc code). In some instances, there need to be stubs if to cut off linking "just before the RSL level" and prevent dependencies from creeping in. - abis_rsl_rcvmsg(): the only program currently interpreting RSL messages is osmo-bsc, the utils are merely concerned with OML, if at all. - paging_flush_bts(): ip.access nanobts models call this when the RSL link is dropped. Only osmo-bsc actually needs to do anything there. - on_gsm_ts_init(): the mechanism to trigger timeslot initialization is related to OML, while this action to take on init would pull in RSL dependencies. utils/ and ipaccess/ each have a stubs.c file to implement these stubs. Tests implement stubs inline where required. From src/utils/, src/ipaccess/ and tests/*/, link in .o files from osmo-bsc/. In order for this to work, the osmo-bsc subdir must be built before the other source trees. (An alternative would be to include the .c files as sources, but that would re-compile them in every source tree. Not a large burden really, but unless linking .o files gives problems, let's have the quicker build.) Minor obvious cleanups creep in with this patch, I will not bother to name them individually now unless code review asks me to. Rationale: 1) libbsc has been separate to use it for osmo-nitb and osmo-bsc in the old openbsc.git. This is no longer required, and spreading over libbsc and osmo-bsc is distracting. 2) Recently, ridiculous linking requirements have made adding new functions cumbersome, because libbsc has started depending on osmo-bsc/*.c implementations: on gscon FSM and bssap functions. For example, neither bs11_config nor ipaccess-config nor bts_test need handover_cfg or BSSMAP message composition. It makes no sense to link the entire osmo-bsc to it, nor do we want to keep adding stubs to each linking realm. Change-Id: I36a586726f5818121abe54d25654819fc451d3bf