aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
AgeCommit message (Collapse)AuthorFilesLines
2018-07-12nat: ctrl: Avoid sending back received ERROR msgsPau Espin Pedrol1-7/+11
We only send back if we had an error parsing the message locally. If we receive an ERROR message from a bsc, we try to forward it if the ID is valid, otherwise only log the received error description locally. Related: OS#3394 Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d
2018-07-12nat: ctrl: use strtol instead of atoi as it has explicit error documentationPau Espin Pedrol1-2/+13
In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994
2018-07-12nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed errorPau Espin Pedrol1-11/+2
Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae
2018-04-11bsc_nat: ctrl: Fix crash on receveing bsc replyPau Espin Pedrol1-2/+8
Since libosmocore 7c0031fc8063771e604976233fb7b46d2b85c077, the cmd param passed to handlers in ctrl_handle_msg is always freed afterwards, thus it is owned by the same function. Avoid keeping it alive and accessing it later when it has already been freed. Related: OS#3157 Change-Id: Ib1e1fb79746d4a4f3e30254fdb7a7e851c2cd0e4
2018-04-11bsc_nat: Drop redundant ccon ptr in bsc_cmd_listPau Espin Pedrol1-5/+4
Change-Id: Ic2e4ca7d8eb4e8f71dc773b3f2c0f09709d90a94
2018-04-11bsc_nat: forward_to_bsc: Fix memleak on send failurePau Espin Pedrol1-1/+2
Change-Id: If0dfae40f03db297eeb4e296daf5fe78ba53a11b
2018-04-11bsc_nat: forward_to_bsc: remove one level of indentationPau Espin Pedrol1-45/+46
Change-Id: I105be500399259a97ef711f17b4a51e72dc8cc53
2018-04-11bsc_nat: ctrl: fix memleak on reply receivalPau Espin Pedrol1-4/+3
Change-Id: I146c4a561b0cd62779d60da3b55b96e24438bd89
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte1-1/+1
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-05-10src: use osmo_timer_setup()Pablo Neira Ayuso1-2/+2
Use new function available in libosmocore to set up timers. Compile tested only. Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
2017-01-25CTRL: remove boilerplateMax1-11/+1
Use CTRL_CMD_DEFINE_RO(), CTRL_CMD_DEFINE_WO() and CTRL_CMD_DEFINE_WO_NOVRF() where appropriate to get rid of boilerplate code. Change-Id: I5bcea0b4f4b8f535bef2b423f2013b8b4a218b5b
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr1-2/+3
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.
2015-05-03filter: Remove nat from bsc_nat_acc_lst and replace with msgHolger Hans Peter Freyther1-5/+5
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-07nat: Check for the access list in set command as wellHolger Hans Peter Freyther1-1/+8
I omitted the check as this was already done by the verify function for this command. Please Coverity and do the check again even if it is not necessary. I begin to doubt the usage of a "dedicated" verify method as well. Silences: Coverity CID 1293150
2015-04-05nat: Add ctrl command to save the configurationHolger Hans Peter Freyther1-0/+31
$ bsc_control.py -d localhost -p 4250 -s net.0.save-configuration 0
2015-04-05nat: Add a ctrl command to add to an existing ACC listHolger Hans Peter Freyther1-0/+62
We want to have a program add entries to the allow list this can be done using: $ bsc_control.py -d localhost -p 4250 -s net.0.add.allow.access-list.NAME "^IMSI$"
2015-04-05nat: Inform others if an IMSI is rejectedHolger Hans Peter Freyther1-0/+18
In case one wants to monitor the access lists one there is now a trap for the IMSI.
2014-08-29nat: Fix compiler warning about unknown prototypeHolger Hans Peter Freyther1-0/+1
bsc_nat_ctrl.c: In function ‘set_net_cfg_cmd’: bsc_nat_ctrl.c:360:3: warning: implicit declaration of function ‘bsc_replace_string’ [-Wimplicit-function-declaration] bsc_replace_string(bsc_cfg, &bsc_cfg->acc_lst_name, cmd->value); ^
2014-08-24Use port number #defines for VTY and CTRL portsHarald Welte1-1/+2
.. as defined in libosmocore
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte1-2/+5
2014-03-23ctrl: Move the lookup into a separate file in preparation for GPRSHolger Hans Peter Freyther1-1/+1
For GPRS the look-up via bts/trx does not make any sense and would introduce bad depdencies for the SGSN. Move the look-up code to a new file and introduce new setup methods.
2014-03-04nat: Introduce command to remove an access-list-nameHolger Hans Peter Freyther1-0/+5
2014-03-04nat: Implement setting the access-control-name through CTRL interfaceHolger Hans Peter Freyther1-19/+99
For operation we want to switch the access-list of a BSC at runtime in a programatic way. Sponsored-by: On-Waves ehf
2013-07-05nat: Please coverity and initialize the saveptr to NULLHolger Hans Peter Freyther1-1/+1
Coverity complains about the saveptr used in the strtok_r. This is not a bug because we pass a string as part of the first call to strtok_r but it is easier to just initialize it. Addresses: Coverity CID 1042323
2012-11-12nat: Move the ctrl handling code into a separate fileHolger Hans Peter Freyther1-0/+324
Move to the control command handling out of the main file into a dedicated module. There are still some calls embedded into the main code but it will be moved soon.