Commit Graph

18 Commits

Author SHA1 Message Date
Harald Welte 4a824ca8fc don't re-implement osmo_talloc_replace_string()
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-06-09 08:49:36 +00:00
Pablo Neira Ayuso 5121576b0c src: use osmo_timer_setup()
Use new function available in libosmocore to set up timers. Compile
tested only.

Change-Id: Ibcfd915688e97d370a888888a83a7c95cbe16819
2017-05-10 11:21:24 +02:00
Max f6e51709fc CTRL: remove boilerplate
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
2017-01-25 11:52:45 +00:00
Neels Hofmeyr 73828152d9 enable ctrl bind config for various programs
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-25 12:18:04 +01:00
Holger Hans Peter Freyther a1e6bd6768 filter: Remove nat from bsc_nat_acc_lst and replace with msg 2015-05-03 21:42:28 +02:00
Holger Hans Peter Freyther 973dbaeebd filter: Move the method definition to the filter module
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-05-03 21:42:27 +02:00
Holger Hans Peter Freyther 08ea4d87f6 nat: Check for the access list in set command as well
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-07 09:10:05 +02:00
Holger Hans Peter Freyther 8ccf06c58b nat: Add ctrl command to save the configuration
$ bsc_control.py -d localhost -p 4250 -s net.0.save-configuration 0
2015-04-05 15:42:32 +02:00
Holger Hans Peter Freyther ab94ca18f2 nat: Add a ctrl command to add to an existing ACC list
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-05 15:42:25 +02:00
Holger Hans Peter Freyther 7c00983275 nat: Inform others if an IMSI is rejected
In case one wants to monitor the access lists one
there is now a trap for the IMSI.
2015-04-05 14:06:16 +02:00
Holger Hans Peter Freyther cd48525ecb nat: Fix compiler warning about unknown prototype
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-29 11:42:26 +02:00
Harald Welte 55dc31e781 Use port number #defines for VTY and CTRL ports
.. as defined in libosmocore
2014-08-24 17:54:49 +02:00
Harald Welte ba874b82be move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
Holger Hans Peter Freyther 49f9e5b6b4 ctrl: Move the lookup into a separate file in preparation for GPRS
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-23 16:25:16 +01:00
Holger Hans Peter Freyther 472f3bd198 nat: Introduce command to remove an access-list-name 2014-03-04 20:39:38 +01:00
Holger Hans Peter Freyther bc3780a73f nat: Implement setting the access-control-name through CTRL interface
For operation we want to switch the access-list of a BSC at runtime
in a programatic way.

Sponsored-by: On-Waves ehf
2014-03-04 20:39:27 +01:00
Holger Hans Peter Freyther b0b8a34dd5 nat: Please coverity and initialize the saveptr to NULL
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
2013-07-05 07:45:08 +02:00
Holger Hans Peter Freyther 98da544992 nat: Move the ctrl handling code into a separate file
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.
2012-11-12 10:49:10 +01:00