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...
Holger Hans Peter Freyther [Fri, 23 Jul 2010 10:20:02 +0000 (18:20 +0800)]
gsm0808: Import unaligned mem access fix from on-waves/bsc-master
Holger Hans Peter Freyther [Fri, 23 Jul 2010 08:35:00 +0000 (16:35 +0800)]
gsm_utils: Move the gsm_7bit_alphabet into the impl and make it static
Harald Welte [Thu, 22 Jul 2010 19:55:24 +0000 (21:55 +0200)]
msgb: Check for available headroom/tailroom and abort() if we violate it
Holger Hans Peter Freyther [Tue, 20 Jul 2010 21:02:33 +0000 (05:02 +0800)]
gsm_04_12.h: Add beginning of structs for SMS CB
I am trying to understand the RSL and GSM 04.12
spec to implement CBS for OpenBSC...
Holger Hans Peter Freyther [Tue, 20 Jul 2010 19:14:01 +0000 (03:14 +0800)]
gsm_7bit_decode: rtext does not hold a null byte, reduce the size
I have added the + 1 as I thought rtext will hold a terminating
null byte but it will not.
Nico Golde [Tue, 20 Jul 2010 13:43:58 +0000 (15:43 +0200)]
tests: don't hardcode length values of expected encoding gsm_7bit_encode:
make sure to return the number of actually written bytes gsm_7bit_decode:
calculate length of resulting septets from input length before decoding
The input length to gsm_7bit_decode reflects the number of encoded bytes
to be decoded. As the decoding is done on the input in septetes we need
to take this into account and recalculate the length.
Holger Hans Peter Freyther [Mon, 19 Jul 2010 18:54:54 +0000 (02:54 +0800)]
gsm_7bit_decode: Handle the case of the last charachter being an escape
If i + 1 == length and it is an escape charachter we would try
to read rtext[length] which is one after the field we have allocated.
Holger Hans Peter Freyther [Mon, 19 Jul 2010 18:46:56 +0000 (02:46 +0800)]
tests: Separate encoding/decoding test to verify them independly
Use the current test result as test data for future
regression testing. The encode function appears to
add too many zeros to the text.
Nico Golde [Fri, 9 Jul 2010 15:19:12 +0000 (17:19 +0200)]
* rewrite GSM 7bit default encoding/decoding based on a lookup table as the previous code produced wrong encodings for certain characters.
Ingo Albrecht [Thu, 15 Jul 2010 20:43:52 +0000 (22:43 +0200)]
Added crc16 from linux kernel.
Andreas Eversberg [Tue, 13 Jul 2010 11:50:39 +0000 (13:50 +0200)]
[VTY] add support for numeric ranges with negative numbers
This enables us to do something like <-128-127> as a numeric range.
Harald Welte [Tue, 13 Jul 2010 11:48:13 +0000 (13:48 +0200)]
[RSL] split rsl_rll_push_l3() L3 LV pushign and rsl_rll_push_hdr()
This allows us to generate RSLms messages that have some non-standard
IEs between the RSL/RLL common header and the L3 INFO IE.
Andreas Eversberg [Mon, 12 Jul 2010 07:12:46 +0000 (09:12 +0200)]
Add 3-digit MNC support to gsm48_generate_lai()
Andreas Eversberg [Mon, 12 Jul 2010 07:11:00 +0000 (09:11 +0200)]
Added new IE definitions to gsm_04_08.h of libosmocore.
Also added RR and MM TLV tables to gsm48.c
[import from accidential commit to osmocom-bb.git]
Andreas Eversberg [Mon, 12 Jul 2010 06:55:14 +0000 (08:55 +0200)]
Added single octet TV (type + value) to libosmocore.
In case of a single octet, the upper nibble is the type, the lower nibble
carries the value.
[import from accidentially committed changes to osmocom-bb.git]
diff --git a/src/shared/libosmocore/include/osmocore/tlv.h b/src/shared/libosmocore/include/osmocore/tlv.h
index
c733dbc..
4cfce87 100644
--- a/src/shared/libosmocore/include/osmocore/tlv.h
+++ b/src/shared/libosmocore/include/osmocore/tlv.h
@@ -212,6 +212,7 @@ enum tlv_type {
TLV_TYPE_TLV,
TLV_TYPE_TL16V,
TLV_TYPE_TvLV,
+ TLV_TYPE_SINGLE_TV
};
struct tlv_def {
diff --git a/src/shared/libosmocore/src/tlv_parser.c b/src/shared/libosmocore/src/tlv_parser.c
index
407e57a..
bbef7a9 100644
--- a/src/shared/libosmocore/src/tlv_parser.c
+++ b/src/shared/libosmocore/src/tlv_parser.c
@@ -36,6 +36,14 @@ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
tag = *buf;
*o_tag = tag;
+ /* single octet TV IE */
+ if (def->def[tag & 0xf0].type == TLV_TYPE_SINGLE_TV) {
+ *o_tag = tag & 0xf0;
+ *o_val = buf;
+ *o_len = 1;
+ return 1;
+ }
+
/* FIXME: use tables for knwon IEI */
switch (def->def[tag].type) {
case TLV_TYPE_T:
Sylvain Munaut [Sun, 4 Jul 2010 09:41:36 +0000 (11:41 +0200)]
gsm_utils: Fix typo in gsm band name
thanks to horizon for noticing :p
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Harald Welte [Wed, 30 Jun 2010 17:50:14 +0000 (19:50 +0200)]
GPRS: Add 'input' generator functions for GPRS cipher algorithm
Harald Welte [Wed, 30 Jun 2010 17:43:11 +0000 (19:43 +0200)]
Add support for plugins (and specifically GPRS encryption plugins)
Harald Welte [Tue, 29 Jun 2010 20:31:21 +0000 (22:31 +0200)]
[gsmtap] add new gsmtap_makemsg() function
This generates a gsmtap message without actually enqueueing to a
bsc_select style queue.
Harald Welte [Tue, 29 Jun 2010 18:51:13 +0000 (20:51 +0200)]
Add gsmtap utility functions to libosmocore
This is imported from OsmocomBB/Layer23
Harald Welte [Fri, 25 Jun 2010 01:00:58 +0000 (03:00 +0200)]
Fix typo in configure script regarding --disable-vty
Andreas Eversberg [Fri, 25 Jun 2010 00:50:56 +0000 (02:50 +0200)]
[RSL] Added special RSL message types for mobile side
- suspension DL
- resume DL
- re-establish DL
Andreas Eversberg [Fri, 25 Jun 2010 00:50:06 +0000 (02:50 +0200)]
[gsm48] fix typo in struct gsm48_req_ref
Harald Welte [Tue, 15 Jun 2010 07:32:14 +0000 (09:32 +0200)]
[GSM 04.08] add more RR IEIs
Sylvain Munaut [Thu, 10 Jun 2010 11:30:50 +0000 (13:30 +0200)]
gsm48: Add authentication response message
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut [Wed, 9 Jun 2010 11:38:56 +0000 (13:38 +0200)]
gsm_utils: Add a fn to test A5(x) support given a classmark2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Holger Hans Peter Freyther [Tue, 8 Jun 2010 08:12:58 +0000 (16:12 +0800)]
vty: Mark app info strings as const char*.
Harald Welte [Tue, 1 Jun 2010 19:21:20 +0000 (21:21 +0200)]
Merge remote branch 'origin/master'
Harald Welte [Tue, 1 Jun 2010 08:47:07 +0000 (10:47 +0200)]
add new new gprs_tmsi2tlli() function
Harald Welte [Mon, 31 May 2010 14:01:59 +0000 (16:01 +0200)]
[VTY] Remove all application specific VTY node definitions from enum
Harald Welte [Sat, 29 May 2010 09:49:51 +0000 (11:49 +0200)]
add configure option '--disable-vty' to prevent building libosmovty
Harald Welte [Tue, 25 May 2010 21:00:45 +0000 (23:00 +0200)]
[VTY] Introduce "struct vty_app_info" for vty_init() function
Harald Welte [Wed, 19 May 2010 17:54:00 +0000 (19:54 +0200)]
rename log_info to osmo_log_info to avoid namespace clash with app
Harald Welte [Wed, 19 May 2010 17:44:57 +0000 (19:44 +0200)]
fix typo resultin in dist/distcheck problem
Harald Welte [Wed, 19 May 2010 17:42:32 +0000 (19:42 +0200)]
Add pkgconfig for libosmovty