From 8b86cd76cf6e5254f888276d73f94bb0bfcee03b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 23 Feb 2017 18:03:28 +0100 Subject: logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_* My recent logging patch was merged to master a bit too soon. Accomodate the request for naming that matches the general "LOG" prefix instead of "LOGGING". libosmocore will not be backwards-compatible with the few commits from change-id I5c343630020f4b108099696fd96c2111614c8067 up to this one. This and following commits are backwards compatible with those before that short window. See also: * openbsc change-id Ib2ec5e4884aa90f48051ee2f832af557aa525991 * osmo-pcu change-id I4db4a668f2be07f3d55f848d38d1b490d8a7a685 Change-Id: I424fe3f12ea620338902b2bb8230544bde3f1a93 --- src/gb/common_vty.c | 12 ++++++------ src/gb/gprs_bssgp.c | 2 +- src/gb/gprs_bssgp_vty.c | 10 +++++----- src/gb/gprs_ns.c | 32 ++++++++++++++++---------------- src/gb/gprs_ns_vty.c | 10 +++++----- 5 files changed, 33 insertions(+), 33 deletions(-) (limited to 'src/gb') diff --git a/src/gb/common_vty.c b/src/gb/common_vty.c index 609ab3d7..5848a11c 100644 --- a/src/gb/common_vty.c +++ b/src/gb/common_vty.c @@ -70,17 +70,17 @@ gDEFUN(libgb_end, int gprs_log_filter_fn(const struct log_context *ctx, struct log_target *tar) { - const struct gprs_nsvc *nsvc = ctx->ctx[LOGGING_CTX_GB_NSVC]; - const struct gprs_bvc *bvc = ctx->ctx[LOGGING_CTX_GB_BVC]; + const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC]; + const struct gprs_bvc *bvc = ctx->ctx[LOG_CTX_GB_BVC]; /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOGGING_FILTER_GB_NSVC)) != 0 - && nsvc && (nsvc == tar->filter_data[LOGGING_FILTER_GB_NSVC])) + if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0 + && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC])) return 1; /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOGGING_FILTER_GB_BVC)) != 0 - && bvc && (bvc == tar->filter_data[LOGGING_FILTER_GB_BVC])) + if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0 + && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC])) return 1; return 0; diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index a4023785..dba4d5ca 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1049,7 +1049,7 @@ int bssgp_rcvmsg(struct msgb *msg) bctx = btsctx_by_bvci_nsei(bvci, msgb_nsei(msg)); if (bctx) { - log_set_context(LOGGING_CTX_GB_BVC, bctx); + log_set_context(LOG_CTX_GB_BVC, bctx); rate_ctr_inc(&bctx->ctrg->ctr[BSSGP_CTR_PKTS_IN]); rate_ctr_add(&bctx->ctrg->ctr[BSSGP_CTR_BYTES_IN], msgb_bssgp_len(msg)); diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index d8fc8407..f3f354cc 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -47,11 +47,11 @@ static void log_set_bvc_filter(struct log_target *target, struct bssgp_bvc_ctx *bctx) { if (bctx) { - target->filter_map |= (1 << LOGGING_FILTER_GB_BVC); - target->filter_data[LOGGING_FILTER_GB_BVC] = bctx; - } else if (target->filter_data[LOGGING_FILTER_GB_BVC]) { - target->filter_map = ~(1 << LOGGING_FILTER_GB_BVC); - target->filter_data[LOGGING_FILTER_GB_BVC] = NULL; + target->filter_map |= (1 << LOG_FLT_GB_BVC); + target->filter_data[LOG_FLT_GB_BVC] = bctx; + } else if (target->filter_data[LOG_FLT_GB_BVC]) { + target->filter_map = ~(1 << LOG_FLT_GB_BVC); + target->filter_data[LOG_FLT_GB_BVC] = NULL; } } diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c index 28f5ff39..76e70ff0 100644 --- a/src/gb/gprs_ns.c +++ b/src/gb/gprs_ns.c @@ -325,7 +325,7 @@ static int gprs_ns_tx(struct gprs_nsvc *nsvc, struct msgb *msg) { int ret; - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); /* Increment number of Uplink bytes */ rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_PKTS_OUT]); @@ -360,7 +360,7 @@ static int gprs_ns_tx_simple(struct gprs_nsvc *nsvc, uint8_t pdu_type) struct msgb *msg = gprs_ns_msgb_alloc(); struct gprs_ns_hdr *nsh; - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); if (!msg) return -ENOMEM; @@ -384,7 +384,7 @@ int gprs_ns_tx_reset(struct gprs_nsvc *nsvc, uint8_t cause) uint16_t nsvci = htons(nsvc->nsvci); uint16_t nsei = htons(nsvc->nsei); - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); if (!msg) return -ENOMEM; @@ -416,7 +416,7 @@ int gprs_ns_tx_status(struct gprs_nsvc *nsvc, uint8_t cause, struct gprs_ns_hdr *nsh; uint16_t nsvci = htons(nsvc->nsvci); - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); bvci = htons(bvci); @@ -469,7 +469,7 @@ int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause) struct gprs_ns_hdr *nsh; uint16_t nsvci = htons(nsvc->nsvci); - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); if (!msg) return -ENOMEM; @@ -497,7 +497,7 @@ int gprs_ns_tx_block(struct gprs_nsvc *nsvc, uint8_t cause) */ int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc) { - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); LOGP(DNS, LOGL_INFO, "NSEI=%u Tx NS UNBLOCK (NSVCI=%u)\n", nsvc->nsei, nsvc->nsvci); @@ -510,7 +510,7 @@ int gprs_ns_tx_unblock(struct gprs_nsvc *nsvc) */ int gprs_ns_tx_alive(struct gprs_nsvc *nsvc) { - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); LOGP(DNS, LOGL_DEBUG, "NSEI=%u Tx NS ALIVE (NSVCI=%u)\n", nsvc->nsei, nsvc->nsvci); @@ -523,7 +523,7 @@ int gprs_ns_tx_alive(struct gprs_nsvc *nsvc) */ int gprs_ns_tx_alive_ack(struct gprs_nsvc *nsvc) { - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); LOGP(DNS, LOGL_DEBUG, "NSEI=%u Tx NS ALIVE_ACK (NSVCI=%u)\n", nsvc->nsei, nsvc->nsvci); @@ -548,7 +548,7 @@ static void nsvc_start_timer(struct gprs_nsvc *nsvc, enum nsvc_timer_mode mode) enum ns_timeout tout = timer_mode_tout[mode]; unsigned int seconds = nsvc->nsi->timeout[tout]; - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); DEBUGP(DNS, "NSEI=%u Starting timer in mode %s (%u seconds)\n", nsvc->nsei, get_value_string(timer_mode_strs, mode), seconds); @@ -576,7 +576,7 @@ static void gprs_ns_timer_cb(void *data) enum ns_timeout tout = timer_mode_tout[nsvc->timer_mode]; unsigned int seconds = nsvc->nsi->timeout[tout]; - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); DEBUGP(DNS, "NSEI=%u Timer expired in mode %s (%u seconds)\n", nsvc->nsei, get_value_string(timer_mode_strs, nsvc->timer_mode), seconds); @@ -638,7 +638,7 @@ static int gprs_ns_tx_reset_ack(struct gprs_nsvc *nsvc) struct gprs_ns_hdr *nsh; uint16_t nsvci, nsei; - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); if (!msg) return -ENOMEM; @@ -692,7 +692,7 @@ int gprs_ns_sendmsg(struct gprs_ns_inst *nsi, struct msgb *msg) msgb_free(msg); return rc; } - log_set_context(LOGGING_CTX_GB_NSVC, nsvc); + log_set_context(LOG_CTX_GB_NSVC, nsvc); msg->l2h = msgb_push(msg, sizeof(*nsh) + 3); nsh = (struct gprs_ns_hdr *) msg->l2h; @@ -1099,7 +1099,7 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg, struct gprs_nsvc *fallback_nsvc; fallback_nsvc = nsi->unknown_nsvc; - log_set_context(LOGGING_CTX_GB_NSVC, fallback_nsvc); + log_set_context(LOG_CTX_GB_NSVC, fallback_nsvc); fallback_nsvc->ip.bts_addr = *saddr; fallback_nsvc->ll = ll; @@ -1215,7 +1215,7 @@ int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg, /* Only the RESET procedure creates a new NSVC */ if (nsh->pdu_type != NS_PDUT_RESET) { /* Since we have no NSVC, we have to use a fake */ - log_set_context(LOGGING_CTX_GB_NSVC, fallback_nsvc); + log_set_context(LOG_CTX_GB_NSVC, fallback_nsvc); LOGP(DNS, LOGL_INFO, "Rejecting NS PDU type 0x%0x " "from %s for non-existing NS-VC\n", nsh->pdu_type, gprs_ns_ll_str(fallback_nsvc)); @@ -1256,7 +1256,7 @@ int gprs_ns_vc_create(struct gprs_ns_inst *nsi, struct msgb *msg, if (!existing_nsvc) { *new_nsvc = gprs_nsvc_create(nsi, 0xffff); (*new_nsvc)->nsvci_is_valid = 0; - log_set_context(LOGGING_CTX_GB_NSVC, *new_nsvc); + log_set_context(LOG_CTX_GB_NSVC, *new_nsvc); gprs_ns_ll_copy(*new_nsvc, fallback_nsvc); LOGP(DNS, LOGL_INFO, "Creating NS-VC for BSS at %s\n", gprs_ns_ll_str(fallback_nsvc)); @@ -1299,7 +1299,7 @@ int gprs_ns_process_msg(struct gprs_ns_inst *nsi, struct msgb *msg, msgb_nsei(msg) = (*nsvc)->nsei; - log_set_context(LOGGING_CTX_GB_NSVC, *nsvc); + log_set_context(LOG_CTX_GB_NSVC, *nsvc); /* Increment number of Incoming bytes */ rate_ctr_inc(&(*nsvc)->ctrg->ctr[NS_CTR_PKTS_IN]); diff --git a/src/gb/gprs_ns_vty.c b/src/gb/gprs_ns_vty.c index 2026c7a5..6de74dd1 100644 --- a/src/gb/gprs_ns_vty.c +++ b/src/gb/gprs_ns_vty.c @@ -61,11 +61,11 @@ static void log_set_nsvc_filter(struct log_target *target, struct gprs_nsvc *nsvc) { if (nsvc) { - target->filter_map |= (1 << LOGGING_FILTER_GB_NSVC); - target->filter_data[LOGGING_FILTER_GB_NSVC] = nsvc; - } else if (target->filter_data[LOGGING_FILTER_GB_NSVC]) { - target->filter_map = ~(1 << LOGGING_FILTER_GB_NSVC); - target->filter_data[LOGGING_FILTER_GB_NSVC] = NULL; + target->filter_map |= (1 << LOG_FLT_GB_NSVC); + target->filter_data[LOG_FLT_GB_NSVC] = nsvc; + } else if (target->filter_data[LOG_FLT_GB_NSVC]) { + target->filter_map = ~(1 << LOG_FLT_GB_NSVC); + target->filter_data[LOG_FLT_GB_NSVC] = NULL; } } -- cgit v1.2.3