Commit Graph

890 Commits

Author SHA1 Message Date
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
Holger Hans Peter Freyther 1e57eb6112 misc: Deal with smatch warnings about the bitfields
Use unsigned ints for the bitfield.
2012-03-02 14:14:33 +01:00
Sylvain Munaut a9efc12ccd vty/telnet: Add function to allow binding telnet interface to custom IP/Interface
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-01 22:33:20 +01:00
Holger Hans Peter Freyther 52746469ff misc: Use msgb_free for freeing the messages 2012-03-01 20:30:32 +01:00
Harald Welte 3e04ed6083 gsmtap: Add GSMTAP_GPRS_CS() / GSMTAP_GPRS_MCS()
As requested by Mike Morrin <Mike.Morrin@ipaccess.com>, we introduce
GSMTAP sub-types for all the different GPRS and EGPRS coding schemes.

This is neccessary due to the fact that the RLC PDU doesn't contain any
explicit indication of the coding scheme used on the radio layer.
2012-02-08 18:13:34 +01:00
Andreas Eversberg 4b332d7d0e libosmocore/gsm: Fixed total size of gsm48_req_ref
"__attribute ((packed))" must be defined for unions, in order to make
sure that the compiler packs unions.
2012-02-07 20:02:17 +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
Harald Welte 7d974addc6 gsmtap: make sure we agree with wireshark on GSMTAP channel types 2012-01-26 13:12:03 +01:00
Harald Welte 2c02043f49 TLV/msgb: Return first byte of newly-pushed data from msgb_*_push()
The msgb_*_push() functions erroneously returned the firsrt byte after
newly-pushed information, which makes no sense at all.
2012-01-22 23:10:40 +01:00
Holger Hans Peter Freyther 97510814d8 tests: Introduce a very basic gsm0808 test
This tests verifies the content of the GSM 08.08 messages, it does
not verify the remaining headroom (which the SCCP/IPA code relies
on being plenty to prepend the header). More to come in the future.
2012-01-22 13:46:58 +01:00
Holger Hans Peter Freyther 58e6d96d68 abis: gsm_data_shared.h includes libosmo-abis header, add abis to cflags
gsm_data_shared.h includes e1_input.h of libosmo-abis, add the
LIBOSMOABIS_CFLAGS to Makefile.am, remove AM_LDFLAGS at the same
time as we only build .a archives.
2012-01-15 17:52:02 +01:00
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