Commit Graph

258 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther 952a18ed19 logging: Add the 'all' category back to the log level command
This is required to be able to set a global log level. The all
command is emitted by the VTY logging code.
2011-03-29 17:03:56 +02:00
Holger Hans Peter Freyther ff0670edf3 vty: Fix a memory leak in the vty description command
Before assigning a new string, free the previous one. This
assume that it was allocated with talloc which should be true
for the osmocom users.
2011-03-29 13:24:21 +02:00
Pablo Neira Ayuso 3abad6a6f9 utils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.h
This is used by the logging to vty conversion functions by now, but it
may be of help for other functions that plan to use snprintf().
2011-03-28 20:00:45 +02:00
Pablo Neira Ayuso 36bdf2cb73 bitvec: add bitvec_find_first_bit_pos() from gsm/rxlev_stat.c
This patch adds bitvec_find_bit_pos() to bitvec.c where it really
belongs to. Before this patch used to be part of gsm/rxlev_stat.c
2011-03-28 20:00:45 +02:00
Pablo Neira Ayuso 8341934844 include: reorganize headers file to include/osmocom/[gsm|core]
This patch moves all GSM-specific definitions to include/osmocom/gsm.
Moreover, the headers in include/osmocore/ have been moved to
include/osmocom/core.

This has been proposed by Harald Welte and Sylvain Munaunt.

Tested with `make distcheck'.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:09:28 +01: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
Pablo Neira Ayuso 04139f14b6 vty: integration with logging framework
The logging categories are registered by the applications, like
osmo-nitb, during startup. Thus, the VTY have to provide the logging
commands according to the logging categories that the application
has registered.

Before this patch, the VTY contained the logging categories
hardcoded. Thus, any change in the logging categories by the
application would not be shown by the VTY.

So far, this was not a problem because all applications used the
same logging categories. However, according to what Harald told
me, this may be a problem in the future.

This patch resolve the lack of integration between the logging
framework and the VTY by generating the VTY logging commands
from the logging categories registered.

Since this patch changes one function of the libosmocore API,
it follows another patch for the openbsc application to get in
sync with the new function layout.

I have reworked and renamed the functions:

 * log_vty_category_string()
 * log_vty_level_string()

to provide the new ones that generate the exact output that VTY
requires.

This patch does not release the memory allocated by
talloc_zero_size() to store the VTY strings for the commands
and the description. I found no exit function that can clean
up resources that were allocated.
2011-03-19 18:33:48 -03:00
Harald Welte 53b2096555 Merge branch 'master' of git.osmocom.org:libosmocore 2011-03-03 00:27:15 +01:00
Harald Welte de79cee5a6 LOGGING: Use host.app_info->name instead of FIXME
This should put a useful syslog identity in place.
2011-02-24 23:47:57 +01:00
Harald Welte 7c3b8fb441 rxlev_stat: Fix compiler warning 2011-02-19 16:35:47 +01:00
Harald Welte 49cc32b0a3 vty: Revert Makefile.am change for libosmocore dependency 2011-02-19 16:10:51 +09:00
Harald Welte a62648b0b0 LOGGING: remove duplicated code between vty-logging and cfg-logging 2011-02-18 21:03:27 +01:00
Harald Welte 6b431033b3 LOGGING: Add missing 'nat' subsystem 2011-02-18 20:39:36 +01:00
Harald Welte 2822296ddb 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)
2011-02-18 20:37:04 +01:00
Harald Welte 46cfd77f75 LOGGING: Add syslog log target 2011-02-17 15:56:56 +01:00
Harald Welte 76e72abe32 LOGGING: Pass the log level down to the log target output function
This will be required for mapping osmocore log levels to syslog priorities.
2011-02-17 15:52:39 +01:00
Holger Hans Peter Freyther 76681bafa8 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.
2011-02-15 01:01:44 +01:00
Harald Welte b05552b14c [utils] introduce ubit_dump to dump buffers of unpacked bits 2011-02-08 16:56:23 +01:00
Harald Welte 3d0ac5e446 [utils] add 'bitdump' function for bitfields 2011-02-08 16:55:03 +01:00
Holger Hans Peter Freyther 549fbb8232 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.
2011-01-22 23:21:26 +01:00
Christian Vogel c7f84e91b7 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)
2011-01-22 22:48:37 +01:00
Sylvain Munaut aeb1077051 bits: Add extended options version of pbit2ubit and ubit2pbit
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-01-21 12:22:30 +01:00
Harald Welte 2230c133a6 [BITS] introduce new packed/unpacked bit conversion routines 2011-01-19 10:10:16 +01:00
Sylvain Munaut 4a4f96d1f6 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>
2011-01-03 22:19:40 +01:00
Harald Welte df327f6d81 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.
2010-12-24 15:10:14 +01:00
Holger Hans Peter Freyther 4f4b0101c4 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.
2010-12-20 13:38:22 +01:00
Holger Hans Peter Freyther 121f358de0 utils: Fix typo. It is ascii. 2010-11-19 19:21:42 +01:00
Sylvain Munaut 7f6615a37d 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>
2010-11-13 22:47:47 +01:00
Sylvain Munaut c91d17b3d5 panic: Fix type warning - osmo_panic_handler_t is already a pointer ...
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-13 18:00:25 +01:00
Sylvain Munaut 2a471ee25d 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>
2010-11-13 17:51:37 +01:00
Holger Hans Peter Freyther af270a41e3 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.
2010-11-04 12:42:50 +01:00
Holger Hans Peter Freyther c25c668106 gsm0808: Add a method to create a new DTAP message with a msgb 2010-11-04 12:27:48 +01:00
Harald Welte 9d92f0e12c select.c: Change license terms from GPLv2 (from ulogd) to GPLv2+ 2010-10-31 13:56:45 +01:00
Holger Hans Peter Freyther aeebe39bd1 gsm0808: Fix the format of the clear IE...
This is really TLV...
2010-10-27 12:36:05 +02:00
Holger Hans Peter Freyther a3f05d8609 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.
2010-10-27 11:53:23 +02:00
Holger Hans Peter Freyther 131bc80b96 msgfile: Allow to have comments in the simple CSV file 2010-10-26 09:32:35 +02:00
Andreas.Eversberg dc0ebdfbdf 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.
2010-10-24 11:59:33 +02:00
Holger Hans Peter Freyther acffb60c1a 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.
2010-10-18 18:22:31 +02:00
Holger Hans Peter Freyther c64970ede5 gsm0480: Add method create own number response 2010-10-18 17:04:49 +02:00
Sylvain Munaut 1a4ea5b436 codec: Add bit ordering tables from specs for HR,FR,EFR & AMR
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-15 09:45:04 +02:00
Holger Hans Peter Freyther 8c6332649b ussd: gsm_7bit_decode will null terminate the string 2010-10-11 09:28:23 +02:00
Holger Hans Peter Freyther d65a6985bf 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.
2010-10-11 09:26:20 +02:00
Holger Hans Peter Freyther 7d0bce3dfb ussd: Add size checks to the parse_ss_invoke calls
Make sure that the mandatory and optional part fits.
2010-10-11 09:26:19 +02:00
Holger Hans Peter Freyther 4156ec6dd1 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.
2010-10-11 09:26:19 +02:00
Holger Hans Peter Freyther 49ad500ac6 ussd: Work with uint16_t for the length
Work with uint16_t for the length all the way.
2010-10-11 09:26:19 +02:00
Holger Hans Peter Freyther 8ac0486c28 ussd: Check the structure of the IE.
This is fixing the current crashes. Next we will need to
manipulate the content...
2010-10-11 09:26:19 +02:00
Holger Hans Peter Freyther daa653fc22 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.
2010-10-11 09:25:14 +02:00
Holger Hans Peter Freyther 00cb5700e6 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
2010-10-09 01:49:11 +08:00
Holger Hans Peter Freyther c87f266522 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...
2010-10-08 19:23:18 +08:00
Holger Hans Peter Freyther 55aea5099c 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.
2010-09-30 19:00:58 +08:00
Sylvain Munaut 47ee693170 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>
2010-09-20 20:59:23 +02:00
Holger Hans Peter Freyther a55caad039 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.
2010-09-20 01:25:54 +08:00
Sylvain Munaut af5ee34c35 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>
2010-09-17 14:38:17 +02:00
Holger Hans Peter Freyther 08aaded3b8 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.
2010-09-14 02:24:03 +08:00
Holger Hans Peter Freyther 2e228fc2af vty: Use the copyright string from the app_info. 2010-09-11 13:41:41 +08:00
Holger Hans Peter Freyther e25b18aa29 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.
2010-09-11 03:58:37 +08:00
Holger Hans Peter Freyther 8304b1e3e9 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.
2010-09-04 11:22:45 +08:00
Holger Hans Peter Freyther be0f7fabd9 plugin: Blind build fix for OSX...
According to a internet search PATH_MAX is in limits.h on OSX.
2010-08-31 17:14:04 +08:00
Holger Hans Peter Freyther 3e85e8dba9 vty: Handle nodes part of the lib in the lib, for the rest call the callback 2010-08-26 15:00:52 +08:00
Holger Hans Peter Freyther 8f09f01380 vty: Add a new callback to let code decide if it is a config node or not 2010-08-26 15:00:52 +08:00
Holger Hans Peter Freyther 50cfb780d2 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.
2010-08-26 15:00:52 +08:00
Harald Welte b6cb023c7b Add helper function 'osmo_daemonize()' to convert process into daemon 2010-08-25 19:24:26 +02:00
Harald Welte 3086c394de logging: add log target logging into text file and log target destroy function 2010-08-25 19:10:50 +02:00
Harald Welte 0083cd381c logging: rename tgt_stdout to tgt_file 2010-08-25 18:10:19 +02:00
Holger Hans Peter Freyther 43558316bc 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.
2010-08-06 06:50:23 +08:00
Holger Hans Peter Freyther c2b7f92a6c gsm0808: Add some more TLV definitions coming from the cellmgr_ng 2010-08-04 18:53:16 +08:00
Harald Welte 1523d7039d Import gsm48_decode_freq_list() from osmocom-bb/layer23
This will enable us to use this function from OpenBSC / ipaccess-config
2010-08-04 11:46:44 +02:00
Harald Welte a439a3a505 logging: Make sure we don't use "end of color" code if colors are turned off 2010-07-30 21:01:54 +02:00
Harald Welte dee47cd14d add new hexdump_nospc() function 2010-07-30 11:47:50 +02:00
Harald Welte 40481e8954 move hexdump() from logging.c to utils.c 2010-07-30 11:40:32 +02:00
Harald Welte 3eba991b3d Import 'hexparse' function from OpenBSC 2010-07-30 10:37:29 +02:00
Sylvain Munaut ac3e61a7a6 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>
2010-07-25 18:08:54 +02:00
Sylvain Munaut 27af075e1e osmocore: Add utility function rsl_chan_nr_str to RSL
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 12:27:44 +02:00
Holger Hans Peter Freyther b60a4b3b97 gsm0808: Why should there be a lchan in the parameter... 2010-07-23 18:35:59 +08:00
Holger Hans Peter Freyther 06f795c56f gsm0808: Import unaligned mem access fix from on-waves/bsc-master 2010-07-23 18:20:02 +08:00
Holger Hans Peter Freyther dd02a47234 gsm_utils: Move the gsm_7bit_alphabet into the impl and make it static 2010-07-23 16:36:05 +08:00
Holger Hans Peter Freyther f8a342c350 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.
2010-07-21 03:14:01 +08:00
Nico Golde c0ce9aa20d 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.
2010-07-21 02:43:58 +08:00
Holger Hans Peter Freyther 446bf37698 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.
2010-07-20 02:54:54 +08:00
Nico Golde 28de05336b * rewrite GSM 7bit default encoding/decoding based on a lookup table as the previous code produced wrong encodings for certain characters. 2010-07-20 02:48:17 +08:00
Ingo Albrecht 383134b5ac Added crc16 from linux kernel. 2010-07-15 22:43:52 +02:00
Andreas Eversberg 33f0fc3c95 [VTY] add support for numeric ranges with negative numbers
This enables us to do something like <-128-127> as a numeric range.
2010-07-13 13:50:39 +02:00
Harald Welte 6eb7d6c887 [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.
2010-07-13 13:48:13 +02:00
Andreas Eversberg ed00fe4449 Add 3-digit MNC support to gsm48_generate_lai() 2010-07-12 09:12:46 +02:00
Andreas Eversberg 014cb8725c 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]
2010-07-12 09:11:00 +02:00
Andreas Eversberg cd2a74bd43 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:
2010-07-12 08:55:14 +02:00
Sylvain Munaut e10ae5b083 gsm_utils: Fix typo in gsm band name
thanks to horizon for noticing :p

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-04 11:41:36 +02:00
Harald Welte e335b91ccd GPRS: Add 'input' generator functions for GPRS cipher algorithm 2010-06-30 19:50:14 +02:00
Harald Welte b9ce51c5fd Add support for plugins (and specifically GPRS encryption plugins) 2010-06-30 19:43:11 +02:00
Harald Welte e34a940542 [gsmtap] add new gsmtap_makemsg() function
This generates a gsmtap message without actually enqueueing to a
bsc_select style queue.
2010-06-29 22:31:21 +02:00
Harald Welte e779c364ac Add gsmtap utility functions to libosmocore
This is imported from OsmocomBB/Layer23
2010-06-29 21:57:25 +02:00
Harald Welte 7b4913662a Merge remote branch 'origin/master' 2010-06-01 21:21:20 +02:00
Harald Welte c226317c9c add new new gprs_tmsi2tlli() function 2010-06-01 10:47:07 +02:00
Harald Welte 544037700c add configure option '--disable-vty' to prevent building libosmovty 2010-05-29 11:49:51 +02:00
Harald Welte 237f6241f2 [VTY] Introduce "struct vty_app_info" for vty_init() function 2010-05-25 23:38:19 +02:00
Harald Welte 4ebdf74728 rename log_info to osmo_log_info to avoid namespace clash with app 2010-05-25 22:28:40 +02:00
Harald Welte 93cf5a38eb fix typo resultin in dist/distcheck problem 2010-05-25 22:28:40 +02:00
Harald Welte 3fb0b6f26e Create libosmovty as library from OpenBSC VTY functions 2010-05-25 22:28:39 +02:00
Andreas.Eversberg 0ebd688746 Added some "get"-functions to bitvec of libosmocore.
- Getting Low or High value from current postion
- Getting unsigned interger from current postion
2010-05-19 18:14:01 +02:00
Holger Hans Peter Freyther 9a3dec0c01 gsm0808: Add API to wrap a GSM48 msg with a BSSMAP/DTAP msg. 2010-05-16 08:15:40 +08:00
Holger Hans Peter Freyther 102bcafb58 gsm0808: Add TLV entries for types used by the Compl Layer3 Information 2010-05-14 07:25:01 +08:00
Harald Welte d2dce6df04 [rate_ctr] always 'overflow' in next larger inetrval when interval ends
If a second ends, we add the number of events in that just-ended second
to the number of events in the currently running minute.  The same happens
at the end of a minute: We add the number of events in that just-ended
minute into the number of events of the still-running hour, etc.

This gives a much more meaningful numbers and we don't end up with
"12 events per second, but 0 events per minute" kind of situations
anymore.
2010-05-13 13:28:12 +02:00
Harald Welte dd178b2dc9 rate_counters: Remove group-name-sprintf-with-idx string 2010-05-13 12:50:44 +02:00
Harald Welte 087fcff9a5 rate_ctr: Store the numeric index as part of 'rate_ctr_group' 2010-05-13 12:16:17 +02:00
Harald Welte 7b45d60887 Add new 'rate counter' implementation to libosmocore
A 'rate counter' is a counter that counts events but also keeps
track of the rate of events (per second, minute, hour and day).

'rate counters' are generally abstracted in 'rate counter groups',
which are instances of a 'rate counter group description'.  This
way we can have e.g. a description describing what kind of counters
a BTS (or TRX) has - and we can then create one instance of that
group for every BTS or TRX that exists.
2010-05-13 11:35:30 +02:00
Harald Welte 7638af95fd logging: add log_vty_{level,category}_string() 2010-05-11 16:39:22 +02:00
Harald Welte 9ac2225ff4 logging: introuduce log_level_str() to obtain the name of a log level 2010-05-11 11:19:40 +02:00
Harald Welte 95df5c0179 msgb: initialize cb[] to zero during msgb_reset() 2010-05-01 23:53:26 +02:00
Harald Welte 35a939463e Import gsm48_construct_ra() from openbsc 2010-05-01 14:25:22 +02:00
Harald Welte a1c4f765ec import gsm48_parse_ra() and gprs_tlli_type() from openbsc 2010-05-01 12:00:21 +02:00
Harald Welte bb77c9d6cc msgb: remove smsh, llch, tlli and gmmh
This is a lot of GSM/GPRS specific stuff in struct msgb which we want
to avoid.  The 'control buffer' will replace them.
2010-04-30 14:26:12 +02:00
Harald Welte 3120ac3f78 remove the unneeded bts_link pointer from msgb 2010-04-30 14:19:48 +02:00
Sylvain Munaut a074ec4b89 gsm 08.08: Fix some u_int8_t -> uint8_t
This breaks the ARM build in osmocom-bb. Besides uint??_t seems to
be the preferred type in osmocore. (coming from stdint.h vs sys/types.h)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-04-28 10:05:29 +02:00
Holger Hans Peter Freyther ba6172a7fd gsm0808: Port asiggnment_complete msg creation to libosmocore. 2010-04-17 06:21:49 +02:00
Holger Hans Peter Freyther 81716d5fa8 gsm0808: Port cipher_complete to be part of libosmocore. 2010-04-17 06:16:35 +02:00
Holger Hans Peter Freyther 7daa01c434 gsm0808: Add the TLV definition for some of the 0808 IEs 2010-04-17 05:14:36 +02:00
Holger Hans Peter Freyther 280cd5153f Add GSM0808 utilities to Osmocore.
The code is coming from the on-waves/bsc-master branch.
2010-04-15 10:10:39 +02:00
Holger Hans Peter Freyther 23ba4747d1 select.c: Make the ugly hacker uglier...
Right now I'm seeing crashes when removing a link and deleting
it and I need this hack to make it not crash. We will have to
understand if llist_for_each_entry_safe has a bug or if we are
doing something bad with the list (anchors not properly initialized).
2010-04-11 17:34:52 +02:00
Harald Welte 163d0ea85b remove references to u_int*_t and use uint*_t instead 2010-04-09 07:57:40 +02:00
Andreas Eversberg 1ef041ff1e gsm48: introduce MM_CONNECTION_PEND state 2010-04-09 07:52:12 +02:00
Harald Welte b1ac2b96f8 gsm48-ie.c: Fix year in copyright message 2010-04-09 07:51:03 +02:00
Holger Hans Peter Freyther 4052c811a9 write_queue: Add callback for exceptions as well. 2010-04-08 10:58:20 +02:00
Harald Welte 9bb553ee40 import gsm48_mi_to_string() from OpenBSC 2010-03-28 18:14:50 +08:00
Harald Welte a3b844cf45 logging: only compile stderr target if we actualy have stderr 2010-03-27 00:04:40 +08:00
Harald Welte 01fd5cb3f0 only include strings.h if it is actually preent 2010-03-26 23:51:31 +08:00
Harald Welte cc6313cc69 logging: fix default initialization of per-category loglevels
Before this patch, there was a bug in the code caused by a memcpy
from one data structure to another. unfortuantely the data structures
were not the same, so we have to explicitly iterate over the array
and assign the structure members manually.
2010-03-26 22:04:03 +08:00
Harald Welte 3ae2758fba rename 'debug' interface to 'logging' interface
It's not really about debugging, but about generic logging...
2010-03-26 21:26:01 +08:00
Harald Welte faadfe2b93 debug: remove unneeded 'number' member of 'struct debug_info_cat'
As the debug subsystem number is used as index into the debug_info_cat
array, there is no need to store the number explicitly inside the
structure again.
2010-03-26 21:26:01 +08:00
Harald Welte d788f6688c debug.c: fix no-color-printing in case .color = NULL 2010-03-26 21:26:01 +08:00
Harald Welte 4a2bb9e38b Import 'debug' support from OpenBSC into libosmocore 2010-03-26 21:26:01 +08:00
Holger Hans Peter Freyther 99a263ff20 write_queue: Add a method to clear the queue. 2010-03-26 09:22:38 +01:00
Harald Welte 52b4abdcb3 replace rsl_rlm_cause_strs with rsl_rlm_cause_name() 2010-03-25 12:11:38 +08:00
Harald Welte 9eb6d88d64 replace gsm48_cc_msg_names[] with gsm48_cc_msg_name()
and implement the backend using value_string
2010-03-25 12:00:54 +08:00
Harald Welte e9e190a8d8 use more value_string in gsm48 and rsl 2010-03-25 11:46:46 +08:00
Harald Welte b59f9350f8 get_value_string(): return "unknown 0x..." instead of "unknown" 2010-03-25 11:46:46 +08:00
Harald Welte cbc8062ef8 fix compiler warnings (itsme <itsme@xs4all.nl>)
* added several 'const' for strings.
 * added 'extern' to declarations of rsl_rlm_cause_strs
2010-03-22 08:28:44 +08:00
Holger Hans Peter Freyther a49951fed7 write_queue: Make the bfd cb public so it can be used in a different context
* I'm doing a nonblocking connect and for this I need to select
  on writable and the first thing I need to do is to check the
  SOL_SOCKET SO_ERROR state. I realize this by setting a different
  cb on the embedded bfd during setup and then go back to the real
  implementation.
2010-03-08 14:32:39 +01:00
Harald Welte 1e9086684f import GSM04.08 encode/decode functions and mncc.h from openbsc 2010-03-07 23:39:54 +01:00
Harald Welte cbb29f7c94 add --disable-talloc option to build without talloc support 2010-03-07 20:24:30 +01:00
Harald Welte d3ff15fc81 use strtol instead of atoi 2010-03-07 18:23:47 +01:00
Harald Welte 622b718195 import some gsm band/arfcn/time related utilities from OsmocomBB 2010-03-07 17:50:21 +01:00
Harald Welte 63d3e396e7 introduce RxLev statistics module, an efficient way for power scan data 2010-03-06 11:34:27 +01:00
Harald Welte d9abf01436 mark some occasions of bitvec as 'const' as appropriate 2010-03-06 11:28:49 +01:00
Harald Welte 6fec514d7b fix CCCH parsing 2010-03-04 14:30:15 +01:00
Harald Welte ecf9dd0d96 add new rsl_dec_chan_nr() function 2010-03-04 14:27:48 +01:00
Harald Welte 61e2bfc5f4 import gsm48 utility functions from OpenBSC
* gsm48_generate_lai() gsm48_generate_mid_from_tmsi() gsm48_generate_mid_from_imsi()
* gsm48_cc_msg_names[]
2010-03-04 10:53:03 +01:00
Harald Welte a73e2f9acb import bcd2char() and char2bcd() from OpenBSC 2010-03-04 10:50:32 +01:00
Harald Welte aebe08c71f import gsm_band_name() and gsm_band_parse() from OpenBSC 2010-03-04 10:39:17 +01:00
Harald Welte eb8bf3915c add 'transparent' argument to rsl_rll_push_l3() and rsl_rll_push_l3()
this is required to make those functions useful for OpenBSC, nut just
OsmocomBB
2010-03-04 10:32:09 +01:00
Harald Welte 098cd4b503 fix rsl_enc_chan_nr() for SDCCH4 2010-03-04 10:12:50 +01:00