Commit Graph

378 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 8297c819e9 vty: Add xsd and a command that can generate the documentation.
When building the doxygen documentation do not remove the other
VTY documentation files in the doc/vty folder. Create a command
that can be installed to dump all nodes and commands as XML on
the given VTY. Create a schema for the XML file and a XSL-T script
that can merge the generated file with additional information.
2012-07-25 11:58:58 +02:00
Andreas Eversberg aa5d0e8894 Fix encoding of BSSGP_IE_NUM_OCT_AFF in bssgp_tx_llc_discarded()
This is a 24bit integer value, and thus we need to encode the three
least significant octets of the network-byte-order 32bit value, not the
three most significant octets.
2012-07-21 13:33:39 +02:00
Harald Welte 007a71e332 authentication: More documentation 2012-07-18 19:47:56 +02:00
Harald Welte a9e4a1402b backtrace: update copyright notice
Holger wrote that function and I made the logging version of it.  The
header was copied during the separation of backtrace.c from gsm_utils.c
in the past, and of course gsm_utils.c had more people involved...
2012-07-14 12:31:55 +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 a9250b9ebc gsm48_decode_lai(): return real integers for mcc/mnc, not hex!
This is to make it orthogonal with gsm48_encode_lai()
2012-07-13 22:57:31 +02:00
Harald Welte e866473f2a add gsm48_decode_lai() to map file 2012-07-13 21:48:35 +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
Holger Hans Peter Freyther 3c16de2954 freebsd: Make libgb compile on FreeBSD
Include header files for recfrom/AF_INET and include a
struct ip_hdr as it is not available on *BSD.
2012-07-12 14:13:41 +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
Alexander Huemer e62651f220 correct inverted logic from commit f3ba8a 2012-07-11 11:00:02 +02:00
Harald Welte 2d956a82c8 bssgp: check for IMSI being a null pointer, not just an empty string. 2012-07-04 21:55:23 +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
Diego Elio Pettenò f3ba8abc97 vty: avoid using a .data variable.
no_password_check was the only initialized, non-relocated data in the
set of libraries, inverting its logic let us keep it in .bss
(non-initialized data, which is mapped to the zero page).

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:44 +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ò 7e007e0f87 build: avoid multi-level recursion for src/ directory.
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Diego Elio Pettenò a1ed2f0bb1 build: use BUILT_SOURCES for the generated source files.
This avoids possible race conditions on heavily multi-core systems.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +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
Harald Welte c17f570538 ganc: add value_strings for GAN message type and protocol discriminator 2012-06-24 21:52:07 +02:00
Harald Welte 0b2a316adb add missing Makefile.am for libosmo-gb 2012-06-19 14:23:21 +08:00
Harald Welte fcaa80553e libosmogb: export btsctx_* functions
Those should be private, but osmo-pcu currently needs them...
2012-06-18 12:19:14 +08:00
Harald Welte c241404f5e libosmogb: export missing symbols 2012-06-17 23:32:48 +08:00
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