lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/40844?usp=email )
Change subject: move general asn debug options into iu_helpers ......................................................................
move general asn debug options into iu_helpers
In prepration to remove iu_client. Move debug variables asn_debug and asn1_xer_print which are not related to iu_client into common part.
Related: OS#5487 Change-Id: If5175c449af13fe81e89488df71fcd8192091659 --- M TODO-RELEASE M include/osmocom/iuh/Makefile.am A include/osmocom/iuh/common.h M include/osmocom/ranap/iu_client.h M src/iu_client.c M src/iu_client_vty.c M src/iu_helpers.c 7 files changed, 23 insertions(+), 13 deletions(-)
Approvals: daniel: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE index b583f7e..2879aed 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ libosmo-ranap deprecate API ranap_ran_rx_co_decode() libosmo-ranap add API iu_client.h: add ranap_iu_page_cs2/ranap_iu_page_ps2 libosmo-ranap new event RANAP_IU_EVENT_NEW_AREA +libosmo-ranap move declaration (backwards compatible): asn_debug, asn1_xer_print: use osmocom/iuh/common.h instead of iu_client.h diff --git a/include/osmocom/iuh/Makefile.am b/include/osmocom/iuh/Makefile.am index e5dff0d..944347c 100644 --- a/include/osmocom/iuh/Makefile.am +++ b/include/osmocom/iuh/Makefile.am @@ -1,2 +1,8 @@ +iuhdir = $(includedir)/osmocom/iuh + noinst_HEADERS = \ iu_common.h + +iuh_HEADERS = \ + common.h + diff --git a/include/osmocom/iuh/common.h b/include/osmocom/iuh/common.h new file mode 100644 index 0000000..78d120d --- /dev/null +++ b/include/osmocom/iuh/common.h @@ -0,0 +1,5 @@ +#pragma once + +/* Debugging switches from asn1c and osmo-iuh */ +extern int asn_debug; +extern int asn1_xer_print; diff --git a/include/osmocom/ranap/iu_client.h b/include/osmocom/ranap/iu_client.h index 465a17d..4b5e58c 100644 --- a/include/osmocom/ranap/iu_client.h +++ b/include/osmocom/ranap/iu_client.h @@ -5,6 +5,7 @@ #include <osmocom/core/defs.h> #include <osmocom/core/linuxlist.h> #include <osmocom/gsm/gsm48.h> +#include <osmocom/iuh/common.h> #include <osmocom/sigtran/sccp_sap.h>
struct msgb; @@ -15,10 +16,6 @@
struct ranap_iu_rnc;
-/* Debugging switches from asn1c and osmo-iuh */ -extern int asn_debug; -extern int asn1_xer_print; - enum ranap_nsap_addr_enc { RANAP_NSAP_ADDR_ENC_X213, RANAP_NSAP_ADDR_ENC_V4RAW, diff --git a/src/iu_client.c b/src/iu_client.c index e31c898..d2b00e9 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -81,15 +81,6 @@
void *talloc_iu_ctx;
-/* Implement the extern asn_debug from libasn1c to indicate whether to print - * asn.1 debug messages (see libasn1c). */ -int asn_debug = 0; - -/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary - * code decoded and encoded during Iu communication should be logged to stderr - * (see asn.1 generated code in osmo-iuh). */ -int asn1_xer_print = 0; - ranap_iu_recv_cb_t global_iu_recv_cb = NULL; ranap_iu_event_cb_t global_iu_event_cb = NULL; int iu_log_subsystem = 0; diff --git a/src/iu_client_vty.c b/src/iu_client_vty.c index b111a5b..2c5a1e4 100644 --- a/src/iu_client_vty.c +++ b/src/iu_client_vty.c @@ -26,6 +26,7 @@ #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/iuh/common.h> #include <osmocom/ranap/iu_client.h>
static enum ranap_nsap_addr_enc *g_rab_assign_addr_enc = NULL; diff --git a/src/iu_helpers.c b/src/iu_helpers.c index 27e6a25..705af31 100644 --- a/src/iu_helpers.c +++ b/src/iu_helpers.c @@ -33,6 +33,15 @@
void *talloc_asn1_ctx;
+/* Implement the extern asn_debug from libasn1c to indicate whether to print + * asn.1 debug messages (see libasn1c). */ +int asn_debug = 0; + +/* Implement the extern asn1_xer_print to indicate whether the ASN.1 binary + * code decoded and encoded during Iu communication should be logged to stderr + * (see asn.1 generated code in osmo-iuh). */ +int asn1_xer_print = 0; + /* decode a BCD-string as used inside ASN.1 encoded Iu interface protocols */ int ranap_bcd_decode(char *out, size_t out_len, const uint8_t *in, size_t in_len) {