Commit Graph

639 Commits

Author SHA1 Message Date
Neels Hofmeyr 7e760acc65 add missing comment in ranap_msg_factory.c 2016-04-19 01:41:27 +02:00
Neels Hofmeyr 4a0a69a88d hnb-test: add Security Mode Command handling 2016-04-19 01:32:25 +02:00
Neels Hofmeyr a9f5566482 ranap_msg_factory: add Security Mode Complete msg generator
Needed by hnb-test to reply to a Security Mode Command message.
2016-04-19 01:32:25 +02:00
Neels Hofmeyr 68b7a47868 RANAP Initiating msg: rx and free Security Mode Command
Add the Security Mode Command procedure code to cn_ranap_rx_initiating_msg_co()
and cn_ranap_free_initiating_msg_co(), for hnb-test (see comments in the code).
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 37017f5df8 hnbgw_cn.c: add #include for inet_ntoa() 2016-04-15 22:47:42 +02:00
Harald Welte 04861ef1ed update dependencies in README file 2016-04-09 20:29:37 +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 a4540be792 hnbgw: set default RNC ID to 23 (for testing)
This should ultimately be user configurable, but for now 23 is better than 0.
2016-04-06 18:58:36 +02:00
Neels Hofmeyr 02be4e3933 hnbgw: debug-log cn disconnect ind 2016-04-06 18:58:36 +02:00
Neels Hofmeyr 0ff24430a1 hnbgw: add handle_cn_conn_conf() debug logging 2016-04-06 18:58:36 +02:00
Neels Hofmeyr 1befe6b221 cosmetic: add comment to hnbgw_cnlink_init() 2016-04-06 18:58:36 +02:00
Neels Hofmeyr 6341f4d410 hnbgw: set DMAIN loglevel to DEBUG by default 2016-04-06 18:58:36 +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 d8013d1f8c ranap_parse_lai(): Fix wrong BCD decoding for MNC. Add test.
Fix the ranap_parse_lai() part that decodes the MNC: place the *10 at the
proper MNC digit.

Add a comprehensive test for ranap_parse_lai() in test-helpers.c. Because
ranap_parse_lai() logs things, add test_common.c to test-helpers compilation
and an expected stderr output to test-helpers' testsuite.at def.
2016-04-06 18:55:14 +02:00
Neels Hofmeyr 8f4cd86904 ranap_parse_lai(): add LAC size check, and log all parse errors 2016-04-06 18:55:14 +02:00
Neels Hofmeyr e5c5525bae rename README.msc to README
The .msc file ending is no good for shell globs like '*.msc'
2016-03-30 14:10:39 +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 576f642eba use of sccp_helpers: apply osmo_ name prefix addition 2016-03-30 14:10:39 +02:00
Neels Hofmeyr 3da8608b6a Move sccp_helpers.[hc] to libosmo-sigtran 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 f67803684f build: use $top_srcdir instead of ../ 2016-02-29 14:28:00 +01:00
Neels Hofmeyr 92b13bc875 fix build: move local include dir before sys installed one 2016-02-29 14:22:21 +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 c164a97bc6 hnb-test-ranap.c: fix missing return 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 306bf18ce6 avoid a warning by declaring struct gprs_ra_id opaquely 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
Daniel Willmann 19dea8b49b asn1: Generate _free_*ies function declarations
ranap_ies_defs.h is checked in so update it

hnbap_ies_defs.h and rua_ies_defs.h need to be regenerated
2016-02-22 11:15:04 +01:00
Harald Welte ce5b9965f9 import TR 25.931 with examples of signalling procedures 2016-02-22 09:17:15 +01:00
Neels Hofmeyr 8f67f8e83c test-ranap.ok: fix expectations after commit 49f99cd26
49f99cd26: 'ranap_msg_factory: Use network byte order for 16 bit mode_versions field'
2016-02-20 15:23:12 +01:00
Daniel Willmann 635fac0c3e ranap: Add custom ranap_decode_rab_setupormodifieditemies() function 2016-02-18 16:02:37 +01:00
Daniel Willmann 4870b995ec ranap_common: Add helper function to get IP from transport layer addr 2016-02-18 13:21:35 +01:00
Daniel Willmann 49f99cd265 ranap_msg_factory: Use network byte order for 16 bit mode_versions field
Instead of 0x0001 the field was 0x0100
2016-02-18 13:21:35 +01:00
Daniel Willmann eac3bf97e8 Better capture for PS Data 2016-02-18 13:21:30 +01:00