Commit Graph

2656 Commits

Author SHA1 Message Date
Sylvain Munaut adea4f1bf8 db: Use proper %llu for subscriber ID in format string.
This was causing weird crashes when running in 32 bit linux.

Thanks to horiz0n for taking the time to debug this with me on IRC.

Written-by: horiz0n <cscan@gmx.net>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-03 22:24:13 +02:00
Harald Welte c48ac4750d [SGSN] Some IEs in ATTACH REQUEST can be longer in 24.008
The original length checks were based on 04.08, but 24.008 allows
longer IEs.
2010-07-03 21:20:06 +02:00
Harald Welte 4b6ac1edb9 [SGSN] Initial work on GMM authentication and ciphering 2010-07-03 11:09:06 +02:00
Harald Welte 3e2e159707 [SGSN] LLC: only copy Kc if algorithm != GPRS_ALGO_GEA0
The caller currently has set the Kc pointer to NULL, this fix avoids
crashing at the callee.
2010-07-02 22:56:55 +02:00
Harald Welte d6f582b352 [SGSN] use GPRS_ALGO_GEA0 instead of '0' 2010-07-02 22:56:55 +02:00
Harald Welte 1b8827ae5b [SGSN] LLC: Make sure we calculate FCS after decryption 2010-07-02 22:55:39 +02:00
Harald Welte d07b4f99ce [SGSN] Use libosmocore GPRS encryption plugins from LLC layer
This adds the bits that call into libosmocore (and its plugins)
to implement GPRS (LLC) encryption.
2010-07-02 22:55:39 +02:00
Harald Welte 496aee463f [SGSN] Call libosmocore helper to load cipher plugins 2010-07-02 22:54:55 +02:00
Harald Welte 6ed4950d5b [SGSN] remove bogus debug statement 2010-07-02 22:52:33 +02:00
Harald Welte 23c13760ca [SGSN] SM: Properly parse APN and PCO Optional IE in PDP CTX ACT REQ 2010-07-02 22:52:04 +02:00
Harald Welte c5d4a0ced1 [SGSN] Print AP name and PDP address of each PDP context 2010-07-02 22:51:16 +02:00
Harald Welte 6add7c2009 [SGSN] Correctly pass IMSI of MM ctx to GTP/GGSN 2010-07-02 22:47:39 +02:00
Harald Welte 3d6815abd1 [SGSN] SNDCP: Subtract SNDCP header from fragment length
We don't want to store too many bytes as we would otherwise create
too large re-assembled packets..
2010-07-02 17:16:07 +02:00
Harald Welte 36f1217f32 [SGSN] SNDCP: SN-PDUs need a 16bit length field
The BSSGP LLC-PDU IE can have up ot 16bit length, so subtracting
the LLC header the SN-PDU can still have almost a length field
close to 0xffff
2010-07-02 16:44:24 +02:00
Harald Welte 8b705f2533 [SGSN] SNDCP: re-set total number of fragment length 2010-07-02 16:18:59 +02:00
Harald Welte 18d1452a92 [SGSN] Send poper SM and GMM STATUS in case we have no MM CTX 2010-07-02 16:18:18 +02:00
Harald Welte ab4094ca6b [SNDCP] some more defragmentation debug statements 2010-07-02 16:01:47 +02:00
Harald Welte 60da7d4f88 [SGSN] SNDCP defrag: use correct length, don't include LLC FCS
The LLC layer tells us the PDU length, and we have to use it
in SNDCP rather than to re-calculate it if we want to avoid copying
the CRC24 into the defrag elements.
2010-07-02 15:45:12 +02:00
Harald Welte 8f0c0a3a3c [SGSN] SNDCP: Actually copy the payload data in the defrag queue entry
Prior to this patch our defragmented messages always consisted of 00-bytes
2010-07-02 10:29:06 +02:00
Harald Welte 11ff3e8ec2 [SGSN] Remove old dead code 2010-07-02 10:17:24 +02:00
Harald Welte 19f9e30eb9 [SGSN] Only increment PDP CTX ACT count after check for retransmission 2010-07-02 10:15:49 +02:00
Harald Welte b37515e86b [SGSN] Account for re-transmitted PDP CTX ACT REQ
In case our PDP CTX ACT ACK gets lost on the Gb or Um link,
the MS re-transmits the PDP CTX ACT REQ.  We have to ACK it
again instead of REJecting it..
2010-07-02 10:12:58 +02:00
Harald Welte 993697c8d2 [SGSN] SNDCP: Fix off-by-one error missing last segment in defrag
When we defragment the segments from the defrage queue, we have
to iterate all the way up to (and including) the last segment number
that we have received.
2010-07-02 10:11:42 +02:00
Harald Welte b87bc86006 [SGSN] SNDCP: more verbose defragmentation debugging 2010-07-01 20:29:20 +02:00
Harald Welte 8911cef81d [SGSN] Fix segfault when passing re-assembled SN-PDU to GMM
sgsn_rx_sndcp_ud_ind() can no longer make the assumption that msgb_bcid() is
valid, as this is only true for an un-fragmented SN-PDU.  So instead,
we now store the RAID in the SNDCP Entity and pass it as an explicit
argument to sgsn_rx_sndcp_ud_ind().
2010-07-01 19:56:19 +02:00
Harald Welte 951a12cf4e [SGSN] SNDCP: fix off-by-one error during defragmentation 2010-07-01 15:09:45 +02:00
Harald Welte 362aea0f4d [SGSN] SNDCP: Initialize defrag list header 2010-07-01 12:31:10 +02:00
Harald Welte fd29a1f6cc [SGSN] GMM: Complete value_string for GMM cause values 2010-07-01 12:26:59 +02:00
Harald Welte 65d96783df [SGSN] SNDCP: use llist_for_each_entry_safe() when cleaning frag queue 2010-07-01 12:19:02 +02:00
Harald Welte 875840c603 [SGSN] Fix TLLI (re)assignments
Once The TLLI (or P-TMSI of which it is derived) change has been
confirmed by the MS, we need to unassign the old TLLI but keep
the new TLLI  _without_ re-setting the LLC entity structure such
as VUsend /VUrecv counters.
2010-07-01 11:54:31 +02:00
Harald Welte 937a9ecfcd [SGSN] Fix segfault when doing PS PAGING
The 'bssgp_paging_info' contains a pointer to the P-TMSI, and not
the P-TMSI itself.  The reason is that it is an optional BSSGP IE.
2010-07-01 11:53:25 +02:00
Harald Welte f78a3b2a22 [SGSN] Add VTY interface for SNDCP 2010-07-01 10:57:44 +02:00
Holger Hans Peter Freyther cacbc73d5e osmo_bsc: Add option parsing, vty dummy
Add dummy files and option parsing for the Osmo BSC code.
2010-06-30 15:11:30 +08:00
Holger Hans Peter Freyther ab5135e36a bsc: Move meas_rep.c into the libbsc.c as it is used from bsc_vty.c 2010-06-30 15:11:30 +08:00
Holger Hans Peter Freyther 5ccab1020c osmo_bsc: Add empty osmo_bsc_main.c and hook it into the build 2010-06-30 15:11:29 +08:00
Holger Hans Peter Freyther ec4bfdc435 bsc_api: Move the API init into the main function.
The BSC API will not be used until the first iteration through
the event loop so it is safe to call it after the bootstrap.
2010-06-30 15:11:29 +08:00
Holger Hans Peter Freyther 2f4dbebb20 osmo-bsc: Start adding code for the osmo_bsc..
This adds the unix domain socket rf control protocol into
the new subdirectory.
2010-06-30 15:11:29 +08:00
Nico Golde 5950236b5e * Fix null ptr dereference and sms memleak in case the recipient of an sms sent via vty is not attached. Store the sms in the database in this case for later delivery.
The problem is that sms_from_text returns NULL in case the
subscriber is not attached which a) leaks memory of the
previously allocated sms and b) runs into a null ptr
dereference in _send_sms_str().

There may be a better solution than this but this is the
easiest way of noticing and taking action I could find
without changing return values of sms_from_text.
2010-06-30 09:10:04 +02:00
Harald Welte bd17b39fd2 [BSC] VTY: Fix parsing of uppercase hex digits 2010-06-30 09:01:35 +02:00
Harald Welte 43ef6483db [SGSN] BSSGP: Print TLLI as hex value like everwhere else 2010-06-30 09:01:35 +02:00
Holger Hans Peter Freyther d9c9f07c2c handover: lchan_free will only free the local resources.
lchan_free only free's the local resource of the BSC but
does not release the channel at the BTS. Use lchan_release
to properly release the channel. This code assumes that the
timeout happens after a CHAN ACT ACK/NACK otherwise we have
some problems. The comment indicates that this is the case.
2010-06-30 13:04:13 +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 0610947f4c misc: Move handover_logic.c into the libbsc.a
We are implementing the intra BSC handover so we should have the
code in the BSC as well.
2010-06-30 12:59:20 +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 e071ab70e9 handover: Attempt to use the same gsm_subscriber_conn for new/old channel
The transaction should not know on which lchan we are operating
as this can change due handover. Add untested code to share the
subscriber connection of the new and old lchan and move the pointer
in case of success/failure. Also on a clear command we will free
any resources allocated...

This code is not tested and needs to be debugged, but it should
have the right structure. I am going to fix a potential memleak
in the next commit.
2010-06-30 12:59:20 +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 2486663844 ussd: Release the MSC connection as fast as possible.. 2010-06-30 12:15:19 +08:00
Holger Hans Peter Freyther 0379c6d386 abis_rsl: Add full MA again until we are confident to remove it
The spec seems to say we do not need to include the full MA,
even for Phase1 phones but that is not so clear...
2010-06-30 12:06:20 +08:00
Holger Hans Peter Freyther e38bd6caa3 abis_rsl: Change code to generate Channel Identification
1.) memset the gsm48_chan_desc to avoid sending dummy data
2.) According to the GSM08.58 9.3.5 the Mobile Allocation
    shall be included but the empty (by setting the length
    to zero).
3.) use msgb_tlv_put and calculate the length via the l3h
    msgb_l3len and assign it.
2010-06-30 12:01:22 +08:00
Holger Hans Peter Freyther 06abe9f383 ussd.c: Make sure text is memset to zero..
Make the strstr fail fast, make sure the text is null terminated...
2010-06-30 11:59:30 +08:00