libosmocore/tests
Neels Hofmeyr 0e8df1c7e4 add osmo_use_count API
Provide a common implementation of use counting that supports naming each user
as well as counting more than just one use per user, depending on the rules the
caller implies.

In osmo-msc, we were originally using a simple int counter to see whether a
connection is still in use or should be discarded. For clarity, we later added
names to each user in the form of a bitmask of flags, to figure out exactly
which users are still active: for logging and to debug double get / double put
bugs. This however is still not adequate, since there may be more than one CM
Service Request pending. Also, it is a specialized implementation that is not
re-usable.

With this generalized implementation, we can:

- fix the problem of inadequate counting of multiple concurrent CM Service
  Requests (more than one use count per user category),
- directly use arbitrary names for uses like __func__ or "foo" (no need to
  define enums and value_string[]s),
- re-use the same code for e.g. vlr_subscr and get fairly detailed VLR
  susbscriber usage logging for free.

Change-Id: Ife31e6798b4e728a23913179e346552a7dd338c0
2019-04-08 13:47:17 +00:00
..
a5 tests: a5_test: Print wrong buffer correctly on error 2018-05-16 21:13:58 +02:00
abis use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
auth Use define for key buffers 2018-12-20 09:51:02 +00:00
bits tests: bitrev_test: Fix dynamic-stack-buffer-overflow 2018-05-16 17:10:33 +02:00
bitvec bitvec: Add bitvec_tailroom_bits() function 2019-02-05 11:16:44 +01:00
codec tests: codec: ecu_fr: Add buffer with unequal XMAXC values 2018-07-21 07:40:20 +00:00
coding coding: check gsm0503_rach_*() results 2019-03-05 11:30:39 +01:00
comp128 tests: test actual support status for auth. algo 2016-06-29 16:33:40 +00:00
conv Add functions for extended RACH coding 2017-12-11 10:36:47 +00:00
ctrl tests: ctrl: Test received ERROR messages are handled correctly 2018-07-16 17:56:25 +00:00
endian add/clean big-endian packed structs (struct_endianess.py) 2018-12-19 18:40:03 +00:00
fr license: Fix the license to GPL 2017-12-09 13:03:29 +00:00
fsm log: fsm: allow logging the timeout on state change 2019-02-26 20:57:58 +00:00
gb NS: Factor out gprs_nsvc_start_test() and use it 2019-02-26 12:18:30 +01:00
gea tests: gea_test: Use correct max size for key in buffer 2018-05-16 20:09:39 +02:00
gprs use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
gsm0408 gsm0408_test: Fix IMEI-SV related tests to use no more than 16 digits 2019-01-22 14:53:46 +00:00
gsm0808 gsm0808_utils: fix gsm48 multirate to S-bit converter 2019-03-11 09:08:31 +01:00
gsm23003 gsm23003: add osmo_imei_str_valid() 2019-01-14 14:39:57 +00:00
gsm29205 LCLS, TS 29.205: add GCR routines 2018-12-14 13:15:39 +00:00
gsup tests/gsup_test.c: drop session IEs from MO-ForwardSM Error 2019-01-05 10:15:47 +00:00
kasumi gsm: kasumi: Fix dynamic-stack-buffer-overflow on out buffers not multiple of 64 bits 2018-05-17 12:13:04 +02:00
lapd RSL/LAPDm: Not all RLL message are "transparent" 2018-04-19 15:09:32 +00:00
logging Enable remote SIM protocol log level 2019-02-14 19:19:57 +01:00
loggingrb license: Fix the license to GPL 2017-12-09 13:03:29 +00:00
msgb use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
msgfile build: resolve compiler warning about implicit delcaration 2014-10-04 11:49:23 +02:00
oap import oap_client_test from osmo-sgsn 2018-07-30 18:24:49 +02:00
osmo-auc-gen umts aka: add sqn_ms out-param, print SQN.MS in osmo-auc-gen 2017-08-29 12:46:46 +00:00
prbs Add pseudo-random bit sequence generator to libosmcoore 2017-07-10 23:42:02 +02:00
sercomm Embedded: add sercomm stubs 2018-01-21 19:08:05 +00:00
sim sim: Fix compiler warning and by this fixing the test result 2016-03-21 11:29:16 +01:00
sms use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
smscb test: Fix compiler warnings on 64bit systems 2015-11-09 16:46:03 +00:00
sockaddr_str add osmo_sockaddr_str API 2019-04-08 13:47:17 +00:00
socket use osmo_init_logging2() with proper talloc ctx 2018-04-06 04:37:50 +02:00
stats rate_ctr: fix osmo-sgsn DoS: don't return NULL on already used index 2017-12-20 01:29:59 +01:00
strrb Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
tdef fsm: add osmo_fsm_inst_state_chg_keep_or_start_timer() 2019-03-07 23:10:21 +01:00
timer timer: Introduce osmo_clock_gettime to override clock_gettime 2018-03-01 12:33:02 +00:00
tlv add tlv_parse2(), capable of multiple instances of the same IE 2018-04-13 05:28:09 +02:00
use_count add osmo_use_count API 2019-04-08 13:47:17 +00:00
ussd gsm/gsm0480: refactor and expose gsm0480_parse_facility_ie() 2018-06-11 23:50:00 +07:00
utils osmo_escape_str_buf: Always copy, don't return input string pointer 2019-03-29 16:42:25 +00:00
vty vty: enable optional-multi-choice syntax: [(one|two)] 2019-02-04 16:43:57 +00:00
write_queue wqueue: Reject messges if queue is considered full 2016-12-09 11:37:37 +01:00
Makefile.am add osmo_use_count API 2019-04-08 13:47:17 +00:00
atlocal.in build: make check: disable sim_test when built with --disable-pcsc 2016-11-16 16:40:44 +00:00
libsercomstub.c Embedded: add sercomm stubs 2018-01-21 19:08:05 +00:00
testsuite.at add osmo_use_count API 2019-04-08 13:47:17 +00:00