Commit Graph

1872 Commits

Author SHA1 Message Date
Daniel Willmann ba34a2fd73 gprs: Increase NS_ALLOC_SIZE to 3k
2k can be insufficient when responding with a STATUS message to a long LLC
packet because the original message is included in the STATUS.

Change-Id: I6f76751cfadf61e87ce4367a38907083e1c98562
Ticket: SYS#2967
Sponsored-by: On-Waves ehf
2016-09-23 02:42:46 +00:00
Neels Hofmeyr 38d232ee5d log CTRL bind address and port
Log 'CTRL at 1.2.3.4 5678' from ctrl_interface_setup*. All callers can now drop
any extra 'CTRL at 1.2.3.4 5678' logging.

Change-Id: If449d0514e3d0cc1b346d7452194d931aa090166
2016-09-23 02:39:12 +00:00
Neels Hofmeyr 55dc2edc89 log telnet bind address and port
Log 'telnet at 1.2.3.4 5678' from telnet_init*. All callers can now drop any
extra 'VTY at 1.2.3.4 5678' logging.

Change-Id: I1da7b9076311d9458caea732fc0daace6533a3fd
2016-09-23 02:39:12 +00:00
Neels Hofmeyr dbc6817792 timer_test: set 8 as default steps, use the default in testsuite.at
Change-Id: I5070578e9fe2bdacaad000eaafb8dc5f549d6f3e
2016-09-22 07:18:39 +02:00
Neels Hofmeyr d0858c2ae9 timer_test: print more details to stdout to check
The test is now fully deterministic, so include all detail in stdout, to check
for.

Change-Id: Iecf6387f1d25253fcf1260777673853030c1d326
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 255dac16a4 timer_test: redirect some output from stderr to stdout
This way we can check the output in timer_test.ok.

Change-Id: Ia3bba1c650be3558d370e0f59d4ee7f36ef97506
2016-09-22 07:18:39 +02:00
Neels Hofmeyr d73c1cc7c2 timer_test: remove all random elements
Change-Id: I9833031407e99f5d7a1144c26b68a7e320b2020d
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 7b4d727ec5 timer_test: do not use real time: deterministic and faster
Use osmo_gettimeofday_override* to decouple the timer test from real time. No
longer call osmo_select_main(), since select() actually waits for real time.

This reduces the timer_test to the osmo_timer_* logic and excludes the real
time and osmo_timers_nearest() accuracy testing with actual waiting involved.
This may be seen as a loss, but is more fit for a test suite.

The main point here is to get deterministic results in jenkins, so that we
don't have to retrigger jobs based on timing failures; added bonus is that the
test runs much faster now.

Change-Id: Ic5649512df86dd17070daa2f314159eafaf8feb8
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 8e2f7e87f4 add osmo_gettimeofday as a shim around gettimeofday
This allows feeding a custom time for unit tests by overriding
osmo_gettimeofday.

Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 13a8fb84f0 timer_test: remove unused precision values and confusing log
Change-Id: I1570b7096c757d63d23e0950feeeb7230f8a5c9f
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 9c9a04705f timer_test: also report early finishes, report timing on error
When a timer was late, show the timing details.

Also count whether timers fired early, for completeness' sake.

Change-Id: Id3942637d77a28b5092ffffcc3e6d9d67c2b8e68
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 633a0e76a2 fix timer_test: don't forget to set tv_usec on the stop time
The timer_test schedules timers and records the desired stop time. Also store
the usec value of the desired stop time, because scheduling at e.g. sec N usec
999999 but recording sec N usec 0, and then receiving a timer at sec N+1 usec 0
is only 1 usec late, but records as 1000000 usecs late. This might have been
the main cause of the timer test not working well on the osmocom build server.

Change-Id: I13bb60f7d341a397f95d13d9c63c40188b6cd5a0
2016-09-22 07:18:39 +02:00
Neels Hofmeyr 5b34f773e4 remove unused local variable in get_rate_ctr()
Unused after 22886d9e32
"Fix retrieving rate_ctr over control interface"

Change-Id: Ib5411da80c4eb4f905a5ed87c60477eca2cdff42
2016-09-19 14:18:38 +02:00
Neels Hofmeyr 2e38d358b6 remove unused function get_rate_ctr_group()
Unused after 22886d9e32
"Fix retrieving rate_ctr over control interface"

Change-Id: I405367ef6ba5833957778a79dd398ce5ea29307e
2016-09-19 14:18:38 +02:00
Neels Hofmeyr d95f01d204 build: tests: don't link system installed libosmogsm.
Add src/gsm/libosmogsm.la explicitly to some test linkages, because otherwise
the linker would pick the libosmogsm already installed on the system instead of
the one that was just built in the source tree.

I noticed because a libosmogsm needing some more symbols from libosmocodec was
still installed, while the patch that cause it was already removed. Thus I
caught all(?) test binaries that linked libosmogsm from $PREFIX.

Change-Id: Ie61d60e1506f16de20add70fd0f44ebfa7a00a75
2016-09-10 12:03:39 +00:00
Neels Hofmeyr 1a587bd782 fix GGSN Ctrl port to 4257
4253 used to collide with the sysmobts-mgr VTY port.
Note, openggsn does not actually have a Ctrl interface yet.

Change-Id: If0fa0e606dabd5bc89907a56ef18cdbbbdedb4b7
2016-09-09 16:23:18 +02:00
Neels Hofmeyr 56313c84c8 comment: */ports.h: link to wiki + manuals, indicate used ports
Change-Id: I6a7bf04e589ccfaea98f20900a9bfe9dd4808dce
2016-09-09 16:22:39 +02:00
Max c69de3e25c Add Marker to ph_tch_param
Extend struct ph_tch_param with Marker bit from RTP header to indicate
speech onset in case of DTX.

Change-Id: Ic664902630b9d335ff9abc7a9ca7249eaf80e05f
Related: OS#1750
2016-09-09 06:35:42 +00:00
Anatoly Orlov 6320934e6a libosmocodec link fix on MacOSX
Fixes the following bug:

  CCLD     libosmocodec.la
Undefined symbols for architecture x86_64:
  "_bitvec_get_bit_pos", referenced from:
      _osmo_fr_check_sid in gsm610.o
  "_bitvec_get_uint", referenced from:
      _osmo_hr_check_sid in gsm620.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libosmocodec.la] Error 1

Change-Id: Id7358b94e274b529a8da38a0b2ef8c892b6dd7a5
2016-09-09 06:35:21 +00:00
Neels Hofmeyr 418ca58085 fix error msg: msgb_put(): say "msgb_put", not "msgb_push"
Change-Id: I72f31ebad693f98eb088a99b83aeb10cf9acc29e
2016-09-09 02:04:39 +02:00
Alexander Couzens e65315fb37 core/counter: add osmo_counter_dec()
Change-Id: I030140a45afa295c3ebc4d3ccaffd437b984f515
2016-08-30 12:02:58 +02:00
Neels Hofmeyr 0318f6b6ca IuPS: add GMM Service Request related constants and value_str
Change-Id: Ie023fc78099932f95cc8f1b3a04fe25dfd14bc35
2016-08-29 13:56:17 +02:00
Neels Hofmeyr b7f191febb fix printf format for commit 'osmo_sock_init(): include host and port in error messages'
Related: CID#143566
Change-Id: I75c542089749a0875d3d1913151fe838d7722ff2
2016-08-29 11:22:39 +02:00
Neels Hofmeyr f0f07d9c9b osmo_sock_init(): include host and port in error messages
For programs like osmo-hnbgw with numerous sockets, the message that some
unspecified connection was refused is not very helpful. Also output the host
and port where an error occured.

Instead of perror, use fprintf(stderr, ..., strerror()) to be able to include a
format string and print host and port as passed to osmo_sock_init().

Change-Id: I8d0343f51310699b78fcb83fd76fd93764acf3dc
2016-08-27 02:01:20 +00:00
Neels Hofmeyr 898e1d878e vty: use VTY_BIND_ADDR_DEFAULT instead of "127.0.0.1"
Change-Id: Ice0688ac9847524cb546f6d41547090b6a3cb3d8
2016-08-20 16:33:47 +02:00
Neels Hofmeyr fef2fa224a configure: check for pkg-config presence
On a fresh installation, I was puzzled by a configure.ac 'syntax error' for
PKG_CHECK_MODULES(TALLOC). It took me some time to figure out that merely
pkg-config was missing.

Add a check for pkg-config, which isn't as straightforward as I would wish,
so comment generously.

Change-Id: I2e7cdc37eb59f9947a45fbc5baddbaf71b655bc0
2016-08-09 14:35:27 +00:00
Max d1dcda01f8 Add control interface port for GGSN
Change-Id: Ie7232189fe3265a8631fd3652b2c8c152cdee918
Related: OS#1646
2016-08-08 17:42:17 +00:00
Harald Welte 1a70223fa3 Add .mailmap file for mapping mail addresses in shortlog
Change-Id: Id6b42bb9ab10f46b76b26057c8228e5da480286d
2016-08-08 13:12:17 +02:00
Max 9a9739c6ab Extend L1SAP with Measurements
We already have RSSI parameter in PH-DATA. Add other measurement
information (BER, BTO, Link Quality).

Change-Id: I2b127eb1856c4cd1bc46490a89592a595f1ee86b
Related: OS#1616
2016-08-04 15:05:57 +00:00
Harald Welte 460f9ef7da fsm: Make sure we call 'onenter' of new state, not old state
Change-Id: I1a0181c25d9debe935e86d97ddffc24675e56a5f
2016-08-01 00:38:36 +02:00
Harald Welte f92e44c539 lapd_core: Fix crash in lapd_dl_flush_hist()
When lapd_dl_flush_hist() was called before we actually had started a
transmit history from lapd_dl_init(), we woul segfault before this
patch.

Change-Id: Ifa677c9b335dd2884b4f3e44699d901957a0500b
2016-08-01 00:27:37 +02:00
Harald Welte 881dcaf7aa Mark input string to osmo_talloc_replace_string() as const
This allows us to pass in strings that are 'const', which for the
source of a copy should be the normal/regular case anyway.

Change-Id: Icee6a5f88babd3a4e30bf0886f0f8d3b865d80ce
2016-07-28 08:02:48 +02:00
Tom Tsou 9a5bbf36b5 egprs: Add CPS tables from TS 04.60
Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP
TS 04.60. Currently osmo-bts-trx is the only user of CPS table
values, but this may change with gprsdecode and other utilities.

Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
2016-07-25 18:33:26 +00:00
bhargava 1a96946875 Update structure in libosmocore for 11 bit RACH
Parameters are added to the structure ph_rach_ind_param to
differentiate the type of RACH received from Layer 1. This is to
further support the 11 bit RACH.

Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477
2016-07-24 14:15:03 +00:00
Max da34bf01a3 Add define for invalid TA
Add GSM48_TA_INVALID which is invalid Timing Advance value according to
3GPP TS 44.018 § 10.5.2.40.

Change-Id: I061760ccac656f39164562a7883f8ab522cd0911
Related: OS#1526
2016-07-23 19:31:30 +00:00
Neels Hofmeyr 47390764dd rsl: add rsl_act_type_name()
Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
2016-07-23 15:32:55 +02:00
Neels Hofmeyr fd80f5a042 dyn TS: add definitions for dynamic TCH/F_TCH/H_PDCH
Add:
* GSM_PCHAN_TCH_F_TCH_H_PDCH
* NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH
* RSL_CHAN_OSMO_PDCH
* RSL_ACT_OSMO_PDCH

Related: OS#1776
Change-Id: Ib1a8b11f37af4686d00ac88beba38557aa29edc2
2016-07-23 15:32:55 +02:00
Neels Hofmeyr 15b96ff70c gsm_08_58.h: introduce RSL_CHAN_NR_1 constant
Using the RSL_CHAN_* constants, we sometimes need to add 1 to the chan bits
to indicate e.g. the second TCH/H channel.

RSL_CHAN_NR_1 marks this lowest channel bit that needs to be added.

The name is analogous to RSL_CHAN_NR_MASK.

Change-Id: Iea06432039d1cd23cc6b5acec308bb829b596d47
2016-07-23 15:25:18 +02:00
Neels Hofmeyr 505adee93b fix compiler warning: gsup.c: missing braces
osmo_auth_vector's first member is an array, so for a zero initializer, we
should add a second set of array braces.

Change-Id: Iace448caca8152e46244f26c3af250f2035c99eb
2016-07-17 07:44:11 +00:00
Holger Hans Peter Freyther 511b448fe3 bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bit
The PCU is using bitvec_write_field a lot but on the
arm-poky-linux-gnueabi-gcc v4.8.1 the calls to set_bit and
set_bit_pos are not inlined. The inlined variant has been
a more quick for the PCU compressed bitmap decompression
testcase.

Used objdump -d to look at the bitvec_write_field before and
after the change. The branch to bitvec_set_bit is gone and a
inlined version has been used.

Change-Id: I0b6b90610f4c17f02e4efa064c3bf1ac2dccb22a
2016-07-16 21:02:41 +00:00
Max edb57e7709 Add function to check TA validity
Check if given Timing Advance is valid according to 3GPP TS 44.018 §
10.5.2.40.

Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5
Related: OS#1545
2016-07-16 21:00:00 +00:00
Holger Hans Peter Freyther 4a62dbbfa9 ussd: Decode interrogateSS that doesn't have test
Keith of Rhizomatica has an issue of a unrejected interrogateSS.
Start with just decoding the message and printing the empty test
and the code.

What is kind of missing is the classification between invoke,
returnResult and returnResultLast that we need to add in the
long run.

Change-Id: Iadfa156707a96f2a34f3948c7cc9a74435f17114
2016-07-12 17:45:34 +02:00
Tom Tsou 9394dbd8e0 Add EGPRS RLC/MAC headers from 3GPP TS 04.60
For shared use by osmo-pcu and osmo-bts-trx.

Change-Id: I500cdc87cd30faf36c8cd92d234642f809c8f2aa
2016-07-12 06:06:33 +00:00
Max 4f169500df Add GEA3 & GEA4 ciphers
Corresponding test code include both official test vectors from the
specs and data from over-the-air tests.

This obsoletes libosmo-crypt-a53 as it was last missing piece
unimplemented in libosmogsm.

Change-Id: I939e4f6b91b4a7c591ef3761fe2d46ed1c2fb2d3
Related: OS#1582
2016-07-11 19:15:24 +00:00
Harald Welte 02a6672885 fsm: delete the timer when changing state
In osmo_fsm_inst_state_chg(), we need to stop any not-yet-expired timer
of the old state before transitioning into the new state.

Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
2016-07-10 15:13:51 +02:00
Harald Welte f3239113db fsm: talloc + copy the 'id' passed into a FSM
The 'id' is used to generate the human-readable name of the FSM.
However, when the FSM creates slave FSMs later, the caller-passed "ID"
mgiht long be gone again (e.g. it was on stack memory).  So let's copy
the 'id' string to a chunk of dynamically-allocated memory at time of
FSM start to ensure we have it later when creating child FSMs.

Change-Id: Ib88a2c02c5c91f17b4ec1e9db57a06d6d66465fb
2016-07-10 15:11:45 +02:00
Harald Welte 673018fed9 fsm: call 'onenter' as last step of a state change
This is useful to allow the user to terinate the fsm from the onenter()
callback.

Change-Id: Ia45a1f3279e702028250e10dc54b2d46a4039905
2016-07-10 15:09:43 +02:00
Max f5f773f013 Add strings with GPRS GMM messages
Change-Id: I48477b733e2da72f59349c00554dd3e080c9f445
Related: OS#1582
2016-07-08 15:08:17 +00:00
Max fdca25dfb8 Add function to check GMM encryptability
Check if particular GMM message can be encrypted according to 3GPP TS
24.008 § 4.7.1.2

Related: OS#1582
Change-Id: I7ad0e03c2c738d174dd6bc3453f332eeb8da1e7d
2016-07-07 12:55:46 +00:00
Neels Hofmeyr ae3b78076e gitignore tests/fsm/fsm_test
was added in 136e73764e

Change-Id: I0f344cc459626f71316f99341f79b5f0479ad82c
2016-07-07 12:52:57 +00:00