Commit Graph

1252 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther bddfab1f97 gsm_04_11: Remove direct RSL calls from the SMS code...
Do not use RSL to release the SAPI/Channel from within the code,
the normal channel release procedure will take care of releasing
the SAPIs and there should be no issue in keeping the SAPI=3
established until the end of the session.
2010-06-08 12:16:17 +08:00
Harald Welte f5f512cc59 GSM 04.08: Improve IMEI recording in hlr.sqlite3 for rejected subscribers
If we send the IDENTITY REQUEST for IMEI before sending the IDENTITY
REQUEST for IMSI, the probability is higher that we receive the IMEI
response and associate it with the respective subscriber.
2010-06-07 17:56:32 +02:00
Harald Welte 3a7074615f [GPRS] BSSGP: Fix formatting of BSSGP TX STATUS 2010-06-03 21:30:57 +02:00
Harald Welte ce22f92b6c [GPRS] SNDCP: Implement fragmentation of N-PDUs to SN-PDUs in downlink
Using the code of this commit, it was possible to provision GPRS
services and access a website from a G1 phone (Qualcomm MSM7k baseband chipset)
using a nanoBTS, Osmo-SGSN and OpenGGSN.

There is still no fragment re-assembly in the uplink path yet,
despite the (untested) code present in the gprs_sndcp.c file
2010-06-03 21:21:21 +02:00
Harald Welte db2c39f888 [GPRS] SNDCP: Check if SN-PDU is too large and reject it
... since we don't do fragmentation yet
2010-06-03 07:16:04 +02:00
Harald Welte 1d9d944310 [GPRS] LLC: Implement per-SAPI default values for LLC parameters 2010-06-03 07:11:04 +02:00
Harald Welte bb1c805718 [GPRS] implement GTP->SNDCP->LLC downlink user-data path
This only works for packets that are small enough to not need
fragmentation at the SNDCP layer (dns queries, ntp and the like).

It requires libgtp built from OpenGGSN dc3744fda045f9fca83de6881176987335a309a8
or later.  Plain 0.90 will NOT work.

Using this version, I could see bi-directional traffic from various
phones going all the way through BTS, OsmoSGSN, OpenGGSN and being routed
to and from the real internet.  Time to celebrate...
2010-06-03 06:38:38 +02:00
Harald Welte 96df60637a [GPRS] add comments to SGSN header file 2010-06-03 06:38:09 +02:00
Harald Welte 52421a0551 [GPRS] SGSN: specify the local bind address in the config file 2010-06-02 23:18:40 +02:00
Harald Welte 61ca7ce006 [GPRS] SGSN: use correct length+data for GSN_ADDRESS
We have to copy the sin_addr.s_addr, rather than the entire sin_addr.  The
latter results in the destination interpreting it as an IPv6 address, as
the only differentiator between IPv4 and IPv6 is the size of the payload
of this IE.
2010-06-02 23:17:33 +02:00
Harald Welte 5cc2bc37a7 [GPRS] SNDCP: Fix PCOMP and DCOMP header field length
They're both just one 4bit nibble, not 1 byte each.
2010-06-02 23:17:05 +02:00
Harald Welte e300d0021c [GPRS] SGSN: Allow vty-based configuration of local listen/bind IP for GTP 2010-06-02 12:41:34 +02:00
Harald Welte 6144452068 [GPRS] SNDCP: Add new SNDCP Entity to global list of entities
Also, don't reject SN-PDUs with positive packet length.
2010-06-02 12:40:48 +02:00
Harald Welte 858491821f [GPRS] Change SI13 to NMO_II, as some phones (like G1) dislike NMO_III
I still believe NMO_III is what we want, but as indiciated some phones
absolutely refuse to even connect to the GPRS network in this mode :(
2010-06-02 12:19:21 +02:00
Harald Welte 69996cb534 [GPRS] SNDCP use DSNDCP instead of DGPRS 2010-06-02 10:26:19 +02:00
Harald Welte 16836a37aa [GPRS] SNDCP: Fix header length (pcomp is part of common_hdr)
Also add some more debug statements
2010-06-02 10:25:40 +02:00
Harald Welte f11b6d2f30 [GPRS] SGSN: fix another segfault (and use-after-free) when GGSN is dead 2010-06-02 10:09:50 +02:00
Harald Welte ebabdea0a6 [GPRS] hand SNDCP N-PDUs to the GTP to the GGSN
This so far only works for UNIT-DATA and only if the N-PDU is not fragmented at
the SNDCP layer.
2010-06-01 18:28:10 +02:00
Harald Welte 807a5d8264 [GPRS] Major LLC / TLLI handling fixes
* separate the LLME and LLE state in the LLC layer
* introduce gprs_llgmm_assign() function for LLGMM-ASSIGN.req primitive
* change QoS profile to match 'real' SGSN
* Update the new TLLI when assigning a P-TMSI

The result now is that the LLC layer is notified of TLLI changes, which in turn
means it doesn't allocate a new LLE structure every TLLI change, which again
in turn means that the UI frame sequence number does not reset to zero.

As a result, MS should no longer ignore frames based on wrong UI sequence number.
2010-06-01 11:57:13 +02:00
Harald Welte 1371f7dd2f [GPRS] SGSN GTP: Fix segfault in case GGSN is down 2010-06-01 11:52:41 +02:00
Harald Welte f7b3a219f6 [GPRS] update SGSN config file example 2010-06-01 11:52:21 +02:00
Harald Welte dce1255d8f [GPRS] GMM: Set LLC 'C/R' bit when sending IDENTITY REQUEST
Commands initiatied by the SGSN have to set C/R = 1
2010-05-31 22:31:04 +02:00
Harald Welte 56a0145dd8 [GPRS] Include IMSI and DRX params in BSSGP DL-UD
When we send a downlink unit-data request via BSSGP, there is a lot
of information that needs to be copied from the mm context, such as
the IMSI, DRX parametes, MS radio access parameters, ...

This is a quite strange layering violation, since we now need to pass
a pointer to the MM ctx from GMM through LLC into BSSGP :(
2010-05-31 22:12:30 +02:00
Harald Welte c2e8cc4a10 [GPRS] Implement TMSI reallocation and timers 3350 + 3370
Our state transitions and timers now reflect 04.08 for GMM much
better than before.  Also, we allocate a new P-TMSI on every ATTACH
and RA UPDATE, as some phones seem to get confused if they don't
get a P-TMSI.
2010-05-31 20:23:38 +02:00
Harald Welte 3d379ba589 [GPRS] BSSGP: Fix way too long TLLI debug line 2010-05-31 20:18:35 +02:00
Harald Welte c91ce1a9d3 [GPRS] BSSGP: More verbose debug log / error reporting 2010-05-31 18:07:17 +02:00
Harald Welte 6463232b09 VTY: properly exit from OML_NODE 2010-05-31 17:17:29 +02:00
Harald Welte 72b4b20a2a [GPRS] BSSGP: When we receive a BLOCK, we should not respond with UNBLOCK-ACK 2010-05-31 17:16:36 +02:00
Harald Welte 81c9b9ca3e OML: Introduce minimal VTY command set to interact with OML managed objects 2010-05-31 16:40:40 +02:00
Harald Welte f5b4ba367c ipaccess-config: More verbose help message 2010-05-31 15:57:29 +02:00
Holger Hans Peter Freyther 0c8aa73db7 [bsc_hack] Call handle_options before bootstrapping the network
Otherwise we can not specify which config file to use and -h will
not work when there is no openbsc.cfg in the cwd.
2010-05-31 21:42:53 +08:00
Holger Hans Peter Freyther 4b4dd100f8 [rsl] Introduce an error state for the lchan and set it on release
When we issue a RF Channel Release in case of a failure we receive
RLL release indications after the channel was tearn down and we
issue another RF Channel Release as a result. The channel allocator
might have already allocated this channel and we release the channel
again with another MS on it.

Make rsl_rf_chan_release take an error argument and make it set
a new state in case of an error and change the RF Channel Release
ack to not set the state back to none in case of an error but wait
for a timeout that is a bit higher than T3111.

I tested this with removing the battery during a phonecall and
waiting for the channel failure. With this test we only send the
release once.
2010-05-31 21:39:23 +08:00
Holger Hans Peter Freyther f30c0dca0d [rsl] Implement the T3111 timer to delay the RF Channel release 2010-05-31 21:33:15 +08:00
Holger Hans Peter Freyther d7fd30617f [rsl] Check the assumption that RF Channel Release is sent during release
We assume that the lchan_free will initiate the release and
that when we handle the RLL release indication or the release
request as part of the shutdown sequence.
2010-05-31 21:30:37 +08:00
Holger Hans Peter Freyther dbc5fae576 [rsl] Move rf channel release scheduling to a new method
The current channel release has a couple of issues we will
need to fix in a set of upcoming commits.

The issues include:
    1.) sending release twice
    2.) reassigning the channel inbetween the relase..
2010-05-31 21:30:16 +08:00
Harald Welte a4b16658d5 [GPRS] Make sure SI13 rest octets look like those of the ip.access BSC 2010-05-31 12:55:11 +02:00
Harald Welte a6932d2eae [GPRS] NS: Fix GRE keepalive response in FR-GRE encapsulation 2010-05-31 11:02:57 +02:00
Harald Welte 02ea86fa71 [GPRS] BSSGP: Acknowledge all SUSPEND and RESUME requests
This is of course not the correct way of dealing with it, but for
now it should make the Ericsson Mobile Plafrom based phones happy
(they insist to do a suspend/resume cycle before pdp ctx act)
2010-05-30 22:00:53 +02:00
Harald Welte 6bdee6ada3 [GPRS] LLC: Increment V(U) and N(U) 2010-05-30 22:00:42 +02:00
Harald Welte b12aa4b1ee [GPRS] GMM: Add some FIXME's to the code 2010-05-30 20:28:22 +02:00
Harald Welte d75d71e95c [GPRS] NS: correctly pass the NS payload length to the TLV parser 2010-05-30 17:19:38 +02:00
Harald Welte 0ede21f547 [GPRS] NS: Don't hand Frame Relay LMI packets into the NS code 2010-05-28 16:12:57 +02:00
Harald Welte cc540c4a0c [GPRS] NS: Respond to GRE keepalive messages
GRE has the strange notion of keepalive messages being encapsulated IPv4
packets adressed back to the sender.  Since we actually really only care
about frame relay, this is a bit strange.  However, we'll do some sanity
checks and send it back through our GRE socket...
2010-05-28 16:06:53 +02:00
Harald Welte edcc3b8945 [GPRS] NS: Frame Relay DLCI for PVC from 16-1007
0 		Reserved for ANSI Annex D and CCITT Annex A link management
1 - 15 		Reserved
16 - 1007 	Any PVC
1008 - 1018 	Reserved
1019 - 1022 	Reserved for LMI multicast
1023 		Reserved for LMI link management
2010-05-28 14:11:49 +02:00
Harald Welte ea985a4357 [GPRS] NS: Print error message if TLV parser fails for some reason 2010-05-28 10:08:14 +02:00
Harald Welte dccf55535a [GPRS] NS: Start TEST procedure, not ALIVE procedure, on RESET/RESET_ACK
According to the spec, after an incoming RESET or RESET_ACK, we shall start the
TEST procedure, not the ALIVE procedure.

Also, when we start the TEST procedure, we have to always send a NS_ALIVE
packet at the same time (we didn't in the case of incoming RESET).

Furthermore, we now only start TIMER_TNS_ALIVE from within the
TIMER_TNS_RESET callback code, where we also make sure that the
alive_retries counter is reset to zero.
2010-05-28 10:03:14 +02:00
Holger Hans Peter Freyther 900aeaf415 gprs: Subtract the headroom for what we can receive
The buffer got allocated with headroom and we need to
subtract that from the size of the buffer.
2010-05-28 03:25:36 +08:00
Harald Welte bb9a9bf05f VTY: Remove some more SUBSCR_NODE related code
SUBSCR_NODE has been eliminated recently, so this is dead code.
2010-05-27 13:40:10 +02:00
Harald Welte 39231150ad VTY: Fix segfault during 'write file' from vty
This bug had been introduced by the recent switch to libosmovty
2010-05-27 13:39:40 +02:00
Harald Welte d3cf85d57c VTY: Fix help for 'subscriber .... a3a8' command 2010-05-27 10:48:11 +02:00