mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-04 05:53:26 +00:00 
			
		
		
		
	logging fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*
In libosmocore, my patch was merged to master a bit too soon. To accomodate the request for naming that matches the general "LOG" prefix instead of "LOGGING", a fixup was committed to libosmocore. Adjust for that. Original patch: change-id I5c343630020f4b108099696fd96c2111614c8067 The fixup: change-id I424fe3f12ea620338902b2bb8230544bde3f1a93 Change-Id: Ib2ec5e4884aa90f48051ee2f832af557aa525991
This commit is contained in:
		@@ -159,7 +159,7 @@ static struct gsm_lchan *lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
 | 
				
			|||||||
		     gsm_ts_and_pchan_name(lchan->ts), log_name, chan_nr);
 | 
							     gsm_ts_and_pchan_name(lchan->ts), log_name, chan_nr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (lchan->conn)
 | 
						if (lchan->conn)
 | 
				
			||||||
		log_set_context(LOGGING_CTX_VLR_SUBSCR, lchan->conn->subscr);
 | 
							log_set_context(LOG_CTX_VLR_SUBSCR, lchan->conn->subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return lchan;
 | 
						return lchan;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -77,7 +77,7 @@ static void page_ms(struct gsm_paging_request *request)
 | 
				
			|||||||
	if (!bts->oml_link)
 | 
						if (!bts->oml_link)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, request->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, request->subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: "
 | 
						LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: "
 | 
				
			||||||
	     "0x%x for ch. type %d (attempt %d)\n", request->subscr->imsi,
 | 
						     "0x%x for ch. type %d (attempt %d)\n", request->subscr->imsi,
 | 
				
			||||||
@@ -91,7 +91,7 @@ static void page_ms(struct gsm_paging_request *request)
 | 
				
			|||||||
	page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
 | 
						page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc,
 | 
				
			||||||
						str_to_imsi(request->subscr->imsi));
 | 
											str_to_imsi(request->subscr->imsi));
 | 
				
			||||||
	gsm0808_page(bts, page_group, mi_len, mi, request->chan_type);
 | 
						gsm0808_page(bts, page_group, mi_len, mi, request->chan_type);
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, NULL);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts)
 | 
					static void paging_schedule_if_needed(struct gsm_bts_paging_state *paging_bts)
 | 
				
			||||||
@@ -255,7 +255,7 @@ static void paging_T3113_expired(void *data)
 | 
				
			|||||||
	gsm_cbfn *cbfn;
 | 
						gsm_cbfn *cbfn;
 | 
				
			||||||
	int msg;
 | 
						int msg;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, req->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, req->subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
 | 
						LOGP(DPAG, LOGL_INFO, "T3113 expired for request %p (%s)\n",
 | 
				
			||||||
		req, req->subscr->imsi);
 | 
							req, req->subscr->imsi);
 | 
				
			||||||
@@ -394,7 +394,7 @@ void paging_request_stop(struct gsm_bts *_bts, struct gsm_subscriber *subscr,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct gsm_bts *bts;
 | 
						struct gsm_bts *bts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Stop this first and dispatch the request */
 | 
						/* Stop this first and dispatch the request */
 | 
				
			||||||
	if (_bts)
 | 
						if (_bts)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -179,22 +179,22 @@ static const struct log_info_cat default_categories[] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static int filter_fn(const struct log_context *ctx, struct log_target *tar)
 | 
					static int filter_fn(const struct log_context *ctx, struct log_target *tar)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const struct gsm_subscriber *subscr = ctx->ctx[LOGGING_CTX_VLR_SUBSCR];
 | 
						const struct gsm_subscriber *subscr = ctx->ctx[LOG_CTX_VLR_SUBSCR];
 | 
				
			||||||
	const struct gprs_nsvc *nsvc = ctx->ctx[LOGGING_CTX_GB_NSVC];
 | 
						const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC];
 | 
				
			||||||
	const struct gprs_nsvc *bvc = ctx->ctx[LOGGING_CTX_GB_BVC];
 | 
						const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((tar->filter_map & (1 << LOGGING_FILTER_VLR_SUBSCR)) != 0
 | 
						if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0
 | 
				
			||||||
	    && subscr && subscr == tar->filter_data[LOGGING_FILTER_VLR_SUBSCR])
 | 
						    && subscr && subscr == tar->filter_data[LOG_FLT_VLR_SUBSCR])
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Filter on the NS Virtual Connection */
 | 
						/* Filter on the NS Virtual Connection */
 | 
				
			||||||
	if ((tar->filter_map & (1 << LOGGING_FILTER_GB_NSVC)) != 0
 | 
						if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0
 | 
				
			||||||
	    && nsvc && (nsvc == tar->filter_data[LOGGING_FILTER_GB_NSVC]))
 | 
						    && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC]))
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Filter on the NS Virtual Connection */
 | 
						/* Filter on the NS Virtual Connection */
 | 
				
			||||||
	if ((tar->filter_map & (1 << LOGGING_FILTER_GB_BVC)) != 0
 | 
						if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0
 | 
				
			||||||
	    && bvc && (bvc == tar->filter_data[LOGGING_FILTER_GB_BVC]))
 | 
						    && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC]))
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
@@ -208,7 +208,7 @@ const struct log_info log_info = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr)
 | 
					void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct gsm_subscriber **fsub = (void*)&target->filter_data[LOGGING_FILTER_VLR_SUBSCR];
 | 
						struct gsm_subscriber **fsub = (void*)&target->filter_data[LOG_FLT_VLR_SUBSCR];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* free the old data */
 | 
						/* free the old data */
 | 
				
			||||||
	if (*fsub) {
 | 
						if (*fsub) {
 | 
				
			||||||
@@ -217,8 +217,8 @@ void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subsc
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (subscr) {
 | 
						if (subscr) {
 | 
				
			||||||
		target->filter_map |= (1 << LOGGING_FILTER_VLR_SUBSCR);
 | 
							target->filter_map |= (1 << LOG_FLT_VLR_SUBSCR);
 | 
				
			||||||
		*fsub = subscr_get(subscr);
 | 
							*fsub = subscr_get(subscr);
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		target->filter_map &= ~(1 << LOGGING_FILTER_VLR_SUBSCR);
 | 
							target->filter_map &= ~(1 << LOG_FLT_VLR_SUBSCR);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1457,7 +1457,7 @@ static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct m
 | 
				
			|||||||
		/* FIXME: request id? close channel? */
 | 
							/* FIXME: request id? close channel? */
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 | 
				
			||||||
	DEBUGP(DRR, "<- Channel was requested by %s\n",
 | 
						DEBUGP(DRR, "<- Channel was requested by %s\n",
 | 
				
			||||||
		subscr->name && strlen(subscr->name) ? subscr->name : subscr->imsi);
 | 
							subscr->name && strlen(subscr->name) ? subscr->name : subscr->imsi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1982,7 +1982,7 @@ static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge)
 | 
				
			|||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Which subscriber do we want to track trans1 or trans2? */
 | 
						/* Which subscriber do we want to track trans1 or trans2? */
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans1->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, trans1->subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* through-connect channel */
 | 
						/* through-connect channel */
 | 
				
			||||||
	return tch_map(trans1->conn->lchan, trans2->conn->lchan);
 | 
						return tch_map(trans1->conn->lchan, trans2->conn->lchan);
 | 
				
			||||||
@@ -2003,7 +2003,7 @@ static int tch_recv_mncc(struct gsm_network *net, uint32_t callref, int enable)
 | 
				
			|||||||
	if (!trans->conn)
 | 
						if (!trans->conn)
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 | 
				
			||||||
	lchan = trans->conn->lchan;
 | 
						lchan = trans->conn->lchan;
 | 
				
			||||||
	bts = lchan->ts->trx->bts;
 | 
						bts = lchan->ts->trx->bts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -3339,7 +3339,7 @@ static int tch_rtp_create(struct gsm_network *net, uint32_t callref)
 | 
				
			|||||||
		mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
 | 
							mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 | 
				
			||||||
	if (!trans->conn) {
 | 
						if (!trans->conn) {
 | 
				
			||||||
		LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n");
 | 
							LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n");
 | 
				
			||||||
		mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
 | 
							mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE);
 | 
				
			||||||
@@ -3395,7 +3395,7 @@ static int tch_rtp_connect(struct gsm_network *net, void *arg)
 | 
				
			|||||||
		mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
 | 
							mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 | 
				
			||||||
	if (!trans->conn) {
 | 
						if (!trans->conn) {
 | 
				
			||||||
		LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n");
 | 
							LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n");
 | 
				
			||||||
		mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
 | 
							mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT);
 | 
				
			||||||
@@ -3572,7 +3572,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
 | 
				
			|||||||
			LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n");
 | 
								LOGP(DMNCC, LOGL_ERROR, "TCH frame for non-existing trans\n");
 | 
				
			||||||
			return -EIO;
 | 
								return -EIO;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
 | 
							log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 | 
				
			||||||
		if (!trans->conn) {
 | 
							if (!trans->conn) {
 | 
				
			||||||
			LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n");
 | 
								LOGP(DMNCC, LOGL_NOTICE, "TCH frame for trans without conn\n");
 | 
				
			||||||
			return 0;
 | 
								return 0;
 | 
				
			||||||
@@ -3646,7 +3646,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
 | 
				
			|||||||
						    data->imsi);
 | 
											    data->imsi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* update the subscriber we deal with */
 | 
							/* update the subscriber we deal with */
 | 
				
			||||||
		log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
 | 
							log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* If subscriber is not found */
 | 
							/* If subscriber is not found */
 | 
				
			||||||
		if (!subscr) {
 | 
							if (!subscr) {
 | 
				
			||||||
@@ -3724,7 +3724,7 @@ int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg)
 | 
				
			|||||||
		subscr_put(subscr);
 | 
							subscr_put(subscr);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		/* update the subscriber we deal with */
 | 
							/* update the subscriber we deal with */
 | 
				
			||||||
		log_set_context(LOGGING_CTX_VLR_SUBSCR, trans->subscr);
 | 
							log_set_context(LOG_CTX_VLR_SUBSCR, trans->subscr);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (trans->conn)
 | 
						if (trans->conn)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,7 @@ static struct gsm_subscriber *subscr_by_dst(struct gsm_network *net,
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* tag the context in case we know it */
 | 
						/* tag the context in case we know it */
 | 
				
			||||||
	log_set_context(LOGGING_CTX_VLR_SUBSCR, subscr);
 | 
						log_set_context(LOG_CTX_VLR_SUBSCR, subscr);
 | 
				
			||||||
	return subscr;
 | 
						return subscr;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user