Commit Graph

3707 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 09db1a44bc nat: Add another test case for TP-SRR clearing and number rewrite 2012-03-26 16:22:08 +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 d77023b1c2 mgcp_test: Add wrong messages as input and check what happens
Test parsing some invalid messages and see if we start to crash.
2012-03-16 10:21:29 +01:00
Holger Hans Peter Freyther 5563e6c268 mgcp_test: Rename method as it now operates on an array of messages
This code was cleaned up, catch up and rename the method.
2012-03-16 10:06:39 +01:00
Holger Hans Peter Freyther 3e60348b3b misc: Deal with smatch warnings about the bitfields
Use unsigned ints for the bitfield.
2012-03-02 14:14:33 +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 94b499c9bd mgcp: add missing prototypes for send_mgcp_reset_* 2012-01-27 00:46:49 +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 27fa7901bb MGCP: Add CRCX test cases
The second test case (CRCX_ZYN) fails as the message is not compliant
with the spec.  However, our parer should be more tolerant, just in
case...
2012-01-27 00:37:23 +01:00
Harald Welte f74da14c01 further generalize mgcp testing code
use a data-structure driven approach
2012-01-27 00:36:56 +01:00
Harald Welte 8819d8289d mgcp_test: remove duplicate code 2012-01-27 00:00:44 +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 be53012f9c nat: Print the sizes and the offending data in case of a failure 2012-01-18 17:20:23 +01:00
Holger Hans Peter Freyther 0354a80357 rsl: This is provided by libosmo-abis, remove it here 2012-01-17 16:14:23 +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