Commit Graph

63 Commits

Author SHA1 Message Date
Pau Espin e395b75619 hnb-test: Fix rc var may be used uninitialized
Warning observed compiling with gcc 11.1.0.

Change-Id: I6ca53dd57572338f15971633441da895843a164d
2021-10-26 14:31:33 +02:00
Pau Espin 1f6c117d07 hnb-test: Fix typo in vty cmd description
Change-Id: Id33e2e8caa37dc359d564188747cd4c1b8bc4064
2021-07-05 12:18:47 +02:00
Pau Espin e6342e1cab tests/hnb-test: Disable building unsued code
Change-Id: I17f20cea8aa63ed79168653292b99c90b8c03caf
2021-01-14 11:31:32 +01:00
Pau Espin 8653233b57 tests/hnb-test: Initialize logging with existing struct log_info
Change-Id: Ic92e60dda41a9e4d139294b1e851fff5c4f26143
2021-01-14 11:29:47 +01:00
Pau Espin 4c928485ba tests/hnb-test: Fix signedness of assigned pointer
Change-Id: I320ad86b83b0308b43489e8d95f63d6ed55821b5
2021-01-14 11:27:34 +01:00
Pau Espin 84c3e8649a tests/hnb-test: Fix uninitialized use of rc variable
Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c
2021-01-14 11:26:15 +01:00
Pau Espin 96a94bc482 tests/hnb-test: check return code of hnbap_encode_ueregisterrequesties
gcc warns about set but not used variable otherwise.

Change-Id: Ia49b7e88a66a4a744c2b14db6331cc0de431f60b
2021-01-14 11:26:15 +01:00
Pau Espin b4ff1f42b8 tests/hnb-test: Fix signedness of imsi_buf
Change-Id: I3b0a6218ac6242d03642972d5b244815ce9d97a0
2021-01-14 11:26:15 +01:00
Pau Espin 89f4c80541 tests/hnb-test: Drop unused variables
Change-Id: I12870a1cf2462b7cc2868a54f58416e03a856084
2021-01-14 11:24:31 +01:00
Martin Hauke c593da5d45 tests: Missing return statement
Change-Id: I4fae9f84a83af280846b07eaa139ff4a05784a2e
2020-02-15 23:01:39 +01:00
Neels Hofmeyr 3050864b73 hnb-test: log accurate three-digit MNC with leading zeros
Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore)
Change-Id: Ie3dd206bca2f38a0ef7ee7f9d3b6bf2eacc899a4
2018-02-28 19:26:07 +01:00
Neels Hofmeyr b0c650e7b0 vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I61b79f633d36814b53e40f1a92b5847c9ff4fde0
2017-11-08 02:28:31 +00:00
Neels Hofmeyr c83e49fc8d log VTY telnet bind only once
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs
'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the
telnet VTY bind here anymore.

Change-Id: Icd9e670c1d30c156f7bd5d0d34892150aeba95e9
2016-09-26 22:44:18 +02:00
Neels Hofmeyr df63de2e37 build: move headers to include/osmocom/*
This came up while fixing 'make distcheck'; this is certainly not the easiest
way but it makes sense to have the headers in include/, like we do in openbsc.

The easy alternative might be to add -I$(top_srcdir)/src to src/Makefile.am.

Remove -I$(top_srcdir)/src from src/tests/Makefile.am, no longer needed.

Change-Id: I5a82e029dcdc4df0a60a31271a4883393fe59234
2016-09-09 06:43:32 +00:00
Neels Hofmeyr 8345792281 build: fix ranap gen, use same for gen hnbap and rua gen
fix extraneous rebuild for each make invocation: touch the ranap.stamp file in
src/ as the make target suggests.

fix for 'make distcheck': ranap gen: move generated sources to builddir, not
srcdir. Thus we also -I the builddir include to pick up those headers.

hnbap and rua have the same situation as ranap (they generate numerous files
from a single make rule). Use the same makefile semantics for those two
(commit for ranap gen omitted the same changes for hnbap and rua).

The generated headers are thus moved to include/osmocom/*/, so adjust #include
statements accordingly (*_common.h, *_ies_defs.h).

Also move hnbap_common.h to include/osmocom/hnbap and rua_common.h to
include/osmocom/rua, since the *_ies_defs.h want to include them; and since
*_ies_defs.h are now in include/osmocom/*, we want a '<foo>' include now.

Also adjust gitignore.

Change-Id: I32213666fcdfc144008fa7d46497c0938d093e86
2016-09-09 06:43:31 +00:00
Daniel Willmann f44d12ce27 ranap_msg_factory: Add keystatus parameter for security mode cmd 2016-04-20 10:17:53 +02:00
Neels Hofmeyr 5ad72b91bb hnb-test: receive Paging, add CL rx
Add ability to receive ConnectionLess transfers in order to read the
Paging and (so far only) print the IMSI paged for.
2016-04-19 18:19:31 +02:00
Neels Hofmeyr bde4d3b3b7 hnb-test: request Iu Release, handle Iu Release Command 2016-04-19 18:19:30 +02:00
Neels Hofmeyr 4a0a69a88d hnb-test: add Security Mode Command handling 2016-04-19 01:32:25 +02:00
Neels Hofmeyr c28ed375b3 hnb-test: cosmetic: rename hnb_test_nas_tx_dt() to hnb_test_tx_dt()
Not all Direct Transfer messages contain a NAS PDU, see Security Mode
Complete.
2016-04-19 01:32:25 +02:00
Neels Hofmeyr 4470f93074 hnb-test: simplify crossing message layers
Adding the Security Mode Control command would break the current scheme of
callbacks across layers. This brought to my attention that the scheme is indeed
unnecessarily complex, so simplify it.

Instead of passing callbacks, call functions directly. Add hnb-test-layers.h to
declare those functions that cross from main to rua, to ranap and back to main
and remove the callback type definitions.

Instead of copying the NAS PDU to a newly allocated msgb, pass the data and len
directly to hnb_test_nas_rx_dtap().

Instead of repeatedly checking the gsm48_hdr length, just pass the struct
gsm48_hdr* and len around and assume the basic header length has been checked.

In some places, rename 'length' to 'len' for cosmetic consistency.
2016-04-19 01:32:25 +02:00
Neels Hofmeyr 26779f8573 hnb-test: generate SRES from hardcoded Ki
Previously the SRES was hardcoded, but the CN changed to generate the SRES.
So now, generate the SRES while still using the hardcoded Ki.

Fixes the Authentication Response message when testing IuCS Location Update.
2016-04-19 01:32:24 +02:00
Neels Hofmeyr d7ad0ac238 hnb-test: parse_mm: assert MM pdisc 2016-04-06 18:58:37 +02:00
Neels Hofmeyr 998726054e hnb-test: on auth response, make it seq nr 2 2016-04-06 18:58:37 +02:00
Neels Hofmeyr ad00d2bee5 hnb-test: rx dtap: log message size 2016-04-06 18:58:37 +02:00
Neels Hofmeyr 8c2b4ec6d6 hnb-test: don't segfault when msgb has no l3 2016-04-06 18:58:37 +02:00
Neels Hofmeyr 7c28f6f438 hnb-test: use gsm48_hdr_pdisc() and gsm48_hdr_msg_type() instead of bitmasks 2016-04-06 18:58:36 +02:00
Neels Hofmeyr e25faa8966 hnb-test: print sent bytes 2016-03-30 14:10:39 +02:00
Neels Hofmeyr 3588810cb7 hnb-test: answer MM Authentication Request
With hardcoded SRES matching the hardcoded auth tuple in openbsc's
sysmocom/iu branch for testing.
2016-03-30 14:10:39 +02:00
Neels Hofmeyr 5dbb7b2c3f hnb-test: print LU Reject 2016-03-30 14:10:39 +02:00
Neels Hofmeyr d4598fa453 hnb-test: factor out MM header parsing 2016-03-30 14:10:39 +02:00
Neels Hofmeyr c04eb533e1 hnb-test: send TMSI REALLOC COMPL only when LU ACC sent a TMSI 2016-03-04 12:40:53 +01:00
Neels Hofmeyr 5f9be1ed5e hnb-test: make hnb-gw address configurable 2016-02-29 13:33:44 +01:00
Neels Hofmeyr ae93712977 hnb-test: add messages leading to Location Update Accept
But note, authentication is not there yet; the CSCN should initiate that.
2016-02-29 10:02:10 +01:00
Neels Hofmeyr 5c1cc8cce4 hnb-test: replace some hex vals with GSM48_* constants 2016-02-29 10:02:10 +01:00
Neels Hofmeyr e1f709fa51 hnb-test fix id resp 2016-02-29 10:02:10 +01:00
Neels Hofmeyr 860a12977c hnb-test: attempt to reply to an MM Identity Request 2016-02-29 10:02:10 +01:00
Neels Hofmeyr b984f36f58 hnb-test: decode NAS pdu when receiving RUA from CN 2016-02-29 10:02:10 +01:00
Neels Hofmeyr 32828708b2 hnb-test: tweak comment 2016-02-29 10:02:10 +01:00
Neels Hofmeyr 7b81128d44 hnb-test: comment on gen_initue_lu() IMSI 2016-02-29 10:02:10 +01:00
Neels Hofmeyr 0968a58836 hnb-test: some rua rx printfs 2016-02-24 20:51:04 +01:00
Neels Hofmeyr a0d21479a7 osmo-hnbgw, hnb-test: allow configuring VTY address 2016-02-24 20:51:04 +01:00
Neels Hofmeyr 6a62e549cd hnb-test: fix wrong domain indicator in ranap.
ranap_new_msg_initial_ue() called with wrong argument order.
2016-02-18 01:30:42 +01:00
Daniel Willmann 8592716116 hnb-test: Increment UE conn_id for each new loc_upd_req 2016-01-14 15:36:49 +01:00
Daniel Willmann 11e912aa6e Free ies struct after use in tests and hnbgw_cn/rua 2016-01-07 13:19:30 +01:00
Neels Hofmeyr 96979af054 move ranap_*.h,iu_helpers.h to include/osmocom/ranap/
A bit hacky: the ranap_ies_defs.h is generated together with the
ranap_encoder.c and ranap_decoder.c. See comments in src/Makefile.am and
include/osmocom/ranap/Makefile.am.
2016-01-05 15:37:23 +01:00
Harald Welte b66c5d0e62 move tests/rua_helper.[ch] to src directory
The RUA Helper is not test-specific.
2016-01-03 18:04:28 +01:00
Harald Welte 056984fab1 merge (+rename) iu_helpers.c into libosmo-ranap 2016-01-03 16:31:31 +01:00
Harald Welte 87ffeb91dc factor out some common shared test init code 2015-12-25 15:34:22 +01:00
Harald Welte c3851220db hnb-test: Add VTY to manually issue Iuh messages
We can now send Iuh messages with commands like 'hnbap hnb register',
'hnbap ue regiter imsi 12345', 'ranap reset cs', 'ranap reset ps',
and even establish connection-oriented RUA using
'channel cs lu imsi 12345'
2015-12-24 15:41:21 +01:00