Commit Graph

5814 Commits

Author SHA1 Message Date
Philipp Maier 0b11db7e9f V.42bis: add sourcecode from IAXmodem (SPANDSP)
V.42bis is a data compression method found in modems. It has also
been specified for GPRS as data compression algorithm.

The implementation has been taken from IAXmodem:

https://sourceforge.net/p/iaxmodem/code/HEAD/tree/
svn checkout svn://svn.code.sf.net/p/iaxmodem/code/ iaxmodem-code
Revision: r36

Change-Id: Iabedece9f97ca944a1e3f747bb073e532c4e9dca
2016-09-24 03:17:59 +00:00
Philipp Maier f1f34360fb SNDCP: add RFC1144 header compression functionality
- Add module to handle compression entities
- Add module to control header compression
- Introduce VTY commands for heade compression configuration
- Add changes in sndcp and llc to integrate header compression

Change-Id: Ia00260dc09978844c2865957b4d43000b78b5e43
2016-09-24 03:17:58 +00:00
Philipp Maier 2c7f83762a RFC1144: integration and unit-test
The previously pushed slhc implementation has been modified to compile
and function outside of the kernel. Also debug log messages were added
and datatypes ware matched. The implementation is now ready to be used

Change-Id: I7a638e88a43b3eb9d006751a03ef2570e36613f0
2016-09-24 03:17:58 +00:00
Philipp Maier b3e116c74d RFC1144: add slhc code from linux kernel
SLHC is an Implementation of RFC1144 TCP/IP header compression. We will need
RFC1144 compression to compress GPRS TCP/IP traffic. The implementation pushed
with this commit was taken from:

git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
commit 29b4817d4018df78086157ea3a55c1d9424a7cfc

Change-Id: Ied69c143678dc4a64cecc671f5c4dfebe19d8519
2016-09-24 03:17:58 +00:00
Philipp Maier 22611be3d9 SNDCP: add SNDCP-XID encoder/decoder and unit test
The SNDCP-XID (or layer-3 xid) is used to exchange layer-3 parameters
such as compression. The encoder encodes a bytestream that is then
sent as regular XID field from LLC.

We will need the SNDCP-XID to negotiate the parameters for our
upcomming GPRS data and header compression features

Change-Id: If2d63fe2550864cafef3156b1dc0629037c49c1e
2016-09-24 03:17:58 +00:00
Alexander Couzens 308cb0719d bts: extend bts_chan_load to allow counting tch only
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
2016-09-23 02:43:12 +00:00
Neels Hofmeyr 7c359eb4b4 cosmetic fixes in libcommon/talloc_ctx.c
Add copyright notice, remove obsolete include, remove unneeded line break.

Change-Id: I4d06a0323aee5a003b06edd179fc61e1936acae5
2016-09-22 21:11:42 +02:00
Neels Hofmeyr 8ce66fd19e cosmetic: transaction.h: 1 comment typo, 1 whitespace
Change-Id: Ia2629f9d9887b50b25c6996531b7ef518fb33335
2016-09-19 11:51:12 +00:00
Neels Hofmeyr 1e918c3d31 debug log for sms: fix/add
One logged the wrong function name. Add others.

Change-Id: Ied5d8e84d5d192c826bc131be8907eaa55190479
2016-09-18 23:40:06 +02:00
Neels Hofmeyr ffaed9eed2 Sanity fixes for gsm0408_dispatch(): rc, assertions
gsm0408_dispatch() is the main entry point for receiving data from the BSC/RNC
level, so make sure callers pass valid pointers before using them all the way
down the code path (related to CID#93769, a fix before this was refactored).

For unknown/unimplemented packet discriminators, make sure to return error
codes.

Change-Id: Ieec39c74a53ef4dfa971dd935c8c9aa60fef58c1
2016-09-18 23:40:06 +02:00
Neels Hofmeyr 378a492fd9 cosmetic: various comment, whitespace tweaks
Change-Id: I131939cfba4d67d7e2c935341deeb14d09523fee
2016-09-18 23:40:06 +02:00
Neels Hofmeyr 0b607297e6 utils/Makefile.am: remove unused LIBOSMOVTY_CFLAGS
Change-Id: Id1152b105bb7364a06d9720829d39f587242b707
2016-09-18 23:40:04 +02:00
Neels Hofmeyr d1fdefedf1 vty l3 help: fix typo 'comamnds'; fix english s/his//
Change-Id: I6be52bbb69de8aa0a6d57a3a320661ad85fc2cc4
2016-09-18 23:35:49 +02:00
Neels Hofmeyr 6d82c351b9 remove unused bsc_copyright from bsc_vty.c
Change-Id: I281791c0f57ca75ffe14431a3030811b2d224f0b
2016-09-18 23:35:49 +02:00
Neels Hofmeyr ab04fb2d50 properly #include <openbsc/gsm_data.h> from gsm_subscriber.h
Don't use quoted, local include, use <> style include.

Cosmetic: also move stdbool.h include to the top to keep osmocom and openbsc
includes grouped.

Change-Id: Iaa3dc36768f96f6b8c91010a2ba389fdc37f1503
2016-09-18 23:35:49 +02:00
Max 292ec58e67 Modify SI 13 field for control_ack_type
Add vty function to explicitly set use of 4xRACH type of ack message for
PACKET CONTROL ACKNOWLEDGMENT. Previous hardcoded value (use RLC/MAC
control block) is used as a default.

This is handy for debugging issues related to Timing Advance in context
of GPRS.

Change-Id: Ie869ac0a82055110f1e3b875e246750c4e113336
Related: OS#1526
2016-09-17 10:00:58 +00:00
Neels Hofmeyr 2867f883a1 log causing rx event for lchan_lookup errors
Add log_name to lchan_lookup() and pass such from the various RSL rx events
that call it to validate the RSL chan_nr.

Change-Id: Id81e7b8b9c27831923f050a78dfc7d650e687033
2016-09-17 09:58:54 +00:00
Neels Hofmeyr b3d8706bea log: abis_rsl: don't log 'error' when there is no error
The message 'RF Channel Release due error 0' keeps catching my eye because
it says 'error' even though the error code is zero, i.e. no error.
This shall end now.

Change-Id: Ie0b9d62e8ce85a096c963931e0ae5527b8dc490a
2016-09-17 09:58:53 +00:00
Alexander Couzens aa386d29fd sms: change rp err cause of smpp_try_deliver errors
smpp_try_deliver could fail with rc < 0. In such cases don't send the MS the rp
error sms rejected (cause 21). A rejected message should not be sent again. The
spec 04 11 recommends sending cause 41 Temporary failure in unknown cases.

Add also a log message and rate counter for such cases.

Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Change-Id: Ia03e50ce2bd9a7d1054cc5a6000fd73bd3497c03
2016-09-17 08:45:07 +00:00
Alexander Huemer c2f2ad8a5f Build fixes
Some fixes for build environments where dependencies are installed in
distinct directories.

Change-Id: I38808fd2911747b266ee6fde91187a88dd7ae355
2016-09-15 16:02:18 +02:00
Alexander Huemer 7b6673fa06 Consistenly format variables in */Makefile.am files
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-09-15 15:55:02 +02:00
Alexander Couzens 58f446ca08 gprs/gprs_llc: fix null pointer deref in gprs_llc_rcvmsg
Change-Id: I1f7e1d524042134c93a4f3de599c54d442447512
2016-09-05 13:36:01 +00:00
Alexander Couzens a173566b35 gprs/gsm0408_gprs_force_reattach_oldmsg: check llme before use
Change-Id: I9385655872c4dcf46aa1d18bcc47b84aba2f34f7
2016-09-05 13:36:01 +00:00
Daniel Willmann 21b269f814 IuPS: Change GTP-U endpoint to SGSN in PMM_IDLE and page UE when data arrives
Change-Id: I47b73a40cbdda6b7c31fb2767f74f9f93d84056b
2016-09-02 04:29:36 +02:00
Daniel Willmann c17cdb40b5 IuPS: Introduce function to change PMM state
This is where IuPS will redirect GTP-U endpoints in a subsequent commit.

Also add comprehensive logging of pmm_state transitions.

Change-Id: I7c2cd1abc1805659b01dffffff31c49fe5161086
2016-09-02 04:29:21 +02:00
Daniel Willmann fac9758820 IuPS: GMM Attach: reset MM ctx pending_req
Change-Id: I0df0f3d88085939eb617405e2013ad164eed477b
2016-09-02 04:29:15 +02:00
Daniel Willmann 5b2363ebb2 IuPS: sgsn_mm_ctx: add enum gprs_pmm_state field, track PMM state
Iu needs to page to transfer data in PMM-IDLE state.

Change-Id: Id37778cb9a0328a21c8e8246998ecdb43dd687d8
2016-09-02 04:29:01 +02:00
Daniel Willmann af241727a9 IuPS: RA UPD: make sure to authorize, for Iu Integrity Protection
Change-Id: I2ea2089895f8a8e125ef39d9bef70dafb2b1ce69
2016-09-02 04:28:49 +02:00
Daniel Willmann 1dee2b6e96 IuPS: add GMM Service Request rx and tx
Change-Id: Ib935de22d23a15f449927840d4d59497ce22abbd
2016-09-02 04:28:41 +02:00
Daniel Willmann 3ecfbbba6f IuPS: send Security Mode Command, track the new_key flag.
Change-Id: I0b2593c2df13b79eb36975b0d302e31cfdf8bb09
2016-09-02 04:28:31 +02:00
Daniel Willmann 770f3e32e0 IuPS: dev hack: init hardcoded Ki on ATT REQ
DEVELOPMENT HACK: Our current HLR does not support 3G authentication tokens.  A
new HLR/VLR implementation is being developed. Until it is ready and actual
milenage authentication is properly supported, we are hardcoding a fixed Ki and
use 2G auth.

Change-Id: Ieca45960fa941a3a706c6e479b04b9f2ef89d860
2016-09-02 04:28:16 +02:00
Daniel Willmann 7bc6986f6b IuPS: add Iu response to delete_pdp_conf()
Change-Id: I6d601586101c0a004b2243633fab48db82b44b7c
2016-09-01 23:44:45 +02:00
Daniel Willmann 6b7b319d54 IuPS: add Iu response to create_pdp_conf()
Change-Id: Iad65ca9b77c3166d4df9a58af527e6aef7e589ee
2016-09-01 23:44:45 +02:00
Daniel Willmann 61329d45b8 IuPS: redirect Iu in various places, link Iu in sgsn-test
In gsm48_gmm_sendmsg(), redirect to iu_tx() for both cases of MM context
present or not.

In gsm48_rx_gmm_att_req(), compose an MM context marked as Iu for messages
coming in from a ue_conn_ctx (passed in msg->dst). Also make sure cid is
initialized to avoid introducing a compiler warning.

In gsm48_rx_gmm_ra_upd_req(), look up an Iu MM context based on the presence of
the ue_conn_ctx in msg->dst.

In sgsn-test, add libiu and libasn1c, libosmo-sigtran, libosmo-ranap, which are
now needed for an --enable-iu build.

Change-Id: Ia47ffbfa6fa0f5a0cd76a379c57ef42faa0d80e3
2016-09-01 23:44:45 +02:00
Daniel Willmann 6292c8d44d IuPS: osmo-sgsn: add core IuPS impl, call iu_init()
Add main Iu entry points for IuPS:
* gsm0408_gprs_rcvmsg_iu()
* sgsn_ranap_iu_event()
* sgsn_ranap_rab_ass_resp()

Add main MM context management for IuPS:
* sgsn_mm_ctx_by_ue_ctx()
* sgsn_mm_ctx_alloc_iu()

Call iu_init() from sgsn_main.c.

Add asn_debug impl ("extern" from libasn1c).
Initialize asn_debug VTY command (iu_vty_init()).

osmo-sgsn build: add libiu and libasn1c, libosmo-sigtran, libosmo-ranap

Change-Id: I469ae6ca9ef254d04ee0d2d79bdd65aebcd027b5
2016-09-01 23:41:10 +02:00
Neels Hofmeyr 9bc42ec47b IuPS: add VTY config for asn_debug
Add file iu_vty.c in libiu, and iu_vty_init() to initialize the new VTY
command:

  log
   logging asn1-debug (1|0)

Change-Id: If4e7d0ab3fc2ed0cdf4fb0a3fa077a9e34890918
2016-08-31 11:11:07 +00:00
Harald Welte 7e82ad20fa osmo-nitb: generate backtrace on SIGABRT
As the NITB has an internal SIGABRT handler that prints a talloc report,
let's also print a stack backtrace at the same point.

Change-Id: Ia63aa5c39b26e27c3ee220d755c17d2c1ef636c5
2016-08-31 11:07:35 +00:00
Alexander Couzens 4b95b5401c bsc/netinit: correct mistyped rate counter
Introduced by b847a21fa4

Change-Id: I57c41f98e3826951a5071b005cb640c23d466477
2016-08-30 14:39:43 +02:00
Alexander Couzens b847a21fa4 libmsc/bsc: split rate counters into bsc and msc group
Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Change-Id: I7361033cd1eb919ec3c2ea2652f40ab8c75b2f99
2016-08-29 18:56:20 +02:00
Daniel Willmann d75864f6f5 IuPS: track msg->dst aka ue_conn_ctx, comment
For Iu connections, msg->dst will point to the ue_conn_ctx, and we need to make
sure to keep msg->dst intact when copying from/to msgb and from/to MM context.

Change-Id: I90c7ca6c3655d447aaca958e0086ae6ce6f6045a
2016-08-27 13:29:33 +02:00
Daniel Willmann 746c7896cb gprs_gmm: Fix bit mask when determining update/attach type
Bit 4 is reserved in 3GPP TS 04.08 so exclude it from the type.

In 3GPP TS 24.008 it indicates if a follow-on request is pending by the
MS, but only in Iu mode. According to the spec it is not required to
react to that request with a follow-on proceed so this field can be
ignored for now.

See 3GPP TS 24.008 Ch. 4.4:
"Unless it has specific permission from the network (follow-on proceed)
the mobile station side should await the release of the RR connection
used for a MM specific procedure before a new MM specific procedure or
MM connection establishment is started."

as well as Ch. 4.4.4.6:
"If the network wishes to prolong the RR connection to allow the mobile
station to initiate MM connection establishment (for example if the
mobile station has indicated in the LOCATION UPDATING REQUEST that it
has a follow-on request pending) the network shall send "follow on
proceed" in the LOCATION UPDATING ACCEPT and start timer T3255."

Change-Id: If1dff960c406060e257dafc54132687ffc42ad8f
2016-08-27 13:29:33 +02:00
Neels Hofmeyr f4daf16c8d cosmetic: gprs_sgsn.c: move pdp.h include to top
Change-Id: I9a9b34d714235462ba72cdb65b7c8c9824dfa9c6
2016-08-27 13:29:33 +02:00
Neels Hofmeyr bfa8878a07 add libiu
Co-Authored by dwillmann, laforge, nhofmeyr

Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3
2016-08-27 13:29:30 +02:00
Philipp Maier 4ac3aee711 Adding LLC-XID related modifications in LLC
With this commit the already existing XID mechanism has been
modified to suit the needs for the upcomming SNDCP-XID patches.

This commit should not break anything since it does not alter
the current behaviour (incoming XID is still just echoed, on
GMM-Reset a basic XID message is still echoed)

Change-Id: I65b9d625e72d3d61c99abdc7041773701d694d52
2016-08-27 04:45:55 +00:00
Philipp Maier 3ec03d5048 Moving grs_sndcp.h header file to include
For some reason gprs_sndcp.h is located in src/gprs. This commit moves
gprs_sndcp.h to include/openbsc and fixes the include path in
gprs_sndcp.c and gprs_sndcp_vty.c

Change-Id: If4e4f1252c81d7907c1b4d738c982bb172b128c9
2016-08-27 04:45:55 +00:00
Philipp Maier a536fc644b Adding LLC-XID encoder / decoder and unit test
The lle-xid encoder/decoder is needed to encode and decode llc
xid parameter messages. We need this to exchange sndcp-parameters
(SNDCP-XID) and also simple parameters such as encryption IOVs

Change-Id: Ia06e4cb08bf9b48c2a4682606d1b1a91d19a9d37
2016-08-27 04:45:54 +00:00
Neels Hofmeyr d5d39ae2b6 log: rsl notice: tiny tweak for readability
Change-Id: I57c3b7d27d857c96e3fa3dacf7b766bc43100fc3
2016-08-27 02:23:47 +00:00
Neels Hofmeyr 423269f803 log: improve for rsl_lchan_mark_broken()
In rsl_lchan_mark_broken(), call rsl_lchan_set_state() so the state transition
gets logged in the debug log.

Remove logging for the broken channel at the callers, instead log the error
actually in rsl_lchan_mark_broken() itself, with the reason message passed by
the caller anyway. (Removes code dup and ensures it's always logged.)

Change-Id: I54ae9bbd3f193bae7b1bda1fef3e33e62b353bf5
2016-08-27 02:23:47 +00:00
Neels Hofmeyr baa6c5546e dyn TS: debug log: if still in use, also log lchan type and state
Change-Id: Ifbf31cde24b2d1022b7a472966c17959c96e6dda
2016-08-27 02:23:47 +00:00
Neels Hofmeyr a0a08d80b8 dyn TS: debug log 'switchover complete' only when there was a switchover
Change-Id: I7ddcb41edce1cd7b22fe91e33bdcaedb21856222
2016-08-27 02:23:47 +00:00