From 5f5b8f2914a5389e3135573a7c6838f3d156b5ab Mon Sep 17 00:00:00 2001 From: Alireza Mohammadi Date: Tue, 18 Jul 2023 14:39:58 +0200 Subject: [PATCH] Fix for ASN1 logging: change name from ASN to ASN1 There is a conflict with some E2AP definitions that put ASN as a preprocessor definition. To avoid this conflict, and since ASN1 is more descriptive than ASN, we change the logging mechanism name from ASN to ASN1. --- CMakeLists.txt | 2 +- common/utils/LOG/log.c | 2 +- common/utils/LOG/log.h | 2 +- common/utils/config.h | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bef6278246..df39235067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,7 +268,7 @@ add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp) target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) # asn1c skeletons have hardcoded this flag to make customized debug logs -# OAI uses this feature to re-use OAI LOG_I(ASN, ...) +# OAI uses this feature to re-use OAI LOG_I(ASN1, ...) if (DEBUG_ASN1C) add_definitions(-DHAVE_CONFIG_H) endif() diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c index cb46287733..f936ed5ae2 100644 --- a/common/utils/LOG/log.c +++ b/common/utils/LOG/log.c @@ -487,7 +487,7 @@ int logInit (void) register_log_component("SCTP","",SCTP); register_log_component("X2AP","",X2AP); register_log_component("LOADER","log",LOADER); - register_log_component("ASN","log",ASN); + register_log_component("ASN1","log",ASN1); register_log_component("NFAPI_VNF","log",NFAPI_VNF); register_log_component("NFAPI_PNF","log",NFAPI_PNF); register_log_component("GNB_APP","log",GNB_APP); diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index ccd97f9779..37b89398cb 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -240,7 +240,7 @@ typedef enum { NR_MAC, NR_PHY, LOADER, - ASN, + ASN1, NFAPI_VNF, NFAPI_PNF, ITTI, diff --git a/common/utils/config.h b/common/utils/config.h index 597ead7ed6..6d15a309c9 100644 --- a/common/utils/config.h +++ b/common/utils/config.h @@ -27,28 +27,28 @@ /* * This file "config.h" will be used by asn1c if HAVE_CONFIG_H_ is defined and * included. This logs asn1c encoder and decoder traces at execution time using - * the regular OAI logging system, i.e., LOG_I(ASN...); + * the regular OAI logging system, i.e., LOG_I(ASN1...); * * As it is very verbose, note that you can change the log level per module in * source or in gdb, e.g., to only activate it for a short time. * * In code: * ``` - * set_log(ASN, OAI_INFO); // enable logging + * set_log(ASN1, OAI_INFO); // enable logging * // do your encoding here - * set_log(ASN, OAI_ERR); // disable logging + * set_log(ASN1, OAI_ERR); // disable logging * ``` * * in gdb: * ``` - * gdb> p set_log(ASN, 1) // disable log, 1 == OAI_ERR - * gdb> p set_log(ASN, 5) // enable log, 5 == OAI_INFO + * gdb> p set_log(ASN1, 1) // disable log, 1 == OAI_ERR + * gdb> p set_log(ASN1, 5) // enable log, 5 == OAI_INFO * ``` */ #include "common/utils/LOG/log.h" #if DEBUG_ASN1C -#define ASN_DEBUG(x...) do{ LOG_I(ASN,x);LOG_I(ASN,"\n"); } while(false) +#define ASN_DEBUG(x...) do{ LOG_I(ASN1,x);LOG_I(ASN1,"\n"); } while(false) #else #define ASN_DEBUG(x...) #endif