Commit Graph

2542 Commits

Author SHA1 Message Date
Harald Welte 44d26113bc NOKIA: use 'struct value_string' whenever possible 2011-08-10 10:51:02 +02:00
Harald Welte 3c3003f703 NOKIA: use 'value_string' for severity and bts_type 2011-08-10 10:51:02 +02:00
Harald Welte c8755af8a5 NOKIA: Move more static variables into 'struct gsm_bts' 2011-08-10 10:51:01 +02:00
Harald Welte 9d2f377927 NOKIA: move 'conf' and 'bts_type' into 'struct gsm_bts'
This is one step in the direction of supporting multiple Nokia BTS
2011-08-10 10:51:01 +02:00
Harald Welte cde579473b NOKIA: Some more whitespace changes 2011-08-10 10:51:01 +02:00
Harald Welte bda367c697 Nokia: Coding style
Running the entire bts_nokia_site.c through the 'Lindent' script
to match indent/coding style with remainder of project.

There are still lots of other cleanups pending, but this one is
a purely cosmetic one.
2011-08-10 10:51:01 +02:00
Dieter Spaar 1664602476 Initial version of Support for Nokia *Site BTS
This includes the MetroSite, but also other Nokia BTS models.
2011-08-10 10:51:01 +02:00
Harald Welte e5215b5398 04.08 / MNCC: elevate error messages to LOGL_ERROR
this way you can actually see them...
2011-08-09 22:06:08 +02:00
Harald Welte 6e4c26aa08 LAPD: Use proper log levels and prefix all messages with LAPD 2011-08-09 22:06:01 +02:00
Harald Welte 52a0b12fe1 LAPD: Remove all calls to 'assert' from the code
For a system-level daemon, no protocol parser error should ever call
assert, which would take down the entire process.
2011-08-09 22:05:51 +02:00
Harald Welte 0b69bc34d7 DAHDI: Fix case where we have multiple E1 ports/cards (spans)
DAHDI creates one device node for every E1 timeslot, starting from '1',
and keeps incrementing that number even for additional ports/cards.

Thus, we have to use the e1inp_line number multiplied by 31 as a base.
2011-08-09 22:05:42 +02:00
Harald Welte cdf76cff9f GPRS: Fix the parsing/interpretation of the PDP CTX status IE
The byte ordering is a bit odd:  The least significant byte is ahead of
the most significant byte, different from everything else in GSM that
seems to be big-endian.

Thanks to Seungju Kim <admin@manateeshome.com> for repoerting the bug.
2011-08-05 21:23:46 +02:00
Dieter Spaar f31dd86059 TRAU: Properly initialize idle frames
This is particularly important in case of the Nokia BTS, as they seem
to drop the RF/signalling channel if they don't get proper TRAU
frames.
2011-07-27 23:52:36 +02:00
Dieter Spaar 402ccedcf4 BSC VTY: Accept MNC of 0-999, as 0 is a valid MNC 2011-07-27 23:43:56 +02:00
Dieter Spaar eabb6e3e4f RSL: Fix erroneous GSM48_IE_CHANDESC_2 in rsl_chan_activate_lchan()
This fixes a bug introduced more than one year ago in commit
e38bd6caa34005816a9336f021fd17d328d5c901:

The RSL_IE_CHAN_IDENT is a TLV, but the GSM48_IE_CHANDESC_2 contained in
it, is a mere TV type IE with fixed length.

The problem specifically has caused problems on Nokia MetroSite BTS,
which apparently read the TSC out of this Layer3 IE.
2011-07-27 23:40:33 +02:00
Dieter Spaar 1f447fbef1 LLC: Fix format string 2011-07-27 23:38:46 +02:00
Harald Welte 4b2ed35b8f GPRS: Fix buffer overflow in case of very long MS RA CAP IE
The MS Radio Access Capability IE can be _very_ long in some recent
high-end mobile phones, way beyond the old 14-byte limit.  We increase
our array to 52 bytes, and make sure not to overflow that buffer.
2011-07-27 23:35:38 +02:00
Holger Hans Peter Freyther 074b2b24e0 smsqueue: There was a race/bug with a booting phone, paging and LU
It was possible to set the LAC=0 on a subscriber that just has
done a LU because it did not respond to a paging request.

E.g. when a phone is rebooting, a SMS being delivered, the phone
is doing the LU, sub_ready_for_sm will try to send a SMS (but the
phone is not ready yet and it will timeout), then the paging code will
send us an expiration note and we might set the LAC=0 for this
subscriber.

Ideally we would be able to stop the paging request once the subscriber
is authenticated and then hand this to the SMS layer, right now the
best thing to do is to detect that we will run into this problem and
not send the SMS, not try to set the LAC=0.
2011-07-25 00:19:36 +02:00
Harald Welte b226864db5 fix some header file related issues preventing lcr from compiling 2011-07-23 10:53:30 +02:00
Daniel Willmann 8d9876e1ba osmo-bsc: Only keep the newest of subsequent invalid positions 2011-07-19 20:07:20 +02:00
Daniel Willmann 3118191f59 osmo_bsc: Track the last three locations. 2011-07-19 20:07:20 +02:00
Daniel Willmann fa2218cbc9 osmo-bsc: Add valid field to location command 2011-07-19 20:07:20 +02:00
Daniel Willmann 6d718c054a osmo-bsc: Improve return handling in verify_net_loc 2011-07-19 20:07:20 +02:00
Daniel Willmann 44fb151c12 osmo-bsc: Compare char * with NULL instead of 0 2011-07-19 20:07:20 +02:00
Daniel Willmann 1c33d4c00d libcommon: Add DCTRL logging destination for libctrl related messages 2011-07-19 20:07:20 +02:00
Daniel Willmann fc83a36cbd libctrl: Use inttypes.h macros to make uint64_t printfs portable. 2011-07-19 20:07:20 +02:00
Holger Hans Peter Freyther 31f5f71647 paging: Add method to find the paging data for a given subscriber 2011-07-19 20:01:54 +02:00
Holger Hans Peter Freyther 0e412c7a55 bsc: Correct the cast for the signal data
There is a dedicated msc_signal_data cast the signal_data to
this type and enjoy working connection closing on a per MSC base.
2011-07-19 19:56:53 +02:00
Holger Hans Peter Freyther 74db7744ee mgcp: Implement RSIP based on a trunk level
Implement the RSIP spec extension to work on the specified
trunk instead of hardcoding it to the virtual trunk.
2011-07-19 19:56:33 +02:00
Holger Hans Peter Freyther 9b9a171da9 bsc: Fix a memory leak when the BSC is not allowed to open a connection
When the BSC is refusing to open an outgoing connection the SCCP
connection was leaked. Use the normal free as the socket should
be either closed or disconnected.
2011-07-19 19:54:33 +02:00
Holger Hans Peter Freyther 5e3bbba962 bsc: Call the RF Control interface ctrl all the way
We had the rf_ctrl_name and the rf_ctl pointer, make both use
the word ctrl.
2011-07-19 19:53:52 +02:00
Holger Hans Peter Freyther fe1ca353bb bts-init: Initialize the BTS like it will look after a reset
Reset the BTS MO State on BTS bootstrap. This way we will always
test the BTS disconnect/reconnect case of the BTS.

Do not reset the administrative state of objects. The BSC might
have set these and wants to maintain them across disconnect/
reconnect. Right now this is true for the TRX state.
2011-07-18 11:35:56 +02:00
Holger Hans Peter Freyther 95fd72b9f7 misc: Remove the osmocom/core/process.h include
The osmo_daemonize moved from process.h to application.h (that
is already included), remove the process.h include.
2011-07-18 10:40:13 +02:00
Holger Hans Peter Freyther d010eb4651 ipaccess-firmware: Fix dumping the wrong header fields
We want to compare the file more_magic[0] and more_magic[1]
with the static more_magic array to see where the difference
is.

src/ipaccess/ipaccess-firmware.c +64 ipaccess_analyze_file(26) warn: buffer overflow 'firmware_header->more_magic' 2 <= 2
src/ipaccess/ipaccess-firmware.c +64 ipaccess_analyze_file(26) warn: buffer overflow 'firmware_header->more_magic' 2 <= 3
2011-07-16 14:43:01 +02:00
Harald Welte 74902c5435 sgsn_libgtp: remove bogus unreached second return statement
found by Smatch
2011-07-16 13:47:37 +02:00
Harald Welte baf7700429 sgsn_main: add comment about exit statement never reached 2011-07-16 13:47:01 +02:00
Harald Welte f6b606f422 gprs_gmm: ctx cannot be null, so remove check
Detected by Smatch:
/home/laforge/projects/git/openbsc/openbsc/src/gprs/gprs_gmm.c +757 gsm48_rx_gmm_att_req(133) warn: variable dereferenced before check 'ctx'
2011-07-16 13:45:57 +02:00
Harald Welte cd367b959e gprs_bssgp_util.c: orig_msg == NULL is not supported
we need it for deriving the NSEI anyway.

Detected by Smatch
2011-07-16 13:45:10 +02:00
Harald Welte d4ab13b630 ipaccess-proxy: use ANSI function declarations (void) 2011-07-16 13:39:44 +02:00
Harald Welte 36ac775838 ipaccess-proxy: fix array bounds problem
detected by Smatch:
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +173 store_idtags(14) error: buffer overflow 'ipbc->id_tags' 255 <= 255
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +173 store_idtags(14) error: buffer overflow 'ipbc->id_tags' 255 <= 255
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +175 store_idtags(16) error: buffer overflow 'ipbc->id_tags' 255 <= 255
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +178 store_idtags(19) error: buffer overflow 'ipbc->id_tags' 255 <= 255
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +500 ipaccess_rcvmsg(66) error: buffer overflow 'ipbc->rsl_conn' 4 <= 4
/home/laforge/projects/git/openbsc/openbsc/src/ipaccess/ipaccess-proxy.c +504 ipaccess_rcvmsg(70) error: buffer overflow 'ipbc->bsc_rsl_conn' 4
<= 4
2011-07-16 13:38:48 +02:00
Harald Welte 5b3c05d89a bs11_config: fix array bounds problem by using value_string
Detected by Smatch:
/home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +223 linkstate_name(5) error: buffer overflow 'bs11_link_state' 3 <= 3
/home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +240 mbccu_load_name(5) error: buffer overflow 'mbccu_load' 6 <= 6
/home/laforge/projects/git/openbsc/openbsc/src/utils/bs11_config.c +905 main(34) info: ignoring unreachable code.
2011-07-16 13:35:24 +02:00
Harald Welte 258c713343 gsm_04_11: use 'unsigned int sms_alphabet' to include 0xffffffff
Detected by Smatch
2011-07-16 13:34:52 +02:00
Harald Welte d1476bc603 db: use ANSI (void) function declarations 2011-07-16 13:24:09 +02:00
Harald Welte 2c5f4c635a db: fix Smatch warnings
/home/laforge/projects/git/openbsc/openbsc/src/libmsc/db.c +254 db_fini(6) info: redundant null check on db_dirname calling free()
/home/laforge/projects/git/openbsc/openbsc/src/libmsc/db.c +256 db_fini(8) info: redundant null check on db_basename calling free()
/home/laforge/projects/git/openbsc/openbsc/src/libmsc/db.c +280 db_create_subscriber(20) warn: variable dereferenced before check 'subscr'
2011-07-16 13:22:57 +02:00
Harald Welte 46324ccfcd bsc_vty: Fix some Smatch warnings
/home/laforge/projects/git/openbsc/openbsc/src/libbsc/bsc_vty.c +1062
show_e1ts(25) warn: variable dereferenced before check 'line'
/home/laforge/projects/git/openbsc/openbsc/src/libbsc/bsc_vty.c +1075
show_e1ts(38) warn: buffer overflow 'line->ts' 32 <= 32
2011-07-16 13:16:39 +02:00
Harald Welte 142c4b8ca8 abis_nm: fix signedness error (uint8_t len cannot be negative)
Detected by Smatch
2011-07-16 13:03:29 +02:00
Harald Welte 7017fa7c9d [bsc-nat] ctrlif: use llist_entry() macro and fix overly-long lines 2011-07-13 14:53:16 +02:00
Harald Welte f071e16f23 [bsc-nat] ctrlif: save ourselves one level of indentation 2011-07-13 14:53:16 +02:00
Harald Welte 6552047d44 [bsc-nat] ctrlif: use the 'err' label consistently
and propagate -ENOMEM in case we have no memory
2011-07-13 14:53:16 +02:00
Harald Welte f8e49dd187 bsc-nat: ctrlif: split out handle_ctrlif_msg() from ipaccess_bsc_read_cb()
We want to avoid spaghetti code by creating smaller functions,
which also helps with the line lengths / indentation levels.
2011-07-13 14:53:16 +02:00