Commit Graph

1427 Commits

Author SHA1 Message Date
Harald Welte 30d2ebddd6 move msgb talloc context into talloc_ctx.c
This keeps the ordering right, independent of link ordering, it
will ensure that the talloc dump will also catch msgb related
memory leaks.
2009-12-24 09:43:25 +01:00
Harald Welte 09f7ad0ff7 fix merge artefact from db.c 2009-12-24 09:42:07 +01:00
Harald Welte 5c706bbaf2 Merge remote branch 'origin/master' 2009-12-24 09:38:38 +01:00
Harald Welte 3606cc5765 [authentication] Code for retrieving authentication data from SQL DB
This is the first step towards supporting actual A3/A8 authentication.
2009-12-24 09:37:34 +01:00
Harald Welte a16ef3d23f ipaccess-proxy: Fix two memory leaks 2009-12-23 23:35:51 +01:00
Harald Welte 61cc306a55 debug: Fix typo DMM -> DNM (we don't need DMM twice)
This prevented NM related log messages from showing up at stderr
2009-12-23 23:03:57 +01:00
Harald Welte afdca0f3df input/ipaccess: Differentiate between LOGL_ERROR and DEBUG
also: make sure we properly reset the OML/RSL UP flags on a dead socket.
2009-12-23 23:01:56 +01:00
Harald Welte 87ed5cd4ad introduce #defines for ip.access RSL and OML UDP ports 2009-12-23 22:47:53 +01:00
Harald Welte 2ca7c31429 Add ipaccess-proxy, a proxy for ip.access A-bis over IP
This proxy allows us to restart OpenBSC while the BTS's are kept
running with their CCCH/BCCH alive.  This is very useful to
make sure the phones don't roam to other networks while restarting
OpenBSC.

The proxy also intrduces UDP sockets for injecting UDP packets
into the A-bis data stream.
2009-12-23 22:44:04 +01:00
Harald Welte b7bcb79bea Fix segfault in case BTS has more TRX than we have configured 2009-12-23 18:24:31 +01:00
Holger Hans Peter Freyther bf2bdc6e84 [ipaccess] The next byte appears to be size...
Using okteta to display the size in bigendian and
then selecting from the start to the " SDP" I get
the same number...
2009-12-23 13:09:27 +01:00
Holger Hans Peter Freyther e0d2ff4c2e [ipaccess] The second four bytes appear to be always the same 2009-12-23 13:03:12 +01:00
Holger Hans Peter Freyther 65d67dc222 [ipaccess] Start adding a tool that analyzes the ipaccess header
So far I have not much idea about the format. It is starting with
the magic byte and the header is spanning until the next occurence
of the " SDP" marker.
2009-12-23 12:52:30 +01:00
Holger Hans Peter Freyther 66e8219f96 [sw_load] It turns out there is a header that needs to be read
The magic " SDP" is occuring twice in the file. The first time
seems to be the file header and the second time it is with the
payload. We will need to parse this somehow...
2009-12-23 08:06:31 +01:00
Holger Hans Peter Freyther e7ff91342e [sw_load] For the nanoBTS just open the firmware
* The two version strings are not in an easy to parse header
  and from my trace it appears like the whole file is sent
  to the BTS. So just open the firmware file..
2009-12-23 07:26:57 +01:00
Holger Hans Peter Freyther 004e055cfd [ipacess-config] Remove one of my bogus debugging statements 2009-12-23 05:31:36 +01:00
Holger Hans Peter Freyther 079353ad1f [statistics] Do the syncing to db from within the bsc_hack
Change the counters_store_db function to be a generic for_each
function taking a function pointer and data. Use that in bsc_hack
to store it to the DB.

This is removing the DB requirement and will allow to handle
the counter values in different ways without making the counter
list public.

I verified that the syncing is still taking place.
2009-12-23 05:30:47 +01:00
Holger Hans Peter Freyther 6fced2fd0a [statistics] Make counter_db_store internal
Do not expose DB functionality on this level
2009-12-23 05:16:13 +01:00
Holger Hans Peter Freyther 5dbd71e31d [sccp] Provide dummy db_store_counter... 2009-12-23 05:13:48 +01:00
Holger Hans Peter Freyther 3b05a7affa [channel] Compile statistics.c into the test. 2009-12-23 05:13:29 +01:00
Holger Hans Peter Freyther f9b1f30558 [debug] Make the test case compile and it is still passing 2009-12-23 05:08:12 +01:00
Holger Hans Peter Freyther b61e3b2158 Import the new logging architecture
This is the new logging architecture, including

* support for multiuple logging targets like stderr and vty
* log levels in addition to categories/subsystems
* filtering based on imsi, i.e. only see events for one subscriber
* dynamically change log level for each category for each vty
2009-12-22 22:32:51 +01:00
Sylvain Munaut 0f9141384b Import code to generate RRLP ephemeris data from u-blox GPS receiver
taken from http://www.246tnt.com/files/rrlp-20091101.tar.bz2
2009-12-22 21:54:40 +01:00
Harald Welte e2b8eceee7 pretty-print statistics in 'show statistics' 2009-12-22 21:47:48 +01:00
Harald Welte 8387a49e39 print last measurement report during 'show lchan' 2009-12-22 21:43:14 +01:00
Harald Welte f9a43c45ea fix sql table creation for 'Counters' table 2009-12-22 21:40:42 +01:00
Harald Welte ffa55a4e87 statistics: Introduce 'struct counter' instead of using unsigned long
This has the advantage that counters can be added all over the code
very easily, while having only one routine that stores all of the
current counter values to the database.  The counters are synced
every 60 seconds, providing relatively fine grained statistics
about the network usage as time passes by.
2009-12-22 20:42:40 +01:00
Harald Welte 4983921af1 [gsm_04_11] Replace hardcoded transaction_id by real allocation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22 13:45:58 +01:00
Sylvain Munaut 4010f1e6f4 bts: Allow config of RACH control parameters tx-integer & max retrans
Tweaking theses can be useful especially tx-integer that influence
both the spread of rach attemps and the delay between two attemps.

Looking up GSM 04.08 3.3.1.1.2 & 10.5.2.29 can help determine good
values. The default are choosed with a wide spacing between attemps
(tx integer = 9 -> T=12 & S=217 (non-combined CCCH/SDCCH) or 115 (for
combined CCCH/SDCCH)). This alleviates the problem of responding to
several RACH attempts by a same MS, allocating several RF channels when
only 1 is needed.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22 13:43:26 +01:00
Sylvain Munaut ff1f19e199 Implement a better sending of pending SMS
The previous implementation had some shortcomings:
 - If the MIN ID given was not the exact id of the first unsent SMS,
 it would try to submit the same sms several time until id++ finally
 made id go to the next one.
 - If a subscriber had several SMS pending it would try to submit
 them individually (only to get rejected because a paging for that
 subscriber was already in progress)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22 13:22:29 +01:00
Harald Welte 9c4f6b5dca missing semicolon at end of statement 2009-12-22 13:16:27 +01:00
Harald Welte b908cb7e0e Display current channel usage load in 'show bts' and 'show network'
This is just the load at one given instant.  We definitely also want to see
some averages and record the measurements in a database later.
2009-12-22 13:11:28 +01:00
Holger Hans Peter Freyther c80210641a [vty] Document the various T??? we are ausing.
Provide a small individual documentation string.
2009-12-22 08:27:21 +01:00
Holger Hans Peter Freyther 0a64603db9 [misc] Move handover into libmsc.a
Handover is a high level decision, it can span multiple BSCs
and belongs mostly into the MSC domain.
2009-12-22 08:19:42 +01:00
Holger Hans Peter Freyther 4f5456c040 [misc] Move rtp_proxy.c into the libbsc.c
For the time being RSL has to know about Layer4 and upwards
and is using the RTP socket class....
2009-12-22 07:48:20 +01:00
Holger Hans Peter Freyther 92ffd926ef [gsm48] Move gsm48_parse_meas_rep to gsm_04_08_utils
Move the function over to the _utils side as handover
measurement is compiled into libbsc and we don't want
to end up with linking errors.
2009-12-22 07:45:17 +01:00
Harald Welte 24ff6ee0a3 keep some internal statistics inside OpenBSC
the statistics will give us some idea about the network load and
performance.
2009-12-22 00:41:05 +01:00
Harald Welte a992a36d5f it's LOGL_ERROR, not LOG_ERROR 2009-12-21 23:44:40 +01:00
Steffen Neubauer ac0c13c02c [sms] bugfix: additional functionality indicator only appears in TP_VPF_ENHANCED - not in TP_VPF_ABSOLUTE 2009-12-21 23:27:54 +01:00
Harald Welte 73d4fce151 make sure bootstrap_bts() only contains static initialization
values that might change at runtime are moved to set_system_infos()
which we might now also call at runtime to update the BTS with
changes in the SI
2009-12-21 23:12:19 +01:00
Harald Welte 713550120c remove duplicate flag for cell barring
it's sufficient if we keep the state of cell barring in one place
2009-12-21 23:08:18 +01:00
Harald Welte 1394fea03f ipaccess: Fix two minor bugs regarding multi-TRX setup
we need to set newbfd->priv_nr to 2+trx_id, rather than keeping
it '2' all the time, as it is used to look-up the e1i_ts when
we receive a packet.  A constant '2' would always match to TRX 0.

we also need to keep one separate bit for each TRX state in order
to properly generate the EVT_E1_TEI_UP event for trx > 0.
2009-12-21 23:01:33 +01:00
Harald Welte 6a22c0135a [gprs] SI 13 should only be generated on C0 (BCCH-carrying TRX) 2009-12-21 19:10:55 +01:00
Harald Welte 31b0347e72 fix crash in A-bis OML plugin in recent wireshark versions 2009-12-21 19:05:13 +01:00
Holger Hans Peter Freyther 306b7219ac [abis] Do not access an array with N elements at index N
Possible crash fixes by preventing accessing the
array out of bounds.
2009-12-21 17:06:07 +01:00
Holger Hans Peter Freyther 17c24c9057 [abis] Properly compare obj_inst->trx_nr to bts->num_trx
* Use >= in this case as we start counting the trx from 0
* This is fixing a problem with multi trx config
2009-12-21 17:00:46 +01:00
Harald Welte b720bd3678 make handover algorithm parameters configurable from VTY 2009-12-21 16:51:50 +01:00
Harald Welte f7c28b099f [handover] Real handover algorithm
This implements the handover algorithm (and associated parameters)
as described in Chapter 8 of the book "Performance Enhancements in
a Frequency |Hopping GSM Network" by Thomas Toftegard Nielsen and Jeroen
Wigard.

The parameters such as averaging windows are configured in struct
gsm_network.  We keep some state to trakc up to 10 neighbors as
they are being reported from the MS.

This has so far only been tested in a network with two BTS that
have each other as neighbor.  Networks with morge neighbors might
encounter bugs.
2009-12-21 13:33:10 +01:00
Harald Welte ade773f441 handover: set old channel to INACTIVE state
After receiving the HANDOVER COMPLETE on the new channel, we mark the
old channel as INACTIVE and try to release it ASAP.
2009-12-21 13:33:10 +01:00
Harald Welte b8bfc567b7 RSL: keep track if a channel is active or not
This allows us to block packets that we have received after the channel
is no longer being used.  This is visible during handover, where we still
receive a measurement report after the MS has switched to the new channel.

This leftover measurement report then attempts to trigger another handover,
which si bogus and will fail - and thus only consumes resources.

With the new LCHAN_S_ACTIVE state, we can check for this when processing
the measurement report.
2009-12-21 13:33:10 +01:00