aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/debug.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-17 23:41:43 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-17 23:41:43 +0200
commitd9a55f67acdcc9a0f63ac48c34926b15b72180da (patch)
tree7454dca42c66f7ef437d595cc18514f1158357e7 /openbsc/src/debug.c
parentb1b290862a1f8896157da1b38c64f516d3905357 (diff)
[GPRS] BSSGP: Add VTY for configuration and inpection
This also includes log filtering based on NSEI/BVCI tuple
Diffstat (limited to 'openbsc/src/debug.c')
-rw-r--r--openbsc/src/debug.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/openbsc/src/debug.c b/openbsc/src/debug.c
index 31694f37f..2a67398b4 100644
--- a/openbsc/src/debug.c
+++ b/openbsc/src/debug.c
@@ -176,7 +176,8 @@ static const struct log_info_cat default_categories[] = {
enum log_filter {
_FLT_ALL = LOG_FILTER_ALL, /* libosmocore */
FLT_IMSI = 1,
- FLT_NSVC = 1,
+ FLT_NSVC = 2,
+ FLT_BVC = 3,
};
static int filter_fn(const struct log_context *ctx,
@@ -184,6 +185,7 @@ static int filter_fn(const struct log_context *ctx,
{
struct gsm_subscriber *subscr = ctx->ctx[BSC_CTX_SUBSCR];
const struct gprs_nsvc *nsvc = ctx->ctx[BSC_CTX_NSVC];
+ const struct gprs_nsvc *bvc = ctx->ctx[BSC_CTX_BVC];
if ((tar->filter_map & (1 << FLT_IMSI)) != 0
&& subscr && strcmp(subscr->imsi, tar->filter_data[FLT_IMSI]) == 0)
@@ -194,6 +196,11 @@ static int filter_fn(const struct log_context *ctx,
&& nsvc && (nsvc == tar->filter_data[FLT_NSVC]))
return 1;
+ /* Filter on the NS Virtual Connection */
+ if ((tar->filter_map & (1 << FLT_BVC)) != 0
+ && bvc && (bvc == tar->filter_data[FLT_BVC]))
+ return 1;
+
return 0;
}
@@ -226,3 +233,15 @@ void log_set_nsvc_filter(struct log_target *target,
target->filter_data[FLT_NSVC] = NULL;
}
}
+
+void log_set_bvc_filter(struct log_target *target,
+ const struct bssgp_bvc_ctx *bctx)
+{
+ if (bctx) {
+ target->filter_map |= (1 << FLT_BVC);
+ target->filter_data[FLT_BVC] = bctx;
+ } else if (target->filter_data[FLT_NSVC]) {
+ target->filter_map = ~(1 << FLT_BVC);
+ target->filter_data[FLT_BVC] = NULL;
+ }
+}