From bdf3fd1dc4368c965f2e02bf2f171dfa8685712b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 3 Jan 2016 17:04:09 +0100 Subject: don't include hnbgw.h from ranap header files To use libosmo-ranap from outside of this repository, we need to eliminated all dependencies to local header files --- src/hnbgw.c | 1 + src/ranap_common.c | 8 +++++++- src/ranap_common.h | 6 ++++-- src/ranap_msg_factory.c | 2 +- src/tests/dummy_cn_sua.c | 1 + src/tests/test_common.c | 1 + 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/hnbgw.c b/src/hnbgw.c index ea3e754..b3d1b63 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -434,6 +434,7 @@ int main(int argc, char **argv) } osmo_sua_set_log_area(DSUA); + ranap_set_log_area(DRANAP); g_hnb_gw->cnlink_cs = hnbgw_cnlink_init(g_hnb_gw, "127.0.0.1", SUA_PORT); g_hnb_gw->cnlink_ps = hnbgw_cnlink_init(g_hnb_gw, "127.0.0.2", SUA_PORT); diff --git a/src/ranap_common.c b/src/ranap_common.c index f6993fd..47ee684 100644 --- a/src/ranap_common.c +++ b/src/ranap_common.c @@ -24,9 +24,10 @@ #include #include "ranap_common.h" -#include "hnbgw.h" extern int asn1_xer_print; +int _ranap_DRANAP = 0; +#define DRANAP _ranap_DRANAP const struct value_string ranap_presence_vals[5] = { { RANAP_RANAP_PDU_PR_initiatingMessage, "Initiating" }, @@ -517,3 +518,8 @@ int ranap_parse_lai(struct gprs_ra_id *ra_id, const RANAP_LAI_t *lai) return 0; } + +void ranap_set_log_area(int log_area) +{ + _ranap_DRANAP = log_area; +} diff --git a/src/ranap_common.h b/src/ranap_common.h index e30ca2a..88bdfcc 100644 --- a/src/ranap_common.h +++ b/src/ranap_common.h @@ -590,8 +590,8 @@ #include #include -#include "hnbgw.h" -#define RANAP_DEBUG(x, args ...) DEBUGP(DRANAP, x, ## args) +#define RANAP_DEBUG(x, args ...) DEBUGP(_ranap_DRANAP, x, ## args) +extern int _ranap_DRANAP; extern int asn1_xer_print; @@ -630,3 +630,5 @@ RANAP_ProtocolIE_FieldPair_t *ranap_new_ie_pair(RANAP_ProtocolIE_ID_t id, asn_TYPE_descriptor_t *type1, void *sptr1, RANAP_Criticality_t criticality2, asn_TYPE_descriptor_t *type2, void *sptr2); + +void ranap_set_log_area(int log_area); diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c index 0c015e5..c62f268 100644 --- a/src/ranap_msg_factory.c +++ b/src/ranap_msg_factory.c @@ -28,7 +28,7 @@ #include "ranap_ies_defs.h" #include "ranap_msg_factory.h" -#include "hnbgw.h" +#define DRANAP _ranap_DRANAP /*! \brief allocate a new long and assing a value to it */ static long *new_long(long in) diff --git a/src/tests/dummy_cn_sua.c b/src/tests/dummy_cn_sua.c index de850a7..4760b7b 100644 --- a/src/tests/dummy_cn_sua.c +++ b/src/tests/dummy_cn_sua.c @@ -307,6 +307,7 @@ int main(int argc, char **argv) int rc; osmo_sua_set_log_area(DSUA); + ranap_set_log_area(DRANAP); test_common_init(); diff --git a/src/tests/test_common.c b/src/tests/test_common.c index d6c1351..4e4c10c 100644 --- a/src/tests/test_common.c +++ b/src/tests/test_common.c @@ -84,4 +84,5 @@ int test_common_init(void) if (rc < 0) exit(1); + ranap_set_log_area(DRANAP); } -- cgit v1.2.3