aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
AgeCommit message (Collapse)AuthorFilesLines
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr1-3/+5
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-03-04move two gsm0480_send_*() to xsc as gsm0480_gen_*()Neels Hofmeyr2-0/+40
Have two separate gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() for each of libbsc and libmsc. Move their core into libxsc as generator functions returning a msgb. Add src/libbsc/gsm_04_80_utils.c (note, not 04_08) to implement the libbsc side of it. The code is identical, but the linked structs and functions differ in each case. There could be a common source file built for both, but I decided against it, for more clarity I hope.
2016-03-04gsm_subscriber_connection: further split between BSC and MSCNeels Hofmeyr1-11/+5
Move some Iu/A members into the MSC #ifdef. Have separate allocate and free functions for the two scopes.
2016-03-04create libxsc and move some code, never link libbsc and libmscNeels Hofmeyr4-756/+38
libbsc and libmsc have conflicting definitions of gsm_subscriber_connection and do no longer belong together anyway. Create libxsc, meaning 'lib[bm]sc', to hold all code used by both libmsc and libbsc, and make sure gsm_subscriber_connection isn't used there. In various binaries and tests, do not link libbsc and libmsc. (Note: this commit was reshaped out of a large wip chunk, it may not compile properly without the subsequent commits)
2016-03-03mscsplit: getting grips on header scopesNeels Hofmeyr1-0/+2
2016-03-03cscn wip: direct dtap responses to IuCSNeels Hofmeyr1-1/+1
2016-03-03cosmetic: remove unused extern.Neels Hofmeyr1-1/+0
2016-03-03mscplit: try to clarify root talloc ctx and global gsm_network.Neels Hofmeyr6-29/+36
The aim is to allow osmo-cscn to pass its own root talloc context and global gsm_network struct instance cleanly. This may stir up some old and dusty globals, but I hope it's for the better, since not all is a BSC. To ensure that a global gsm_network pointer for the bsc_vty is set, have it as argument to bsc_vty_init(). The vty configuration commands are added only after bsc_vty_init(), which are needed to configure the network struct. So split up the bsc_bootstrap_network() function into bsc_network_init() to allocate a gsm_struct, and bsc_network_configure() to read the config file once the vty commands are in place. In this way, no global bsc_gsmnet pointer is needed for the bsc vty. The atomic super glue is dissolved and osmo-cscn will be allowed to have a different name for it. Admitted, it's still called the bsc_vty, but a split thereof is probably coming soon, because the CSCN doesn't want any of the BSC nor BTS specific vty commands.
2016-03-03mscsplit: remove bts and lchan pointers from libmscNeels Hofmeyr6-57/+115
The diff between this and master will probably need a lot of review and fixes. The current state does compile, but I expect pretty much everything to be broken now. Future development will reinstate proper functionality piecemeal. The first goal is to get basic signalling to work, then SMS. The voice control (RTP) is completely disabled now (see "#if BEFORE_MSCSPLIT") and will be fixed last AFAICT.
2016-03-03Indicate A-interface for new A subscr-conn.Neels Hofmeyr1-0/+1
2016-03-03cosmetic: a rename, comments.Neels Hofmeyr1-3/+5
Rename conn_ctx_list -> ue_conn_ctx_list. Indicate Iu-CS 'siblings' for a couple of functions. Tweak/add comments.
2016-03-03wip (reminders to self, whitespace)Neels Hofmeyr1-1/+3
2016-03-03subscr_name(): Handle case for subscr == NULLHarald Welte1-1/+1
subscr_name() was called from several places: * either without a check for subscr being NULL, which for example was causing a segfault if we hand-over a channel before identifying the subscriber * or with an explicit NULL check and the ternary operator (?). We now simplify the code by checking for the NULL Subscriber in subscr_name() itself.
2016-03-03move subscriber conns list into struct gsm_network.Neels Hofmeyr2-6/+4
Replace the global sub_connections llist with gsm_network.subscr_conns. Initialize and apply where applicable. Remove bsc_api_sub_connections().
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr1-2/+4
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25enable telnet VTY bind address config for various programsNeels Hofmeyr1-1/+5
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2016-02-24minor fixes in bsc_vty.c and bsc_nat.cNeels Hofmeyr1-1/+0
Remove unused talloc.h from bsc_vty.c. In bsc_nat.c, use OSMO_CTRL_PORT_BSC_NAT instead of hardcoding port number, and include ctrl/ports.h for that. Fix comment typo "COMAMND"
2016-01-30gsm0408: Provide unique strings for the gsm 04.08 messageHolger Hans Peter Freyther1-8/+8
At Rhizomatica we see that some GSM 04.08 messages are leaked and have no other indication if that is Call Control, SMS or something else.
2016-01-28fix bsc_vty out: timeslot indented too deeply.Neels Hofmeyr1-8/+8
In 'show running-config', timeslot appears as a sub-element of rsl, but it is a direct child of trx. Fix the timeslot section in vty_out by removing one space of idention. Adjust various config examples. Rationale: it's not relevant for function, but confuses human operators. Fixing it will save the next hacker some time.
2015-12-12indicate the GSM 04.08 channel mode in 'show lchan'Harald Welte1-0/+16
2015-11-20vty: Print NCC/BCC and not just integer value of BSICHarald Welte1-1/+2
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte2-27/+8
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2015-11-02stats: Enable stats for sgsn, gbproxy, nitb, bsc, natJacob Erlbeck1-0/+2
This commit initialises and enables the stats subsystem for the given binaries. Sponsored-by: On-Waves ehf
2015-10-02amr: Attempt to unbreak the AMR support in the BSCHolger Hans Peter Freyther1-1/+1
The signature of mr_config and the BSC implementation didn't match and the compiler was warning about it: osmo_bsc_api.c:530:2: warning: initialization from incompatible pointer type .mr_config = bsc_mr_config, ^ osmo_bsc_api.c:530:2: warning: (near initialization for ‘bsc_handler.mr_config’) Change the mr_config again and provide an implementation that will set the ms and bts data structure. It would be better to put the size outside of the IE but I am not going to change it right now. It would also be nice to either move the AMR setting into the "nitb" structure or have the msc data be used _after_ the bts settings. This needs to be cleaned up in the next step. Manually verified by placing a MO call and checking that both the channel mode modify and the mode modify request contain the multi rate config with the rate mr config (length two bytes, version 1, icmi==1, no start mode being set).
2015-10-02amr: Kill more duplication and let the code work one of the modesHolger Hans Peter Freyther1-34/+25
2015-10-02amr: Instead of putting ms/bts into the same struct.. use it twiceHolger Hans Peter Freyther3-38/+24
This way a lot of if/else can just be killed by the caller deciding which of the two instances to use. I have copied both branches to new files, replace bts for ms in one of them and ran diff on it. There is no difference.
2015-10-02amr: Remove some code duplication in preparationHolger Hans Peter Freyther2-15/+18
Merge two copies into a local static helper function. The format of the message will change and then it is easier to modify it in one place than in two. Sadly the original patch was merged before this clean-up so do the clean-up as second step. Conflicts: openbsc/src/libbsc/abis_rsl.c openbsc/src/libbsc/gsm_04_08_utils.c
2015-09-22Add full AMR multirate IE support with VTY config for MS and BTS sideAndreas Eversberg6-38/+459
2015-09-04system_information.c: Distinguish two previously identical log msgsHarald Welte1-2/+2
2015-09-04Fix neighbor channel list generation for 1900 MHz PCS bandHarald Welte1-3/+3
In the 1900 MHz PCS band, we always generated neighbor cell lists consisting of only a single neighbor cell, rather than al the configured BTSs.
2015-08-17Send RADIO LINK TIMEOUT value via OML attribute to BTSAndreas Eversberg1-0/+4
The same radio link timeout value is used for BTS and MS side.
2015-08-17Add option to set RADIO LINK TIMEOUT value via VTYAndreas Eversberg2-3/+17
2015-08-03paging: Go through all BTS to stop pagingHolger Hans Peter Freyther1-16/+9
As the comment says we should not rely that the paging occurs on the current LAC. We might page at more BTS. Walk all the BTS to stop paging. No callbacks will be issued by this stop operation.
2015-08-03paging: In case paging failed stop it everywhereHolger Hans Peter Freyther1-1/+3
In case we can't page on a BTS then stop it everywhere. The callers of paging_request assume that this is kind of an atomic operation and we should help with that.
2015-07-01bsc: Check for the rand and then generate a resHolger Hans Peter Freyther1-1/+6
Check if the NAT has sent 16 bytes of RAND and if a key has been configured in the system and then generate a result using milenage. The milenage res will be sent and noth the four byte GSM SRES derivation.
2015-07-01bsc/nat: Fix the structure of the identity request messageHolger Hans Peter Freyther1-2/+15
Unfortunately the basic structure of the response is broken. There is a two byte length followed by data. The concept of a 'tag' happens to be the first byte of the data. This means we want to write strlen of the token, then we want to write the NUL and then we need to account for the tag in front. Introduce a flag if the new or old format should be used. This will allow to have new BSCs talk to old NATs without an additional change. In the long run we can clean that up.
2015-06-20bts: Arfcn can never be smaller than 0Holger Hans Peter Freyther1-2/+1
Remove the condition because it can never be true. Fixes: Coverity CID#1307793
2015-06-19Fix GSM900 ARFCN range checkMichael McTernan1-2/+2
Allow ARFCN 0 to be used in GSM900 band.
2015-06-02libbsc: Move SIs update/generation for a BTS into a separate function.Alexander Chemeris2-14/+26
The code to do that doesn't belong to the control interface, so abstract it out to a separate function gsm_bts_set_system_infos(). [hfreyther: Fix the coding style...]
2015-04-29sub: Remove paging requests before dispatchingHolger Hans Peter Freyther1-4/+10
The dispatching might lead to the removal of more paging requests and makes "request" invalid. Remove it before calling the callback.
2015-04-04bts: "Repair" broken channels if we receive the release ackHolger Hans Peter Freyther1-3/+14
We had issues with odd behavior on the nanoBTS which lead to the introduction of the "broken" state. On busy multi BTS cells (e.g. rhizomatica) with wifi backhaul the timeout we set to wait for a RF Channe Release ACK is sometimes too little and channels are marked broken that look to be okay (besides the still to be determined delay). In case of a sysmoBTS we now know that we can change the state of a broken channel back to normal in case we do receive the right response. Manually verified using the Smalltalk BTS code PackageLoader fileInPackage: 'FakeBTS' bts := FakeBTS.BTS new. bts btsId: '1903/0/0'. bts connect: 'localhost'. bts waitForBTSReady. test := FakeBTS.OpenBSCTest new. test bts: bts. test requireAnyChannel ... wait for NITB output <0004> abis_rsl.c:223 (bts=0,trx=0,ts=0,ss=0) Timeout during deactivation! Marked as broken. ... process pending messages stdin next <0004> abis_rsl.c:735 (bts=0,trx=0,ts=0,ss=0) CHAN REL ACK for broken channel. Releasing it. So the channel went from broken to unallocated.
2015-02-10ctrl: Implement a global result for rf_locked0.14.0Holger Hans Peter Freyther1-2/+27
Create a one stop command to give a statement for the entire network. This can be used to check the policy and the state of the entire network.
2015-02-10ctrl: Add a command to check how many bts are configuredHolger Hans Peter Freyther1-0/+10
This can be used to query how many bts are configured to check if all of them are locked or not.
2015-02-10nitb: Move the rf-lock commands from osmo-bsc to libbscHolger Hans Peter Freyther1-0/+83
The bts.0.rf-state and rf_locked command have been moved from the osmo-bsc binary to libbsc. All tests continue to pass.
2015-02-07nokia: Allow to set the reset time for the nokia btsSipos Csaba2-4/+23
2015-01-31bsc/nitb: Allow to set the GPRS mode through the ctrl commandHolger Hans Peter Freyther2-11/+44
Create a control command to read and modify the gprs mode. Use the get_string_value to indicate if the value was found or not. This is useful for the ctrl interface where I didn't want to replicate "none", "gprs" and "egprs". Share code to verify that a BTS supports the mode. Related: SYS#591
2015-01-31ctrl/bsc: Fix copy and paste error and update textHolger Hans Peter Freyther1-0/+2
30f1f376383df3ae8d85e96542bf14d174c25d89 introduced new channel combinations but had a copy and paste error in the description. The jenkins system didn't run the external tests so this issue and others were not noticed until now. Fix the copy and paste and update the test result.
2015-01-31rsl: Remove unused code for channel activationHolger Hans Peter Freyther1-35/+0
The code has been unused for a long time. Let's remove it.
2015-01-27nitb: Allow the network to decide if a subscriber should be createdHolger Hans Peter Freyther1-0/+2
2015-01-05RSL: Change "... is back in operation" to an INFO level messageHarald Welte1-1/+1