Commit Graph

28 Commits

Author SHA1 Message Date
Neels Hofmeyr e78ae21ff4 move to libcommon-cs: net init 3: actual move
Reincarnate gsm_network_init() as the parts not specific to libbsc.
Move from bsc_network_init() those bits that are not BSC specific (and useful
for upcoming osmo-cscn).

Add libcommon-cs to all linkages that use gsm_network_init().

Note: the only requirement to allow linking gsm_network_init() without libbsc
is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items
are kept out of libcommon-cs because it makes sense semantically. But the separation
is not strong in that the BSC specific data members are of course still
omnipresent in struct gsm_network. If bsc_network_init() is not called, these
are not initialized properly -- for now no users of uninitialized members
exist.

So this is just a first step towards a sensible split of the BSC and MSC
gsm_network structs. The long term aim should be to have entirely separate
structs with some common general items.

Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-24 16:58:31 +01:00
Alexander Huemer 7b6673fa06 Consistenly format variables in */Makefile.am files
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-09-15 15:55:02 +02:00
Holger Hans Peter Freyther 4ba947bf4b filter: Separate SCCP/BSSAP extraction and gsm48 code
For the BSC we will have the gsm48_hdr and don't need to
find data within SCCP. For legacy reasons we need to
initialize con_type, imsi, reject causes early on and
need to do the same in the filter method.
2015-05-03 21:42:28 +02:00
Holger Hans Peter Freyther 4247cead2b filter: Move the gsm 04.08 filter to a common place
For customer requirements we want to be able to do
filtering on the BSC as well. The same messages need
to be scanned and the same access-lists will be looked
at. In the future we might even split traffic based
on the IMSI. Begin with moving the code to a new top
level directory and then renaming and removing the
nat dependency.
2015-05-03 21:42:27 +02:00
Harald Welte ba874b82be move libctrl from openbsc to libosmoctrl (libosmocore.git) 2014-08-21 15:34:28 +02:00
Pablo Neira Ayuso cab6e7528c mgcp: add voice muxer support
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-05-22 14:39:16 +02:00
Holger Hans Peter Freyther cb78612689 nat: Fix make distcheck for the nat
The jenkins runs make distcheck in the default configuration and
not with the nat enabled.

DISTCHECK_CONFIGURE_FLAGS="--enable-nat" make distcheck
2013-09-19 11:01:14 +02:00
Holger Hans Peter Freyther ddf191eafc nat: Allow to use the prefix lookup to rewrite numbers
* 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-31 16:36:40 +02:00
Alexander Huemer a1c09a401d Makefile.am: Use AM_CPPFLAGS
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-06-12 09:16:27 +02:00
Holger Hans Peter Freyther 462b7d7158 nat: We want the remote to respond to our DLCX request
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-16 09:17:21 +02:00
Holger Hans Peter Freyther 1f8276e588 nat: Introduce a global IMSI barr list using red-black trees 2013-01-07 15:02:34 +01:00
Holger Hans Peter Freyther adc2e87372 nat: Move the IMSI/TMSI filtering to a new and dedicated file
Move all routines related to filtering to a separate file.
2013-01-07 15:02:34 +01:00
Holger Hans Peter Freyther 6ecb3cb599 nat: Extract the message re-writing from the utils to a dedicated file
Move the code around to make it more clear what the routines should do.
2013-01-07 15:02:34 +01:00
Holger Hans Peter Freyther aa433d2d84 nat: Add the bsc_data.c file to the EXTRA_DIST 2012-01-15 17:55:50 +01:00
Holger Hans Peter Freyther 6c88217c19 tests: Introduce running tests with GNU autotest in OpenBSC
The quality of the tests is of different value but it is good to
get started and improve from here.
2012-01-06 18:52:05 +01:00
Pablo Neira Ayuso ed5cacb240 src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.

The main changes are:

- The directory libabis/ has been removed as it now lives in
  libosmo-abis.

- new configuration file format for nanoBTS and HSL femto, we
  need to define the virtual e1_line and attach it to the OML
  link.

- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
  BS11 and rbs2000) now use the new libosmo-abis framework.

- use r232 input driver available in libosmo-abis for bs11_config.

- use ipa_msg_recv instead of old ipaccess_read_msg function.

- delete definition of gsm_e1_subslot and input_signal_data.
  These structures now lives in libosmo-abis.

Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.

This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:

- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node

This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-19 22:38:35 +02:00
Pablo Neira Ayuso 928cb33eb4 tests: fix bsc-nat test
In 136f453dd2, I forgot to update
the new header path in the test/bsc-nat files (this happened to
me because I forgot to configured openBSC without --enable-nat).
2011-03-26 23:57:53 +01:00
Harald Welte c1b2cfafd4 Fix build of bsc-nat test 2011-03-04 13:49:02 +01:00
Holger Hans Peter Freyther ecd94a4b45 misc: Introduce a --enable-coverage mode to build with gprof coverage
This adds a test coverage build. One can use gcov and lcov on the
resulting data afterwards to see which code paths were executed and
which were not.
2010-11-15 20:06:45 +01:00
Holger Hans Peter Freyther 3e9a7f80bd misc: Replace the idiom for replacing a string with a function call
Remove a lot of code in favor of a new function that is freeing
the old string and copying the new one. I should have gotten the
context and the strings right.
2010-10-12 23:31:53 +02:00
Holger Hans Peter Freyther 30e1ae923d sccp: Use the external libosmo-sccp as sccp implementation
Add --enable-nat and --enable-osmo-bsc to build applications
requiring the Osmo SCCP library to be installed. We are not
using autodiscover as this is out of fashion.
2010-07-31 04:09:38 +08:00
Holger Hans Peter Freyther 434a1fd84e nat: Make the test compile, no bssap.c, use log_target 2010-06-15 20:31:43 +08:00
Holger Hans Peter Freyther c14e09bb2d nat: Store the creation time of a sccp connection.
Generate it when creating the connection but also when
reusing an existing connection.
2010-06-15 20:24:18 +08:00
Holger Hans Peter Freyther 241e13005a nat: In the case of losing the MSC, reset all endpoints
When losing the SCCP connection make sure that we free all
endpoints. The disconnection of the BSC should already make
sure they are closed but this makes sure everything is
properly reset.
2010-06-15 20:24:10 +08:00
Holger Hans Peter Freyther 465313e48c nat: Look at the assignment command and remember on which timeslot the data is
This information will be needed when we are trying to forward
MGCP connections to and from the BSC through the IPA protocol.
2010-06-15 20:24:09 +08:00
Holger Hans Peter Freyther bae9da49b9 nat: Move paging by lac handling code into the utils file
Moving it here means we can more easily test this code, there is one
behaviour change with the code that we only support paging messages
with one LAC and will silently ignore the others.
2010-06-15 20:24:09 +08:00
Holger Hans Peter Freyther 38f7c75739 nat: Add a test case for the connection tracking
This test case tests connectiont tracking by sending
a CR, getting a CC, sending a DTAP, receiving a DTAP,
receiving a RLSD, sending a RLC. It verifies that the
messages are properly patched specially the references
at the BSC.
2010-06-15 20:24:09 +08:00
Holger Hans Peter Freyther 6db5ce5318 [nat] Add missing Makefile.am.. 2010-06-15 20:24:06 +08:00