Commit Graph

190 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 59f787a4c1 auth: Release the security operation after we sent out a message
The release might release the lchan we want to send the response
on. Reorder the code to first send the message and then give up
the security operation which might release the lchan.
2010-12-27 10:58:55 +01:00
Holger Hans Peter Freyther d3baf415b1 paging: Introduce a GSM_PAGING_BUSY event for a special timeout
Start counting the attempts of each paging request and call
the callback with the PAGING_BUSY type when the paging request
timed out but the subscriber was not paged at all. This can
only happen with a huge paging backlog.
In case the system has so many pending paging
2010-12-25 21:39:04 +01:00
Harald Welte a29e43a26f BSC Call Control: Actually implement call statistics
The existing call realated statistics counters apparently were
never used.  This introduces a new set of counters, two for the
MO and MT case.
2010-12-24 16:07:40 +01:00
Harald Welte 86dda08762 Authentication: use ENUM instead of magic numbers
This improves readability of the code...
2010-12-23 18:09:51 +01:00
Holger Hans Peter Freyther d4e6872d6c gsm48: Release the LU procedure only after the TMSI REALL_COMPL
We send a LU Accept with the TMSI as the MI. According to the
spec the phone should store this new TMSI and send a TMSI
REALLOCATION COMPLETE to us. We will release the LU then and this
should trigger the release procedure.
2010-12-22 20:25:38 +01:00
Harald Welte 434bb3f39f MNCC: introduce mncc_upq_enqueue() wrapper around msgb_enqueue()
This wrapper will allow us to add queue related code at one single
location in the code as opposed to three locations.
2010-12-22 19:03:40 +01:00
Holger Hans Peter Freyther f93e8fabd8 gsm48: Use NULL instead of 0 for pointers in C. 2010-12-22 18:26:36 +01:00
Harald Welte c7782dec4a gsm48_tx_release_compl(): Don't use transaction after trans_free()
In commit 39e2eadc99 a bug was introduced
that used the 'trans' after trans_free() had already been called.

This became visible now when the openbsc+lcr combination was calling
an unknown/invalid telephone number in a MO call, resulting in
a segfault.
2010-12-21 19:33:19 +01:00
Sylvain Munaut 0fbfd1bb52 gsm_04_08: Make gsm48_secure_channel available globally
Can't declare it in gsm_04_08.h tough ... gsm_cbfn is defined in
gsm_data.h and trying to include that in gsm_04_08 just creates a
huge mess.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 567c8dc7c9 gsm_04_08: Use subscr_get_channel instead of directly paging_request
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 22:39:40 +01:00
Sylvain Munaut 67706df7c2 gsm_04_08: Don't set ciphering manually but call gsm0808_cipher_mode
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-12-01 20:36:34 +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 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 12eb9b7bd9 gsm_04_80: Require libosmocore for creating USSD messages
Use the libosmocore to create USSD messages, increase the
minimum version of libosmocore, add header files, remove
the code.
2010-09-30 18:56:07 +08:00
Holger Hans Peter Freyther 841c2000d3 gsm0408: Reorder the includes, openbsc first, osmocore second 2010-09-30 18:56:06 +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 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 e0009f10ca gsm48: Add method to send a separate facility message...
Send a facility messages with notifySS/CNAP as payload
to the phone... the function is not called from anywhere
in the tree yet but I use it locally.
2010-08-12 01:44:57 +08:00
Holger Hans Peter Freyther 02d39b2c4d msc: Create a dummy operation to keep the channel open for five seconds
* We should create the transaction for SMS, CC on the CM Service Request
  but for now we will use a band aid and create a dummy operarion to wait
  five seconds for the transaction to be opened.
2010-07-05 15:36:08 +08:00
Holger Hans Peter Freyther 88519eaaef msc: Add includes to silence a compiler warning. 2010-06-30 12:59:20 +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 db4ef0d369 bsc_api: Remove the lchan usage from the Paging Response handling. 2010-06-21 16:40:09 +08:00
Holger Hans Peter Freyther 758f4dfa17 silent_call: Use the gsm_subscriber_connection instead of lchan->conn 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 d42c3f25a6 bsc_api: Remove the lchan from the USSD code... 2010-06-17 17:35:57 +08:00
Holger Hans Peter Freyther 3f122bed1e bsc_api: Kill &lchan->conn usage, stop msg->lchan too.. 2010-06-17 17:14:35 +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 86481c29d4 bsc_api: Make paging/silent call work with the subscriber_connection
Do not use the lchan for the paging but operate on the
subscriber_connection, change the signals too to not carry
the lchan but the subscriber connection... the silent call
and vty code still assume there is a lchan inside the
subscriber connection.
2010-06-17 15:05:57 +08:00
Holger Hans Peter Freyther 57c4decd1d bsc_api: Pass the subscriber connection to the SMS... 2010-06-16 15:43:01 +08:00
Holger Hans Peter Freyther 9ce1b27fbf bsc_api: Use gsm_subscriber_connection in rrlp.c 2010-06-16 15:42:40 +08:00
Holger Hans Peter Freyther b2be195b50 bsc_api: Rename lchan_for_subscr to connection_for_subscr and update code
With handover and late/early assignment there might be two channels
for one subscriber and only the BSC knows which one to use, so use
the gsm_subscriber_connection everywhere...
2010-06-16 15:42:38 +08:00
Holger Hans Peter Freyther 0128843591 gsm48: Release the "operation" after sending out data...
* With an immediate release we would release the lchan
  before sending the data... change it.
2010-06-16 15:42:21 +08:00
Holger Hans Peter Freyther 228c1059fd bsc_api: Remove the lchan from the secure channel code...
The code still needs to stop touching the lchan directly
and put stuff into it.
2010-06-16 15:42:21 +08:00
Holger Hans Peter Freyther e9ed340425 bsc_api: Cut back on direct lchan usage. 2010-06-16 15:42:21 +08:00
Holger Hans Peter Freyther 230a4d886d gsm48: Split LU Reject sending and generation into two. 2010-06-15 19:40:05 +08:00
Holger Hans Peter Freyther 2c0f16699e gsm48: Separate CM Service Reject sending and creation.
Split out the msg generation from the sending, this will
be used by the nat to send a refusal message.
2010-06-15 19:39:27 +08:00
Holger Hans Peter Freyther 9140174faa bsc_api: Remove the lchan argument from gsm48_tx_mm_info. 2010-06-15 14:16:02 +08:00
Holger Hans Peter Freyther d521d97976 bsc_api: Remove the lchan argument from the mm_tx_identity_req method. 2010-06-15 14:11:01 +08:00
Holger Hans Peter Freyther 7bc5ba3674 bsc_api: Remove lchan from LU Reject...
Remove the lchan from the signature, the removal of the
msg->lchan will follow as a next step.
2010-06-15 14:09:34 +08:00
Holger Hans Peter Freyther dc5db2424d bsc_api: Kill the lchan argument from the LU Accept Method. 2010-06-15 14:07:27 +08:00
Holger Hans Peter Freyther 9c137a7819 bsc_api: Move most of GSM0408 to the DTAP API...
* gsm_04_08_utils.c will directly send the message...
* gsm_04_08.c will use the DTAP API, add a new method to pull
  in the data from the transaction...
2010-06-15 13:57:40 +08:00
Holger Hans Peter Freyther f6fb3efcba bsc_api: Switch gsm_04_08.c to use the clear request of the API. 2010-06-15 13:16:52 +08:00
Sylvain Munaut c593cf100a gsm_04_08: Improve gsm48_rx_mm_auth_resp debug in failure case
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:52 +02:00
Sylvain Munaut ba87f458ec gsm_04_08: Establish secure channel on CM SERVICE REQUEST
Note that establishing a secure channel is considered to
be an implicit CM SERVICE ACK.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:52 +02:00
Sylvain Munaut 267fba0a2b gsm_04_08: Establish secure channel on LOCATION UPDATE
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:51 +02:00
Sylvain Munaut 2030a2a228 gsm_04_08: Store the key_seq given in LOC UPD REQUEST in state
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:51 +02:00
Sylvain Munaut 30a15384f4 gsm_04_08: Add a operation to enable ciphering on a lchan
This will take care of the auth/check/enable cipher sequence
and call a callback function when done.

Currently the negotiated Kc is saved but not re-used, so
there is an authentication each time ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:51 +02:00