gbproxy: Add BVC log filters
Since gbproxy doesn't use bssgp_rcvmsg from libosmocore we need to
implement our own filtering.
Change-Id: I4d1b57b89990945d307f27a58a7f630be0253d5b
Related: SYS#5232
diff --git a/src/gbproxy/gb_proxy.c b/src/gbproxy/gb_proxy.c
index d8b828c..329c1d1 100644
--- a/src/gbproxy/gb_proxy.c
+++ b/src/gbproxy/gb_proxy.c
@@ -31,6 +31,7 @@
#include <arpa/inet.h>
#include <time.h>
+#include <osmocom/core/logging.h>
#include <osmocom/core/talloc.h>
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
@@ -1568,12 +1569,12 @@
}
}
-
/* called by the ns layer */
int gprs_ns2_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
{
struct osmo_gprs_ns2_prim *nsp;
struct gbproxy_config *cfg = (struct gbproxy_config *) ctx;
+ uintptr_t bvci;
int rc = 0;
if (oph->sap != SAP_NS)
@@ -1589,11 +1590,14 @@
switch (oph->primitive) {
case PRIM_NS_UNIT_DATA:
+
/* hand the message into the BSSGP implementation */
msgb_bssgph(oph->msg) = oph->msg->l3h;
msgb_bvci(oph->msg) = nsp->bvci;
msgb_nsei(oph->msg) = nsp->nsei;
+ bvci = nsp->bvci | BVC_LOG_CTX_FLAG;
+ log_set_context(LOG_CTX_GB_BVC, (void *)bvci);
rc = gbprox_rcvmsg(cfg, oph->msg);
msgb_free(oph->msg);
break;