From 603e065f43a9b0a6d9d92584ba458fefee32b516 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 26 Jul 2017 18:07:53 +0200 Subject: add osmo_sccp_addr_name() and three value_string[]s osmo_sccp_addr_dump() just prints the raw values. In osmo_sccp_addr_name(), use osmo_ss7_pointcode_print() and newly added RI, SSN and GT value_string[] to print more human readable log output. Change-Id: Ie1aedd7894acd69ddc887cd65a8a0df4b888838c --- include/osmocom/sigtran/sccp_sap.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/osmocom/sigtran/sccp_sap.h') diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index 13b1022..796597f 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -60,6 +60,11 @@ enum osmo_sccp_routing_ind { OSMO_SCCP_RI_SSN_IP, }; +extern const struct value_string osmo_sccp_routing_ind_names[]; +static inline const char *osmo_sccp_routing_ind_name(enum osmo_sccp_routing_ind val) +{ return get_value_string(osmo_sccp_routing_ind_names, val); } + + /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */ enum osmo_sccp_gti { OSMO_SCCP_GTI_NO_GT, @@ -69,6 +74,10 @@ enum osmo_sccp_gti { OSMO_SCCP_GTI_TT_NPL_ENC_NAI, }; +extern const struct value_string osmo_sccp_gti_names[]; +static inline const char *osmo_sccp_gti_name(enum osmo_sccp_gti val) +{ return get_value_string(osmo_sccp_gti_names, val); } + /* RFC 3868 3.10.2.3 */ enum osmo_sccp_npi { OSMO_SCCP_NPI_UNKNOWN = 0, @@ -126,6 +135,10 @@ enum osmo_sccp_ssn { OSMO_SCCP_SSN_BSS_OAM = 253, }; +extern const struct value_string osmo_sccp_ssn_names[]; +static inline const char *osmo_sccp_ssn_name(enum osmo_sccp_ssn val) +{ return get_value_string(osmo_sccp_ssn_names, val); } + struct osmo_sccp_gt { uint8_t gti; uint8_t tt; -- cgit v1.2.3