Commit Graph

2691 Commits

Author SHA1 Message Date
Harald Welte 9c3dc90d16 introduce HAVE_TM_GMTOFF_IN_TM
Not all architectures have the tm.tm_gmtoff member.  This fixes cygwin
builds.
2012-04-08 16:59:24 +02:00
Harald Welte a334c296e0 make sure we still build on systems that don't have IPPROTO_GRE 2012-04-08 15:56:00 +02:00
Holger Hans Peter Freyther 2f2be578cb misc: Use other size modifiers to fix compiler warnings
control_if.c:521:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat]
osmo_bsc_bssap.c:473:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ [-Wformat]
mgcp_main.c:162:4: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformatt]
2012-03-16 12:18:39 +01:00
Holger Hans Peter Freyther 20fea24515 bsc: Prepare to have multiple MSC connections
We now have a list of MSCs but in the code we will
try to access the MSC with the nr 0.
2012-03-16 11:56:21 +01:00
Holger Hans Peter Freyther 44e5dad3e2 bsc: Use the right connection for outgoing packets
This is needed for simple UDT messages where we do not have
a SCCP connection.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther abd668a68d bsc: Move more things to use osmo_msc_data* directly 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther f936fb4086 bsc: Move the bsc_filter to use the osmo_bsc_sccp_con 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 4cdb050d13 bsc: Move away from ->bsc.msc to use the selected MSC
For multiple MSCs we should only have one place where the MSC
is selected and the rest will extract it from somewhere.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther f31a4a4810 bsc: Stop using net->bsc->msc and get the right msc from somewhere else 2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 8ec4952557 bsc: Create a osmo_bsc_data and embed osmo_msc_data
We want to have multiple MSCs but we also have some data
that is only present on a per BSC basis. Right now the
MSC data is not allocated with talloc, so we have some
change in the talloc contexts.
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther 4d31900e2d bsc: Address warnings about implicit declarations
osmo_bsc_main.c: In function ‘main’:
osmo_bsc_main.c:398:2: warning: implicit declaration of function ‘bts_init’ [-Wimplicit-function-declaration]
osmo_bsc_main.c:399:2: warning: implicit declaration of function ‘libosmo_abis_init’ [-Wimplicit-function-declaration]
osmo_bsc_main.c:418:2: warning: implicit declaration of function ‘bsc_bootstrap_network’ [-Wimplicit-function-declaration]
2012-03-16 11:56:10 +01:00
Holger Hans Peter Freyther dc3389f9c8 bsc: Fix compiler warning about wrong return and unused variable
osmo_bsc_api.c: In function ‘bsc_cm_update’:
osmo_bsc_api.c:195:2: warning: ‘return’ with a value, in function returning void [enabled by default]
osmo_bsc_api.c:193:28: warning: unused variable ‘sccp’ [-Wunused-variable]
2012-03-16 11:56:10 +01:00
Harald Welte ae1997248c mgcp: implement a more tolerant parser based on strtok_r()
Instead of building complex manual byte-wise parsers, we simply use two
strtok_r loops:  one iterating over all the lines, the next one
iterating over the invididual space-separated elements in the first line.

The benefit is that we now accept \r, \n or \r\n, or any multiple of
them as line ending.  This works around incompliant MGCP implementations
like that of Zynetix MSC.

Addition: mgcp_analyze_header returns 0 when all out parameters have
been set.

Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:24:18 +01:00
Harald Welte 6b36b90f75 mgcp: make sure all command line options are documented
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:21:34 +01:00
Harald Welte ec7683f3b0 mgcp: consistently name bsc_mgcp osmo-bsc_mgcp
Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
2012-03-16 10:21:34 +01:00
Holger Hans Peter Freyther a8ddb08e05 misc: Use msgb_free for freeing the messages 2012-03-01 20:30:32 +01:00
Andreas Eversberg c50543b18a Improved generation of SYSTEM INFORMATIONs 2* and 5* for neighbour bands
In addition to SI 2 and SI 5, the SI 2ter and 2bis is generated, if
neighbour cells in other bands exist. Also it is indicated in the rest
octets of SI3, that SI 2ter is used. If no neighbour cell in a different
band exists, the SI 2ter and SI 5ter is omitted.

A special case is P-GSM range (channels 1-124). To be compatible with
older phones, SI 2bis and SI 5bis is used. If the BCCH lays inside the
P-GSM band, only neighbour cells of the P-GSM range are included in
SI 2 and SI 5. If neighbour cells exist in the same band (900), but lay
outside the P-GSM range, the SI 2bis and SI 5bis is used to extend the
list of neighbour cells. The extension is also indicated in SI 2 and
SI 5. If the BCCH lays inside the P-GSM range, but no neighbour cell
exists in the same band outside the P-GSM range, the SI 2bis ans SI 5bis
are omitted.
2012-03-01 08:29:56 +01:00
Tobias Engel c33d7d71cb Make sure USSD code only responds *#100# for retrieving own number
strstr() was used with wrong argument order, causing it to always match,
and causing an invalid response to a variety of different SS and USSD
requests.

This has apparently caused havoc among a number of HTC phones which
issue SS requests without user interaction upon boot, and then trip over
our inappropriate response.
2012-02-24 22:23:17 +01:00
Harald Welte 2935034b5e fix generation of frequency list (E-GSM vs. P-GSM 900) 2012-02-17 15:59:25 +01:00
Holger Hans Peter Freyther c8ddf73c8f bts_ipaccess_nanobts.c: Remove unused variable.
This must have been obsoleted by the move to libosmo-abis.

GCC warning:
bts_ipaccess_nanobts.c: In function ‘ipaccess_drop_oml’:
bts_ipaccess_nanobts.c:509:21: warning: variable ‘line’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:31:05 +01:00
Holger Hans Peter Freyther 863dc9bc84 abis_rsl.c: Remove unused variable net.
The old BSC code had code to override the payload type, this has
been removed, remove the variable accessing it.

GCC warning:
abis_rsl.c: In function ‘ipa_rtp_pt_for_lchan’:
abis_rsl.c:1590:22: warning: unused variable ‘net’ [-Wunused-variable]
2012-02-03 20:29:00 +01:00
Holger Hans Peter Freyther 54fa2c7eab abis_rsl: The rach information was not used, introduce a signal
Introduce a SS_CCCH for the paging and the rach load. The paging
code could now start using the signal.

GCC warning:
abis_rsl.c: In function ‘rsl_rx_ccch_load’:
abis_rsl.c:1371:11: warning: variable ‘rach_access_count’ set but not used [-Wunused-but-set-variable]
abis_rsl.c:1370:11: warning: variable ‘rach_busy_count’ set but not used [-Wunused-but-set-variable]
abis_rsl.c:1369:11: warning: variable ‘rach_slot_count’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:26:25 +01:00
Holger Hans Peter Freyther c6d0a17100 abis_rsl.c: Remove unused variable ts_number
GCC warning:
abis_rsl.c: In function ‘rsl_rx_chan_rqd’:
abis_rsl.c:1245:10: warning: variable ‘ts_number’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:10:13 +01:00
Holger Hans Peter Freyther 06b04f851b abis_om2000.c: Remove unused variable to_trx_oml.
GCC warning:
abis_om2000.c: In function ‘abis_om2k_sendmsg’:
abis_om2000.c:804:6: warning: unused variable ‘to_trx_oml’ [-Wunused-variable]
2012-02-03 20:03:06 +01:00
Holger Hans Peter Freyther 37e6523c0f vty: Remove two unimplemented OML functions
attribute get|set <0-255> (.HEX) was never implemented and the
output about the unused attributes clutter the build output, remove
them.

GCC warning:
abis_nm_vty.c: In function ‘oml_attrib_get’:
abis_nm_vty.c:141:25: warning: unused variable ‘oms’ [-Wunused-variable]
abis_nm_vty.c: In function ‘oml_attrib_set’:
abis_nm_vty.c:152:25: warning: unused variable ‘oms’ [-Wunused-variable]
2012-02-03 20:03:02 +01:00
Holger Hans Peter Freyther dae5307a57 misc: abis_nm.c Use the result of ret.
Use LOGP(DNM, LOGL_ERROR, ...); for errors in the
abis_nm_rx_sw_act_req method.

GCC warning:
abis_nm.c: In function ‘abis_nm_rx_sw_act_req’:
abis_nm.c:412:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
2012-02-03 20:03:00 +01:00
Holger Hans Peter Freyther f02bb200c5 misc: gsm_data.c address compiler warning
Assume nothing special needs to be done for the Nokia
*site hardware.

GCC warning:
gsm_data.c: In function ‘gsm_set_bts_type’:
gsm_data.c:342:2: warning: enumeration value ‘GSM_BTS_TYPE_NOKIA_SITE’ not handled in switch [-Wswitch]
2012-02-03 20:02:54 +01:00
Harald Welte 1fe73a19cd ARFCNs are in the range of 0..1023, not 0..1024
I'm sure I read somewhere that it actually was 0..1024, as I kept
wondering how stupid it was to use 10bit+1.  However, that source
was incorrect, as GSM TS 05.05 quite clearly states 0..1023
2012-01-29 13:24:12 +01:00
Harald Welte 78b5586e25 osmo-bsc: Remove hard-coded check for codec preferecne in ASS CMD
When we get an assignment command from the MSC, we no longer have to
check statically for certain codecs, as we have a vty-configured list of
codecs that is checked just below.
2012-01-27 00:43:06 +01:00
Harald Welte 6a85705d51 MGCP: Add VTY commands to reset (RSIP) one or all endpoints 2012-01-27 00:41:39 +01:00
Harald Welte 50f93a4acd bsc_mgcp: optionally connect the MGCP socket to the MGW
This allows the use of the existing "call-agent ip A.B.C.D" command in
libmgcp in order to set a default destination address of the call agent.

This is required as a pre-condition for certain call agents (like the
zynetix MSC) that require a RSIP from the BSC to the MSC as the initial
MGCP message.
2012-01-27 00:38:59 +01:00
Harald Welte cf149eebb6 Move the bulk of RR processing from MSC into BSC
RR Messages like STATUS, GPRS SUSPEND, HANDOVER COMPLETE/FAIL, ...
should be processed on the BSC side of things, not on the MSC side.

This is among other things required in preparation of intra-BSC
hand-over support in osmo-bsc.
2012-01-23 16:40:24 +01:00
Harald Welte 95e862cab4 Move processing of CLASSMARK CHANGE behind bsc_api
This prevents osmo-bsc from sending RR messages to the MSC and rather
process them inside the BSC and turn them into BSSAP CM UPDATE.
2012-01-23 10:28:35 +01:00
Harald Welte d55cef9b07 osmo-bsc: correctly parse the TMSI in BSSAP paging from MSC
the TMSI is a uint32_t big-endian value and not a gsm 04.08 mobile
identity like the IMSI.
2012-01-20 17:21:36 +01:00
Holger Hans Peter Freyther 7d60bdb2c2 nat: Add VTY command for the TP-DA rewriting. 2012-01-18 20:40:01 +01:00
Holger Hans Peter Freyther 2718845967 nat: Fix the no sms-clear-tp-srr command 2012-01-18 20:34:08 +01:00
Holger Hans Peter Freyther 47b144b002 nat: Internationalize the TP-DA if it starts with a 00
Internationalize the number like we do it for Call Control. Update
the test result to match this new behavior.
2012-01-18 20:15:29 +01:00
Holger Hans Peter Freyther 8e60f629e2 nat: Prepare to rewrite the TP-DA number of a SMS submit.
Introduce number rewriting of SMS-SUBMIT. Introduce a new list,
move code around to help with finding a new number, somehow the
number encoding for TP-DA is borked, 03.40 references 04.11 but
the length appears to be strlen(number) without taken the type
field into account.
2012-01-18 20:14:58 +01:00
Holger Hans Peter Freyther 445d00543a mgcp: Fix warning about unused variable
mgcp_network.c:335:22: warning: variable ‘cfg’ set but not used [-Wunused-but-set-variable]
2012-01-17 16:00:08 +01:00
Holger Hans Peter Freyther 9592c45e34 mgcp: Provide documentation for the method, check sscanf return 2012-01-17 15:58:48 +01:00
Holger Hans Peter Freyther f95f2733e6 lchan: Close a possible still open RTP Socket
In case of a reset (loss of the BTS) close down all remaining
RTP Proxy sockets. In case of a lchan_free shout if the rtp
proxy is still open. I would prefer if the proxy code sits inside
the gsm subscriber connection.
2012-01-17 15:30:24 +01:00
Holger Hans Peter Freyther 1d7f7c8ca8 ho: Remove rtp_proxy.h include, no proxy code in here 2012-01-17 15:27:13 +01:00
Holger Hans Peter Freyther 794e8f2649 abis: gsm_data_shared.h includes libosmo-abis header, add abis to cflags
gsm_data_shared.h includes e1_input.h of libosmo-abis, add the
LIBOSMOABIS_CFLAGS to Makefile.am, remove AM_LDFLAGS at the same
time as we only build .a archives.
2012-01-15 17:52:02 +01:00
Holger Hans Peter Freyther 9e7837a14d mncc: Include size and offsets of struct gsm_mncc in the hello
Increase the version number and send the sizeof of the gsm_mncc
and the gsm_data_frame structure. Include the offsets of some
members as well to maybe identify ABI problems.

The reason we go through this is that we want to benefit from
the native ABI and don't want to force packed structs.
2012-01-15 00:40:42 +01:00
Holger Hans Peter Freyther c0a6674614 channel: Review lchan_free calls and the state the channel is in
In case of a memory allocation failure in rsl_rx_chan_rqd we would
have left the channel in the LCHAN_S_ACT_REQ state. Move the state
change below the allocation.
2012-01-15 00:28:15 +01:00
Holger Hans Peter Freyther dfcfe65f24 lchan: Rename release_reason to release_mode
Use the name of GSM 08.58 for the release mode.
2012-01-15 00:03:19 +01:00
Holger Hans Peter Freyther bbf2139fdc channel: The error timer and the lchan_deact_tmr are both running
In case a BTS does not send the RF Channel Release ACK and we are
closing the channel because of an error two timers are running to
set the state back to none.

Make lchan_deact_tmr_cb and rsl_rx_rf_chan_rel_ack behave the same
in regard to changing the state of the lchan. For the other direction
we are save, the error path will set the state to NONE and the timeout
will call lchan_free to set the channel type back to NONE, only then
the lchan may be allocated again.

The channel release procedure requires some more tweaking, some part
was started in the zecke/28c3 branch and needs to be tested/integrated
with the goal of having one common release path.
2012-01-15 00:02:54 +01:00
Holger Hans Peter Freyther c55f0a5415 Revert "libbsc: Log if a channel is freed with lchan->state != LCHAN_S_NONE"
In case of a failed channel we still want the channel to not be
re-allocated right away but keep it closed/unused for (T3109 + T311).

rsl_rx_rf_chan_rel_ack has a check to not set the channel to S_NONE in
case the channel is in the error state. Add the camp Harald added a timer
to set the channel back to the none state in case the RF Channel Release
is not acked.

This reverts commit fc462dd59e.
2012-01-15 00:02:54 +01:00
Holger Hans Peter Freyther 7173f63eed bsc: Fix "show lchan" for partially provided information
show lchan should be capable of showing all allocated lchans,
all of a given bts, a given trx, a given ts. This feature was
broken when I added the ability to show a more simple summary.

Restore the initial behavior by splitting out the for loops
for the bts/trx/ts and check if we have parsed all parameters
and then call and return the subroutine.
2012-01-15 00:02:54 +01:00
Holger Hans Peter Freyther 0977e0c4b8 nat: Add the line break after the '. 2012-01-11 11:23:25 +01:00