Commit Graph

1319 Commits

Author SHA1 Message Date
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 580cb83ae3 Merge branch 'on-waves/sccp' 2010-06-15 17:06:45 +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
Holger Hans Peter Freyther ecd9933826 gsm_04_11: Place subscr_put_channel whenever being done with SMS. 2010-06-15 12:53:08 +08:00
Holger Hans Peter Freyther cea722bc51 gsm_04_11: Speculative leak fix for the SMS... 2010-06-15 12:29:37 +08:00
Holger Hans Peter Freyther 6a3d765bf9 bsc_api: Do not use RLL inside the SMS code, handle SAPI n REJECT
Directly send a SMS using the send method, in case of an error
we will need to find the transaction and free the SMS and the
transaction.
2010-06-15 12:04:34 +08:00
Holger Hans Peter Freyther 43b0909394 bsc_api: Create osmo_msc, and initialize the MSC API in the bsc_init. 2010-06-15 12:04:34 +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
Sylvain Munaut e824d9c2a1 auth: Add support for XOR test A3A8 algo (and vty commands)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:53 +02: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 0c873a06b6 vty/auth: Make sure we clear the last tuple when changing auth params
If the Ki or auth algo changes, chances are that the last tuple cannot
be used anymore, so clear it.

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
Sylvain Munaut 31ac307130 db: Fix typo in sync_lastauthtuples SQL UPDATE stmt
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:51 +02:00
Sylvain Munaut 92b2ff5081 db: Change naming convention for auth info functions
- exported function have a 'db_' prefix
 - use 'sync' vs 'set'
 - use 'for' vs 'by'

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:50 +02:00
Sylvain Munaut 10bf812a6a db: Use subscriber_id as primary key for AuthKeys/AuthLastTuples
It's unique and not null and we never use 'id' anyway.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:50 +02:00
Sylvain Munaut c614a6a199 db: Rename AuthTuples to AuthLastTuples
Ultimately, we'll need to store both the last used tuple by a
subscriber and a list of known tuples (for unknown Ki). What's
currently implemented for AuthTuples is the former behavior, so
reflect that.

The second use case will be added as a separate table with separate
accessors later on.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:50 +02:00
Harald Welte 993d06065a [GPRS] Add comment on GTP being defined in 29.060 / 09.060 2010-06-14 17:00:51 +02: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 8e78fa7862 gsm_04_11: Attempt to fix some possible memory leaks in the SMS code
Sometimes we need to free the SMS, sometimes also the transaction.
2010-06-14 16:13:16 +08:00
Holger Hans Peter Freyther 4cd5158874 gsm_04_11: Remove some old code. 2010-06-14 16:06:39 +08:00
Sylvain Munaut 644a0cac0c [gprs] bssgp: Fix LLC PDU length encoding in BSSGP.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 15:15:42 +02:00
Sylvain Munaut eda125ca51 [gprs] sndcp: Fix call to msgb_alloc_headroom to have both head&tail room
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 15:15:42 +02:00
Sylvain Munaut 5914bad40b [grps] Fix GTP data_ind call back message creation
We'll need to push data both before and after, so make sure there
is both headroom & tailroom

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 15:15:42 +02:00
Harald Welte efbdee9a5c [GPSR] SGSN: Keep traffic counters for each PDP context 2010-06-10 15:12:38 +02:00
Harald Welte bb35c45a02 [GPRS] BSSGP/SGSN: Implement Gb-Interface Paging
We now have a function that generates BSSGP PS and CS paging request.

It is called from the libgtp code when we receive a GTP packet from
the GGSN for a MM context that is in SUSPEND state.  We then issue
a PS paging request to the Cell with the BVCI where the last RA update
was being performed.

TODO: We still don't enqueue the GTP packet (and transmit it on paging
complete), and we don't rate-limit the paging requests, i.e. every GTP packet
will trigger another paging request.

We probably also need some kind of logic that marks the phone as UNREGISTERED
if it doesn't respond to paging requests for some time.
2010-06-10 15:12:38 +02:00
Harald Welte bffeff8089 [GPRS] SGSN: fix typo 2010-06-10 15:12:38 +02:00
Holger Hans Peter Freyther c2e88baa5e ipa-proxy: Remove printf debugging. 2010-06-10 18:27:20 +08:00
Holger Hans Peter Freyther 7afac583cd gsm_04_11: Start using the GSM Subscriber class to ask for a channel
The paging message should not be called directly and the GSM Subscriber
can handle multiple requests at the same time... Now a subscr_put_channel
should be called after the message sending. But it is not very clear when
this can be called. The current code works by luck that the SAPI=0 will
be released...
The MT-SMS was tested via the VTY interface and a N900.
2010-06-10 18:23:28 +08:00
Holger Hans Peter Freyther ca5702a5c6 gsm_04_11: Handle OOM same as expired and clean the message. 2010-06-10 18:20:54 +08:00
Holger Hans Peter Freyther 0afa044c09 gsm_04_11: Fix a typo.. 2010-06-10 18:08:12 +08:00
Holger Hans Peter Freyther 2e234f524c bsc_rll: Stop using lchan refcounts, use the lchan signal to stop the timer
Stop using the lchan refcounts and start handling the lchan
release to stop timers and free the RLL resources for the
channel.
2010-06-10 17:59:31 +08:00
Holger Hans Peter Freyther 4fe22cc56d ipa-proxy: Patch the IPA Set Attribute messages for NSVCI
We will tell the BTS where we are listening, but the ACK
will return the original settings... this should make it
possible to intercept the GPRS stream..
2010-06-10 15:59:45 +08:00
Holger Hans Peter Freyther 21e1c0d01c ipa-proxy: Fix the send routine.. convert port to network order 2010-06-10 15:59:45 +08:00
Harald Welte e98c635391 [SMS] Properly reject processing of compressed SMS
As we don't support compressed SMS, we have to properly reject it.

In the existing code, we segfaulted at some later point since the error
handling was incomplete.

This was triggered by some obscure STK SIM card that insisted on sending a
compressed SMS after registering to the OpenBSC network.
2010-06-09 21:40:45 +08:00
Harald Welte 5bfe499366 [GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX state 2010-06-09 21:40:45 +08:00
Harald Welte f54e7e2102 [GPRS] GMM/SM: Improve error handling by sending STATUS messages 2010-06-09 21:40:45 +08:00
Harald Welte 588d44ee65 [GPRS] Drop all PDP contexts not present in PDP CTX STATUS IE at RA UPD 2010-06-09 21:40:45 +08:00
Harald Welte 60ebc02ba8 [GPRS] SM: Acknowledge PDP CTX DEACT for non-existing PDP CTX
Some phones (notably a Ericsson Mobile Platform based E-TEN M800)
insist on sending PDP CTX DEACT messages for contexts that have already
been deactivated.  The spec doesn't really say what we should do in
this case. But since there is no "reject", we simply acknowledge it.
2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 0897dad300 ipa-proxy: Only handle some stuff of the CCM locally...
This is a good interim solution for messages not handled by us,
right now this would include the NVRAM attributes that I do not
feel like caching right now.
2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 952aba7406 ipa-proxy: Move UDP socket code to the BTS and forward messages...
Forward messages from BTS to Network, Network to BTS... now
we only need to fix the Set GPRS attributes on the fly...
2010-06-09 21:40:45 +08:00