aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-05nat: Remove unused func bsc_vty_init()Pau Espin Pedrol1-8/+0
The function is never called in osmo-bsc-nat, and logging_vty_add_cmds() is called directly in main(). Change-Id: Ie13cf5dc7f8dfa6fc6c3953dfcacaed7d5feb114
2018-08-16vty: Fix typo writing bts-jitter-buffer-delay-{min,max}Pau Espin Pedrol1-2/+2
Change-Id: I83948ce626b924802d1963411a3f40c5fed24355
2018-07-04nat: Add VTY cmd paging-bss-forward to nat nodePau Espin Pedrol1-0/+23
This command controls forward/drop of BSS paging messages from MSC to all BSCs connected to BSC-NAT. In situations in which MS don't generally roam from one BSC to another under the BSC-NAT, it may be beneficial (bandwidth wise) to drop these global paging commands, which are usually issued by the MSC if the location of the MS isn't known and LAC paging has failed. Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3
2018-06-28bsc_vty: Write access list entries when storing bsc configPau Espin Pedrol1-3/+2
Back-port from osmo-bsc.git d99182c01037f4dd14fb72b2b06497e0c1bebb49. Change-Id: I0b951a9c3dbe245c3813fc91ceb9118a0de779b8
2018-06-28Rename bsc_msg_acc_lst_vty_init to have more uniform prefixPau Espin Pedrol1-1/+1
Back-port from osmo-bsc.git a0f1196eda79de0e838b29eb91d9f31839f2f447. Change-Id: I519fb945a99206dff6c4aeb476d527e632b7e751
2018-06-28bsc-nat: Add more complete VTY command to show BSC related infoPau Espin Pedrol1-68/+74
Other VTY commands already exist which provides each a subset of these features, but while operating bsc-nat it became interesting to have all this info easily reachable for a specific BSC. Change-Id: I47bfd4fb800390505bdeb0f1d0bd1306fb888a59
2018-06-15bsc-nat: show running-config now prints bsc nodesPau Espin Pedrol1-39/+41
Fixes: OS#3335 Change-Id: I847e84d5cc50619059cbae7a2c6471c60609aec6
2018-04-16nat: Add jitter buffer on the uplink receiverPau Espin Pedrol1-0/+76
Default usage values are defined in mgcp node, and can be per-BSC overriden on each bsc node. Change-Id: Ibf3932adc07442fb5e9c7a06404853f9d0a20959
2017-11-01vty: skip installing cmds now always installed by defaultNeels Hofmeyr1-3/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: I4951982fc78ae167d8e16a672d7af44d703721a9
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte1-14/+14
osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602
2017-02-08vty: remove ignored logging parametersMax1-2/+2
Since ce9fec3e896571835ac5bfd2980d6836f2b29f0d libosmocore ignores parameters to log_vty_command_* functions. Hence parameter of logging_vty_add_cmds() is ignored too. As we depend on much later libosmocore version anyway, we can simplify code somewhat by removing parameters which will be ignored anyway. Change-Id: I62f752fd88f1d8fefa563648f9864c7c31f87991
2016-09-26mscsplit: bsc_vty_init(): decouple from global bsc_gsmnetNeels Hofmeyr1-1/+1
Add an explicit gsm_network pointer instead of using the bsc_gsmnet global. This allows passing a gsm_network struct from the main() scope, which helps to decouple libmsc from libbsc. Change-Id: I9e2c0d9c18d4cebb5efb71565ad84df2bc2e0251
2016-04-16nat/vty: Do not print token update statementHolger Hans Peter Freyther1-4/+1
On start this would print one line per BSC and this doesn't add a lot of value. Let's just remove this logging message.
2016-04-14NAT: reload BSCs config dynamicallyMax1-0/+29
Add vty tests for BSC configuration reloading. Load BSCs configuration on bscs-config-file command: * remove all runtime configured BSC not in the config file * close connections to all BSC with updated token value Fixes: OS#1670 Sponsored-by: On-Waves ehf
2016-04-14NAT: move BSC config into separate fileMax1-3/+46
Introduce new configuration option bscs-config-file which includes BSC configuration from the given file. Both absolute and relative (to the main config file) paths are supported. Add 'show bscs-config' command to display current BSC configuration. Note: it is still possible to have BSC configuration in the main file (provided proper index number is used) and in runtime but BSC configuration is no longer saved automatically. The management of included configuration file is left to external tools. Update configuration examples. Fixes: OS#1669 Sponsored-by: On-Waves ehf
2016-04-12NAT: allow allocating BSC in arbitrary orderMax1-10/+4
Check for existing BSC before allocating new one. Track number of remaining BSCs on deallocation. Explicitly use BSC number in allocation function.
2016-04-12NAT: vty command to display number of BSCsMax1-0/+9
Add command 'show nat num-bscs-configured' to display number of configured BSCs. Sponsored-by: On-Waves ehf
2015-10-12osmux: Enforce Osmux only global and per BSC configurationHolger Hans Peter Freyther1-7/+15
Extend the osmux only setting from the MGCP MGW to the NAT. This is applied when an endpoint is allocated and/or when the allocation is confirmed by the remote system. Not tested. The impact should only be when the new option is being used. Fixes: OW#1492
2015-07-01nat: After we identified the bsc check the keyHolger Hans Peter Freyther1-2/+30
We are using the token to find the right bsc_config and then we can use the last_rand of the bsc_connection to calculate the expected result and try to compare it with a time constant(???) memcmp.
2015-05-03filter: Move the con_type into the filter_stateHolger Hans Peter Freyther1-1/+1
2015-05-03filter: More renaming and remove of "NAT" from itHolger Hans Peter Freyther1-5/+5
2015-05-03filter: Remove nat from bsc_nat_acc_lst and replace with msgHolger Hans Peter Freyther1-3/+3
2015-05-03filter: Cease out "struct bsc_nat" from the APIHolger Hans Peter Freyther1-1/+1
This means we need to require a talloc context and simply operate on the list. I had considered creating a structure to hold the list head but I didn't find any other members so omitted it for now.
2015-05-03filter: Move VTY code into the filter moduleHolger Hans Peter Freyther1-110/+2
2015-05-03filter: Move the method definition to the filter moduleHolger Hans Peter Freyther1-0/+1
Move the filter methods to the filter module. This is still only usable for the NAT and the _dt/_cr filter routines need to move back to the bsc_nat in the long run.
2015-04-23nat: Make mode-set patching optionalHolger Hans Peter Freyther1-0/+23
2015-04-07nat: Fix timeslot range in 'show bsc mgcp' VTY commandJacob Erlbeck1-1/+1
Currently the inner loop in show_bsc_mgcp iterates of the timeslot interval [0, 31]. Timeslot 0 is not valid, which causes mgcp_timeslot_to_endpoint to generate a corresponding warning and to return an invalid endp value. That value causes an out-of-bound read access, possibly hitting unallocated memory. This patch fixes the loop range by starting with timeslot 1. Note that this does not prevent mgcp_timeslot_to_endpoint from returning an invalid endpoint index when called with arguments not within its domain. Addresses: <000b> ../../include/openbsc/mgcp.h:250 Timeslot should not be 0 [...] vty=0xb4203db0, argc=1, argv=0xbfffebb0) at bsc_nat_vty.c:256 max = 1 con = 0xb4a004f0 i = 0 j = 0 [...] ==15700== ERROR: AddressSanitizer: heap-use-after-free on address 0xb520be4f at pc 0x8062a42 bp 0xbfffeb18 sp 0xbfffeb0c Sponsored-by: On-Waves ehf
2015-01-21osmux: Initialize the socket only onceHolger Hans Peter Freyther1-3/+5
The per BSC code didn't guard against the init already having been executed. This lead to: Adding a osmo_fd that is already in the list. <000b> bsc_nat_vty.c:1200 Setting up OSMUX socket So a new socket got created and the old one leaked. Luckily Linux appears to allow to bind multiple times so we were able to just read from the new one. Use the same guard that is used on the MGCP MGW. Re-order the log message to say "Setting up" before we actually do that. I manually verified that osmux_init is called at most once. The log message was spotted by Roch
2014-08-27osmux: move osmux socket initialization out of osmux_enable_endpoint()Pablo Neira Ayuso1-0/+16
In the bsc-nat side, the osmux socket initialization can be done from the vty. This ensure that the osmux socket is available by the time the bsc-nt receives the dummy load that confirms that the osmux flow has been set up. This change is required by the follow up patch. This change ensures that the Osmux socket in the bsc-nat is already in place by the time this receives the dummy load.
2014-07-07nat: Fix the documentation issue with the osmux commandHolger Hans Peter Freyther1-1/+1
Documentation error (missing docs): <command id='osmux (on|off)'> <param name='off' doc='(null)' />
2014-05-22mgcp: add voice muxer supportPablo Neira Ayuso1-0/+19
This patch adds the voice muxer. You can use this to batch RTP traffic to reduce bandwidth comsuption. Basically, osmux transforms RTP flows to a compact batch format, that is later on decompacted to its original form. Port UDP/1984 is used for the muxer traffic between osmo-bsc_nat and osmo-bsc_mgcp (in the BSC side). This feature depends on libosmo-netif, which contains the osmux core support. Osmux is requested on-demand via the MGCP CRCX/MDCX messages (using the vendor-specific extension X-Osmux: on) coming from the BSC-NAT, so you can selectively enable osmux per BSC from one the bsc-nat.cfg file, so we have a centralized point to enable/disable osmux. First thing you need to do is to accept requests to use Osmux, this can be done from VTY interface of osmo-bsc_nat and osmo-bsc_mgcp by adding the following line: mgcp ... osmux on osmux batch-factor 4 This just initializes the osmux engine. You still have to specify what BSC uses osmux from osmo-bsc_nat configuration file: ... bsc 1 osmux on bsc 2 ... bsc 3 osmux on In this case, bsc 1 and 3 should use osmux if possible, bsc 2 does not have osmux enabled. Thus, you can selectively enable osmux depending on the BSC, and we have a centralized point for configuration from the bsc-nat to enable osmux on demand, as suggested by Holger. At this moment, this patch contains heavy debug logging for each RTP packet that can be removed later to save cycles. The RTP ssrc/seqnum/timestamp is randomly allocated for each MDCX that is received to configure an endpoint.
2014-01-20nat: Make the access-list deny cause configurableHolger Hans Peter Freyther1-4/+12
Add two optional arguments to the imsi-deny rule for the reject cause and verify that it is saved out.
2013-10-30vty: Use vty_install_default() instead of bsc_install_default()Jacob Erlbeck1-3/+3
Remove ournode_exit_cmd, ournode_end_cmd, and bsc_install_default() since this functionality is provided by the current libosmocore. Replace calls to bsc_install_default() by call to vty_install_default() with the following semantic patch: @rule1@ expression N; @@ - bsc_install_default(N); + vty_install_default(N); Ticket: OW#952 Sponsored-by: On-Waves ehf
2013-09-02vty: Rename 'mgcp-through-msc-ipa' command to 'use-msc-ipa-for-mgcp'Jacob Erlbeck1-5/+5
Currently the 'mgcp' command fails in the 'config-nat' node, because it get confused with 'mgcp-through-msc-ipa' which is executed instead because of the prefix based command selection. Thus the latter command is renamed by this patch to avoid the common prefix. The workaround in the test suite is removed.
2013-09-02vty: Use generic 'end' and 'exit' commandsJacob Erlbeck1-9/+3
Add bsc_install_default() and replace all install_default() This patch adds bsc_install_default() which calls install_default() and add 'exit' and 'end'. All other calls to install_default() are replaced by calls to bsc_install_default(). Since 'exit' and 'end' are now added automatically to each node, the explicit registrations of these commands are removed by this patch, too. The related tests succeed now without work-arounds (except for the 'config' node itself which is part of libosmocore).
2013-09-02nat: Use bsc_nat_msc_is_connected instead of accessing it directlyHolger Hans Peter Freyther1-2/+2
2013-08-14nat/ussd: Add 'show ussd-connection' vty commandJacob Erlbeck1-0/+13
This command returns the current state of the connection to the USSD side channel provider. It shows whether a provider has been connected and authorized or not. Fixes: OW#953
2013-08-13nat: Misc changes spotted while going through the file with JacobHolger Hans Peter Freyther1-3/+3
* Spell Configure correctly * Use %s and VTY_NEWLINE instead of \n
2013-07-31nat: Implement a post-routing for the NAT softwareHolger Hans Peter Freyther1-0/+27
* The post-routing is applied after the first re-writing. To do this the new number is copied back into the called data structure. * Add a testcase that goes from 0172 to 0049 and then back to 0049 using the post rule with a table lookup.
2013-07-31nat: Allow to use the prefix lookup to rewrite numbersHolger Hans Peter Freyther1-0/+60
* Increase the rewritten rule to five digits (this is the easiest for the unit test). This will add another 40kb to the runtime size. * Create a unit test that tests adding and removing the prefix rules. * Use the regexp match to replace from one package
2013-07-31nat: Add a no number-rewrite command and call it through a VTY testHolger Hans Peter Freyther1-2/+15
The test is just testing the invocation but does not verify that the side effect of this call. It is good enought for now.
2013-04-16nat: Rename "struct sccp_connections" to "struct nat_sccp_connection"Holger Hans Peter Freyther1-1/+1
The name sccp_connection is used in the osmo-sccp code, sccp_connections was used in the NAT for tracking a sccp_connection. Rename it so it is obvious that the struct belongs to the nat. The rename was done with sed: $ sed -i s,"struct sccp_connections","struct nat_sccp_connection",g \ include/openbsc/*.h src/osmo-bsc_nat/* tests/*/*
2013-04-16nat: We want the remote to respond to our DLCX requestHolger Hans Peter Freyther1-2/+3
We want to send a TRAP with the MGCP statistics from the NAT and the connected BSC. The BSC endpoint can be either released because of a DLCX from the MGCP CallAgent or the SCCP Connection release on the A-link. This is why we need to queue the statistics when the deleting the endpoint on the BSC. The processing is continued once the response arrives. This code assumes that the response of the DLCX will be sent by the remote side. The current amount of outstanding responses can be seen on the VTY. This assumption is based on the fact that the BSC has already responded to the CRCX and maybe to the MDCX. The MGCP RFC is bended to prefix the transaction identifier with "nat-" to easily detect the response and hand it to the handler. This will then parse the response and generate the TRAP. The current version is v1. We assume that the transaction space is big enough and we will not re-assign the transaction identifier too early.
2013-04-16nat: Make it possible to send MGCP messages through the IPA multiplexHolger Hans Peter Freyther1-0/+17
Instead of handling MGCP through the UDP socket, read and write messages through the ipa connection to the MSC.
2013-01-07nat: Introduce a global IMSI barr list using red-black treesHolger Hans Peter Freyther1-2/+65
2012-08-17VTY: improve VTY prompt and make sure exit/end works everywhereHarald Welte1-3/+5
Some nodes below 'config' didn't have ournode_exit / ournode_end, and thus were not able to properly perform this function. exit should always only go back one level, while end drops us back to ENABLE_NODE. The prompt now represents the nesting level, and there's one consistent space after the final prompt character (typically #).
2012-07-28nat: Document all parameters of the VTY commandsHolger Hans Peter Freyther1-26/+50
2012-01-18nat: Add VTY command for the TP-DA rewriting.Holger Hans Peter Freyther1-0/+27
2012-01-18nat: Fix the no sms-clear-tp-srr commandHolger Hans Peter Freyther1-1/+1
2012-01-10nat: Implement clearing of TP-SRR flags from TPDUsHolger Hans Peter Freyther1-0/+28
Match IMSI and destination address against a set of entries, if it is matching the header will be modified and no sender report will be requested. Change the test case to request the sender report and then verify that this bit is reset to 0.