aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-08-04 04:56:01 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-08-04 06:09:14 +0800
commitd4310b986524290baa43669df01ef105623379fc (patch)
tree5be71f3cd7b30ea95e0f6aebeff65202376af726
parent48f4d63d8d4f25247ad368c42e0dfa087fd80a34 (diff)
debug: Add a debug area to make the application link
-rw-r--r--src/Makefile.am4
-rw-r--r--src/debug.c61
2 files changed, 63 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5872598..0dc2e14 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,13 +4,13 @@ AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(LIBOSMOVTY_CFLAGS)
sbin_PROGRAMS = cellmgr_ng mgcp_mgw
-mgcp_mgw_SOURCES = mgcp_ss7.c mgcp/mgcp_protocol.c mgcp/mgcp_network.c thread.c
+mgcp_mgw_SOURCES = mgcp_ss7.c mgcp/mgcp_protocol.c mgcp/mgcp_network.c thread.c debug.c
mgcp_mgw_LDADD = $(LAFORGE_LIBS) $(NEXUSWARE_C7_LIBS) $(NEXUSWARE_UNIPORTE_LIBS) \
$(LIBOSMOVTY_LIBS) $(LIBOSMOCORE_LIBS) -lpthread
cellmgr_ng_SOURCES = main.c mtp_layer3.c thread.c input/ipaccess.c pcap.c \
bss_patch.c \
openbsc_nat/bssap.c openbsc_nat/tlv_parser.c bssap_sccp.c \
- msc_conn.c link_udp.c snmp_mtp.c
+ msc_conn.c link_udp.c snmp_mtp.c debug.c
cellmgr_ng_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOSCCP_LIBS) $(LIBOSMOVTY_LIBS) $(NEXUSWARE_C7_LIBS) \
-lpthread -lnetsnmp -lcrypto
diff --git a/src/debug.c b/src/debug.c
new file mode 100644
index 0000000..4382a47
--- /dev/null
+++ b/src/debug.c
@@ -0,0 +1,61 @@
+/* cellmgr logging support code */
+/*
+ * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <cellmgr_debug.h>
+
+#include <osmocore/utils.h>
+
+/* default categories */
+static const struct log_info_cat default_categories[] = {
+ [DINP] = {
+ .name = "DINP",
+ .description = "A-bis Intput Subsystem",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DSCCP] = {
+ .name = "DSCCP",
+ .description = "SCCP Protocol",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DMSC] = {
+ .name = "DMSC",
+ .description = "Mobile Switching Center",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DMGCP] = {
+ .name = "DMGCP",
+ .description = "Media Gateway Control Protocol",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+};
+
+static int filter_fn(const struct log_context *ctx,
+ struct log_target *tar)
+{
+ return 0;
+}
+
+const struct log_info log_info = {
+ .filter_fn = filter_fn,
+ .cat = default_categories,
+ .num_cat = ARRAY_SIZE(default_categories),
+};
+