diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-08-11 15:07:37 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-08-24 16:16:39 +0200 |
commit | 3e23ddf88b38f9316b61daff6f8f41e57e883a14 (patch) | |
tree | 80b36ff43fb2420069e5d7d61d413ad5891b0697 /openbsc/tests/gbproxy/gbproxy_test.c | |
parent | 1449c9f06f7f10319517f50fd64b5e2926284d44 (diff) |
gbproxy: Parse Detach Request messages
GSM 24.008 also allows a P-TMSI field in Detach request messages.
This patch adds gbprox_parse_gmm_detach_req() to parse Detach Request
messages which sets the ptmsi field if the IE is present.
In addition, when power_off is set to 1 (MO only), the
invalidate_tlli field is set, since Detach Request message is
expected in this case.
The second detach test (see 'RA update') is modified to use
power_off instead of relying on a Detach Accept from the network.
To make this work, the PTMSI of the RA Update Accept is fixed to
match the TLLI of the Detach Request.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/gbproxy/gbproxy_test.c')
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index 5363749c6..27454a2a9 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -221,8 +221,8 @@ static const unsigned char bssgp_ra_upd_acc[91] = { 0x18, 0x00, 0x81, 0x00, 0x0e, 0x9d, 0x41, 0xc0, 0x19, 0x08, 0x09, 0x00, 0x49, 0x21, 0x63, 0x54, 0x40, 0x50, 0x60, 0x19, 0x54, 0xab, 0xb3, 0x18, - 0x05, 0xf4, 0xef, 0xe2, 0x81, 0x17, 0x17, 0x16, - 0xc3, 0xbf, 0xcc + 0x05, 0xf4, 0xef, 0xe2, 0xb7, 0x00, 0x17, 0x16, + 0xd7, 0x59, 0x65 }; /* Base Station Subsystem GPRS Protocol: GSM A-I/F DTAP - Activate PDP Context Request */ @@ -239,7 +239,19 @@ static const unsigned char bssgp_act_pdp_ctx_req[76] = { 0x00, 0x5a, 0xff, 0x02 }; -/* Base Station Subsystem GPRS Protocol: GSM A-I/F DTAP - Detach Request */ +/* Base Station Subsystem GPRS Protocol: GSM A-I/F DTAP - Detach Request (MO) */ +/* normal detach, power_off = 1 */ +static const unsigned char bssgp_detach_po_req[44] = { + 0x01, 0xef, 0xe2, 0xb7, 0x00, 0x00, 0x00, 0x04, + 0x08, 0x88, 0x11, 0x22, 0x33, 0x40, 0x50, 0x60, + 0x75, 0x30, 0x00, 0x80, 0x0e, 0x00, 0x15, 0x01, + 0xc0, 0x19, 0x08, 0x05, 0x09, 0x18, 0x05, 0xf4, + 0xef, 0xe2, 0xb7, 0x00, 0x19, 0x03, 0xb9, 0x97, + 0xcb, 0x84, 0x0c, 0xeb +}; + +/* Base Station Subsystem GPRS Protocol: GSM A-I/F DTAP - Detach Request (MO) */ +/* normal detach, power_off = 0 */ static const unsigned char bssgp_detach_req[44] = { 0x01, 0xef, 0xe2, 0xb7, 0x00, 0x00, 0x00, 0x04, 0x08, 0x88, 0x11, 0x22, 0x33, 0x40, 0x50, 0x60, @@ -1060,13 +1072,9 @@ static void test_gbproxy_ra_patching() dump_peers(stdout, 0, 0, &gbcfg); - /* Detach */ - send_ns_unitdata(nsi, "DETACH REQ", &bss_peer[0], 0x1002, - bssgp_detach_req, sizeof(bssgp_detach_req)); - - send_ns_unitdata(nsi, "DETACH ACC", &sgsn_peer, 0x1002, - bssgp_detach_acc, sizeof(bssgp_detach_acc)); - + /* Detach (power off -> no Detach Accept) */ + send_ns_unitdata(nsi, "DETACH REQ (PWR OFF)", &bss_peer[0], 0x1002, + bssgp_detach_po_req, sizeof(bssgp_detach_po_req)); dump_global(stdout, 0); dump_peers(stdout, 0, 0, &gbcfg); |