Commit Graph

47 Commits

Author SHA1 Message Date
Harald Welte c0f0007292 import oap message parsing / encoding from openbsc.git; AGPL->GPL
In the process, also:
* Change the license from AGPLv3 to GPLv2-or-later;
* correct spelling of 'sysmocom' to lowercase;
* add '2016' to the copyright;
* rename to osmo_*;
* add API docs;
* add logging category DLOAP: define id and add to internal_cat;
* redirect all oap.c logging to DLOAP.

A unit test will follow in a subsequent patch, since it needs a minor tweak for
decoding of boolean values.

The related openbsc change-id is I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf.

Tweaked-by: Neels Hofmeyr
Change-Id: If5099e60681a215e798b6675f21813f26769c253
2016-12-11 03:42:58 +01:00
Vadim Yanitskiy d2d9760c08 utils/conv_gen.py: generate a single file
Instead of generating every convolutional code into a separate
file (such as conv_xcch_gen.c, conv_cs3_gen.c), it is better to
have a single file, containing all definitions, because as many
convolutional codes we add, as many entries we will have to add
into 'src/gsm/Makefile.am'. This approach increases readability
of the Makefile.am, and also makes us able to share some data
between some convolutional code definitions.

For example: xCCH, RACH, SCH, TCH/F, both CS2 and CS3 may use
the same *_state[][2] and *_output[][2] arrays within a single
file. This optimization is currently WIP.

Change-Id: Ib4e4ee5fdde38429e68e3b2fa50ec03a18f59daa
2016-10-23 07:38:15 +00:00
Neels Hofmeyr 2b3c228416 gsm/Makefile.am: use proper top_builddir/top_srcdir paths
This fixes the conv*gen.c targets when building in a different directory
than the source tree.

Notably, building in a different dir worked when the generated sources were
already present from a previous build inside the source directory.

Change-Id: I5a9b780ad4ba607ea39854dcf7207ed05f5447bc
2016-10-12 22:50:24 +00:00
Tom Tsou 9a5bbf36b5 egprs: Add CPS tables from TS 04.60
Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP
TS 04.60. Currently osmo-bts-trx is the only user of CPS table
values, but this may change with gprsdecode and other utilities.

Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
2016-07-25 18:33:26 +00:00
Max 4f169500df Add GEA3 & GEA4 ciphers
Corresponding test code include both official test vectors from the
specs and data from over-the-air tests.

This obsoletes libosmo-crypt-a53 as it was last missing piece
unimplemented in libosmogsm.

Change-Id: I939e4f6b91b4a7c591ef3761fe2d46ed1c2fb2d3
Related: OS#1582
2016-07-11 19:15:24 +00:00
Harald Welte 3b6fb0880c import gprs_gsup_message.[ch] from openbsc as gsup.[ch]
Move those routines from OpenBSC to libosmogsm, so they can be
re-used from other programs.  I think it was a mistake to add them only
inside the openbsc repository in the first place.  We need to pay more
attention to this in the future.
2016-05-06 11:21:06 +02:00
Harald Welte 64f38c0410 import gsm_04_08_gprs.[ch] from openbsc.git
The definitions in this header file (and associated strings in the
c file) are generic about the GPRS Layer3 signalling protocols, and
thus should be part of the library.
2016-05-05 18:49:27 +02:00
Holger Hans Peter Freyther 3a96d2837c conv_gen: Use python2 to execute the script
The script does not work with python3:

$ python3 utils/conv_gen.py
  File "utils/conv_gen.py", line 124
    def _print_term(self, fi, num_states, pack = False):

Second there is no 'python' on FreeBSD and one needs to select
the major version to use.

  GEN      conv_cs3_gen.c
  GEN      conv_xcch_gen.c
  GEN      conv_cs2_gen.c
python: not found
python: not found
python: not found

By using python2 we solve both issues. On Debian python2 is located
inside the python-minimal package.
2016-04-29 21:24:48 +02:00
Harald Welte 84da22f964 Add code generator for convolutional codes
Add python utility to generate .c code with convolutional
encoder/decoder based on polynomial description of the code. If argument
given it'll be interpreted as intended output directory, otherwise
current working directory is used.

Codes for *CCH, CS2/3 and TCH/AFS are generated. Corresponding manual
implementations are removed from tests. This introduce build-time
dependency on python.

The main work for this patch was generously contributed by Sylvain
Munaut.

Fixes: OS#1629
2016-04-29 13:17:22 +02:00
Harald Welte 90e614f7cc remove our internal copy of talloc, use system libtalloc
Shipping our own private copy of talloc was a good idea in 2008,
when it was not readily available on most target platforms.  Today,
the situation is quite different, as it is a standard library on
major Linux distributions.
2015-12-05 23:38:18 +01:00
Jan Engelhardt c2ddc4f555 build: have a disable-static build succeed
When using configure --disable-static, no libosmogsm.a will be
created, and the tests fail to link because symbols like _a5_3 and
_a5_4 are not exported through the only remaining libosmogsm.so.

A method to overcome this is an intermediate private non-distributed
library, examples of which are present in e.g. libabc, kmod and
systemd.

With this, disable-static can now be the default and practical compile
time be halved.
2015-09-16 18:08:48 +02:00
Harald Welte 908085ccbc Add APN utility function to libosmogsm
The current functions are used to 'qualify' an APN from the
user-supplied APN name (name identifier) towards the fully-qualified
APN name which is used in the .grps DNS zone.
2015-05-25 11:12:16 +08:00
Harald Welte 783d073a37 add gsm0341_test to generate SMSCB hex strings
Those hex strings can then be copy+pasted into the OSmoNITB VTY
2014-12-29 17:09:11 +01:00
Jan Engelhardt 9ffeb9756a build: remove unused all_includes and use AM_CPPFLAGS
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the
unused all_includes variable, which is never set.
2014-10-03 08:48:31 +02:00
Holger Hans Peter Freyther 96af78650d misc: Look into the build directory for generated files
the bits/crc files are not inside the sourcedirectory but will end
in the build directory. Go and look there as well. This somehow
doesn't fail with make distcheck but when building for Yocto Dizzy.
2014-09-25 18:18:49 +02:00
Harald Welte 336915aa0a prepare for 0.7.0 release 2014-08-21 15:53:20 +02:00
Harald Welte e391996947 ipa: rename functions for consistency
As we are breaking builds by moving functions from libosmo-abis to
libosmocore anyway, we might as well give functions more appropriate
names.  ipaccess is a company, while IPA is the multiplex protocol, and
CCM is the protocol used for establishing identities on the IPA
multiplex.
2014-08-20 23:16:36 +02:00
Harald Welte 28aa991c2f import various generic IPA related functions from libosmo-abis
libosmo-abis is about forming A-bis interfaces/lines by means
of E1 or the IPA multiplex (or possibly other link layers).

The IPA multiplex is used in other contexts, such as the Control
interface, or the A interface.  In that context, it makes sense to
have generic IPA related functions in libosmocore.
2014-08-20 23:16:34 +02:00
Sylvain Munaut 579a7103a1 gsm: Add Kasumi cipher implementation
Submitted-by: Max <max.suraev@fairwaves.co>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16 14:59:30 +02:00
Holger Hans Peter Freyther 0c50b17a26 Release: Prepare the release of 0.6.6 2014-03-31 15:40:46 +02:00
Kevin Redon be355cd78a implement COMP128 version 2 and 3 A3/A8 algorithm
simple copy into C from reversed code from www.hackingprojects.net
2013-11-03 15:05:25 +01:00
Holger Hans Peter Freyther f136013f0d gsm: The LAPDm prim/structs changed, increment current version 2013-08-09 17:41:34 +02:00
Holger Hans Peter Freyther 45cdaa095a cygwin: Link many libraries with -no-undefined to create a dll
Only the Gb library relies on having undefined references to a
symbol that needs to be provided by the host application. For
all other libraries we can link with -no-undefined.
2013-03-03 10:10:07 +01:00
Sylvain Munaut 5689a3b744 build: Don't use the deprecated INCLUDES in the various Makefile.am
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-11 23:59:31 +01:00
Tobias Engel 597460fd97 Do not use --version-script linker flag on OSX
Add a check to not use --version-script linker flag if compiled on OSX
since it doesn't exist there
2012-10-27 10:03:12 +02:00
Harald Welte 335aedabf2 increaes libosmocgsm LIBVERSIN due to gsm_decode_lai() change 2012-08-03 10:51:10 +02:00
Diego Elio Pettenò c5f055f9e5 build: use LT_INIT(pic-only) instead of forcing -fPIC.
This actually allows for the user to override the decision and at the
same time supports compilers that might not be able to use -fPIC at
all.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:44 +02:00
Harald Welte c17f570538 ganc: add value_strings for GAN message type and protocol discriminator 2012-06-24 21:52:07 +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 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 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 75524cbabd increment LIBVERSION of libosmocore for new api 2011-12-01 21:12:11 +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
Harald Welte 17f56f385b update LIBVERSION to reflect new API additions 2011-10-10 08:46:40 +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 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 1f0b8c26f7 add LAPDm code from osmocom-bb into libosmocore 2011-06-27 10:51:37 +02:00
Harald Welte ea19c97816 import gsm0502_calc_paging_group() from openbsc 2011-06-26 14:47:16 +02:00
Harald Welte b5503136fa Import sytem information related definitions + code from openbsc 2011-05-24 15:01:53 +02:00
Harald Welte f7a1bcce0c abis_nm: import definitions and common code on A-bis OML from OpenBSC 2011-05-22 22:45:16 +02:00
Harald Welte 7533705ab1 libosmocore: bump library interface version to '1' for new osmo_ names 2011-05-08 14:35:40 +02:00
Sylvain Munaut f1d3344781 gsm/a5: Add a A5 1&2 implementation
It's always useful to have around

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-26 14:40:49 +02:00
Pablo Neira Ayuso fba495e5f6 This patch moves the GSM-specific functions to the new library
libosmogsm which is provided by libosmocore.

I have also moved generate_backtrace() to backtrace.c instead
of gsm_utils.c, otherwise the timer and msgfile tests depend on
libosmogsm.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:08:08 +01:00