Commit Graph

4064 Commits

Author SHA1 Message Date
Katerina Barone-Adesi e0aee7aaa9 Introduced support for external python tests
The test scripts warn about missing documentation, untested configs,
check common errors, and stub out testing individual VTY commands.
The scripts have been moved to the another osmocom repository,
python/osmo-python-tests

The features were requested by zecke.
2013-06-24 13:22:34 +02:00
Harald Welte cc6b2d2fa3 ctrlif: Flush/Clear write_queue when closing the control socket 2013-06-24 10:59:40 +02:00
Harald Welte 1304b35a64 bsc_vty: Print human-readable string version of NM ADM STATE 2013-06-24 10:59:33 +02:00
Harald Welte abadd54346 GPRS LLC: Add non-standard method of sequence number recovery
In some situations (like MS reboot without prior DETACH or SGSN reboot
without prior MS detach), the LLC sequence numbers for UI mode could
be different on both sides.

The LLC spec unfortunately doesn't permit us to send something like a
FRMR in this case, but instructs us to silently discard the frame.  At
that time the remote LLC entity will re-transmit the frame with the same
seqeunce number over and over again, which we will drop again and again.

The mthod used now will keep track of the last received UI sequence
number.  If that number is retransmitted for three times in a row, then
we accept this sequence number and recover from that point on.
2013-06-21 14:06:18 +02:00
Harald Welte 22ce59826a osmo-bsc VTY: fix saving of codec-list
the codec-list parser expects only spaces between the elements of the
list, while the 'save' code is putting ", " between the elements
2013-06-19 15:42:44 +02:00
Holger Hans Peter Freyther b0bf1da4c8 smpp: Only write the systemd-id if it is not empty
system_id is a char array, which makes the NULL check a tautology,
so we should check with strlen if the string is empty or not.

This is fixing the "write" command of VTY that would otherwise
create a config file that can not be parsed.
2013-06-12 09:35:43 +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 846d8dca9f vty: Print the state of all GPRS OML objects in show bts
For debugging GB-proxy/IPA issues it is nice to see the state of
the OML objects.
2013-05-29 16:37:27 +02:00
Harald Welte c75ed6d593 SMPP: Add new 'dcs_transparent' ESME setting
If an ESME has the dcs_transparent config flag, then the TP-DCS
of MO-SMS is transparently passed to SMPP and not converted to SMPP
specific data_coding values.

This is needed in cases where ESMEs actually care about the exact
TP-DCS, as the conversion from TP-DCS to SMPP data_coding is not
bijective.
2013-05-28 20:59:25 +02:00
Harald Welte 27d5e65640 SMPP: Pass on 0xFx style DCS from SMPP to GSM
There are multiple ways how the TS 03.38 TP-DCS can indicate 8bit or
7bit messages.  SMPP has it's own data coding specification, which is
different from TS 03.38.

However, some SMPP ESMEs want to be able to have fine-grained control
over the TP-DCS indicated in the TPDU header.  If such values like 0xF6
are used in SMPP, we now transparently pass them on to the GSM side.
2013-05-28 20:37:07 +02:00
Harald Welte 61e1935a5f SMPP: Respond with BIND_TRX_RESP to BIND_TRX, not BIND_TX_RESP 2013-05-26 14:40:14 +02:00
Holger Hans Peter Freyther 9f3835b988 mgcp: Initialize the tone to CHAR_MAX as this might not be a request
The RQNT message might not contain a 'S:' line with the actual tone
to play. Instead of calling the callback with the 0 as tone just leave
early.

Example:
X: 6B9519B88F0
R: D/[0-9#*](N), G/ft, fxr/t38
2013-05-21 17:04:35 +02:00
Pablo Neira Ayuso 0a244b40c9 nat: fix use after free in forward_sccp_to_bts
valgrind detected an use after free in the path of forward_sccp_to_bts.
The 'parsed' object is referenced from update_con_authorize.
2013-05-13 01:13:27 +02:00
Holger Hans Peter Freyther 2177624ca9 channels: Mark channels as broken that time out on activation/release
A channel that fails to send an ACK/NACK/REL within the four second
timeout is now marked as broken. In case the release comes in late
it will be ignored. The lchan should already been freed and for now
we don't want to trust the channel.

In the future we might want to send a "release" for a channel that
got activated ack late and just set the state to none on a channel
that is released acked late.

The late ACK and REL has been tested with two manual tests using the
fakebts. The channels remained blocked even after having received
the ACK message here. The NACK case has not been manually tested.
2013-05-02 19:36:29 +02:00
Holger Hans Peter Freyther e152a46f6e Merge branch 'zecke/features/sysmobts'
* This branch make the type sysmobts work.
* Asssume a bsc_gsmnet variable to be defined.
* This allows to use channel configurations not supported by the
  nanoBTS.
* Manually tested with the FakeBTS and tested by users.
2013-04-29 20:47:52 +02:00
Holger Hans Peter Freyther e48c1871af ipaccess: Remove the ipaccess_gsmnet and assume there is a bsc_gsmnet
Assume that there is a bsc_gsmnet and modify the ipaccess-config to
provide this symbol. If a bsc_gsmmnet is not available when linked
the linker will complain and fail.

E.g. give an error like this:
../../src/libbsc/libbsc.a(bts_ipaccess_nanobts.o): In function `ipaccess_sign_link_up':
src/libbsc/bts_ipaccess_nanobts.c:550: undefined reference to `bsc_gsmnet'
2013-04-29 20:44:42 +02:00
Holger Hans Peter Freyther 4b0e36ae7f sysmobts: Make the nanoBTS NM code work for the sysmobts
Use the is_ipaccess_bts method to check if this is either is
nanoBTS or sysmoBTS. The sysmobts type can now be used to bootstrap
a bts.
2013-04-29 20:44:42 +02:00
Holger Hans Peter Freyther 84b033f8c7 sysmobts: Initialize the NM signal handler only once in a mixed network
Make sure that the bts_ipa_nm_sig_cb is only installed once. In
a nanoBTS + sysmoBTS network the _start method will be called
for each mode leading to the handler being registered twice.

Make sure that there is only one handler registered by unregistering
a previously installed handler. The osmo_signal_unregister_handler
will remove 0 or 1 handlers per invocation and we only add one
handler in this file so it is always balanced.
2013-04-29 20:44:42 +02:00
Holger Hans Peter Freyther e84dd98d26 sysmobts: Avoid a crash when trying to look-up a BTS
The nanoBTS code is trying to find a struct gsm_bts based on
the ipaccess_gsmnet and the ipaccess_unit data. The pointer is
not initialized in the case of a sysmoBTS leading to a classic
NULL pointer dereference.

Move the feature init into the _init method. This way we can
re-use the start code of the nanoBTS. This ensures that the
ipaccess_gsmnet pointer is properly initialized and that the
signal handlers are installed.
2013-04-29 20:44:42 +02:00
Holger Hans Peter Freyther 7a0010bdd4 nat: Include LAC/CI as TV values at the end of the 'status' message
Extend the status message and send LAC/CI as part of the status
message. It is using TV to allow sending more fields in the feature.
We only need to encode the data and this is why there is no tlv
description yet.
2013-04-29 20:40:44 +02:00
Holger Hans Peter Freyther d7b22c624b smpp: Attempt to fix a memory leak of the msgb
The smpp_pdu_rx method does not free the msgb. Introduce an
annotation (currently defined to nothing) to indicate what
will happen to a msgb.
2013-04-29 14:00:59 +02:00
Holger Hans Peter Freyther 2bc90c274d nat: Use memcmp for the token on the USSD interface as well
This is similar to the token on the A-interface. There are no more
token based authentication in the NAT.
2013-04-22 10:54:32 +02:00
Holger Hans Peter Freyther ab22335378 nat: Move the callstats to a new header file due sccp usage
The bsc_nat.h is included by common_vty.c so we may not used
sccp_types.h in the bsc_nat.h header file. Move the callstats
to a new file and include it where it is needed.
2013-04-22 09:07:39 +02:00
Holger Hans Peter Freyther 7e9b039a94 nat: Add an example for a black list 2013-04-18 15:11:49 +02:00
Holger Hans Peter Freyther 70c58ef03b ctrl: Provide a reply in case the range check failed 2013-04-17 14:34:36 +02:00
Holger Hans Peter Freyther d38cf50d0a ctrl: Make the commands static to not pollute the namespace
We do not need to access these commands from another compilation
unit and can just make it static.
2013-04-17 14:34:26 +02:00
Holger Hans Peter Freyther b2b291d3ef nat: Extract the LAC/CI from the Complete Layer3 Information
Find the Cell Identifier from the Complete Layer3 Information and
store it for future reference. We could begin to verify that the
LAC/CI used really belongs to the BSC.
2013-04-16 14:14:17 +02:00
Holger Hans Peter Freyther c279e39c12 nat: Rename "struct sccp_connections" to "struct nat_sccp_connection"
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-16 09:53:13 +02:00
Holger Hans Peter Freyther 0e5f5aeaad debian: Begin the 0.13.0 series with a new changelog entry 2013-04-16 09:23:33 +02:00
Holger Hans Peter Freyther dbd9449a16 nat: Allow to re-write international numbers in the CC Setup messages
Prepend the international number with a '+' and then do the normal
re-writing on it. There are a couple of ways to handle this:

	\+([0-9]), \+[0-9][0-9]([0-9]), \+49([0-9])

Add a test case for the international re-write based on an already
internationalized number.
2013-04-16 09:20:06 +02:00
Holger Hans Peter Freyther 27b6184225 nat: Allow to daemonize the NAT process
Add handling for the 'D' option
2013-04-16 09:20:00 +02:00
Holger Hans Peter Freyther dc3a78f0c4 Merge commit 'zecke/mgcp-statistics' 2013-04-16 09:18:29 +02:00
Holger Hans Peter Freyther ac04d8d55e nat: Name the variable more properly and begin with net.1.bsc.%d
We can identify the NAT and BSC given the types of the variable,
no need to put them into the value itself.
2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 7d7054eafa nat: Include the sccp_src_ref and sccp_dst_ref for this call
This can help with some post analysis for failed calls and helps
finding the connection in the pcap trace.
2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 7c831ecd19 nat: Do not allow the amount of pending responses to grow infinitely
Limit the amount of pending DLCX responses to three times the amount
of available endpoints. Currently all MGCP messages are sent and handled
in sequence.
2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 931ad6ac33 nat: Reword the log messages as this is normal operation
The bsc_mgcp_dlcx method is called from the mgcp policy callback
but also from inside the nat core when the SCCP connection is going
away.
2013-04-16 09:17:21 +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 c327187259 nat: Make it possible to send MGCP messages through the IPA multiplex
Instead of handling MGCP through the UDP socket, read and write messages
through the ipa connection to the MSC.
2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 77956aa034 nat: Move all methods sending a response to the callagent to a single place
For testing it can be nice to handle MGCP messages through the IPA
protocol. Prepare the code to send the messages through other means.
2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 6de9d0ba35 nat: Address the FIXME and send the MDCX down to the BSC 2013-04-16 09:17:21 +02:00
Holger Hans Peter Freyther 1c0c317094 debian: Fix the installation of the sgsn example data
Creating the sgsn package failed because the debian directory has
been moved and the .examples file was not updated. This was reported
by plotr.
2013-04-05 18:43:25 +02:00
Holger Hans Peter Freyther 30156e1eea sysmobts: Add the necessary data structure and init for the SAPI queue
The sysmobts is now having a SAPI queue with all pending SAPI operations
on the BTS. Add the llist_head to the lchan and make sure it is initialized
by the shared code.
2013-04-05 18:41:45 +02:00
Holger Hans Peter Freyther d34adb2f9f nat: Fix authentication by-pass using shorter tokens
The token was compared with the configured one but only up to a
user supplied length. Compare the token sizes and then use memcmp
for the actual comparison to make sure to compare the right ammount
of characters.

There is no unit-test but there should be one.
2013-04-02 10:10:21 +02:00
Holger Hans Peter Freyther 8ae35c1606 bsc-ctrl: Fix a potential memory leak on failed verification
It was possible that the tmp was strduped but not freed, e.g. when
the number of commas was not right. It would evenutally be freed at
the time the cmd is freed thanks to the talloc hierachy.
2013-03-28 17:13:01 +01:00
Holger Hans Peter Freyther 0c908b6e72 db: Link to the VTY library for the vty_config_unlock symbol
Linking started to fail for me due the symbol coming from the
vty library and the db code not linking to it.
2013-03-21 11:12:56 +01:00
Andreas Eversberg 0c8f9ca30b Add VTY option to set GPRS network-control-order to enable MS measurements
In order to enable GPRS downlink measurements at mobile, the
network-control-order must be set to nc1.
2013-03-17 14:37:16 +01:00
Harald Welte 7159e8bea3 Fix osmo-nitb build without libsmpp 2013-03-13 15:40:14 +01:00
Harald Welte 3f78600346 SMPP: Implement SMPP Osmocom Estensions on MO-SMS
An ESME can now be configured in the VTY to enable osmocom-extensions,
which will add vendor-specific SMPP TLVs for RxLev/RxQual/ARFCN/IMEI and
transmit power to the SMPP DELIVER-SM message type.
2013-03-13 15:30:48 +01:00
Harald Welte 76afa16d04 SMPP: Fix crash on delivery of incoming SUBMIT-SM
As bsc_gsmnet is NULL at the time we call smpp_openbsc_init(),
we later run into segfaults with subscribers that don't have a
subscr->net set.

However, we cannot delay smpp_openbsc_init() until after
bsc_bootstrap_network(), as we then fail to parse the SMPP specific
VTY/config file options...
2013-03-13 15:30:48 +01:00
Harald Welte 8b29180cad IPA: Allow RSL connection to different IP address as OML
This patch adds a new VTY command "ip.access rsl-ip A.B.C.D" at the
BTS level.  If you set this IP address, the BTS will be instructed to
establish the RSL link to the indiciated IP address, rather than using
the same as for the OML link (default).

Use "ip.access rsl-ip 0" to disable the feature.
2013-03-12 13:58:30 +01:00