Harald Welte
3068d5747a
msgb_trim(): actually trim to an absolute length, as the comment states
...
The previous commit introduced a new msgb_trim() but the implementation
differed from the specification.
2012-01-14 22:08:28 +01:00
Harald Welte
b0f91513cd
msgb: introduce msgb_trim() and msgb_l3trim() to trim msgb's
2012-01-14 21:54:17 +01:00
Holger Hans Peter Freyther
7be8c2b686
Merge remote-tracking branch 'origin/zecke/lapd-fixes'
2012-01-14 21:44:03 +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
Holger Hans Peter Freyther
4a075f82f0
lapd: Disable one part of the test as it fails on FreeBSD
...
I thought this number would be wrong in the same way but it depends
on OS/ARCH. Disable this part of the test for now.
2011-12-12 00:41:25 +01:00
Holger Hans Peter Freyther
15f740caa3
lapd_test: Look at the content of LAPD messages and compare them
...
Verify the output, accept two known errors in the generation of it.
2011-12-12 00:34:06 +01:00
Holger Hans Peter Freyther
72bd4eb3b9
lapdm: Create a simple test case to transmit data between both ends
...
This is testing the establishment of two ends (BTS, MS) one is in
the polling mode as used by osmo-bts. Transfer data between the two
ends. The sent data is not verified though. This should be followed
up soon.
2011-12-11 21:35:06 +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
57143a4361
milenage_test: make sure test output is what .ok file expects
2011-12-07 03:12:44 +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
9df00bb857
milenage_test: make sure test result matches expectations
2011-12-07 02:56:11 +01:00
Harald Welte
915e0ef5e7
add 'osmo-auc-gen' tool that can be used to generate auth vectors
...
Thsi tool usses libosmocore in order to generate 2G and 3G
authentication vectors from private key material, exactly like an AuC
would produce them in a real network.
2011-12-07 02:38:42 +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
5c6032393b
whitespace fixes in milenage_test.ok
2011-12-07 00:24:59 +01:00
Harald Welte
4b3fbd45ac
add milenage internal headers to ensure 'make dist' works
2011-12-07 00:24:32 +01:00
Harald Welte
e076ac087c
add autotest script for milenage/auth testing
2011-12-07 00:10:18 +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
Holger Hans Peter Freyther
62cb457632
tests: Use the missing from the source directory
...
No need to keep a manual copy of the missing binary, use the one
that will be in the top_srcdir.
2011-11-29 22:20:34 +01:00
Alexander Huemer
322f60aeb6
fix two mistakes in AM_LDFLAGS
2011-11-25 09:43:45 +01:00
Harald Welte
85fc31416b
BSSGP: Add functions required for true BSS-side BSSGP implementation
...
The BSS-side of BSSGP requires quite a number of additional functions
for sending unidirectional messages that a SGSN never sends.
This is a first step into completing the BSSGP implementation and making
it ready to be used from osmo-bts and other BTS-side GPRS
implementations.
2011-11-25 08:58:40 +01:00
Harald Welte
eb3ccf6489
BSSGP: add more doxygen comments
2011-11-25 08:15:42 +01:00
Sylvain Munaut
e7e28ed092
Update .gitignore with new tests
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-25 07:45:49 +01:00
Harald Welte
2861007a40
GPRS: add new bssgp_create_cell_id(), opposite of bssgp_parse_cell_id()
2011-11-24 21:33:16 +01:00
Harald Welte
a9f23c8291
GPRS NS: Add some doxygen API documentation
2011-11-24 21:33:16 +01:00
Sylvain Munaut
40a8700247
libosmocore: Update LIBVERSION because of ABI chaanges
...
The recent convolutional code changes break the ABI.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:53:53 +01:00
Sylvain Munaut
29eb92db02
core/conv: Add regression testing code
...
It tests both a given test vector encoding/decoding, and
some random coding/decoding cycles.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:48:42 +01:00
Sylvain Munaut
ae8dbb4d77
core/conv: Add utility methods to know length of coded/decoded vectors
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:47:32 +01:00
Sylvain Munaut
297d13f460
core/conv: Add support for other termination types (trunc & tail biting)
...
Note that this breaks the ABI and the low level API. But it shouldn't
break the high level API, nor the conv code definitions (because fields
default to 0, and for new fields '0' is the previous behavior)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:46:58 +01:00
Sylvain Munaut
d4440d4cfa
core/conv: Really only consider error for non-zero soft values
...
This should have been done with 1dd7c84733
but somehow was missed and only applied to the 'finish' method and
not the 'scan' method.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 16:04:58 +01:00
Sylvain Munaut
03d2c8906b
core/conv: Minor documentation improvements
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 11:53:49 +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
e45e699199
core/logging: Remove const qualifier on return of logp2syslog_level
...
This generates a warning because it doesn't "mean" anything.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-20 08:59:36 +01:00
Sylvain Munaut
31d3de943c
core/serial: Fix warning when on platform other than linux
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-20 08:55:11 +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
17af41d9cd
utils: Fix alias to weak alias to allow OSX compilation
...
Using a weak alias works just as good AFAICT.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-19 22:30:39 +01:00
Sylvain Munaut
a42e2f6fb6
tests/a5: Add a5_test.ok as EXTRA_DIST
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 21:31:01 +01:00
Sylvain Munaut
fb19530f67
tests: fix cut & paste error
...
Damn ... I fixed it locally and didn't properly commit the fix before
push.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 21:16:51 +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
810c33483e
tests/a5: Add a5 regression testing
...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-17 20:33:19 +01:00