Commit Graph

354 Commits

Author SHA1 Message Date
Harald Welte 641f7cee5d libosmogb: move files to proper location and fix build 2012-06-17 23:05:26 +08:00
Harald Welte 2d52d10a52 add additional newline in vty welcome message 2012-06-16 17:01:29 +08:00
Harald Welte 8b0d5b3726 VTY: safe version of printing VTY welcome message
The old method used raw writes to the telnet FD, which is bad for
several reasons:
  a) we don't know if we can actually write that many bytes to the
     socket at the given time
  b) the socket is still in blocking mode, so we could stall the entire
     process
  c) there may be weird interaction with the buffered writes of the
     vty_out

Now, the print_welcome() functionality has moved to vty_hello() instead,
where we can use normal vty_out() in buffered mode.

This commit is expected to fix the garbled welcome message on arm-eglibc
targets.

It might still be a good idea to migrate the entire telnet interface to
libtelnet - but at some later time ;)
2012-06-03 12:44:38 +02:00
Sylvain Munaut 98d77bd4dc src/codec: Fix typo in Makefile
Thanks to horizon for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-05-14 20:40:39 +02:00
Harald Welte 973c3c3f24 LAPDm: Ensure there is no payload in DISC frames
When we send DISC frames (especially generated from RSL), we don't want
any remaining bytes from the RSL message showing up as bogus DISC
payload.
2012-04-26 22:15:12 +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
Harald Welte bc32d051bf sync prototype of osmo_sockaddr_is_local with declaration
in e476442cf0 we changed from sockle_t
to unsigned int, but only in the header, not in the implementation!
2012-04-08 11:32:18 +02:00
Harald Welte df90aedcc7 libosmogsm: Add tvlv_att_def to exported symbols 2012-04-05 01:42:00 +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 3e071446be lapdm: fix RSL message format in RLL ERROR INDICATION
In rsl_rll_error() we don't need to re-set the msg->l2h as that would
corrupt the message.  The recipient would interpret any cause value
as 0.
2012-04-05 00:28:38 +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
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
Harald Welte 042afe7fe7 milenage: Add function to compute OPC from OP and K 2012-03-21 08:19:47 +01:00
Holger Hans Peter Freyther fb6a2e274f lapd: Remove unused variable t200_start in lapd_acknowledge.
lapd_core.c: In function 'lapd_acknowledge':
lapd_core.c:710:38: warning: variable 't200_start' set but not used [-Wunused-but-set-variable]
2012-03-16 10:35:38 +01:00
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
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 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
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
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 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 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 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 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
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 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 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 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
Pablo Neira Ayuso a71b8eaca7 timer: Better fix to the timer re-scheduling situation
As it turns out, the previous fix didn't cover the case of a
timer X being re-scheduled inside a timer call back expiring at
the same time as the previous X instance.

Written-by: Pablo Neira Ayuso <pablo@gnumonks.org>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13 10:11:31 +01:00
Sylvain Munaut cc90d494ce gsm/gsm0411_smc: Fix typo
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-12 23:52:40 +01:00