Commit Graph

46 Commits

Author SHA1 Message Date
Harald Welte 9af6ddfcec License change: We are now AGPLv3+ instead of GPLv2+
The reason for this is quite simple: We want to make sure anyone
running a customized version of OpenBSC to operate a network will
have to release all custom modifiations to the source code.
2011-01-01 15:39:34 +01:00
Holger Hans Peter Freyther 08eebd59b7 lchan: Every SS_LCHAN signal now sends a struct lchan_sig_data
The SS_LCHAN signals now always include the lchan_sig_data. For
the measurement report it will optionally include the measurement
report as well. Attempt to update all handlers of this signal as well
2010-12-27 13:32:20 +01:00
Holger Hans Peter Freyther 9ae7b29e3a bsc: Some S_LCHAN signals don't provide an lchan
Check the signal and only continue if it is any of the
signals we want to handle. In the case of measurement
reports we would cast some random code to a lchan.
2010-12-27 12:30:12 +01:00
Holger Hans Peter Freyther 8ce8d3a00d bsc: Avoid crashing when no lchan is present in the subscriber connection
If someone wants to send a message but we have no lchan anymore
we will now complain, delete the message and return.
2010-12-27 10:58:55 +01:00
Harald Welte 2cafc4b309 BSC API: Make 'Got data in non active state' message as LOGL_INFO
LOGL_ERROR will make this message shpw up in everey default log
config.  However, as it seems, this is commonly observed in case
a MS still sends a MS STATUS (in respons to the MM INFO) at the
end of a location area update.

It might be best to actually change the channel release procedure
to make sure we can still pass such 'late' data to the MSC until
the time the Layer2 has been completely released.
2010-12-24 15:42:22 +01:00
Holger Hans Peter Freyther e2fee354cf misc: Include abis_rsl.h to remove some compiler warnings
This was introduced by a recent change to gsm_data.h to include
less header files. We really need to access the RSL information
here so it is fine to include the file.
2010-12-22 18:26:36 +01:00
Holger Hans Peter Freyther 77cd95d5b5 bsc_api: Implement the assignment command for the BSC. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther f05750ca24 bsc_api: Rework the signal handler to be extendable 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther abf962b096 bsc_api: Clear lchan->conn on lchan_release
Set conn to NULL before starting the release procedure, remove
code to check for a lchan->conn as it can not happen. If there
are any memleaks we will notice them.
Detach the lchan->conn from the channel before detaching.
2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 8d216c7756 bsc_api: Clear the conn->lchan before calling subscr_con_free 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther a2e5cb8601 bsc_api: Clear the conn of the failed lchan to avoid a runtime warning 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther a2828fa4bc bsc_api: Set the lchan->conn to NULL in all of the cases 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 088dde8173 bsc_api: Send a channel modify when we already have a TCH. 2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 7e50c8140b bsc_api: Plug a theoretical window for the RLL callbacks
The timedout could come between lchan_release and the
S_CHALLOC_FREED signal. In the future we might want to
use the gsm0808_clear to stop the RLL timeouts and such.
2010-11-15 20:06:47 +01:00
Holger Hans Peter Freyther 8d380dcadd bsc_api: Change submit dtap to allow to automatically use the SACH
For SAPI=3 on a TCH it might be nice to use the SACH to submit
the message. The api allows to automatically use the SACH if
a message like this is submitted.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 2603c1f545 bsc_api: Clarify the parameters of the assignment command 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 4be7d41a50 bsc_api: Implement sending the cipher mode method
This will set the encryption algorithm, key and then
send the RR Cipher Mode message to the MS. The method
is also verifying the input.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 2f169d64dd bsc_api: Make the cipher_mode take the 'include imei sv' argument
The cipher mode command should enable encryption and send the
right RR message to the other side.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 45b575fd94 bsc_api: The rr_cause is optional, pass it as a pointer 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 46caa3048d bsc_api: Provide the link_id in the dtap callback. 2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther b094171c9f bsc_api: Add needed parameters to the assignment complete callback
Provide the chosen channel and more information in the assignment
complete method.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 6c199e7d99 bsc_api: Look into the msg and call the right API functions
For certain messages we will need to call other GSM0808 functions. To
keep the bsc_hack working we will try to send this through the normal
messages first and then fallback to dtap if no handler is registered.

The gsm_04_08.c code is not forced to handle the IPA activation
and channel modify ack anymore. This is done transparently by the
BSC API now.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 05c68841a8 bsc_api: Fix a use after free error in the Clear Request path
The implementation of bsc_hack would call subscr_con_free before
the BSC API has had the chance to call gsm0808_clear to try to
release other channels. Fix that by adding a return value.
2010-11-15 20:06:46 +01:00
Holger Hans Peter Freyther 85531cc60d misc: Once again go from "On Waves" to "On-Waves"..
Try to get the company name of our sponsor right...
2010-10-06 20:38:36 +08:00
Holger Hans Peter Freyther adb6e1cce1 janitor: Move the * to the variable name 2010-09-18 06:44:24 +08:00
Holger Hans Peter Freyther 1f69b4653b bsc: Fix the clear to release resources first, then set to NULL
This is fixing a crash reported by Nico. Somehow I staged an
unfinished version of this code. The crash should be gone.
2010-09-16 22:50:19 +08:00
Holger Hans Peter Freyther aaa40b8688 bsc_api: Do not free the subscriber conn on clear and clear request
Do not free the GSM Subscriber Connection when a channel is failing
or if a clear is requested, instead just give up _all_ the channels,
reset them to NULL and free the remaining channels.
2010-09-16 20:53:04 +08:00
Holger Hans Peter Freyther 79f763fe91 bsc: Keep all active subscriber connections in a list. 2010-09-16 02:16:02 +08:00
Holger Hans Peter Freyther a2aedad005 bsc: Move the subscriber_con code into the bsc_api 2010-09-16 02:16:01 +08:00
Holger Hans Peter Freyther dbc62db8db bsc_api: Add stub for the cipher mode command. 2010-07-23 17:15:15 +08:00
Holger Hans Peter Freyther c354de8f94 bsc_api: Create dummy stub for the assignment command. 2010-07-23 17:15:15 +08:00
Holger Hans Peter Freyther 49ab278b6f bsc_api: Only forward L3 messages when the channel is active
Avoid forwarding messages from a channel that is already being
closed. Harald has forwarded a crash report where this was failing.
2010-07-05 11:38:37 +08:00
Holger Hans Peter Freyther f2553a6c3a handover: Call bsc_handover_clear from gsm0808_clear
The bsc_handover_clear will release an in-progress handover
and free the lchana and the data associated with this handover
2010-06-30 13:02:08 +08:00
Holger Hans Peter Freyther d06516557a bsc_api: Avoid use after free kind of error on the lchan. 2010-06-30 12:17:35 +08:00
Holger Hans Peter Freyther 4049455d74 bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
    * Errors via the clear_request callback...
    * no more transactions and operations are going on.

This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
2010-06-28 18:01:47 +08:00
Holger Hans Peter Freyther 2412a07965 bsc_api: Allocate the subscriber_connection dynamically
This is a big change to the way we use the subscriber
connection. From now on it is is dynamically allocated
and we will slowly move from a 1:1 lchan to conn to
having more than one lchan per connection.

This is the first commit, the subscr_con* methods will
move to gsm_data once the use_count is removed from the
connection, the freeing of the connection will also change.
2010-06-28 16:12:39 +08:00
Holger Hans Peter Freyther 94d625bfa0 Revert "bsc_api: Move debug context for subscriber into the bsc_api.c"
This is breaking the filtering for the Measurement Report case, revert
the patch for now.

This reverts commit 69e8f8285b.
2010-06-28 13:38:19 +08:00
Holger Hans Peter Freyther 69e8f8285b bsc_api: Move debug context for subscriber into the bsc_api.c 2010-06-21 16:40:09 +08:00
Holger Hans Peter Freyther f6d0e06940 bsc_api: Set the l3h header from within the dtap method
This is fixing USSD which broke when the code was
switched to use the BSC API.
2010-06-17 17:48:13 +08:00
Holger Hans Peter Freyther 9764331062 bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.
The next step in the way to the BSC API. We have a clear a
new connection was opened signal now... and the MSC could
use it...
2010-06-17 16:41:25 +08:00
Holger Hans Peter Freyther 77008464be bsc_api: Move BSC API between MSC and RSL code...
The lowlevel BSC paging API is a simple wrapper around
the RSL command. The BTS will automatically repeat these
messages but if we end up with two MSC inputs we will
need to count these messages somewhere...
2010-06-16 15:42:40 +08:00
Holger Hans Peter Freyther 9c595b7474 bsc_api: Implement transparent RLL establishment and SAPI n REJECT
When submitting a DTAP message, the BSC API will attempt to
establish the RLL layer and then send the message or send an
SAPI n REJECT. This will be used by the SMS code.
2010-06-15 12:04:34 +08:00
Holger Hans Peter Freyther 0cfbe26cb9 bsc_api: Add newline to the end of the file. 2010-06-15 12:04:34 +08:00
Holger Hans Peter Freyther abcddf1152 bsc_api: Add init, dispatch the clear request when a channel is going missing 2010-06-14 18:26:09 +08:00
Holger Hans Peter Freyther 2a9285c028 bsc_api: Move some parts over to the BSC API. 2010-06-14 18:26:09 +08:00
Holger Hans Peter Freyther ec32b5860e bsc: Start creating 08.08 like API
The 08.08 API will interface with the internal BSC code and it is
the boundary between MSC and BSC. So nothing that calls the BSC
functionality should know about lchan or such.
2010-03-25 09:07:28 +01:00