Commit Graph

92 Commits

Author SHA1 Message Date
Harald Welte 973c3c3f24 LAPDm: Ensure there is no payload in DISC frames
When we send DISC frames (especially generated from RSL), we don't want
any remaining bytes from the RSL message showing up as bogus DISC
payload.
2012-04-26 22:15:12 +02:00
Sylvain Munaut dca7d2caaa doc: Fix the Doxygen section endings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-04-18 21:53:23 +02:00
Harald Welte df90aedcc7 libosmogsm: Add tvlv_att_def to exported symbols 2012-04-05 01:42:00 +02:00
Holger Hans Peter Freyther 7c373bce1d misc: Fix make distcheck, add the new libosmogsm.map file to the tarball 2012-04-05 00:44:46 +02:00
Harald Welte 3e071446be lapdm: fix RSL message format in RLL ERROR INDICATION
In rsl_rll_error() we don't need to re-set the msg->l2h as that would
corrupt the message.  The recipient would interpret any cause value
as 0.
2012-04-05 00:28:38 +02:00
Harald Welte 1c72bfb2cb libosmogsm: Introduce explicit list of exported symbols
There is now a "libosmogsm.map" file containing an explicit list of
to-be-exported symbols.  This should prevent us from leaking non-static
symbols into the global namespace.

A similar scheme should be adopted by all other osmocom libraries
2012-04-04 22:43:25 +02:00
Harald Welte a72e47b8a0 auth_milenage/osmo-auc-gen: compute OPC in case only OP is known 2012-03-21 09:04:14 +01:00
Harald Welte 042afe7fe7 milenage: Add function to compute OPC from OP and K 2012-03-21 08:19:47 +01:00
Holger Hans Peter Freyther fb6a2e274f lapd: Remove unused variable t200_start in lapd_acknowledge.
lapd_core.c: In function 'lapd_acknowledge':
lapd_core.c:710:38: warning: variable 't200_start' set but not used [-Wunused-but-set-variable]
2012-03-16 10:35:38 +01:00
Sylvain Munaut 2dafed51e5 gsm/a5: Rewrite equation doc with proper numbering
No idea where I copied the original from but here we use the
other notation. (matches wikipedia and sources)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-02 23:39:19 +01:00
Harald Welte 07b625dd2c GSM 08.08: change gsm0808_create_classmark_update() prototype
The caller explicitly specifies CM2 and CM3, rather than one blob
containing both.
2012-01-26 22:42:16 +01:00
Harald Welte 65c2d36005 GSM 08.08: Cleanup the code, remove lots of magic hard-coded numbers
Rather than manually hard-coding numbers and using byte-arrays, we use
the msgb_*_{push,put}() function family of libosmocore/libosmogsm.

This is currently untested.
2012-01-26 22:42:15 +01:00
Holger Hans Peter Freyther 3a5f08c221 lapdm: Make sure that the msgb_l3len(msg) == length...
This code should not play with the internals of the msgb like this,
this code got introduced in af48bed556 and is breaking the
osmo-bts usecase of forwarding an RSL message.

Add a test case that fails without the new code. I would prefer if
we could get rid of the manipulating the msgb like this, it is prone
to errors like this one.
2012-01-12 23:23:19 +01:00
Holger Hans Peter Freyther 90656dbd00 lapd: Warn if someone attempts to send an empty message
DATA REQ with a msgb_l3len(msg) == 0 message does not make any
sense, log an error and return immediately before attempting to
send an empty I frame in lapd_send_i.
2012-01-12 23:23:10 +01:00
Holger Hans Peter Freyther 6ecafef28f lapd: Mention the L3 size of the payload being sent 2012-01-12 23:17:23 +01:00
Andreas.Eversberg 301f01e938 libosmocore/lapd: Fixed handling of sequence errors at lapd_core.c
If a sequence error is received, the N(R) variable must still be used to
acknowledge previously transmitted frames.

If there are two subsequent sequence errors received, ignore it. (Ignore
every second subsequent error.) This happens if our reply with the REJ is
too slow, so the remote gets a T200 timeout and sends another frame with
a sequence error. Test showed that replying with two subsequent REJ
messages could the remote L2 process to abort. Replying too slow shouldn't
happen, but may happen over serial link between BB and LAPD.

Written-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-01-10 13:02:01 +01:00
Gus Bourg 4b6bc3b4b5 Fix generation of GPRS Routing Area in case of 3-digit MNC
This fixes a simple typo that causes erroneous GPRS Routing Area
encoding if you use 3-digit MNCs.
2011-12-14 23:20:21 +01:00
Harald Welte d318e61607 auth_core: add missing string.h include to reduce warnings 2011-12-07 12:16:27 +01:00
Harald Welte aae2362455 auth_core: don't use anonymous unions to make certain gcc versions happy 2011-12-07 11:35:02 +01:00
Harald Welte 1726ec5e17 auth_milenage: we now copy RAND in auth_core, no need to do it twice 2011-12-07 02:56:28 +01:00
Harald Welte 4afdd5dca2 auth_core: Make sure we always save the RAND in the vector 2011-12-07 02:38:18 +01:00
Harald Welte a5ab1620f4 auth_core: add functions for parsing algorithm names 2011-12-07 02:33:11 +01:00
Harald Welte 4b3fbd45ac add milenage internal headers to ensure 'make dist' works 2011-12-07 00:24:32 +01:00
Harald Welte 781bd5daeb Auth: Import milenage implementation from hostap (Jouni Malinen)
... and add integration into the osmo_auth core.
2011-12-06 22:50:31 +01:00
Harald Welte d82e0eb697 Add a generic abstraction for GSM/3G authentication algorithms
Indiidual algorithms can be implemented as plugins.  libosmogsm itself
only provides COMP128v1 via this generic interface.
2011-12-06 21:53:42 +01:00
Harald Welte 39a287db74 comp128: mark ki and srand as 'const' input parameters 2011-12-06 21:52:09 +01:00
Harald Welte 75524cbabd increment LIBVERSION of libosmocore for new api 2011-12-01 21:12:11 +01:00
Harald Welte ad633b0919 SMS: export gsm411_bcdify() and gsm411_unbcdify() functions
The same functions are e.g. required by the NITZ code in 04.08, and we
don't want copy+paste.
2011-12-01 21:09:19 +01:00
Sylvain Munaut 9a5f3b8f78 gsm/lapd_core: Make sure rc is initialize in lapd_rx_u
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-20 09:01:59 +01:00
Sylvain Munaut ad4a6a8840 gsm/a5: Bit faster way to compute parity ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-20 08:46:56 +01:00
Sylvain Munaut 2735ac4848 gsm/a5: Add documentation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 21:01:46 +01:00
Sylvain Munaut 7f975d231b gsm/a5: Rewrite A5/2 algo to avoid the delayed bit
It's just clearer that way ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 20:36:50 +01:00
Sylvain Munaut 3e387cb35c gsm/a5: Add const qualifier on the key
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 19:45:58 +01:00
Sylvain Munaut cc90d494ce gsm/gsm0411_smc: Fix typo
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:52:40 +01:00
Sylvain Munaut 0d9b8ec9d3 include/gsm_04_11: Fix compatibility issue with GSM411_TMR_TC1A
We need to keep the old one for compatibility !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:52:20 +01:00
Andreas Eversberg c1a91a896f gsm/sms: Rewrite of SMR process, extracted from OpenBSC
The SMR process is used to transfer SMS TPDUs. It is now extracted from
OpenBSC. It includes a real state machine now for easier debugging.

Also it implements the TR1M and TR2M timers. The memory notification
procedure is missing, but not required for network side.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:37 +01:00
Andreas Eversberg bbf9034eaa gsm/sms: Rewrite of SMC process, extracted from OpenBSC
The SMC process is used to transfer RP frames. It is now extracted from
OpenBSC. It includes a real state machine now for easier debugging.

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:37 +01:00
Andreas.Eversberg d84f47abb3 gsm/sms: Moved utility functions of SMS processing to new gsm0411_utils.c
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:37 +01:00
Andreas.Eversberg 153903c8cf gsm/lapdm: Display SAPI in debug message for easier debug
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas.Eversberg 816e178e99 gsm/lapdm: Fix UI frames from BTS->MS have length (B4 format)
This is part of a set of commit to fix LAPDm to handle datalink
connection on ACCH (SAPI 3)

This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4).

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas.Eversberg f1f80de007 gsm/lapdm: Fix TA and power level handling in the ACCH header
Timing advance and power level indicated by MS (measurement reports)
and BTS (SI 5/6) are now stored for use at ACCH data link connection.

This is part of a set of commit to fix LAPDm to handle datalink
connection on ACCH (SAPI 3)

This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4).

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas.Eversberg cbed327965 gsm/lapdm: Set N201 depending on the frame type
This is part of a set of commit to fix LAPDm to handle datalink
connection on ACCH (SAPI 3)

This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4).

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas.Eversberg 5ac44784b6 gsm/lapdm: Make T200 timer depends on the link type (SACCH is slower)
This is part of a set of commit to fix LAPDm to handle datalink
connection on ACCH (SAPI 3)

This is required to transfer SMS on SACCH of TCH/f or SDCCH/8 (4).

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas.Eversberg a42b699516 gsm/lapdm: Add missing msgb_free in rslms_rx_rll error cases
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Andreas Eversberg 5ad4ac800c lapd: Fixed possible double free buf in lapd_core.c
Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Harald Welte 17f56f385b update LIBVERSION to reflect new API additions 2011-10-10 08:46:40 +02:00
Andreas Eversberg 78122ab568 Added defines to use primitive/operation tuples in switch/case statements 2011-10-10 08:38:58 +02:00
Andreas Eversberg 742fc79d58 LAPD: Moved timer handling into seperate functions 2011-10-10 08:38:58 +02:00
root af48bed556 Split of LAPDm into a core part and a GSM specific part
Instead of mixing together the GSM layer 1 interface and RSL interface
with the implementation of LAPD, the core function of LAPD is now
extracted from LAPDm. The core implementation is now in lapd_core.c
and lapd_core.h respectively.

The lapd_core.c implements exactly one datalink instance for one SAP.
The surrounding implementation "lapdm.c" codes/decodes the layer 2
headers and handles multiplexing and datalink instances, as well as
translates primitives from/to RSL layer.

lapd_core.c can now be used for other LAPD implementations. (ISDN/ABIS)
2011-10-10 08:38:58 +02:00
Harald Welte ee876c9172 LAPDm: Fix encoding of RLL ERROR IE 2011-09-03 10:43:41 +02:00