aboutsummaryrefslogtreecommitdiffstats
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2024-01-31utils/conv_codes_gsm.py: fix inconsistent formattingVadim Yanitskiy1-2/+2
Change-Id: Ida99f0fe149b234c738875527dd64b610d33e050
2023-07-07gsm: Improve the TCH/H2.4 coding routinesSylvain Munaut1-0/+18
The spec isn't super clear, but basically the conv coding is done in two blocks of 72 bits. The way it's currently implemented isn't "wrong" in the sense it will produce correct output given no bit errors, but it's better to do the decoding in two blocks because this then it makes use of the fact we know the state of the encoder after the 72 bits, which improves the corrective ability of the code. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: Id2551ffe2a0ebfd0a6df0e1d288a6f0af7e1eda7
2023-07-07gsm: Fix comment for TCH/F4.8 codeSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I62f6d0e9fec180138be5f37664969d56e79f3c13
2023-06-02libosmogsm: Allow auth API caller to specify RES lengthHarald Welte1-4/+14
There are 3G algorithms which support different lengths of RES values (4, 8, 16 byte). For MILENAGE, we never really had to bother, as the 4-byte RES is simply the first 4 bytes of the 8-byte RES. However, for TUAK, the expected RES length is an input parameter to the Keccak crypto functions, so the result of all parameters (including CK, IK, ...) will be completely different for RES length 4 than RES length 8. So let's permit the caller of the osmocom auth API to specify the requested RES length via the osmo_auth_vector.res_len parameter. For backwards compatibility of callers of the old osmo_auth_gen_vec/ osmo_auth_gen_vec_auts API: Always force the res_len to 8 in this case, which was the hard-coded length before this patch. Change-Id: Ic662843fbe8b5c58e4af39ea630ad5ac13fd6bef
2023-06-02osmo-auc-gen: Convert over to osmo_auth_gen_vec*2 APIHarald Welte1-4/+33
This allows the tool to support K/OPc lengths != 128 bit. Let's add more length checks of command-line arguments while we're adding those checks for K/OPc. Change-Id: Iffed02ec0fc9c9a996da6f218d67314e381cbb29
2023-05-25gsm: fix convolutional code definition for TCH/F4.8Vadim Yanitskiy1-1/+1
The block length for TCH/F4.8 is off by 4 bits. Value 152 matches with what TS 45.003 section 3.4.3 defines, but for some reason the encoder generates more bits (468) than it must (456). This results in buffer overruns when encoding TCH/F4.8. All block length values in conv_codes_gsm.py are 4 bits less than the respective values in TS 45.003. I have no idea why... Change-Id: Id86d1aa0fd6791a8be431b5547bb723c74c35757 Related: OS#1572
2023-03-15New osmo-gsmtap-logsend utilityHarald Welte2-1/+142
This utility can be used to "pipe" stdin or some file as log lines via GSMTAP logging. Change-Id: Ida96e87d84e0c349c5069edc67fec1c3cf19d1ab
2023-03-14fix 'make vty-test' for --disable-external-tests --enable-gbNeels Hofmeyr1-1/+1
Change-Id: I80ac270bfb563a769a7746d8fbceac09e267ce03
2023-03-11utils/osmo-stat-dummy/Makefile.am: drop empty variablesVadim Yanitskiy1-2/+2
Change-Id: I1b9497900b0eebd77fd226f52a9050cdbd9e6cdc
2023-03-11utils/Makefile.am: do not overwrite AM_CFLAGSVadim Yanitskiy1-3/+1
* $(TALLOC_CFLAGS) is already present in AM_CFLAGS, * osmo-sim-test: do not redefine but append $(PCSC_CFLAGS). Change-Id: I7b9af3a1a9493a432af89198e291f4523388751e
2023-03-11utils/Makefile.am: remove duplicate libosmogsm.laVadim Yanitskiy1-1/+1
It's already listed in $(LDADD), no need to append it again. Change-Id: I03f5f4330e828a938dafd93b9fdb576afb2b7f12
2023-02-25convolutional coding for CSDHarald Welte1-0/+87
This patch adds the convolutional code definitions for CSD (circuit switched data) on TCH/F channels with user bit rates of 2400, 4800, 9600 and 14400 bps. Related: OS#4396, OS#1572 Change-Id: I412131d7ee2e676402bf8d88394af17c4447b664
2023-01-27libosmocore: Transition to use of 'telnet_init_default'arehbein1-2/+1
Replace remaining calls of telnet_init_dynif() by telnet_init_default() Related: OS#5809 Change-Id: Ie762d0c642021db1a6ef95333cd771351de86845
2023-01-18Fix all references to config.hPau Espin Pedrol1-1/+1
config.h is created in $(top_buildir)/config.h. Let's make sure all CPPFLAGS add correct -Ipath includes, and that all code includes the correct file. Change-Id: Ie9ea38bb009bc715b01cde4d66d181f7bec2e7bd
2023-01-18Move src/*.{c,h} to src/core/Pau Espin Pedrol2-2/+2
This way we have all libosmocore.so in an own subdir instead of having lots of files in the parent dir, which also contains subdirs to other libraries. This also matches the schema under include/osmocom/. Change-Id: I6c76fafebdd5e961aed88bbecd2c16bc69d580e2
2022-12-21utils/osmo-stat-dummy: check for ENABLE_UTILITIESOliver Smith1-0/+2
Don't attempt to build osmo-stat-dummy, unless ENABLE_UTILITIES is set. We check for this in utils/Makefile.am too. Fix for currently failing master-osmo-ccid-firmware job, at cross-compiling libosmocore: make[3]: *** No rule to make target '../../src/vty/libosmovty.la', needed by 'osmo-stat-dummy'. Stop. Fixes: 7a79dd3d ("osmo-stat-dummy: add rate counters and statsd tester") Change-Id: I44e49b5646518bd07b2628ca488e4bf74586852c
2022-12-20ctrl: add optional port to bind commandMax1-1/+1
So far ctrl interface did not allow to specify port to bind to. Let's fix this and make it consistent with the way vty bind works. N. B: the functions which ignore port configured via vty are marked as deprecated, the sw which uses them should be ported to either newly added ctrl_init_default() or simplified ctrl_interface_setup() The similar change for vty interface will be addressed via separate patch series. Related: OS#5809 Change-Id: I0fd87fd41fd3ac975273968d24f477daa3cd3aa9
2022-12-20osmo-stat-dummy: add rate counters and statsd testerMax6-0/+458
It's handy for testing rate counters as well as statsd metrics. Related: OS#5671 Change-Id: Ibd8b17aa3ba9ceb527c6231310f01d736fb542a7
2022-11-30osmo-ns-dummy: add ctrl interfaceMax2-3/+25
It's handy for rate_ctr tests with follow-up patches. Related: OS#5671 Change-Id: If6e06d9433e438b92f1ed1ef0f892308e031779b
2022-11-10*/Makefile.am: do not mix up AM_CFLAGS with AM_CPPFLAGSVadim Yanitskiy1-2/+2
Change-Id: I2c1d5f9c61714f487fbbe60603b2682f2c0a4c6b
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte3-3/+3
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that uses constructs of earlier C standards, which were abandoned in C99. See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for some related discussion. Change-Id: I84fd99442d0cc400fa562fa33623c142649230e2
2022-05-13osmo-arfcn: Fix false positive in gcc 12.1.0Pau Espin Pedrol1-1/+1
The pointer is initialized in all its uses, however newer gcc warns about it: """ inlined from ‘main’ at /libosmocore/utils/osmo-arfcn.c:144:16: /usr/include/bits/stdlib-float.h:27:10: error: ‘param’ may be used uninitialized [-Werror=maybe-uninitialized] """ Change-Id: If3eff4ab14a7b2a950386244c9b5f2b9adb32f99
2022-04-27Use internal <osmocom/core/talloc.h> everywhereVadim Yanitskiy1-1/+1
Change-Id: If40e1eefcfa88a2b376becfe057836acdd3a1cc2
2021-12-14treewide: remove FSF addressOliver Smith5-20/+0
Remove the paragraph about writing to the Free Software Foundation's mailing address. The FSF has changed addresses in the past, and may do so again. In 2021 this is not useful, let's rather have a bit less boilerplate at the start of source files. Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2021-10-04revisit some calls of strtol(), stroul(), strtoull()Neels Hofmeyr1-1/+3
Replace some with atoi(), where the VTY has already validated correct range of the argument. Replace others with the new osmo_str_to_int() or osmo_str_to_int64() functions, possibly covering more detection of invalid number strings. Leave those strtol() callers that depend on endptr to provide the next string token. Related: SYS#5542 Change-Id: I0ebb06e751c28f7d1cdf328de29cd227a2449391
2021-09-21osmo-auc-gen: Print RFC3310 IMS HTTP-AKA style base64 nonce/resHarald Welte1-1/+20
This is useful when debugging IMS Authentication which uses RFC3310 representation of the nonce and expected result. Change-Id: Ibfa72410d8ff8e5b42063f1a12bff69ad2bebbb8
2021-09-17osmo-auc-gen: Permit specifying the SQN in hex (0x12345) formatHarald Welte1-1/+1
Use base '0' of strtoul to permit both decimal and hexadecimal input to the SQN parameter. Some other tools represent the SQN as hex, so this avoids having to use some external tool to convert and allows you to copy+paste it to the osmo-auc-gen command line. Change-Id: I67c6341a989de433451994b824e12afd0c26cb8a
2021-03-22osmo-aka-verify: Fix use case with OP and not OPcHarald Welte1-1/+5
Change-Id: Ic6b5da83276ce2618cd80c6d34d3322bad7b4c48
2021-03-21utils/osmo-aka-verify: fix swapped CK/IK argumentsVadim Yanitskiy1-1/+1
The positions of arguments in the call to "milenage_check" do not match the ordering of the parameters: * "ck" is passed to "ik" * "ik" is passed to "ck" Let's simply reorder the arguments of milenage_check() to match the ordering in milenage_f2345(). Change-Id: Ia003d3c9d88fb8f6740791583855a709b8639160 Fixes: CID#220324
2021-03-20utils: osmo-aka-verify to verify UMTS AKA (SIM side)Harald Welte2-1/+246
This new utility implements the UMTS AKA procedures of the SIM side. It can be used to manually verify the correctness of authentication tuples received from the network. Change-Id: I497747fbf09f633dcd7c592bd9af7fca9a820645
2021-02-20Drop use of log_set_print_filename() API inside libosmocorePau Espin Pedrol1-2/+1
Let's use log_set_print_filename2() API instead, which has less ackward behavior implications like changing the print status of category-hex. Related: OS#5034 Change-Id: Ifc78e1dcba5baf0b41f6ccbbbd1e3f06552d73da
2021-02-02osmo-ns-dummy: Add "mirror-mode" to mirror back any received packetsHarald Welte2-10/+44
Change-Id: If57bfdeb390d88d1ea058f7a9ce0403e64a5beda
2021-01-30osmo-ns-dummy: Add simple NS traffic generatorHarald Welte3-1/+312
This adds a simple NS traffic generator that can be used to perform load testing on NS links, particularly those with limited bandwidth such as frame-relay E1 lines. Related: OS#4995 Change-Id: Iad3b694c85962dbbc6b4a27a0ed5bc841add464f
2021-01-28gprs_ns2: remove api call gprs_ns2_dynamic_create_nseAlexander Couzens1-1/+0
The call was only introduced as workaround for the first implementation of vty. There is no need for this anymore. The configuration can just add "accept-ipaccess" to the bind to allow creation of dynamic ipaccess NSE. Change-Id: Ie924ead6da17657f3da334068c8ada82c8845495
2021-01-28gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vtyAlexander Couzens1-1/+1
Drop the vty(1) code and replace it with vty2. The vty(1) was only used as intermediate to not develop a vty while developing a new code base behind. Users of gprs_ns2_ has to use the new vty code. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: Ic2059e75d8ede8e5c29c4fef6be608ed79c8a97c
2021-01-28Revert "gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vty"Pau Espin Pedrol1-1/+1
This reverts commit b306094448564e27bc031b519396f1b0e294b231. It was merged too quickly and patches for projects using related features are not yet prepared. Change-Id: I8a2aaf74a47de8f4f0adb37d16426d199788e3fe
2021-01-28gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vtyAlexander Couzens1-1/+1
Drop the vty(1) code and replace it with vty2. The vty(1) was only used as intermediate to not develop a vty while developing a new code base behind. Users of gprs_ns2_ has to use the new vty code. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb
2021-01-19osmo-ns-dummy: don't leak primitive messagesAlexander Couzens1-0/+3
The message in the primitive must be freed by the user Change-Id: I2a7b19f019485c7b1f15baf20b62edc19b663415
2021-01-17osmo-ns-dummy: allow to create dynamic NSEsAlexander Couzens1-0/+1
Without setting the flag the osmo-ns-dummy won't create any dynamic NSEs. This flag will be removed in a future release but for now it will be included. Related: SYS#5208 Change-Id: I196cc454b5d7bc53848f73596a2f92730b78922b
2021-01-01utils: add osmo-ns-dummyAlexander Couzens2-3/+292
A dummy client to do integration tests of the ns2 layer. It drop all unit data. But allows vty tests. Change-Id: I127c178426bc1a3da8de251740eda93853030d6d
2020-08-04utils/gsmtap_logread.py: make it executableVadim Yanitskiy1-0/+0
Change-Id: I2a3ee31ddc8838ce8e7a58de89a0e606ae918c6a
2020-05-05sim: When decoding SW, take application specific SW into accountHarald Welte1-2/+2
So far we only looked at SW definitions of the card profile. However, if we have a currently selected application, we also must check that application for SW definitions. This breaks ABI and API all over the place, but as there are no known users beyond osmo-sim-test, this is acceptable. Change-Id: I3a1d60898529c173f73587e34c155660ba5f5fb1
2020-03-22osmo-sim-test: Avoid double-closeHarald Welte1-4/+1
Change-Id: Ibd67a5461085a77dd9e804a4f1266d67ee91a04a Closes: CID#208960
2020-03-21osmo-sim-test: Also [attempt to] dump DF.GSM on USIM cardsHarald Welte1-2/+2
an USIM application can very well exist on a UICC without supporting classic DF.GSM access. However, most commonly, both are found on cards. Change-Id: I6180a3f81a7d3006e8ece4302c2433db2588bfaa
2020-03-21sim: re-structure how we support cards + applicationsHarald Welte1-51/+98
Before this change, a card application (USIM, ISIM, ...) didn't exist as a separate concept from a card profile. This meant, we had a manual combination of UICC card profile with USIM application, and another one of UICC card profile and ISIM application. But what if there's a combined USIM+ISIM? In reality, applications exist as separate objects, on top of an ETSI UICC. Lets therefore register all known applications to the osim library core, and add code to osmo-sim-test which dynamically detects all applications present on a given card (by reading EF.DIR). Change-Id: Ic4b4ac433a9976842b30a017fb0fc347d87201cd
2020-03-21osmo-sim-test: Optionally dump card files to host filesystemHarald Welte1-11/+97
Using the new '--output-dir' command line argument, the user can instruct osmo-sim-test to dump the file content to a local directory. osmo-sim-test will create one sub-directory per DF, and create a text file for each EF. The contents of the text files are a hexdump of the contents. Transparent EF are dumped as one line of hex, while linear fixed EF are dumped as one record per line, i.e. the number of lines corresponds to the number of records. Change-Id: I35176f4a13c3537eaa8de550e231818a22b4c07c
2020-03-21osmo-sim-test: don't print SW in successful case of dump_file()Harald Welte1-1/+0
Change-Id: Ie5a58a89052400d76a8607a2e0063917385beb25
2020-03-21osmo-sim-test: Use stderr for error messagesHarald Welte1-7/+7
Change-Id: I8f36b07b8601af2b0d54d95c3c6374d6c54bafd1
2020-03-09conv: add convolutional coder for AMR SID UPDATE framesPhilipp Maier1-0/+19
AMR SID update frames are protected using an 1/4 convolutional coder, wich is similar to the one used with 6,7 kbit voice frames. Except that there is no puncturing and the length is different. Change-Id: Ia35ed4178a7f0d816052b7e5d6478b93a1d9744f Related: OS#2978
2020-03-04osmo-sim-test: check tlv_parsed struct tp before accessPhilipp Maier1-4/+8
The variable struct tlv_parsed tp in dump_file() conditionally initalized by tlv_parse() but later it is accessed under a different condition without a check that makes sure that tp is only accessed when tlv_parse() was called beforehand. Lets introduce a check that makes sure tp can not be accessed when it is uninitalized. Change-Id: I6b0209b966127a4195e6f4bcb43d49387c7646ce Fixes: CID#208435