Commit Graph

2117 Commits

Author SHA1 Message Date
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
Sylvain Munaut b48216f9d1 auth: Add #define for special value for key_seq
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14 20:43:48 +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 2844144afd GPRS: Increase the NS msg size to 2048
According to the GPRS NS spec the maximum framesize
is 1600 octets for FrameRelay, it can be bigger if
configured to be so. Make it 2048 octets to have some
space available...
2010-06-14 22:11:40 +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 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
Holger Hans Peter Freyther 05a379b857 bsc_api: Add a callback based BSC -> MSC api... 2010-06-14 15:50:35 +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
Holger Hans Peter Freyther 6147c5d7d0 ipa-proxy: Add option to locally listen to GPRS...
This is just the boilerplate code, the rest is not implemted yet.
2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 7670651f49 ipa: Print the IP addr in the listen as well.. 2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 6cb9b230ed ipa: Say which addr could not be connected... 2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 1a0c2b7509 ipaccess-proxy: Add getopt based config options to the proxy...
Make the ip addresses configurable and such.
2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 3dac881271 ipa: Increase msgb size for the IPA msg in the proxy. 2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 62d97986a3 GPRS: Copy the content of the msgb instead of creating one that points to the other
Right now the memcpy with the data will copy data to itself as
the new_msg->data and msg->data are the same due the previous
copying of the header which included copying the list entry..

We allocate a message as big as the current one, then we have to
set all pointers by looking of how far they are away from the
msg->_data and add that to the new pointers.

Also copy the OpenBSC/GPRS specific CB data, also do the same
for calculating the offset to the data... At the end we should
end up with a copy...
2010-06-09 21:40:44 +08:00
Holger Hans Peter Freyther 62eaf54e7a GPRS: Fix crash when the peer can not be found...
Use UINT_MAX (or -1) if the peer can not be found.
2010-06-09 21:40:44 +08:00
Holger Hans Peter Freyther 57da4471d1 misc: Fix the return type of the go back vty function...
Without this we will get warnings about incompatible assignments
2010-06-09 21:40:44 +08:00
Holger Hans Peter Freyther 89476f5c8f GPRS: Fix compiler warning that will also lead to a crash at runtime. 2010-06-09 21:40:36 +08:00
Holger Hans Peter Freyther b9a4fcfdaf GPRS: Have a simple map from BSSGP PDU to the name...
Sadly the FieldInfo does not provide this mapping...
2010-06-08 13:45:10 +08:00
Holger Hans Peter Freyther e11b107f76 GPRS: Add something that should have become a histogram display...
One small problem... there is no way to be called at the end of
reading a pcap file...
2010-06-08 13:18:58 +08:00
Holger Hans Peter Freyther de4b0a207d chan_alloc: Stop the channel timers in the reset 2010-06-08 12:16:17 +08:00
Holger Hans Peter Freyther 4f5848dc91 abis_rsl: Allow to specify the release mode for a given channel.
This can be used by handover, early assignment to indicate the
close of the old channel...
2010-06-08 12:16:17 +08:00
Holger Hans Peter Freyther 44752d9f84 abis_rsl: Fixup direct assignment and go through the method. 2010-06-08 12:16:17 +08:00
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
Holger Hans Peter Freyther 7f573d5668 GPRS: Print the IP address to see the direction... 2010-06-07 21:37:43 +08:00
Holger Hans Peter Freyther bc10593314 GPRS: It is TLLI and not TTLI... 2010-06-07 19:17:30 +08:00
Holger Hans Peter Freyther f488121058 GPRS: Show the TLLI as hex value... 2010-06-07 19:16:31 +08:00
Holger Hans Peter Freyther 7d3b3d0e71 GPRS: Add script to track the N(U) on GPRS LLC messages..
tshark -q -X lua_script:gprs/gprs-verify-nu.lua -r trace.pcap

Output:
JUMP in N(U) on TLLI 3741437425 and SAPI: 9
	 last: 1 now: 3
JUMP in N(U) on TLLI 3741437425 and SAPI: 9
	 last: 10 now: 12
2010-06-07 19:08:57 +08:00
Holger Hans Peter Freyther 8acedec8c9 GPRS: Add wireshark lua script to split a trace by TLLI
This is currently only looking at one TLLI and is splitting
the trace by that TLLI...
2010-06-07 18:09:54 +08:00