aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-msc/msc_main.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-03-22 15:51:22 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-03-22 17:05:42 +0100
commit6a8b9c70fceba57f624c9c23c97cbb27389e4584 (patch)
tree54c6fbf7659318e6dcfbab978a3ea7c85d56421c /src/osmo-msc/msc_main.c
parent34fd0c69a3beb97fd8315488fa384e5b7b090bca (diff)
dissolve libcommon: drop debug.c
Apply more concise logging categories in each main scope. The bulk goes to msc_main.c, obviously, while tests and utils get a slimmed down bunch of logging categories. Change-Id: I969a0662ba273f3721b6820d02151b7a5b8014b8
Diffstat (limited to 'src/osmo-msc/msc_main.c')
-rw-r--r--src/osmo-msc/msc_main.c112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c
index 6de81dac9..1cf264274 100644
--- a/src/osmo-msc/msc_main.c
+++ b/src/osmo-msc/msc_main.c
@@ -401,6 +401,118 @@ static int ss7_setup(void *ctx)
return 0;
}
+static const struct log_info_cat msc_default_categories[] = {
+ [DRLL] = {
+ .name = "DRLL",
+ .description = "A-bis Radio Link Layer (RLL)",
+ .color = "\033[1;31m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DCC] = {
+ .name = "DCC",
+ .description = "Layer3 Call Control (CC)",
+ .color = "\033[1;32m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DMM] = {
+ .name = "DMM",
+ .description = "Layer3 Mobility Management (MM)",
+ .color = "\033[1;33m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DRR] = {
+ .name = "DRR",
+ .description = "Layer3 Radio Resource (RR)",
+ .color = "\033[1;34m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DMNCC] = {
+ .name = "DMNCC",
+ .description = "MNCC API for Call Control application",
+ .color = "\033[1;39m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DPAG] = {
+ .name = "DPAG",
+ .description = "Paging Subsystem",
+ .color = "\033[1;38m",
+ .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,
+ },
+ [DHO] = {
+ .name = "DHO",
+ .description = "Hand-Over",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DDB] = {
+ .name = "DDB",
+ .description = "Database Layer",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DREF] = {
+ .name = "DREF",
+ .description = "Reference Counting",
+ .enabled = 0, .loglevel = LOGL_NOTICE,
+ },
+ [DCTRL] = {
+ .name = "DCTRL",
+ .description = "Control interface",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+ [DSMPP] = {
+ .name = "DSMPP",
+ .description = "SMPP interface for external SMS apps",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
+ [DRANAP] = {
+ .name = "DRANAP",
+ .description = "Radio Access Network Application Part Protocol",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
+ [DVLR] = {
+ .name = "DVLR",
+ .description = "Visitor Location Register",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
+ [DIUCS] = {
+ .name = "DIUCS",
+ .description = "Iu-CS Protocol",
+ .enabled = 1, .loglevel = LOGL_DEBUG,
+ },
+ [DBSSAP] = {
+ .name = "DBSSAP",
+ .description = "BSSAP Protocol (A Interface)",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+
+};
+
+static int filter_fn(const struct log_context *ctx, struct log_target *tar)
+{
+ const struct vlr_subscr *vsub = ctx->ctx[LOG_CTX_VLR_SUBSCR];
+
+ if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0
+ && vsub && vsub == tar->filter_data[LOG_FLT_VLR_SUBSCR])
+ return 1;
+
+ return 0;
+}
+
+const struct log_info log_info = {
+ .filter_fn = filter_fn,
+ .cat = msc_default_categories,
+ .num_cat = ARRAY_SIZE(msc_default_categories),
+};
+
int main(int argc, char **argv)
{
int rc;