2012-05-24 18:07:15 +00:00
|
|
|
/* gprs_debug.cpp
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Ivan Klyuchnikov
|
2019-03-21 21:33:36 +00:00
|
|
|
* Copyright (C) 2019 Harald Welte <laforge@gnumonks.org>
|
2012-05-24 18:07:15 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2020-03-28 18:46:27 +00:00
|
|
|
extern "C" {
|
2012-05-24 18:07:15 +00:00
|
|
|
#include <osmocom/core/utils.h>
|
|
|
|
#include <osmocom/core/logging.h>
|
2020-03-28 18:46:27 +00:00
|
|
|
}
|
|
|
|
|
2012-05-24 18:07:15 +00:00
|
|
|
#include <gprs_debug.h>
|
|
|
|
|
|
|
|
/* default categories */
|
|
|
|
|
|
|
|
static const struct log_info_cat default_categories[] = {
|
2019-03-21 21:33:36 +00:00
|
|
|
[DCSN1] = {
|
|
|
|
.name = "DCSN1",
|
|
|
|
.color = "\033[1;31m",
|
|
|
|
.description = "Concrete Syntax Notation One (CSN1)",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 0,
|
|
|
|
},
|
|
|
|
[DL1IF] = {
|
|
|
|
.name = "DL1IF",
|
|
|
|
.color = "\033[1;32m",
|
|
|
|
.description = "GPRS PCU L1 interface (L1IF)",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMAC] = {
|
|
|
|
.name = "DRLCMAC",
|
|
|
|
.color = "\033[0;33m",
|
|
|
|
.description = "GPRS RLC/MAC layer (RLCMAC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMACDATA] = {
|
|
|
|
.name = "DRLCMACDATA",
|
|
|
|
.color = "\033[0;33m",
|
|
|
|
.description = "GPRS RLC/MAC layer Data (RLCMAC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMACDL] = {
|
|
|
|
.name = "DRLCMACDL",
|
|
|
|
.color = "\033[1;33m",
|
|
|
|
.description = "GPRS RLC/MAC layer Downlink (RLCMAC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMACUL] = {
|
|
|
|
.name = "DRLCMACUL",
|
|
|
|
.color = "\033[1;36m",
|
|
|
|
.description = "GPRS RLC/MAC layer Uplink (RLCMAC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMACSCHED] = {
|
|
|
|
.name = "DRLCMACSCHED",
|
|
|
|
.color = "\033[0;36m",
|
|
|
|
.description = "GPRS RLC/MAC layer Scheduling (RLCMAC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DRLCMACMEAS] = {
|
|
|
|
.name = "DRLCMACMEAS",
|
|
|
|
.color = "\033[1;31m",
|
|
|
|
.description = "GPRS RLC/MAC layer Measurements (RLCMAC)",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DTBF] = {
|
|
|
|
.name = "DTBF",
|
|
|
|
.color = "\033[1;34m",
|
|
|
|
.description = "Temporary Block Flow (TBF)",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DTBFDL] = {
|
|
|
|
.name = "DTBFDL",
|
|
|
|
.color = "\033[1;34m",
|
|
|
|
.description = "Temporary Block Flow (TBF) Downlink",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DTBFUL] = {
|
|
|
|
.name = "DTBFUL",
|
|
|
|
.color = "\033[1;34m",
|
|
|
|
.description = "Temporary Block Flow (TBF) Uplink",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DNS] = {
|
|
|
|
.name = "DNS",
|
|
|
|
.color = "\033[1;34m",
|
|
|
|
.description = "GPRS Network Service Protocol (NS)",
|
2020-03-25 11:23:52 +00:00
|
|
|
.loglevel = LOGL_NOTICE,
|
2019-03-21 21:33:36 +00:00
|
|
|
.enabled = 1,
|
|
|
|
},
|
|
|
|
[DPCU] = {
|
|
|
|
.name = "DPCU",
|
|
|
|
.color = "\033[1;35m",
|
|
|
|
.description = "GPRS Packet Control Unit (PCU)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
Introduce NACC support
A new nacc_fsm is introduced per MS object, with its partner priv
structure struct nacc_fsm_ctx, which exists and is available in the MS
object only during the duration of the NACC procedure.
The NACC context is created on an MS whenever a Pkt Cell Change
Notification is received on Uplink RLCMAC, which asks for neighbor
information of a given ARFCN+BSIC.
First, the target ARFCN+BSIC needs to be translated into a CGI-PS
(RAC+CI) address. That's done by asking the BSC through the Neighbour
Resolution Service available in osmo-bsc using the CTRL interface.
Once the CGI-PS of the target cell is known, PCU starts a RIM RAN-INFO
request against the SGSN (which will route the request as needed), and
wait for a response containing the SI bits from the target cell.
After the SI are received, the scheduler is instructed to eventually
poll a TBF for the MS originating the CCN, so that we can send the SI
encapsulated into multiple Packet Neighbor Cell Data messages on the
downlink.
One all the SI bits are sent, the scheduler is instructed to send a
Packet Cell Change Continue message.
Once the message above has been sent, the FSM autodestroys itself.
Caches are also introduced in this patch which allows for re-using
recently known translations ARFCN+BSIC -> CGI-PS and CGI-PS -> SI_INFO
respectively.
Change-Id: Id35f40d05f3e081f32fddbf1fa34cb338db452ca
2021-01-21 17:46:13 +00:00
|
|
|
[DNACC] = {
|
|
|
|
.name = "DNACC",
|
|
|
|
.color = "\033[1;37m",
|
|
|
|
.description = "Network Assisted Cell Change (NACC)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
2021-01-21 17:44:23 +00:00
|
|
|
[DRIM] = {
|
|
|
|
.name = "DRIM",
|
|
|
|
.color = "\033[1;38m",
|
|
|
|
.description = "RAN Information Management (RIM)",
|
|
|
|
.loglevel = LOGL_NOTICE,
|
|
|
|
.enabled = 1,
|
|
|
|
},
|
2012-05-24 18:07:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int filter_fn(const struct log_context *ctx,
|
|
|
|
struct log_target *tar)
|
|
|
|
{
|
2017-02-23 17:10:13 +00:00
|
|
|
const struct gprs_nsvc *nsvc = (const struct gprs_nsvc*)ctx->ctx[LOG_CTX_GB_NSVC];
|
|
|
|
const struct gprs_nsvc *bvc = (const struct gprs_nsvc*)ctx->ctx[LOG_CTX_GB_BVC];
|
2012-05-24 18:07:15 +00:00
|
|
|
|
|
|
|
/* Filter on the NS Virtual Connection */
|
2017-02-23 17:10:13 +00:00
|
|
|
if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0
|
|
|
|
&& nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC]))
|
2012-05-24 18:07:15 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
/* Filter on the BVC */
|
2017-02-23 17:10:13 +00:00
|
|
|
if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0
|
|
|
|
&& bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC]))
|
2012-05-24 18:07:15 +00:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
const struct log_info gprs_log_info = {
|
|
|
|
filter_fn,
|
|
|
|
(struct log_info_cat*)default_categories,
|
|
|
|
ARRAY_SIZE(default_categories),
|
|
|
|
};
|