diff options
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r-- | openbsc/src/libcommon/common_vty.c | 4 | ||||
-rw-r--r-- | openbsc/src/libcommon/debug.c | 49 | ||||
-rw-r--r-- | openbsc/src/libcommon/gsm_data.c | 34 | ||||
-rw-r--r-- | openbsc/src/libcommon/gsm_subscriber_base.c | 3 | ||||
-rw-r--r-- | openbsc/src/libcommon/talloc_ctx.c | 32 |
5 files changed, 55 insertions, 67 deletions
diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0f1..0dcba3acb 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -42,6 +42,7 @@ int bsc_vty_go_parent(struct vty *vty) vty->node = CONFIG_NODE; vty->index = NULL; break; +#ifdef ROLE_BSC case BTS_NODE: vty->node = GSMNET_NODE; { @@ -69,6 +70,7 @@ int bsc_vty_go_parent(struct vty *vty) vty->index_sub = &ts->trx->description; } break; +#endif case OML_NODE: case OM2K_NODE: vty->node = ENABLE_NODE; @@ -106,7 +108,7 @@ int bsc_vty_go_parent(struct vty *vty) case BSC_NODE: case MSC_NODE: case MNCC_INT_NODE: - case NITB_NODE: + case CSCN_NODE: default: if (bsc_vty_is_config_node(vty, vty->node)) vty->node = CONFIG_NODE; diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c index 7fb3ecb67..774c0437a 100644 --- a/openbsc/src/libcommon/debug.c +++ b/openbsc/src/libcommon/debug.c @@ -41,74 +41,74 @@ static const struct log_info_cat default_categories[] = { .name = "DRLL", .description = "A-bis Radio Link Layer (RLL)", .color = "\033[1;31m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DCC] = { .name = "DCC", .description = "Layer3 Call Control (CC)", .color = "\033[1;32m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DMM] = { .name = "DMM", .description = "Layer3 Mobility Management (MM)", .color = "\033[1;33m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DRR] = { .name = "DRR", .description = "Layer3 Radio Resource (RR)", .color = "\033[1;34m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DRSL] = { .name = "DRSL", .description = "A-bis Radio Siganlling Link (RSL)", .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DNM] = { .name = "DNM", .description = "A-bis Network Management / O&M (NM/OML)", .color = "\033[1;36m", - .enabled = 1, .loglevel = LOGL_INFO, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DMNCC] = { .name = "DMNCC", .description = "MNCC API for Call Control application", .color = "\033[1;39m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DPAG] = { .name = "DPAG", .description = "Paging Subsystem", .color = "\033[1;38m", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DMEAS] = { .name = "DMEAS", .description = "Radio Measurement Processing", - .enabled = 0, .loglevel = LOGL_NOTICE, + .enabled = 0, .loglevel = LOGL_DEBUG, }, [DSCCP] = { .name = "DSCCP", .description = "SCCP Protocol", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DMSC] = { .name = "DMSC", .description = "Mobile Switching Center", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DMGCP] = { .name = "DMGCP", .description = "Media Gateway Control Protocol", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DHO] = { .name = "DHO", .description = "Hand-Over", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DDB] = { .name = "DDB", @@ -118,7 +118,7 @@ static const struct log_info_cat default_categories[] = { [DREF] = { .name = "DREF", .description = "Reference Counting", - .enabled = 0, .loglevel = LOGL_NOTICE, + .enabled = 0, .loglevel = LOGL_DEBUG, }, [DGPRS] = { .name = "DGPRS", @@ -128,7 +128,7 @@ static const struct log_info_cat default_categories[] = { [DNS] = { .name = "DNS", .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DBSSGP] = { .name = "DBSSGP", @@ -148,12 +148,12 @@ static const struct log_info_cat default_categories[] = { [DNAT] = { .name = "DNAT", .description = "GSM 08.08 NAT/Multiplexer", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DCTRL] = { .name = "DCTRL", .description = "Control interface", - .enabled = 1, .loglevel = LOGL_NOTICE, + .enabled = 1, .loglevel = LOGL_DEBUG, }, [DSMPP] = { .name = "DSMPP", @@ -165,6 +165,21 @@ static const struct log_info_cat default_categories[] = { .description = "BSC/NAT IMSI based filtering", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DRANAP] = { + .name = "DRANAP", + .description = "Radio Access Network Application Part Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DIUCS] = { + .name = "DIUCS", + .description = "Iu-CS Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DSUA] = { + .name = "DSUA", + .description = "SCCP User Adaptation Protocol", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; enum log_filter { diff --git a/openbsc/src/libcommon/gsm_data.c b/openbsc/src/libcommon/gsm_data.c index 242c014db..2cfca0201 100644 --- a/openbsc/src/libcommon/gsm_data.c +++ b/openbsc/src/libcommon/gsm_data.c @@ -70,25 +70,6 @@ int gsm_bts_model_register(struct gsm_bts_model *model) return 0; } -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic) -{ - struct gsm_bts *neigh; - /* FIXME: use some better heuristics here to determine which cell - * using this ARFCN really is closest to the target cell. For - * now we simply assume that each ARFCN will only be used by one - * cell */ - - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; - } - - return NULL; -} - const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1] = { { GSM_BTS_TYPE_UNKNOWN, "unknown" }, { GSM_BTS_TYPE_BS11, "bs11" }, @@ -228,19 +209,6 @@ int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) return 1; } -struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan) -{ - struct gsm_meas_rep *meas_rep; - - meas_rep = &lchan->meas_rep[lchan->meas_rep_idx]; - memset(meas_rep, 0, sizeof(*meas_rep)); - meas_rep->lchan = lchan; - lchan->meas_rep_idx = (lchan->meas_rep_idx + 1) - % ARRAY_SIZE(lchan->meas_rep); - - return meas_rep; -} - int gsm_btsmodel_set_feature(struct gsm_bts_model *bts, enum gsm_bts_features feat) { return bitvec_set_bit_pos(&bts->features, feat, 1); @@ -336,7 +304,7 @@ struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_typ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = 5; /* Use 30 min periodic update interval as sane default */ + bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ set_radio_link_timeout(&bts->si_common.cell_options, 32); /* Use RADIO LINK TIMEOUT of 32 seconds */ diff --git a/openbsc/src/libcommon/gsm_subscriber_base.c b/openbsc/src/libcommon/gsm_subscriber_base.c index 50f411888..1f98cc66c 100644 --- a/openbsc/src/libcommon/gsm_subscriber_base.c +++ b/openbsc/src/libcommon/gsm_subscriber_base.c @@ -43,6 +43,9 @@ struct llist_head *subscr_bsc_active_subscribers(void) char *subscr_name(struct gsm_subscriber *subscr) { + if (!subscr) + return "unknown"; + if (strlen(subscr->name)) return subscr->name; diff --git a/openbsc/src/libcommon/talloc_ctx.c b/openbsc/src/libcommon/talloc_ctx.c index ae6a15636..c26b50f98 100644 --- a/openbsc/src/libcommon/talloc_ctx.c +++ b/openbsc/src/libcommon/talloc_ctx.c @@ -17,22 +17,22 @@ extern void *tall_map_ctx; extern void *tall_upq_ctx; extern void *tall_ctr_ctx; -void talloc_ctx_init(void) +void talloc_ctx_init(void *ctx_root) { - tall_msgb_ctx = talloc_named_const(tall_bsc_ctx, 0, "msgb"); - tall_fle_ctx = talloc_named_const(tall_bsc_ctx, 0, + tall_msgb_ctx = talloc_named_const(ctx_root, 0, "msgb"); + tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(tall_bsc_ctx, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(tall_bsc_ctx, 0, "auth_ciph_oper"); - tall_gsms_ctx = talloc_named_const(tall_bsc_ctx, 0, "sms"); - tall_subscr_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscriber"); - tall_sub_req_ctx = talloc_named_const(tall_bsc_ctx, 0, "subscr_request"); - tall_call_ctx = talloc_named_const(tall_bsc_ctx, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); - tall_sigh_ctx = talloc_named_const(tall_bsc_ctx, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(tall_bsc_ctx, 0, "subch_txq_entry"); - tall_trans_ctx = talloc_named_const(tall_bsc_ctx, 0, "transaction"); - tall_map_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(tall_bsc_ctx, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(tall_bsc_ctx, 0, "counter"); + tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); + tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); + tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); + tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); + tall_sub_req_ctx = talloc_named_const(ctx_root, 0, "subscr_request"); + tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); + tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); + tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); + tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); + tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); + tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); + tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); + tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } |