diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2014-06-27 11:55:04 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-07-22 17:03:23 +0200 |
commit | aa3e334608d0101c8e98b5bc65d4cd9fd2bc82ea (patch) | |
tree | 7f6eef3fd6916be5d54b3ca7c901af871e756b2e /openbsc/tests/gbproxy/gbproxy_test.c | |
parent | 25049b93b1363246b4099f2dca748b191ae1742d (diff) |
gprs/test: Rearrange for PTMSI parsing
Add TLLI cache output to gbprox_dump_peers() to include this info
into the test output.
Separate RA Update Req message handling from Attach Request handling.
Note: There is no test case for the P-TMSI Reallocation Command yet.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests/gbproxy/gbproxy_test.c')
-rw-r--r-- | openbsc/tests/gbproxy/gbproxy_test.c | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index a9d06551b..1598c72e2 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -63,7 +63,7 @@ static const unsigned char bssgp_attach_acc[88] = { 0x0e, 0x9e, 0x41, 0xc0, 0x05, 0x08, 0x02, 0x01, 0x49, 0x04, 0x21, 0x63, 0x54, 0x40, 0x50, 0x60, 0x19, 0xcd, 0xd7, 0x08, 0x17, 0x16, 0x18, 0x05, - 0xf4, 0xfb, 0xc5, 0x47, 0x22, 0x42, 0x67, 0x9a + 0xf4, 0xef, 0xe2, 0xb7, 0x00, 0x42, 0x67, 0x9a }; /* Base Station Subsystem GPRS Protocol: GSM A-I/F DTAP - GMM Information */ @@ -892,16 +892,15 @@ static void test_gbproxy_ra_patching() send_ns_unitdata(nsi, "ATTACH ACCEPT", &sgsn_peer, 0x1002, bssgp_attach_acc, sizeof(bssgp_attach_acc)); - send_ns_unitdata(nsi, "UPDATE REQ", &bss_peer[0], 0x1002, - bssgp_ra_upd_req, sizeof(bssgp_ra_upd_req)); - - send_ns_unitdata(nsi, "RA UPD ACC", &sgsn_peer, 0x1002, - bssgp_ra_upd_acc, sizeof(bssgp_ra_upd_acc)); + /* Replace APN (1) */ + send_ns_unitdata(nsi, "ACT PDP CTX REQ (REPLACE APN)", + &bss_peer[0], 0x1002, + bssgp_act_pdp_ctx_req, sizeof(bssgp_act_pdp_ctx_req)); send_ns_unitdata(nsi, "GMM INFO", &sgsn_peer, 0x1002, bssgp_gmm_information, sizeof(bssgp_gmm_information)); - /* Replace APN */ + /* Replace APN (2) */ send_ns_unitdata(nsi, "ACT PDP CTX REQ (REPLACE APN)", &bss_peer[0], 0x1002, bssgp_act_pdp_ctx_req, sizeof(bssgp_act_pdp_ctx_req)); @@ -914,6 +913,32 @@ static void test_gbproxy_ra_patching() &bss_peer[0], 0x1002, bssgp_act_pdp_ctx_req, sizeof(bssgp_act_pdp_ctx_req)); + gbprox_dump_peers(stdout, 0); + + /* 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)); + + gbprox_dump_peers(stdout, 0); + + printf("--- RA update ---\n\n"); + + send_ns_unitdata(nsi, "RA UPD REQ", &bss_peer[0], 0x1002, + bssgp_ra_upd_req, sizeof(bssgp_ra_upd_req)); + + send_ns_unitdata(nsi, "RA UPD ACC", &sgsn_peer, 0x1002, + bssgp_ra_upd_acc, sizeof(bssgp_ra_upd_acc)); + + /* Remove APN */ + send_ns_unitdata(nsi, "ACT PDP CTX REQ (REMOVE APN)", + &bss_peer[0], 0x1002, + bssgp_act_pdp_ctx_req, sizeof(bssgp_act_pdp_ctx_req)); + + gbprox_dump_peers(stdout, 0); + /* Detach */ send_ns_unitdata(nsi, "DETACH REQ", &bss_peer[0], 0x1002, bssgp_detach_req, sizeof(bssgp_detach_req)); @@ -921,6 +946,7 @@ static void test_gbproxy_ra_patching() send_ns_unitdata(nsi, "DETACH ACC", &sgsn_peer, 0x1002, bssgp_detach_acc, sizeof(bssgp_detach_acc)); + gbprox_dump_global(stdout, 0); gbprox_dump_peers(stdout, 0); |