Commit Graph

258 Commits

Author SHA1 Message Date
Andreas.Eversberg eaac0cfe77 gsm/gsm48_ie: Fix other range format decoding
As it turns out, the other range were affected too, so Anreas wrote
the fix for them as well.

Written-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 20:12:19 +02:00
Harald Welte a24026a499 RSL: add rsl_ipac_msg_name() for ipa specific RSL extension names 2011-09-02 12:26:50 +02:00
Sylvain Munaut 71fd42fede gsm/gsm48_ie: Fix Range 256 format decoding
From the mail:

---
appended is another patch for fixing a bug in the calculation of the
frequency lists. This time the patch is for the "Range 256 format".
The problem is that the operand for the "smod" operation might be
negative, in this case the simplified version won't work as expected.

In the patch I introduced a separate function for "smod" which takes
care of the sign. I have not yet checked if the other formats are also
affected, this would be the case if the "smod" operand can be negative.

There might be other solutions to fix the problem without the need
for a separate function, however I have not thought further about it.

A test vector is the following frequency list ("Range 256 format",
first byte is the length):

 09 8b 1c 83 8c 15 ef 02 2d 30

The correct ARFCNs are

 569 571 576 578 586 608 712 715 719

The uncorrected version would instead return:

 444 457 460 464 569 576 578 586 608

This means four ARFCNs are wrong which will cause problems if for
example the frequency list contains the ARFCNs for hopping.
----

Written-by: Dieter Spaar <spaar@mirider.augusta.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-01 22:05:29 +02:00
Harald Welte 712691d8d8 add functions for bit-reversal
Sometimes we need stuff like reversing every bit in each byte (but not
the byte-order).
2011-09-01 14:47:31 +02:00
Harald Welte 36c5a3e285 logging: add osmo_vlogp() as vararg / va_list compatible function 2011-08-31 19:40:03 +02:00
Harald Welte d38c8b88d7 doxygen: Add main page for all three libraries 2011-08-30 11:32:56 +02:00
Harald Welte 4e777c300f doxygen: Add documentation for Abis OML 2011-08-17 19:15:24 +02:00
Harald Welte e881b1b9eb doxygen: split VTY configuration in multiple files 2011-08-17 18:52:30 +02:00
Harald Welte 8f2c7e5b2b RSL: add doxygen documentation 2011-08-17 18:52:21 +02:00
Harald Welte 6bdf0b158c doxygen: Add documentation for LAPDm code 2011-08-17 18:22:08 +02:00
Harald Welte 57c7d37059 doxygen: Add documentation about TLV parser 2011-08-17 17:50:55 +02:00
Harald Welte 7acb30c69b doxygen: Add (partial) VTY API documentation 2011-08-17 17:14:12 +02:00
Harald Welte 47379ca95b doxygen: Add documentation for gsmtap_util.[ch] 2011-08-17 17:14:12 +02:00
Harald Welte af8e4352b5 doxygen: Add documentation to signal.[ch] 2011-08-17 17:14:12 +02:00
Harald Welte a523d14096 doxygen: document panic.[ch] 2011-08-17 17:14:12 +02:00
Harald Welte 9327c6dc0f doxygen: Add docs for rate_ctr 2011-08-17 17:14:12 +02:00
Harald Welte 2777ecd987 doxygen: Add 'write_queue' module 2011-08-17 17:14:12 +02:00
Harald Welte 8598f1866e doxygen: add doxygen module 'utils' 2011-08-17 17:14:12 +02:00
Harald Welte 18fc465b7f doxygen documentation for logging framework 2011-08-17 17:14:12 +02:00
Harald Welte ba6988bd89 some more doxygen work (include the notion of modules) 2011-08-17 17:14:11 +02:00
Pablo Neira Ayuso 300e78d3e5 logging: fix parsing of logging mask (-d DMI case)
Without this patch, `-d DMI' enables logging for DMI and DMIB.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-08-11 14:33:16 +02:00
Andreas.Eversberg 1a99df84e1 gsm/gsm48_ie: Fix frequency list decoding
Fix-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-30 20:27:40 +02:00
Harald Welte 087e1136eb use the 'L' prefix in debug names (DLINP instead of DINP) 2011-07-29 11:43:39 +02:00
Holger Hans Peter Freyther 7e1a622124 sms: Fix style issues with the code, add spaces after keywords 2011-07-24 20:17:00 +02:00
Dennis Wehrle 291e61346b sms: SMS where cropped (from VTY), concatenation of SMS where not possible
Additionally it wasn't possible to send concatenated sms from the vty.
To send multiple sms, it is necessary to use padding bits and add a user_data_header.
Therefore the gsm_7bit_encode function was splitted to gsm_7bit_encode and gsm_septets2octets.
gsm_septets2octets: this is the old gsm_7bit_encode function + additional padding parameter

Additionally the gsm_7bit_decode function was modified to take account for the user_data_header.
With the new gsm_get_octet_len function you can get the octet length for a given septet length.

I also added several sms tests.
2011-07-24 20:14:13 +02:00
Harald Welte 95f7eb288c remove DLRSL and DLNM, we don't need them
They are not used anywhere in our libraries, so they should be defined
by the respective applications
2011-07-21 16:58:44 +02:00
Harald Welte 892e621fec make sure we don't have namespace clashes between libraries and apps
* All loging prefixes in libraries should be DL like DLINP
* All signals / subsystems should be called S_L_* SS_L_*
* All command nodes should be called L_*_NODE

This makes sure existinc code still compiles as expected
2011-07-19 14:31:44 +02:00
Pablo Neira Ayuso 199f37723b logging: add libosmo-abis logging subsystems
This adds the libosmo-abis logging subsystems to libosmocore,
it uses the new change that harald proposed based on negative
numbers for library logging subsystems.
2011-07-18 17:00:08 +02:00
Harald Welte 584427cd04 lapdm: fix memory leak due to unreachable code
detected by Smatch
2011-07-16 12:21:55 +02:00
Harald Welte f4d45ab021 gsm 08.08: use ANSI function definition with (void) 2011-07-16 12:13:00 +02:00
Harald Welte 79599ba0eb tlv: Make tlv parser arrays 256 entries wide to prevent overflow on 0xff
If we encounter a tag with 0xFF, we overflow our existing tlv_parse
array definitions.

Warning: this breaks ABI
2011-07-16 12:08:28 +02:00
Harald Welte 4876dcf12b gprs_cipher_core: Fix potential buffer overflows
detected by Smatch
2011-07-16 12:03:46 +02:00
Harald Welte 2b32215fc3 telnet_interface: if we don't check for the return value, don't use ret 2011-07-16 12:03:46 +02:00
Harald Welte 9c3cbfb01e telnet_interface: get rid of 'const' warning 2011-07-16 12:03:46 +02:00
Harald Welte 95b2b47b26 get rid of non-ANSI function declarations missing (void)
Detected by Smatch
2011-07-16 12:03:46 +02:00
Harald Welte 7e82020259 timer: use (void) for functions that take no arguments
This has been detected by http://smatch.sourceforge.net/
2011-07-16 12:03:46 +02:00
Holger Hans Peter Freyther 128d9e2343 osmo_hexdump: Fix segfault when input is too long.
In snprinftf the size is a size_t (unsigned) in case we want
to write more than we have available, len_remain will be < 0.

This was spotted while removing hexdump from simtrace and comparing
it to our implementation.

int snprintf(char *str, size_t size, const char *format, ...);
2011-07-15 16:07:23 +02:00
Harald Welte 0c83670a59 GSM 08.08: Fix generation of CIPHER MODE REJECT
The message has a total length of 4 octets, so don't allocate only 3 in the
msgb.
2011-07-12 00:02:27 +02:00
Harald Welte 9b837e6fda gsm 08.08: add value_strings and gsm0808_msg_name() function 2011-07-11 17:45:31 +02:00
Harald Welte da127cbb3e fix against corrupted output in parallel logging
In 8256076722 it was attempted to fix
a bug previously introduced by logging related changes.  The problem
is that a va_list can be corrupted after it has been used once, so
we need to va_copy before each successive use.

And if we copy it, we also need to use the copy, and not the original ;)
2011-07-02 21:51:32 +02:00
Harald Welte 8264e09ca2 lapdm: make sure we flush all queues whenever entering IDLE state
this fixes a memory leak where the final UA would always remain
in memory after a LAPDm entity has been disconnected.
2011-06-29 19:22:47 +02:00
Harald Welte 9e1f0604b5 add msgb_set_talloc_ctx() to set the talloc context for msgb allocations 2011-06-29 18:46:10 +02:00
Harald Welte 7721a77eaf make sure abis_nm <-> osmocom pchan type conversion always works 2011-06-29 18:44:06 +02:00
Harald Welte 7ca604bcd3 LAPDm: Uplink SACCH frames use format B, not format B4 2011-06-29 12:13:51 +02:00
Harald Welte 6420774b3b LAPDm: When Rx DATA from L1, L1 does not know the SAPI
We have to determine the SAPI ourselves inside the LAPDm header.
2011-06-27 23:32:14 +02:00
Harald Welte ce9fec3e89 Fix the generation of the log_categories string + LAPDM
... I should do more testing :(

Conflicts:

	src/logging.c
2011-06-27 23:19:06 +02:00
Harald Welte 9fe1652212 logging: make sure to add the internal categories, as intended 2011-06-27 23:17:35 +02:00
Harald Welte 1f0b8c26f7 add LAPDm code from osmocom-bb into libosmocore 2011-06-27 10:51:37 +02:00
Harald Welte b43bc048eb logging: introduce library-internal logging categories
We do this by using a trick: library-internal log categories use
negative subsystem numbers, which are converted into positive
array indexes at the time of logging.

library-internal log categories need to be knwo at compile-time,
while application-specified categories now are of unlimited number,
as they are dynamically allocated.
2011-06-27 10:40:25 +02:00
Harald Welte ea19c97816 import gsm0502_calc_paging_group() from openbsc 2011-06-26 14:47:16 +02:00