diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-30 02:12:02 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-30 02:12:02 +0800 |
commit | e4cb3e039b78e03dc7115faac065830dada67a17 (patch) | |
tree | 201230f1260a349f31bed07f7d518fd127c476b7 | |
parent | 30cc096640a4d10ba9db64e101042a15822644ec (diff) |
sccp: Adjust the code to only depend on libosmocore
* Introduce a method to set the value of the debug area to
use and default it to -1. Turn the DSCCP enum into a local
variable to make the log messages work.
* Remove usage of openbsc and libbsc.a
-rw-r--r-- | include/sccp/sccp.h | 5 | ||||
-rw-r--r-- | src/sccp/sccp.c | 9 | ||||
-rw-r--r-- | tests/sccp/Makefile.am | 2 | ||||
-rw-r--r-- | tests/sccp/sccp_test.c | 5 |
4 files changed, 17 insertions, 4 deletions
diff --git a/include/sccp/sccp.h b/include/sccp/sccp.h index a0cdf0b..b25e21f 100644 --- a/include/sccp/sccp.h +++ b/include/sccp/sccp.h @@ -174,4 +174,9 @@ struct sccp_parse_result { int sccp_determine_msg_type(struct msgb *msg); int sccp_parse_header(struct msgb *msg, struct sccp_parse_result *result); +/* + * osmocore logging features + */ +void sccp_set_log_area(int log_area); + #endif diff --git a/src/sccp/sccp.c b/src/sccp/sccp.c index 3657080..e054df5 100644 --- a/src/sccp/sccp.c +++ b/src/sccp/sccp.c @@ -25,11 +25,13 @@ #include <string.h> #include <osmocore/msgb.h> -#include <openbsc/debug.h> #include <osmocore/talloc.h> +#include <osmocore/logging.h> #include <sccp/sccp.h> +// Unassigned debug area +static int DSCCP = 0; static void *tall_sccp_ctx; static LLIST_HEAD(sccp_connections); @@ -1423,3 +1425,8 @@ static __attribute__((destructor)) void on_dso_unload(void) { talloc_report_full(tall_sccp_ctx, stderr); } + +void sccp_set_log_area(int log_area) +{ + DSCCP = log_area; +} diff --git a/tests/sccp/Makefile.am b/tests/sccp/Makefile.am index b35693e..b7caf7d 100644 --- a/tests/sccp/Makefile.am +++ b/tests/sccp/Makefile.am @@ -4,5 +4,5 @@ AM_CFLAGS=-Wall -ggdb3 $(LIBOSMOCORE_CFLAGS) noinst_PROGRAMS = sccp_test sccp_test_SOURCES = sccp_test.c -sccp_test_LDADD = $(top_builddir)/src/libsccp.a $(top_builddir)/src/libbsc.a $(LIBOSMOCORE_LIBS) +sccp_test_LDADD = $(top_builddir)/src/libsccp.a $(LIBOSMOCORE_LIBS) diff --git a/tests/sccp/sccp_test.c b/tests/sccp/sccp_test.c index 3b9ef4e..b6cade3 100644 --- a/tests/sccp/sccp_test.c +++ b/tests/sccp/sccp_test.c @@ -23,12 +23,13 @@ */ #include <stdio.h> +#include <string.h> #include <arpa/inet.h> -#include <openbsc/gsm_data.h> -#include <openbsc/debug.h> +#include <osmocore/logging.h> #include <osmocore/msgb.h> +#include <osmocore/utils.h> #include <sccp/sccp.h> |