aboutsummaryrefslogtreecommitdiffstats
path: root/tests/msc_vlr/msc_vlr_tests.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-10 02:15:20 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-23 14:35:31 +0200
commit78ada64be73f52f68962ebed988f77d9bc027c9e (patch)
treeef08c165279afaa6a3bd334577f36b0e617a4fc6 /tests/msc_vlr/msc_vlr_tests.c
parent4df72051f9b5c8228520763fdbfcbc0d4df295e8 (diff)
04.08: log protocol discriminators and message types by name
On incoming 04.08 messages, we log only the protocol discriminator in decimal. Enhance: log pdisc and message type in hex, and also log the protocol and message type as human readable string. Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions of dtap from/to the MS. Adjust the expected output of msc_vlr_tests. Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
Diffstat (limited to 'tests/msc_vlr/msc_vlr_tests.c')
-rw-r--r--tests/msc_vlr/msc_vlr_tests.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 2049e9f8e..6da34aed6 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -69,6 +69,17 @@ struct msgb *msgb_from_hex(const char *label, uint16_t size, const char *hex)
return msg;
}
+const char *gh_type_name(struct gsm48_hdr *gh)
+{
+ return gsm48_pdisc_msgtype_name(gsm48_hdr_pdisc(gh),
+ gsm48_hdr_msg_type(gh));
+}
+
+const char *msg_type_name(struct msgb *msg)
+{
+ return gh_type_name((void*)msg->data);
+}
+
void dtap_expect_tx(const char *hex)
{
/* Has the previously expected dtap been received? */
@@ -153,8 +164,10 @@ void rx_from_ms(struct msgb *msg)
int rc;
struct gsm48_hdr *gh = msgb_l3(msg);
- log("rx from MS: pdisc=0x%02x msg_type=0x%02x",
- gh->proto_discr, gh->msg_type);
+
+ log("MSC <--%s-- MS: %s",
+ ran_type_name(rx_from_ran),
+ gh_type_name(gh));
if (g_conn && !conn_exists(g_conn))
g_conn = NULL;
@@ -427,8 +440,9 @@ int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg)
int _validate_dtap(struct msgb *msg, enum ran_type to_ran)
{
- btw("DTAP --%s--> MS: %s",
- ran_type_name(to_ran),
+ struct gsm48_hdr *gh = (void*)msg->data;
+ btw("DTAP --%s--> MS: %s: %s",
+ ran_type_name(to_ran), msg_type_name(msg),
osmo_hexdump_nospc(msg->data, msg->len));
OSMO_ASSERT(dtap_tx_expected);