Commit Graph

47 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther f8eff2e4b5 [ipa] Fix the reporting of link down...
Now bsc_init.c is able to handle the link down messages.
2010-04-15 11:19:08 +02:00
Holger Hans Peter Freyther 70402a4e4d [ipa] Handle losing the RSL/OML connection..
This is addressing multiple issues regarding the loss of the
OML/RSL link to the BTS.

1.) When we lose the OML link, close down all RSL connections
on all TRXs (only tested with one TRX) and free the e1inp_line
allocated for the OML connection.
2.) When we lose the RSL link on any TRX and we know to which
lines this connection belongs, we will close down the OML connection
as we have a problem to just reactivate one RSL link.
3.) When we lose the RSL link on any TRX and we do not know
where it belongs to we will free the bfd we have allocated in the
rsl listen/accept method and we properly close the socket (i could
not test this one properly). This is made under the assumption
the BTS has not responded to the ID request.
4.) When we already have a bts->oml_link we will throw it away
and use the new link (it should not happen) and the same applies
to the rsl link.
2010-04-15 11:17:24 +02:00
Holger Hans Peter Freyther 63cb447fd5 Revert "ipa: Reduce the throttling of the IPA msges"
Reducing the throttling to this value created a regression with
bringing up RSL on the nanoBTS 900. We do seem to have a bug/issue
in the bsc_init code and might send a command too early without this
longer wait period and then the state transition does not happen.

For now it is agreed that reverting is the best thing to do.

Debugged-by: Sylvain Munaut <246tnt@gmail.com>

This reverts commit f5284ae1cf.
2010-04-11 10:14:16 +02:00
Holger Hans Peter Freyther 6c8c0ddbe2 [ipa] When including MGCP our messages might be bigger than 300 byte
The length field of the IPA header allows to have 16bit numbers
and I just ran into the 300 byte limit with MGCP messages. Make it
three times the size and see how long this is going to be enough.
2010-04-07 23:10:38 +02:00
Holger Hans Peter Freyther b6e1a40c9c [misnd] Use the size_t modifier when printing the size. 2010-03-30 15:25:02 +02:00
Holger Hans Peter Freyther acf8a0c59f [misc] Remove whitespace from the end of the line. 2010-03-29 08:47:44 +02:00
Holger Hans Peter Freyther edee7944a5 ipa: Fix the previous patch and initialize the fds to -1
The code in 354ef81d80 checked
for fd >= 0 but on startup the struct is memset to 0 so this
test is true. Initialize the fds to -1 to make the code work
and be able to handle all ranges of the fd.
2010-03-24 11:20:27 +01:00
Holger Hans Peter Freyther b3121c5b3f ipa: Handle corrupt incoming messages without crashing
Attempt to read the three byte IPA header. If we read 0 then
the socket can be closed otherwise we need to read three bytes, if
we don't we do have a failure.

After having parsed the header we need to evaluate the length,
if the length is bigger than would fit into our buffer we will
ignore that and print an error.

This is fixing a crash when the BTS is crashing...
2010-03-24 08:40:55 +01:00
Holger Hans Peter Freyther f5284ae1cf ipa: Reduce the throttling of the IPA msges
This code used to be a sleep, it was changed to be a timer by Andreas
but this timer does not seem to have any use. When doing the sw load
this timer is increasing the upload time dramatically, reduce it to
make it work faster.
2010-03-24 08:33:22 +01:00
Holger Hans Peter Freyther dc6af631e5 ipa: Use two defines instead of magic numbers
We spearate OML/RSL by putting a magic number into the priv_nr. Use
a define instead of ordinary integers.
2010-03-24 05:07:50 +01:00
Holger Hans Peter Freyther 354ef81d80 ipaccess: Handle the case of replacing RSL connections
Fix a infinite loop when establishing a new RSL connection and the
BSC is identifying itself with a unit id of an already established
RSL connection. The infinite loops happens because we are corrupting
the the linuxlist inside the bsc_fd when registering the bfd twice.

Due the lack of proper authentication favor the new RSL connection
as the real one and close the previous one.
2010-03-24 04:44:50 +01:00
Harald Welte dfe6c7d910 split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB

The library currently includes the following modules:

bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist

msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 16:27:23 +01:00
Holger Hans Peter Freyther 4d2d95b35a ipaccess.c: Fix some resource leaks in error conditions.
* Close the socket when the bind is failing.
* Close the socket when the listen is failing.
* Close the socket then the bsc_register_fd is failing.
* Return an error when the socket call is not returning a socket.
2010-02-19 13:07:05 +01:00
Holger Hans Peter Freyther d3d5be1cde [ipaccess] Make the IPA version of LTV public. 2010-02-09 17:40:37 +01:00
Holger Hans Peter Freyther 3bc856bc16 [ipa] Make sending of ID REQ public...
Make sending of the ID Request message public. We are going
to use this in the BSC NAT code to ask for querying the BSC.
2010-02-07 13:21:51 +01:00
Holger Hans Peter Freyther 301e628761 [ipaccess] Create a method to send the ID ACK messages 2010-02-07 13:21:40 +01:00
Harald Welte (local) 7971d3d281 ipaccess input: Print BTS number that has disappeared 2009-12-29 11:00:37 +01:00
Harald Welte fb33957405 properly check for EAGAIN in recv() calls
If recv() has no more messages on a non-blocking socket, errno will be EAGAIN,
not the return value!
2009-12-24 13:35:18 +01:00
Harald Welte da956931fa if we recv() from an abis-ip socket, don't consider -EAGAIN an error 2009-12-24 12:49:43 +01:00
Harald Welte 5c706bbaf2 Merge remote branch 'origin/master' 2009-12-24 09:38:38 +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 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 88a412ac80 ip.access: Keep OML/RSL up/down state per-bts for multi-BTS setups 2009-12-16 17:32:37 +01:00
Holger Hans Peter Freyther c7df7c6e42 [ipaccess] Fix spelling in the comment 2009-11-17 09:46:33 +01:00
Harald Welte 986c3d76db fix some more compiler warnings 2009-11-17 06:12:16 +01:00
Sylvain Munaut d7d1c99a53 ip.access: Header has a 16bit length in network byte order
This is confirmed by looking at the source of their dissector.
The length can go up to 273 bytes apparently (again, according
to the source of their dissector).
2009-10-29 16:33:59 +01:00
Holger Hans Peter Freyther 5ea731338d [misc] Use talloc_zero instead of talloc and later memset 2009-10-29 02:29:45 +01:00
Holger Hans Peter Freyther 67b596199d input/ipaccess.c: clang says ret might be uninitialized
and it appears to be right that for the "default" case ret
will not be assigned and we return ret.
2009-10-27 10:08:38 +01:00
Harald Welte e73501a4f6 [ipaccess] revert commit 9bd7bc1b4c
Commit 9bd7bc1b4c caused the RSL
initialization to happen too early, resulting in the BTS
bootstrapping but missing [some of?] the system information
types.
2009-10-21 21:16:00 +02:00
Harald Welte 9bd7bc1b4c input/ipaccess: remove one more static variable 2009-10-20 00:50:03 +02:00
Harald Welte 8175e95222 ip.access: Support multi-TRX / RSL stream ID
In order to support multi-TRX configurations, we need to be able
to cope with multiple RSL streams (each with their own stream identifier)
inside one ip.access TCP connection.

Since this is very similar to using the TEI on a E1 line, we simply
recycle the logic and data fields that are used for the TEI.
2009-10-20 00:22:00 +02:00
Andreas Eversberg 38ae5cb2c2 use tx delay timer instead of usleep() in ip.access input driver
this fixes the delay of audio caused by stalling of the openbsc process.
the use of 'usleep(100000)' for slowing down transmission to nanoBTS is
replaced by the tx-delay timer. i did this on bs11 code, so i did it the
same way. it actually queues frames for transmission not nanoBTS. on
transmission a timer is started and when this timer expires, the next
frame in the queue is transmitted (timer restarted) until the queue is
empty.
2009-10-08 12:53:16 +02:00
Sylvain Munaut 86538c7fab input/ipaccess: Fix segv caused by use of uninitialized var
This is a regression coming from the recent split of the
handle_ts1_read method in two.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2009-10-01 03:53:31 +02:00
Holger Hans Peter Freyther d5f052230c [ipaccess] Prepare to reuse parts of the code for the A-link
For the MSC<->BSC connection we are going to use the same header
as used from BTS<->BSC but we are not having an E1-Link, a gsm network
or a gsm_bts available and can not use this part of the code.
2009-09-30 06:27:16 +02:00
Holger Hans Peter Freyther 336f509941 ipaccess.c: Make the compiler happy...
The compiler thinks the variables might not be initialized, we
know it is wrong... but just make it happy.
2009-08-10 08:26:14 +02:00
Holger Hans Peter Freyther 4e2973d2d3 misdn.c: Fix warning about redefining AF_ISDN..
We use the same construct in e1_inpit.c, use it here too.
2009-08-10 08:26:13 +02:00
Holger Hans Peter Freyther e4042c72d7 misc: Remove some obviously unused and unneeded variables.. 2009-08-10 08:26:13 +02:00
Holger Hans Peter Freyther 09e364b167 misc: Fix warnings about returning with value...
return rc in these cases.
2009-08-10 08:26:12 +02:00
Harald Welte 42581829ec the actual config file code (not just config files)
this was missing from commit a08a9acdb6
2009-08-08 16:12:58 +02:00
Harald Welte 9e85b54799 prepare mISDN driver for multiple lines/instances
In order to use multiple mISDN cards, we need to:
1) move driver initialization out of line initialization
2) make sure we allow partial (virtual) E1 cards with < 30 B-channels
2009-08-04 14:11:49 +02:00
Harald Welte dd2b434b20 make sure misdn plugin handles DL_UNITDATA_IND
This reportedly fixes the problem that we didn't see MEASurement REPort
messages from the BS-11.
2009-07-04 09:28:00 +02:00
Harald Welte 966636f39f use named variant when allocating msgb's
when we generate a talloc report (SIGUSR1), we can now see which system
allocated a given msgb, this helps memory leak debugging
2009-06-26 19:39:35 +02:00
Harald Welte a4ffea9505 fix various talloc / dynamic bts/trx related bugs
Prior to this patch, nanobts was not able to operate after recent changes
2009-06-22 01:36:25 +02:00
Harald Welte e441d9c361 switch to dynamically allocated BTS and TRX data structures
This makes it much easier to do run-time configuration using the vty
interface.
2009-06-21 16:17:15 +02:00
Harald Welte 2cf161be08 introduce talloc all over OpenBSC 2009-06-20 22:36:41 +02:00
Harald Welte 13e10daa33 move openbsc into its own subdirectory 2009-06-10 05:40:52 +08:00