Harald Welte [Sat, 19 Feb 2011 07:10:51 +0000 (16:10 +0900)]
vty: Revert Makefile.am change for libosmocore dependency
Harald Welte [Fri, 18 Feb 2011 20:03:27 +0000 (21:03 +0100)]
LOGGING: remove duplicated code between vty-logging and cfg-logging
Harald Welte [Fri, 18 Feb 2011 19:39:36 +0000 (20:39 +0100)]
LOGGING: Add missing 'nat' subsystem
Harald Welte [Fri, 18 Feb 2011 19:37:04 +0000 (20:37 +0100)]
LOGGING: configure logging from the vty
We can now configure logging to (multiple) files, stderr and syslog
from the vty command line in a persistent way (config file)
Harald Welte [Thu, 17 Feb 2011 14:56:56 +0000 (15:56 +0100)]
LOGGING: Add syslog log target
Harald Welte [Thu, 17 Feb 2011 14:52:39 +0000 (15:52 +0100)]
LOGGING: Pass the log level down to the log target output function
This will be required for mapping osmocore log levels to syslog priorities.
Holger Hans Peter Freyther [Mon, 14 Feb 2011 23:42:19 +0000 (00:42 +0100)]
write_queue: Only pop the queue if it is not empty
It is possible that the queue is cleared after the select
and before the callback for writable is called. Check if
the list is not empty brefore taking an item out of it.
Harald Welte [Tue, 8 Feb 2011 15:56:23 +0000 (16:56 +0100)]
[utils] introduce ubit_dump to dump buffers of unpacked bits
Harald Welte [Tue, 8 Feb 2011 15:55:03 +0000 (16:55 +0100)]
[utils] add 'bitdump' function for bitfields
Holger Hans Peter Freyther [Fri, 28 Jan 2011 09:13:41 +0000 (10:13 +0100)]
gsmtap: The TETRA_AACH was defined twice, remove one, renumber
The GSMTAP_TETRA_AACH was defined twice. On the tetra list we
decided to remove the second entry and renumber the list as no
one is using this yet.
Holger Hans Peter Freyther [Sat, 22 Jan 2011 22:17:21 +0000 (23:17 +0100)]
logging: Add isup,m2ua,pcap from the cellmgr.
This is something that we should generate dynamically from
the log_info as well. This is adding bits from the cellmgr_ng.
Christian Vogel [Sat, 22 Jan 2011 21:48:37 +0000 (22:48 +0100)]
ubit2pbit flushes at the wrong moment, added one note to bits.h
(e.g. input2[] test sequence from testra/crc_test
decodes incorrectly to packed bits: 90 b0 3e 80 03 87 53 bd 6f 08,
this patch fixes it)
Sylvain Munaut [Fri, 21 Jan 2011 11:22:30 +0000 (12:22 +0100)]
bits: Add extended options version of pbit2ubit and ubit2pbit
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Harald Welte [Wed, 19 Jan 2011 09:10:16 +0000 (10:10 +0100)]
[BITS] introduce new packed/unpacked bit conversion routines
Harald Welte [Wed, 19 Jan 2011 08:40:59 +0000 (09:40 +0100)]
[gsmtap] extend GSMTAP for TETRA
Harald Welte [Tue, 18 Jan 2011 20:38:12 +0000 (21:38 +0100)]
gsmtap.h: Add some more comments
Holger Hans Peter Freyther [Sun, 16 Jan 2011 16:38:22 +0000 (17:38 +0100)]
msgb: Make sure at compile time that headroom is smaller than size
All current code is using constants to allocate the msgb with
headroom. Use a static_assert to make sure that the headroom
is smaller than the size. This makes API misusage unlikely to
happen.
Holger Hans Peter Freyther [Sun, 16 Jan 2011 16:37:27 +0000 (17:37 +0100)]
misc: Move the static_assert from logging to the utils
This is just an ordinary macro, no specific reason to
have it in logging.h. This was compile tested with code
from our osmo family.
Alex Badea [Sat, 15 Jan 2011 17:43:42 +0000 (19:43 +0200)]
gsm 03.41: fix GSM341_MSG_CODE macro argument
One usage of the "ms" argument is typoed as "msg". Fix it to prevent
subtle future failures. Also paranthesize the macro argument for good
measure.
Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
Holger Hans Peter Freyther [Thu, 13 Jan 2011 11:31:25 +0000 (12:31 +0100)]
debian: Make the -dev package depend on the normal one
Make libosmocore-dev depend on libosmocore. Otherwise
we only end up with the libosmocore.a files installed
and then have various issues with the link order when
linking OpenBSC and such.
Holger Hans Peter Freyther [Thu, 13 Jan 2011 10:09:44 +0000 (18:09 +0800)]
debian: Switch to the 3.0 git format, update version, fix depends
Switch to the git format as this can generate the source directly
from the git checkout. Increase the version number to 0.1.27 as this
is the latest tag, depend on autoconf, automake and libtool and use
autoreconf when building to be able to directly build from a git
clone.
Sylvain Munaut [Mon, 3 Jan 2011 21:19:40 +0000 (22:19 +0100)]
vty: Fix typo testing return value of bind
Thanks to playya__ (Dr. Fred) on IRC for pointing this out
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Wed, 29 Dec 2010 20:14:20 +0000 (21:14 +0100)]
smscb: Add definition of a warning message
Holger Hans Peter Freyther [Wed, 29 Dec 2010 20:13:44 +0000 (21:13 +0100)]
smscb: Ignore the very simple test application.
Holger Hans Peter Freyther [Wed, 29 Dec 2010 11:00:01 +0000 (12:00 +0100)]
smscb: Mention 23.041 and fix the size of the update number
Holger Hans Peter Freyther [Wed, 29 Dec 2010 10:57:48 +0000 (11:57 +0100)]
smscb: Add some simple decoding routines for SMSCB.
Harald Welte [Fri, 24 Dec 2010 14:10:14 +0000 (15:10 +0100)]
Use the app_info->name instead of the hostname
This makes more sense in case you run BCS, SGSN and other components
on the same host. Having multiple telnet sessions with the same
prompt can otherwise be confusing.
Holger Hans Peter Freyther [Mon, 20 Dec 2010 12:38:22 +0000 (13:38 +0100)]
rate_ctr: No need to include the inttypes.h
There should not be any u_int*_t types in this file, no need
to include this file. It is breaking compilation with the last
x86 build of GNU ARM for GCC 3.4.
Alex Badea [Sat, 27 Nov 2010 21:35:08 +0000 (23:35 +0200)]
protocol: introduce gsm_03_41.h
This currently contains definitions for the BTS->MS SMSCB message.
Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
Alex Badea [Sat, 27 Nov 2010 21:34:46 +0000 (23:34 +0200)]
gsm_08_58: add struct and constants for RSL_IE_CB_CMD_TYPE
Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
Alex Badea [Sat, 27 Nov 2010 18:00:39 +0000 (20:00 +0200)]
gsm_04_12: fix 04.13 typos
There are two occurrences of "413" in the 04.12 header file.
These are probably typos; correct them to "412".
Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
Holger Hans Peter Freyther [Fri, 19 Nov 2010 18:20:46 +0000 (19:20 +0100)]
utils: Fix typo. It is ascii.
Harald Welte [Thu, 18 Nov 2010 22:54:20 +0000 (23:54 +0100)]
gsmtap.h: Add GSMTAP_TYPE_SIM
Sylvain Munaut [Sat, 13 Nov 2010 21:47:47 +0000 (22:47 +0100)]
Move the generate backtrace call from MSGB_ABORT to osmo_panic handler
This has two benefits:
- All people calling osmo_panic() will have the backtrace
- It makes the thing build in 'target' mode in osmocom-bb
And one downside:
- The osmo_panic handler is now in the backtrace
(I can live with that :)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sat, 13 Nov 2010 17:00:25 +0000 (18:00 +0100)]
panic: Fix type warning - osmo_panic_handler_t is already a pointer ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sat, 13 Nov 2010 16:51:37 +0000 (17:51 +0100)]
gsm_utils: Define 4 upper bits as "flags" and mask them out in utility functions
This way those function don't care about the flags they don't know about
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Harald Welte [Tue, 9 Nov 2010 12:42:26 +0000 (13:42 +0100)]
msgb: fix printing of msgb pointer during MSGB_ABORT()
Harald Welte [Tue, 9 Nov 2010 12:41:48 +0000 (13:41 +0100)]
msgb: don't compare unsigned int with int (fix lcr build)
Harald Welte [Fri, 5 Nov 2010 06:50:40 +0000 (07:50 +0100)]
msgb_abort(): better formatting
Harald Welte [Fri, 5 Nov 2010 06:49:39 +0000 (07:49 +0100)]
generate backtrace in msgb_abort()
This helps us to debug where we encounter insufficient headroom...
Harald Welte [Fri, 5 Nov 2010 06:47:41 +0000 (07:47 +0100)]
Change msgb_abort() function in MSGB_ABORT argument with variable arguments
This enables callers to provide format string and arguments to it
Also, put conditionals into the macro, and remove them from the caller
site.
Holger Hans Peter Freyther [Thu, 4 Nov 2010 11:42:50 +0000 (12:42 +0100)]
gsm0808: Move the clear request from bsc_msc_ip to here
This method should use the msgb_tlv_put routines instead
of the stuff it is doing. This will be cleaned up.
Holger Hans Peter Freyther [Thu, 4 Nov 2010 11:26:06 +0000 (12:26 +0100)]
gsm0808: Add a method to create a new DTAP message with a msgb
Harald Welte [Sun, 31 Oct 2010 12:56:45 +0000 (13:56 +0100)]
select.c: Change license terms from GPLv2 (from ulogd) to GPLv2+
Holger Hans Peter Freyther [Wed, 27 Oct 2010 10:36:05 +0000 (12:36 +0200)]
gsm0808: Fix the format of the clear IE...
This is really TLV...
Holger Hans Peter Freyther [Wed, 27 Oct 2010 09:49:24 +0000 (11:49 +0200)]
gsm0808: Add a method to create a clear command message.
Use the msgb_tv_put functions for putting the data into
the message. Do not support the extended error reports.
Holger Hans Peter Freyther [Tue, 26 Oct 2010 07:31:16 +0000 (09:31 +0200)]
msgfile: Allow to have comments in the simple CSV file
Sylvain Munaut [Sun, 24 Oct 2010 19:13:40 +0000 (21:13 +0200)]
codec: Fix bit order table definition for GSM HR
There is two tables: one for unvoiced frames and one for voiced frames.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sun, 24 Oct 2010 16:23:10 +0000 (18:23 +0200)]
codec: Add the missing bits for include to install and pkgconfig to work
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Andreas.Eversberg [Sun, 24 Oct 2010 09:59:33 +0000 (11:59 +0200)]
bitvec: Fix decoding of H / L values
it returns if a given bit in the vector is "high" or "low".
the bitval that represents "high" depends on the bit position.
bitval2mask returns that. so we must check if the bit in the vector
equals the returned bitval.
Holger Hans Peter Freyther [Mon, 18 Oct 2010 16:22:31 +0000 (18:22 +0200)]
msgb: Add non-inlined helper functions to ease with language bindings
It is easier from languages that dlopen libosmocore to have a function
to access this data than to poke at the bytes of the struct directly. Add
copyright for this method and the reset method I did earlier this year.
Holger Hans Peter Freyther [Mon, 18 Oct 2010 14:56:43 +0000 (16:56 +0200)]
gsm0480: Add method create own number response
Sylvain Munaut [Fri, 8 Oct 2010 13:09:16 +0000 (15:09 +0200)]
codec: Add bit ordering tables from specs for HR,FR,EFR & AMR
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Fri, 8 Oct 2010 13:09:41 +0000 (15:09 +0200)]
Update .gitignore
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Mon, 11 Oct 2010 07:28:23 +0000 (09:28 +0200)]
ussd: gsm_7bit_decode will null terminate the string
Holger Hans Peter Freyther [Mon, 11 Oct 2010 07:23:50 +0000 (09:23 +0200)]
ussd: Make sure that we at least have 8 bytes when decoding the string
The actual gsm_7bit_decode can still cause a buffer overrun
but at least we are safe until this point.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 07:12:33 +0000 (09:12 +0200)]
ussd: Add size checks to the parse_ss_invoke calls
Make sure that the mandatory and optional part fits.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 07:07:50 +0000 (09:07 +0200)]
ussd: Make sure the component fits.
Use a while() {} to check offset +2 <= length on the first
iteration of the loop. Once we have the component length
check that it is going to fit into the given length.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 07:06:47 +0000 (09:06 +0200)]
ussd: Work with uint16_t for the length
Work with uint16_t for the length all the way.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 06:49:27 +0000 (08:49 +0200)]
ussd: Verify that parsing is stil working and print the decoded text.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 06:21:00 +0000 (08:21 +0200)]
ussd: Add next test that show that we access the data out of bounds
This test is showing that the internal ASN1 code is not checking
the size properly.
Holger Hans Peter Freyther [Mon, 11 Oct 2010 06:08:58 +0000 (08:08 +0200)]
ussd: Check the structure of the IE.
This is fixing the current crashes. Next we will need to
manipulate the content...
Holger Hans Peter Freyther [Mon, 11 Oct 2010 05:56:06 +0000 (07:56 +0200)]
ussd: Add a test case, switch parsing to use a gsm48_hdr and len
The current USSD code is not doing any size checks, add a test
case to find out how easily we access the data out of bounds.
Begin to use the length in some places.
Holger Hans Peter Freyther [Fri, 8 Oct 2010 17:47:15 +0000 (01:47 +0800)]
gsm0480: Move the USSD parsing code to libosmocore
- Change u_int8 to uint8
- Change DEBUGP to LOGP
- Change fprintf(stderr, to LOGP(0, LOGL_DEBUG
- We should define log areas used inside libosmocore
Holger Hans Peter Freyther [Wed, 6 Oct 2010 16:00:15 +0000 (00:00 +0800)]
msgfile: Add a file parser for a simple file format
This file format will be used to store per country code,
per network code messages. This will be used for various
things ranging from access control, to messages...
Holger Hans Peter Freyther [Thu, 30 Sep 2010 10:30:41 +0000 (18:30 +0800)]
gsm0480: Add USSD format functions to libosmocore
These routines come from OpenBSC, the msgb_wrap_* functions
belong to Mike Haben, the rest is mine. The msgb allocation
is compatible to the GSM48 allocation in OpenBSC.
Sylvain Munaut [Mon, 20 Sep 2010 18:59:23 +0000 (20:59 +0200)]
gsm48: Fix gsm48_encode_called - Set no extension bit
The highest bit must be set as "No extension byte" marker,
so that the next byte is considered to be the BCD number
and not some more control stuff
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Sun, 19 Sep 2010 17:23:15 +0000 (01:23 +0800)]
gsm0808: Fix the TLV definition of CIC and Service Handover
The nat code stumbled over the CIC bug as it was detecting
timeslot 0x1 as a new CIC and we were patching the data outside
the actual packet... The TLV parser needs some better size
checking too.
Sylvain Munaut [Fri, 17 Sep 2010 12:38:17 +0000 (14:38 +0200)]
Make sure we don't user std{err,in,out} if they don't exist.
This is required for target build in libosmocore
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Fri, 17 Sep 2010 11:55:45 +0000 (13:55 +0200)]
protocol/gsm_04_08: Fix cr field position in gsm48_cip_mode_cmd
Thanks to Dieter for pointing this out.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Mon, 13 Sep 2010 18:24:03 +0000 (02:24 +0800)]
vty: Add functions to access index and node
It is easier to call these two functions from bindings than
wrapping the vty structure and figuring out the alignment of
the enum on all different ABIs.
Holger Hans Peter Freyther [Sat, 11 Sep 2010 05:41:41 +0000 (13:41 +0800)]
vty: Use the copyright string from the app_info.
Holger Hans Peter Freyther [Fri, 10 Sep 2010 19:58:37 +0000 (03:58 +0800)]
vty: Link osmovty to osmocore as it is using the symbols
Use SUBDIRS to build src first and the src/vty. We will need
to find the right way add the dependencies.
Holger Hans Peter Freyther [Sat, 4 Sep 2010 03:19:39 +0000 (11:19 +0800)]
vty: Everything <= CONFIG_NODE is not a child of config
The method should be renamed to is child of config node
as it was comparing if vty->node > CONFIG_NODE. This is
fixing an assert in go_to_parent as we tried to find a
parent for the CONFIG_NODE.
Andreas Eversberg [Wed, 1 Sep 2010 21:37:07 +0000 (23:37 +0200)]
Add handover and frequency redefiniton message headers
This simply add some TS 04.08 related structures for frequency
redefinition and handover.
Holger Hans Peter Freyther [Tue, 31 Aug 2010 09:14:04 +0000 (17:14 +0800)]
plugin: Blind build fix for OSX...
According to a internet search PATH_MAX is in limits.h on OSX.
Holger Hans Peter Freyther [Tue, 31 Aug 2010 09:09:44 +0000 (17:09 +0800)]
vty: Make the talloc ctx extern void* to avoid duplicate symbols
Holger Hans Peter Freyther [Thu, 26 Aug 2010 06:37:10 +0000 (14:37 +0800)]
vty: Handle nodes part of the lib in the lib, for the rest call the callback
Holger Hans Peter Freyther [Wed, 25 Aug 2010 09:34:56 +0000 (17:34 +0800)]
vty: Add a new callback to let code decide if it is a config node or not
Holger Hans Peter Freyther [Wed, 25 Aug 2010 05:23:53 +0000 (13:23 +0800)]
vty: Move the assumption of the config nodes into a function
Move the assumption that something is a child of the CONFIG_NODE
into a new function. The next step will be to use something else
for that.
Harald Welte [Wed, 25 Aug 2010 17:25:37 +0000 (19:25 +0200)]
add header file for osmo_daemonize()
Harald Welte [Wed, 25 Aug 2010 17:24:26 +0000 (19:24 +0200)]
Add helper function 'osmo_daemonize()' to convert process into daemon
Harald Welte [Wed, 25 Aug 2010 17:24:00 +0000 (19:24 +0200)]
logging: add missing include file changes for last commit (logfile)
Harald Welte [Wed, 25 Aug 2010 17:10:50 +0000 (19:10 +0200)]
logging: add log target logging into text file and log target destroy function
Harald Welte [Wed, 25 Aug 2010 12:55:44 +0000 (14:55 +0200)]
logging: rename tgt_stdout to tgt_file
Harald Welte [Tue, 24 Aug 2010 13:17:13 +0000 (15:17 +0200)]
add debian packaging related information
Using the debian directory in this commit, it is possible to generate
libosmocore and libosmocore-dev packages (dpkgs).
Holger Hans Peter Freyther [Thu, 5 Aug 2010 22:48:43 +0000 (06:48 +0800)]
bsc_fd: Add a build option to be able to debug fd list corruption
bsc_register_fd on an already registered fd can corrupt the list
in a heavy way and make the select end in an infinite loop, this
code will workaround the issue and provide a way to set a breakpoint
at the right position in the code.
Holger Hans Peter Freyther [Wed, 4 Aug 2010 10:50:43 +0000 (18:50 +0800)]
gsm0808: Add some more TLV definitions coming from the cellmgr_ng
Harald Welte [Wed, 4 Aug 2010 09:46:44 +0000 (11:46 +0200)]
Import gsm48_decode_freq_list() from osmocom-bb/layer23
This will enable us to use this function from OpenBSC / ipaccess-config
Holger Hans Peter Freyther [Tue, 3 Aug 2010 22:27:08 +0000 (06:27 +0800)]
vty: Forward delcare the logging command.
Harald Welte [Fri, 30 Jul 2010 19:01:54 +0000 (21:01 +0200)]
logging: Make sure we don't use "end of color" code if colors are turned off
Harald Welte [Fri, 30 Jul 2010 09:43:30 +0000 (11:43 +0200)]
add new hexdump_nospc() function
Harald Welte [Fri, 30 Jul 2010 09:40:32 +0000 (11:40 +0200)]
move hexdump() from logging.c to utils.c
Harald Welte [Fri, 30 Jul 2010 08:37:29 +0000 (10:37 +0200)]
Import 'hexparse' function from OpenBSC
Sylvain Munaut [Sun, 25 Jul 2010 16:09:28 +0000 (18:09 +0200)]
core/msgb: Use the new osmo_panic call to handle errors
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sun, 25 Jul 2010 16:08:54 +0000 (18:08 +0200)]
core: Add some generic panic handling
This also includes an option for a minimal 'infinite loop' type
panic that could be required for embedded target that don't have
abort() or fprintf()
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sun, 25 Jul 2010 14:16:42 +0000 (16:16 +0200)]
build: Use AS_HELP_STRING macro to format the ./configure --help better
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Sun, 25 Jul 2010 10:25:17 +0000 (12:25 +0200)]
osmocore: Add utility function rsl_chan_nr_str to RSL
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Fri, 23 Jul 2010 11:22:23 +0000 (19:22 +0800)]
msgb: Avoid warnings that the string might contain %s or such..
Holger Hans Peter Freyther [Fri, 23 Jul 2010 10:35:59 +0000 (18:35 +0800)]
gsm0808: Why should there be a lchan in the parameter...