Commit Graph

447 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 33e8a87cd7 smc: Introduce an id and prefix all log messages with SMC(ID)
When OpenBSC is handling more than one message at a time it is difficult
to see which log message belongs to which SMC. Introduce a uint64_t id
that can be set to the row_id/message_id and prefix all log messages
with SMC(ID).

This change is ABI and API incompatible with previous versions of
libosmogsm.

Example:
SMC(100) instance created
SMC(100) message MNSMS-EST-REQ received in state IDLE
2012-11-22 00:41:49 +01:00
Steve Markgraf 5905d5be60 msgb: fix msgb_pull_u*()
msgb_pull returns a pointer to the new begin of the
buffer, unlike msgb_get(), where those functions
were originally taken from.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-11-14 20:14:33 +01:00
Holger Hans Peter Freyther d38e0ef82a smc: Make it possible to include gsm0411_smc.h as first header file
The code embeds the timer so one needs to include the header file.
2012-11-14 17:20:33 +01:00
Tobias Engel 6ad25f290e Add "extern" keywords
Without the "extern" keyword the variables in this header file will be
seen as empty definitions when compiled on OSX.
2012-10-27 10:03:12 +02:00
Harald Welte 8ec7f901bb logging: Make sure to install standard "end" command in VTY node
When you are in the config-log VTY node, you expect "end" to work
like in any other sub-node of config.
2012-10-22 19:43:26 +02:00
Andreas Eversberg f44ed8cf92 Fix: Correcting bssgp_tx_fc_bvc, bssgp_tx_fc_ms, bssgp_tx_ul_ud 2012-09-30 14:38:20 +02:00
Nico Golde bb67be9bd2 build: fix directory creation for core headers, introduced by d471a219. 2012-09-20 09:58:45 +02:00
Holger Hans Peter Freyther 7c7d39adac vty: Include osmocom/core/utils.h for the value_string struct 2012-09-11 12:27:03 +02:00
Holger Hans Peter Freyther db1533651f logging: Introduce a print_filename flag for the logtarget
Introduce a print_filename attribute for each logtarget. Initialize it
with 1 to be backward compatible with earlier versions. The bit is taken
from an existint bitfield. There were at least six bits left of the byte.
2012-09-11 11:24:51 +02:00
Holger Hans Peter Freyther 06f645542c logging: Mark the log_info_cat pointer as consts
Applications should keep the log area in a static const area. Mark
the pointer as const to address compiler warnings in OpenBSC, cast
the const away for the osmo_log_info as it is not declared as const.
2012-09-11 10:31:29 +02:00
Harald Welte e92866bbb1 Gb: Add functions for sending flow control messages from BSS side 2012-09-10 08:56:04 +02:00
Harald Welte 30fabdf61d Gb: Add header file for BSS-side BSSGP functions
.. not sure how we could have missed that so far.
2012-09-10 08:54:35 +02:00
Harald Welte 972b502eca msgb: msgb_get() is supposed to get bytes from END, msgb_pull() from HEAD
msgb_get() has been wrong all the time, despite the documentation being
correct.  If you've used the broken msgb_get() before, you have to
change your code now, sorry.
2012-09-08 20:01:00 +02:00
Harald Welte d8b476988d BSSGP: make bvc_ctx->fc a dynamic talloc allocation
this ensures that we can talloc the flow-control queue entries
as siblings off the bvc_ctx.
2012-09-07 12:07:54 +02:00
Harald Welte bb8262275f BSSGP flow-control: various fixes
* add more comments on units of struct members
* make sure to parsre FC-BVC message correctly
* add error message in case user passes PDU larger than bucket size
* add new function to initialize flow control struct
2012-09-07 12:07:54 +02:00
Harald Welte d11c059502 libosmogb: Port BSSGP flow control from openbsc/laforge/bssgp_fc branch
This code is supposed to implement the BSSGP flow control algorithm,
both for the per-BSS and for the per-MS flow control.

The code currently has no test cases, they will come in a separate
commit.
2012-09-07 12:07:54 +02:00
Harald Welte 1f87d75b7a USSD: text is 'char' not uint8_t 2012-09-07 12:07:10 +02:00
Harald Welte a102b63c28 gsmtap: add minimal support for encapsulating UMTS RRC in GSMTAP 2012-09-02 14:07:57 +02:00
Harald Welte 30a8ec466c GSM 04.08: Add 'enum gsm48_bcap_speech_ver' 2012-08-24 23:00:05 +02:00
Harald Welte c8a0b93939 GSM 04.08: Add support for parsing CSD related bearer capabilities
Also adds a test case for both encoder and decoder of this IE
2012-08-24 21:37:59 +02:00
Harald Welte eed26116c9 GSM 08.58: Add channel modes for transparent data services 2012-08-24 15:36:12 +02:00
Harald Welte fab0ae9b43 import vty_cmd_string_from_valstr() from osmo-bts
This function is able to generate a VTY help string based on an
array of 'struct value_string'.
2012-08-20 18:43:09 +02:00
Holger Hans Peter Freyther 08b286277b utils: Change semantic of OSMO_MAX/OSMO_MIN to match semantic of a function
Add parentheses around the OSMO_MAX and OSMO_MIN macro to match
the behaviour of calling a function. The current version does not
evaluate to what is expected. (OSMO_MAX(3, 2) + 13)  currently
results in 3 and not 16.
2012-08-15 17:08:21 +02:00
Holger Hans Peter Freyther d296f4244f gb: Make suspend_ref a plain uint8_t instead of a uint8_t*
The OpenSUSE build is not happy about the uint8_t to uint8_t*
assignment. As the suspend_ref is a mandatory field we can make
it a plain uint8_t. Increase the LIBVERSION as the ABI has changed.
2012-08-03 10:08:02 +02:00
Harald Welte 007a71e332 authentication: More documentation 2012-07-18 19:47:56 +02:00
Harald Welte 45ecd04e54 backtrace: Add a variant that uses the libosmocore logging framework
I recently discovered that we can only print backtraces to stdout, which
is of course useless in a daemon environment.  We'd rather want to use
the libosmocore logging framework instead.
2012-07-14 12:30:53 +02:00
Harald Welte 2fe684755a TLV: add new "vTvLV" type for GAN
This new TLV type is specific to TS 44.318.  Contrary to the TvLV type
of TS 08.16/08.18, it has an inverted meaning of the extension (0x80)
bit:
	* if the extension bit is not set, 1-byte length
	* if the extension bit is set, 2-byte length

Futhermore, it has support for variable-length tags, where the tag part
can be optionally two bytes in length.  As this esoteric option hasn't
been seen in the wild yet, we only add encoding support but skip
decoding for now.
2012-07-14 01:50:33 +02:00
Harald Welte 774a9de8b3 import gsm48_decode_lai() function from osmocom-bb/mobile sysinfo.c 2012-07-13 21:35:13 +02:00
Harald Welte e30b6ac5d1 timer: Add function osmo_timer_remaining() to determine remainign time 2012-07-13 12:22:20 +02:00
Andreas Eversberg 3c6a2cef5e VTY: Allow to compile vty.h and command.h headers with C++ 2012-07-12 09:42:36 +02:00
Holger Hans Peter Freyther fb4bfc2ad5 logging: Fix compile breakage introduced by the warning fixes
Make sure the declaration and definition match, add const to
the functions called by logp/logp2.

Compile output:
logging.c:317: error: conflicting types for 'logp'
../include/osmocom/core/logging.h:34: note: previous declaration of 'logp' was here
logging.c:327: error: conflicting types for 'logp2'
../include/osmocom/core/logging.h:168: note: previous declaration of 'logp2' was here
make[3]: *** [logging.lo] Error 1
2012-07-12 09:26:25 +02:00
Andreas Eversberg 2d6563b78e logging: Avoid compiler warnings when compiling c++ code
this patch i use to suppress warnings when compiling osmo-pcu (c++).
since __FILE__ is constant, the called logging function with parameter
"file" must be constant too, in order to avoid compiler warnings.
2012-07-10 13:10:15 +02:00
Diego Elio Pettenò 23431c75c8 codec: make data tables constant.
When declaring them constant, they are written on the .rodata section
instead of .data, which means that they can be mapped directly from
disk to memory.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:44 +02:00
Diego Elio Pettenò f5df9ab549 build: use the standard AM_V_GEN definition for output.
This actually allows for the command to be printed if using `make V=1`

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Diego Elio Pettenò d471a21920 build: simplify headers management and remove recursion
There is no real reason to keep the include directory a multi-level
recursion, so instead declare everything within include (so that we
can use proper nobase_ declarations) and be it.

Please note that since we removed the sub-Makefile.am, ./configure
will not create the directory structure for us on out-of-tree builds,
so we have to make sure the directory we're generating to exists first.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Harald Welte 327009e420 GAN/UMA: use correct IE Identifier foer T3920
As Dieter found out, there has been a mix-up of 3902 with 3920 :/
2012-06-29 21:14:52 +02:00
Harald Welte c17f570538 ganc: add value_strings for GAN message type and protocol discriminator 2012-06-24 21:52:07 +02:00
Harald Welte c2a25c67f8 44.318: Add missing message types 2012-06-24 20:30:20 +02:00
Harald Welte 727399461d Fix bit-endianness in UMA/GAN definitions 2012-06-24 19:46:37 +02:00
Harald Welte 2b1ab863e1 44.318: add structure describing Control Channel Description IE 2012-06-24 16:52:46 +02:00
Harald Welte 53c815b7ae gsm_44_318: add protocol discriminator enum and data[0] array to hdr 2012-06-23 21:54:46 +02:00
Harald Welte 4498a0ac85 gsm_44_318.h: fix syntax errors in GAN definitions 2012-06-23 20:46:48 +02:00
Harald Welte b21825effc linuxrbtree: don't use 'new' as argument name to avoid C++ incompatibility 2012-06-18 12:18:46 +08:00
Harald Welte 641f7cee5d libosmogb: move files to proper location and fix build 2012-06-17 23:05:26 +08:00
Harald Welte e02b9f404c add GPRS/Gb related osmo_prim SAPs 2012-06-17 14:09:25 +08:00
Harald Welte d85d0159a5 add library VTY nodes for NS and BSSGP 2012-06-16 16:54:19 +08:00
Harald Welte 8cce125ff9 signal: add SS_L_NS as a signal subsystem for NS code in libosmo-gb 2012-06-16 16:37:57 +08:00
Harald Welte 81cd54a0c3 add GSM_LCHAN_PDTCH 2012-04-19 23:19:10 +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
Holger Hans Peter Freyther 738f13395d vty: Add a function to write the current config to a file. 2012-03-28 17:53:27 +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
Holger Hans Peter Freyther 58d3153249 misc: Fix warning when compiling telnet_interface.c
In file included from telnet_interface.c:30:0:
osmocom/core/socket.h:25:4: warning: 'struct osmo_fd' declared inside parameter list [enabled by default]
telnet_interface.c: In function 'telnet_init_dynif':
telnet_interface.c:84:4: warning: passing argument 1 of 'osmo_sock_init_ofd' from incompatible pointer type [enabled by default]
osmocom/core/socket.h:24:5: note: expected 'struct osmo_fd *' but argument is of type 'struct osmo_fd *'
2012-03-16 09:18:12 +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
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 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
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
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 a5ab1620f4 auth_core: add functions for parsing algorithm names 2011-12-07 02:33:11 +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 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 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 03d2c8906b core/conv: Minor documentation improvements
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 11:53:49 +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 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 4cfbae8152 utils: Add declaration back for osmo_osmo_hexdump_nospc
As it turns out, if a project uses the old name but without a declaration,
it'll causes a segfault on 64 bits platform (because of the implicit
int return type which doesn't apply since here it's a pointer).

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 23:04:00 +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 c626da9f87 gsm/sms: Added DLSMS debugging
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 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 f948dbc442 vty: Fixed vty_down_level to move down from config nodes
When using ^D at config nodes above the CONFIG_NODE, the
go_parent_cb function is used to go down by one node. This
is equivalent to "exit" command.

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 dc3be0a653 vty/telnet_interface: Add telnet_exit function
This frees socket and pending connections

Written-by: Andreas Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:36 +01:00
Sylvain Munaut 2179f402e0 core/rbtree: add const qualifier to some functions
See kernel commit f4b477c47332367d35686bd2b808c2156b96d7c7

----
The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls
take a pointer to an RB node or RB root. They do not change the
pointed objects, so add a 'const' qualifier in order to make life
of the users of these functions easier.

Indeed, if I have my own constant pointer &const struct my_type *p,
and I call 'rb_next(&p->rb)', I get a GCC warning:

warning: passing argument 1 of ?~@~Xrb_next?~@~Y discards qualifiers from pointer target type

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:23:35 +01:00
Sylvain Munaut ff23d24972 utils: Fix a bad double osmo_ prefix for osmo_hexdump_nospc
Hopefully no project where using them it seems

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-10 23:03:18 +01:00
Sylvain Munaut 07f1103782 timer: Add compatibility header with timer helpers
Some of these are not always present, especially when cross compiling

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-21 21:55:29 +02:00
Pablo Neira Ayuso 066c912fd3 timer: add scalable RB-tree based timer infrastructure
This patch adds RB-tree based timers which scales better than the
previous list-based implementation.

It does not require any API changes. It breaks ABI because the
osmo_timer_list structure has changed though (to avoid this in
the future, we can put internal data in some private structure).

The following table summarizes the worst-case computational complexity
of this new implementation versus the previous one:

                                rb-tree         list-based
                                -------         ----------
calculate next timer to expire  O(1)            O(n)
insertion of new timer          O(log n)        O(n)
deletion of timer               O(log n)        O(1)
timer-fired scheduler           O(log n)        O(3n)

The most repeated cases are:

* the calculation of the next timer to expire, that happens in every
  loop of our select function.

* the timer-fired scheduler execution.

This new implementation only loses in the deletion of timer scenario,
this happens because we may need to rebalance the tree after the
removal.

So I think there is some real gain if we have some situation in which
we have to handle lots of timers.
2011-10-17 13:25:29 +02:00
Pablo Neira Ayuso f74db0b33d add rb-tree implementation to libosmocore
This patch adds red black trees implementation to libosmocore.
This data structure is very useful to search for elements in
ordered sets in O(log n) instead of O(n) that lists provide.

The first client of this code will be one follow up patch that
implements rbtree-based timer scheduler.
2011-10-17 13:25:29 +02:00
Harald Welte 226ef1d143 add header file containing UMA/GAN protocol definitions 2011-10-10 09:21:27 +02:00
Andreas Eversberg 78122ab568 Added defines to use primitive/operation tuples in switch/case statements 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
root 8a996b4844 Changed logging of LAPD from DLLAPDM to DLLAPD 2011-10-10 08:38:58 +02:00
Sylvain Munaut f84571d0f4 gsmtap: Add type/subtypes for GMR-1 protocol
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-09 16:57:33 +02:00
Harald Welte ccd040f61e GSMTAP: Add comments to explain how to make GSMTAP changes 2011-10-08 14:40:14 +02:00
Harald Welte fae779ac54 GSMTAP: Import changes from Wireshark
There have been some changes in the wireshark source code that have
never been submitted to gsmtap.h

GSMTAP_CHANNEL_PACCH has been defined in an incompatible way in mainline
wirshark :(
2011-10-08 14:40:09 +02:00
Sylvain Munaut 15ae715b0d gsmtap: Add a _ex version of gsmtap_{makemsg,send} to specify content type
From: iZsh <izsh@fail0verflow.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-26 13:05:07 +02:00
Harald Welte aa244bfe63 bring gsmtap.h in sync with recent wireshark additions 2011-09-26 00:24:59 +02:00
Sylvain Munaut 2749c0bfbf core: Add generic CRC functions (templates expended to 8 16 32 64 bits)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-16 22:59:18 +02:00
Alexander Huemer 4d7bcea870 correct declaration of osmo_sitype2rsl 2011-09-05 09:50:47 +02:00
Harald Welte d61d517a2e add missing declarations of cfg_description_cmd to vty/vty.h 2011-09-04 22:56:10 +02:00
Sylvain Munaut fe28dedd4c core/serial: Add utilities to deal with serial ports
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 22:21:09 +02:00
Sylvain Munaut bf9d25039c build/include: Only install headers for enabled options
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 20:41:42 +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
Christoph Fritz ab7c9c766b logging: include stdarg.h for va_list
fixes tiny compile error:

  CC     socket.lo
  In file included from socket.c:13:
  ../include/osmocom/core/logging.h:31: error: expected declaration
specifiers or ‘...’ before ‘va_list’
  make[3]: *** [socket.lo] Error 1
2011-09-01 17:44:35 +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
Holger Hans Peter Freyther c2c0ad7832 signal: Fix compiler warning about signedness of constant
Use the u suffix to mark the constant as unsiged integer.

This fixes:
warning: this decimal constant is unsigned only in ISO C90
2011-08-22 15:31:17 +02:00
Harald Welte be145198df doxygen: document some more structure members for RSL 2011-08-18 11:45:18 +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 eee3790d24 doxygen: Add documentation for prim.h 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
Harald Welte bd598e3c5e start to add doxygen documentation to libosmocore headers 2011-08-16 23:26:52 +02:00
Harald Welte 2af435986f fix off-by-one error in OSMO_NUM_DLIB
This bug was introduced in 95f7eb288c and
it caused a segfault on 'write terminal'
2011-07-29 15:12:41 +02:00
Harald Welte 430be84994 add definition of OSMO_MIN macro, similar to OSMO_MAX 2011-07-27 23:28:41 +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
Holger Hans Peter Freyther c0dbe0be05 vty: Increase the number of arguments one can have in VTY commands
For some interactive commands (e.g. sending a SMS in OpenBSC) we
are using the "NAME." arg definition. For the usecase of sending SMS
it is not enough to only allow about 13 spaces. Increase the limit.

Original patch is coming from Dennis Wehrle.
2011-07-24 19:58:06 +02:00
Harald Welte b7b61236d8 don't call a function argoment 'class' for the benefit of c++ users
This had broken lcr compilation...
2011-07-23 10:50:36 +02:00
Holger Hans Peter Freyther 59b3175dfb ipaccess: Reserve an extensions for an external SMSC connection
This could be used to submit SMS to OpenBSC and to get informed
about new SMS coming from OpenBSC.
2011-07-23 09:59:24 +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
Harald Welte c5a0ded53f mkae the new 'void *dst' member part of a union with the trx pointer
this ensures struct msgb is the same size as before, which will ensure
binary compatibility
2011-07-18 17:00:08 +02:00
Pablo Neira Ayuso 2ade3a0222 vty: reserve nodes for libosmo-abis
This patch reserves E1INP_NODE and IPA_NODE for libosmo-abis
VTY interfaces.
2011-07-18 17:00:08 +02:00
Pablo Neira Ayuso 29cbf618e3 msgb: add ->dst attribute to store routing information
This patch adds a new attribute to msgb objects. This new
attribute will store a pointer to the routing information,
in the case of the A-bis link, this will be used to store
e1inp_sign_link instead of struct gsm_bts_trx.

This deprecates msg->trx, that can be removed once all
application are ported to use msg->dst.
2011-07-18 17:00:08 +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
Pablo Neira Ayuso 39c0243d9b signal: reserve signal subsystems >= INT_MAX/2 for libraries
The first range (from 0 to INT_MAX/2) of signal subsystems can be
used by client applications while the second range (from INT_MAX)
is reserved for libraries.

This is useful to support signals defined in libraries that
may be used by different client applications.
2011-07-18 17:00:07 +02:00
Harald Welte e0aa5bb9f7 gsm 04.80: fix typo (256, not 265!)
This was introduced by me in commit
79599ba0eb

Thanks to Alexander Huemer for detecting it
2011-07-16 15:42:46 +02:00
Harald Welte 39b44bbca7 gsm 04.80: ussd_request.text can contain 0xff, needs to be unsigned
Found by Smatch
2011-07-16 13:28:59 +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 95b2b47b26 get rid of non-ANSI function declarations missing (void)
Detected by Smatch
2011-07-16 12:03:46 +02:00
Harald Welte 87dbca148f don't use signed bit-fields
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
Harald Welte 9b837e6fda gsm 08.08: add value_strings and gsm0808_msg_name() function 2011-07-11 17:45:31 +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 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
Harald Welte 94df39e905 add some utility functions for paging related calculation (TS 05.02) 2011-06-26 14:40:12 +02:00
Harald Welte 2aee7b14ca add gsm48_number_of_paging_subchannels() function
(from openbsc's rsl_number_of_paging_subchannels)
2011-06-26 14:20:04 +02:00
Harald Welte e9b744e581 add MAX() macro as OSMO_MAX 2011-06-26 14:19:54 +02:00
Harald Welte 32e1f239b3 merge process.[ch] with application.[ch] 2011-06-26 14:14:05 +02:00