lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

February 2024

  • 1 participants
  • 1748 discussions
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
by matanp 24 Feb '24

24 Feb '24
matanp has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email ) Change subject: ctrl: Add lchan show to all ctrl levels ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I23c1a7e6f6679e3964e359fb202ffe6781a07e8a Gerrit-Change-Number: 36084 Gerrit-PatchSet: 2 Gerrit-Owner: matanp <matan1008(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 14:43:43 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
by Jenkins Builder 24 Feb '24

24 Feb '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email ) Change subject: ctrl: Add lchan show to all ctrl levels ...................................................................... Patch Set 1: (12 comments) File src/osmo-bsc/bsc_ctrl.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/2c999516_794f6dee PS1, Line 848: if (!strlen(bts_dump)) { braces {} are not necessary for single statement blocks File src/osmo-bsc/bts_ctrl.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/736e9b6d_36f243f4 PS1, Line 1490: if (!dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/1a09a2f6_ddf99b5c PS1, Line 1497: if (!trx_dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/c1940d64_49523a36 PS1, Line 1500: if (!strlen(trx_dump)) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/13ee2fd0_b6065d52 PS1, Line 1504: if (!dump) { braces {} are not necessary for single statement blocks File src/osmo-bsc/bts_trx_ctrl.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/95a1656f_55f9a5a3 PS1, Line 107: if (!dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/14d12fd3_ba918595 PS1, Line 113: if (!ts_dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/20863877_8be44e47 PS1, Line 116: if (!strlen(ts_dump)) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/8e41ae50_bc3ebdbd PS1, Line 120: if (!dump) { braces {} are not necessary for single statement blocks File src/osmo-bsc/bts_trx_ts_ctrl.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/317405df_94726d75 PS1, Line 104: if (!dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/133e4a99_88f9d9cd PS1, Line 110: if (!lchan_dump) { braces {} are not necessary for single statement blocks Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14666): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/a6b83fc2_272fca44 PS1, Line 114: if (!dump) { braces {} are not necessary for single statement blocks -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I23c1a7e6f6679e3964e359fb202ffe6781a07e8a Gerrit-Change-Number: 36084 Gerrit-PatchSet: 1 Gerrit-Owner: matanp <matan1008(a)gmail.com> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 14:40:56 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
by matanp 24 Feb '24

24 Feb '24
matanp has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email ) Change subject: ctrl: Add lchan show to all ctrl levels ...................................................................... ctrl: Add lchan show to all ctrl levels This new commands show information about logical channels: net.btsN.trxM.tsI.show-lchan.full net.btsN.trxM.show-lchan.full net.btsN.show-lchan.full net.show-lchan.full Change-Id: I23c1a7e6f6679e3964e359fb202ffe6781a07e8a --- M include/osmocom/bsc/ctrl.h M src/osmo-bsc/bsc_ctrl.c M src/osmo-bsc/bts_ctrl.c M src/osmo-bsc/bts_trx_ctrl.c M src/osmo-bsc/bts_trx_ts_ctrl.c M src/osmo-bsc/bts_trx_ts_lchan_ctrl.c 6 files changed, 232 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/84/36084/1 diff --git a/include/osmocom/bsc/ctrl.h b/include/osmocom/bsc/ctrl.h index 86eb3b1..c61e01f 100644 --- a/include/osmocom/bsc/ctrl.h +++ b/include/osmocom/bsc/ctrl.h @@ -1,6 +1,7 @@ #pragma once #include <osmocom/ctrl/control_cmd.h> +#include <osmocom/bsc/gsm_data.h> struct gsm_network; struct gsm_bts; @@ -15,6 +16,10 @@ int bsc_bts_trx_ts_lchan_ctrl_cmds_install(void); void ctrl_generate_bts_location_state_trap(struct gsm_bts *bts, struct bsc_msc_data *msc); void osmo_bsc_send_trap(struct ctrl_cmd *cmd, struct bsc_msc_data *msc_data); +char *lchan_dump_full_ctrl(const void *t, struct gsm_lchan *lchan); +char *ts_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx_ts *ts); +char *trx_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx *trx); +char *bts_lchan_dump_full_ctrl(const void *t, struct gsm_bts *bts); enum bsc_ctrl_node { diff --git a/src/osmo-bsc/bsc_ctrl.c b/src/osmo-bsc/bsc_ctrl.c index cfba3e2..1502f7c 100644 --- a/src/osmo-bsc/bsc_ctrl.c +++ b/src/osmo-bsc/bsc_ctrl.c @@ -820,6 +820,46 @@ return CTRL_CMD_HANDLED; } +/* Return full information about all logical channels. + * format: show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_net_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_network *net = cmd->node; + int bts_nr; + bool first_bts = true; + char *bts_dump; + + cmd->reply = talloc_strdup(cmd, ""); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { + bts_dump = bts_lchan_dump_full_ctrl(cmd, gsm_bts_num(net, bts_nr)); + if (!bts_dump) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + if (!strlen(bts_dump)) { + continue; + } + cmd->reply = talloc_asprintf_append(cmd->reply, first_bts ? "%s" : "\n%s", bts_dump); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + first_bts = false; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(net_show_lchan_full, "show-lchan full"); + static int bsc_base_ctrl_cmds_install(struct gsm_network *net) { int rc = 0; @@ -837,6 +877,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_notification); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_inform_msc); + rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_show_lchan_full); rc |= ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c index eac01bf..2dbf6e4 100644 --- a/src/osmo-bsc/bts_ctrl.c +++ b/src/osmo-bsc/bts_ctrl.c @@ -1479,6 +1479,57 @@ CTRL_CMD_DEFINE_RO(bts_neighbor_list_si2quater_earfcn, "neighbor-list si2quater earfcns"); +char *bts_lchan_dump_full_ctrl(const void *t, struct gsm_bts *bts) +{ + int trx_nr; + bool first_trx = true; + char *trx_dump, *dump; + struct gsm_bts_trx *trx; + + dump = talloc_strdup(t, ""); + if (!dump) { + return NULL; + } + + for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { + trx = gsm_bts_trx_num(bts, trx_nr); + trx_dump = trx_lchan_dump_full_ctrl(t, trx); + if (!trx_dump) { + return NULL; + } + if (!strlen(trx_dump)) { + continue; + } + dump = talloc_asprintf_append(dump, first_trx ? "%s" : "\n%s", trx_dump); + if (!dump) { + return NULL; + } + first_trx = false; + } + + return dump; +} + +/* Return full information about all logical channels in a BTS. + * format: bts.<0-255>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_bts_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + + cmd->reply = bts_lchan_dump_full_ctrl(cmd, bts); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(bts_show_lchan_full, "show-lchan full"); + int bsc_bts_ctrl_cmds_install(void) { int rc = 0; @@ -1523,6 +1574,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_rach_max_trans); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si2quater_uarfcn); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si2quater_earfcn); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_show_lchan_full); rc |= neighbor_ident_ctrl_init(); diff --git a/src/osmo-bsc/bts_trx_ctrl.c b/src/osmo-bsc/bts_trx_ctrl.c index d5e8f5a..80bf523 100644 --- a/src/osmo-bsc/bts_trx_ctrl.c +++ b/src/osmo-bsc/bts_trx_ctrl.c @@ -97,6 +97,55 @@ } CTRL_CMD_DEFINE(trx_max_power, "max-power-reduction"); +char *trx_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx *trx) +{ + int ts_nr; + bool first_ts = true; + char *ts_dump, *dump; + + dump = talloc_strdup(t, ""); + if (!dump) { + return NULL; + } + + for (ts_nr = 0; ts_nr < TRX_NR_TS; ts_nr++) { + ts_dump = ts_lchan_dump_full_ctrl(t, &trx->ts[ts_nr]); + if (!ts_dump) { + return NULL; + } + if (!strlen(ts_dump)) { + continue; + } + dump = talloc_asprintf_append(dump, first_ts ? "%s" : "\n%s", ts_dump); + if (!dump) { + return NULL; + } + first_ts = false; + } + + return dump; +} + +/* Return full information about all logical channels in a TRX. + * format: bts.<0-255>.trx.<0-255>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_trx_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx *trx = cmd->node; + + cmd->reply = trx_lchan_dump_full_ctrl(cmd, trx); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(trx_show_lchan_full, "show-lchan full"); + int bsc_bts_trx_ctrl_cmds_install(void) { int rc = 0; @@ -104,6 +153,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power); rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn); rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_locked); + rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_show_lchan_full); rc |= bsc_bts_trx_ts_ctrl_cmds_install(); diff --git a/src/osmo-bsc/bts_trx_ts_ctrl.c b/src/osmo-bsc/bts_trx_ts_ctrl.c index f0a592d..d6895ab 100644 --- a/src/osmo-bsc/bts_trx_ts_ctrl.c +++ b/src/osmo-bsc/bts_trx_ts_ctrl.c @@ -94,6 +94,51 @@ /* Parameter format: "(<arfcn>|all)" */ CTRL_CMD_DEFINE_WO(ts_hopping_arfcn_del, "hopping-arfcn-del"); +char *ts_lchan_dump_full_ctrl(const void *t, struct gsm_bts_trx_ts *ts) +{ + bool first_lchan = true; + char *lchan_dump, *dump; + struct gsm_lchan *lchan; + + dump = talloc_strdup(t, ""); + if (!dump) { + return NULL; + } + + ts_for_n_lchans(lchan, ts, ts->max_lchans_possible) { + lchan_dump = lchan_dump_full_ctrl(t, lchan); + if (!lchan_dump) { + return NULL; + } + dump = talloc_asprintf_append(dump, first_lchan ? "%s" : "\n%s", lchan_dump); + if (!dump) { + return NULL; + } + first_lchan = false; + } + + return dump; +} + +/* Return full information about all logical channels in a timeslot. + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.show-lchan.full + * result format: New line delimited list of <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>, + * <ms power>,<interference dbm>, <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>, + * <ipa bound conn id>,<ipa conn ip>,<ipa conn port>,<ipa conn speech mode> + */ +static int get_ts_show_lchan_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts_trx_ts *ts = cmd->node; + + cmd->reply = ts_lchan_dump_full_ctrl(cmd, ts); + if (!cmd->reply) { + cmd->reply = "OOM"; + return CTRL_CMD_ERROR; + } + + return CTRL_CMD_REPLY; +} +CTRL_CMD_DEFINE_RO(ts_show_lchan_full, "show-lchan full"); int bsc_bts_trx_ts_ctrl_cmds_install(void) { @@ -101,6 +146,7 @@ rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_add); rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_hopping_arfcn_del); + rc |= ctrl_cmd_install(CTRL_NODE_TS, &cmd_ts_show_lchan_full); rc |= bsc_bts_trx_ts_lchan_ctrl_cmds_install(); diff --git a/src/osmo-bsc/bts_trx_ts_lchan_ctrl.c b/src/osmo-bsc/bts_trx_ts_lchan_ctrl.c index 6ddbe1e..9298b92 100644 --- a/src/osmo-bsc/bts_trx_ts_lchan_ctrl.c +++ b/src/osmo-bsc/bts_trx_ts_lchan_ctrl.c @@ -68,55 +68,45 @@ CTRL_CMD_DEFINE(lchan_ms_power, "ms-power"); -/* Return full information about a logical channel. - * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.lchan.<0-8>.show.full - * result format: <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>,<ms power>,<interference dbm>, - * <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>,<ipa bound conn id>,<ipa conn ip>, - * <ipa conn port>,<ipa conn sppech mode> - */ -static int get_lchan_show_full(struct ctrl_cmd *cmd, void *data) + +char *lchan_dump_full_ctrl(const void *t, struct gsm_lchan *lchan) { - struct gsm_lchan *lchan = cmd->node; struct in_addr ia; char *interference = ",", *tmsi = "", *ipa_bound = ",,", *ipa_conn = ",,"; if (lchan->interf_dbm != INTERF_DBM_UNKNOWN) { - interference = talloc_asprintf(cmd, "%d,%u", lchan->interf_dbm, lchan->interf_band); + interference = talloc_asprintf(t, "%d,%u", lchan->interf_dbm, lchan->interf_band); if (!interference) { - cmd->reply = "OOM"; - return CTRL_CMD_ERROR; + return NULL; } } if (lchan->conn && lchan->conn->bsub && lchan->conn->bsub->tmsi != GSM_RESERVED_TMSI) { - tmsi = talloc_asprintf(cmd, "0x%08x", lchan->conn->bsub->tmsi); + tmsi = talloc_asprintf(t, "0x%08x", lchan->conn->bsub->tmsi); if (!tmsi) { - cmd->reply = "OOM"; - return CTRL_CMD_ERROR; + return NULL; } } if (is_ipa_abisip_bts(lchan->ts->trx->bts) && lchan->abis_ip.bound_ip) { ia.s_addr = htonl(lchan->abis_ip.bound_ip); - ipa_bound = talloc_asprintf(cmd, "%s,%u,%u", inet_ntoa(ia), lchan->abis_ip.bound_port, + ipa_bound = talloc_asprintf(t, "%s,%u,%u", inet_ntoa(ia), lchan->abis_ip.bound_port, lchan->abis_ip.conn_id); if (!ipa_bound) { - cmd->reply = "OOM"; - return CTRL_CMD_ERROR; + return NULL; } } if (is_ipa_abisip_bts(lchan->ts->trx->bts) && lchan->abis_ip.connect_ip) { ia.s_addr = htonl(lchan->abis_ip.connect_ip); - ipa_conn = talloc_asprintf(cmd, "%s,%u,0x%02x", inet_ntoa(ia), lchan->abis_ip.connect_port, + ipa_conn = talloc_asprintf(t, "%s,%u,0x%02x", inet_ntoa(ia), lchan->abis_ip.connect_port, lchan->abis_ip.speech_mode); if (!ipa_conn) { - cmd->reply = "OOM"; - return CTRL_CMD_ERROR; + return NULL; } } - cmd->reply = talloc_asprintf(cmd, "%u,%u,%u,%u,%s,%u,%s,%s,%u,%u,%s,%s,%s,%s,%s,%s", + return talloc_asprintf(t, "%u,%u,%u,%u,%s,%u,%s,%s,%u,%u,%s,%s,%s,%s,%s,%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, @@ -133,6 +123,18 @@ ipa_bound, ipa_conn ); +} + +/* Return full information about a logical channel. + * format: bts.<0-255>.trx.<0-255>.ts.<0-8>.lchan.<0-8>.show.full + * result format: <bts>,<trx>,<ts>,<lchan>,<type>,<connection>,<state>,<last error>,<bs power>,<ms power>,<interference dbm>, + * <interference band>,<channel mode>,<imsi>,<tmsi>,<ipa bound ip>,<ipa bound port>,<ipa bound conn id>,<ipa conn ip>, + * <ipa conn port>,<ipa conn speech mode> + */ +static int get_lchan_show_full(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_lchan *lchan = cmd->node; + cmd->reply = lchan_dump_full_ctrl(cmd, lchan); if (!cmd->reply) { cmd->reply = "OOM"; return CTRL_CMD_ERROR; -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I23c1a7e6f6679e3964e359fb202ffe6781a07e8a Gerrit-Change-Number: 36084 Gerrit-PatchSet: 1 Gerrit-Owner: matanp <matan1008(a)gmail.com> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-abis[master]: Fix critical bug in default TCP keepalive user timeout
by pespin 24 Feb '24

24 Feb '24
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email ) Change subject: Fix critical bug in default TCP keepalive user timeout ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf Gerrit-Change-Number: 36079 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sat, 24 Feb 2024 14:20:34 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in libosmo-abis[master]: Fix critical bug in default TCP keepalive user timeout
by fixeria 24 Feb '24

24 Feb '24
Attention is currently required from: laforge. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email ) Change subject: Fix critical bug in default TCP keepalive user timeout ...................................................................... Patch Set 2: Code-Review+1 (1 comment) Commit Message: https://gerrit.osmocom.org/c/libosmo-abis/+/36079/comment/d762b6f1_8228f661 PS2, Line 22: Ia7659c209aea0d26eb37d31e771adc91b17ae668 This commit (https://gerrit.osmocom.org/c/libosmo-abis/+/30280) does not introduce the regression itself; it does enable the keepalive feature by default. The buggy logic was added in `I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f` (https://gerrit.osmocom.org/c/libosmo-abis/+/14565) And so the bug is present since 0.7.0 (Jun 2019). -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf Gerrit-Change-Number: 36079 Gerrit-PatchSet: 2 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Sat, 24 Feb 2024 13:10:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks
by Jenkins Builder 24 Feb '24

24 Feb '24
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email ) Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks ...................................................................... Patch Set 1: (1 comment) File src/osmo-hnbgw/hnbgw.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14663): https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080/comment/8face840_2bd10288 PS1, Line 272: * SCTP Socket / stream handling trailing whitespace -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc Gerrit-Change-Number: 36080 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 11:40:12 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks
by laforge 24 Feb '24

24 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email ) Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks ...................................................................... [cosmetic] re-order hnbgw.c to group code in major blocks Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc --- M src/osmo-hnbgw/hnbgw.c 1 file changed, 203 insertions(+), 173 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/80/36080/1 diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index 086582e..695822e 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -47,85 +47,10 @@ {} }; -void g_hnbgw_alloc(void *ctx) -{ - OSMO_ASSERT(!g_hnbgw); - g_hnbgw = talloc_zero(ctx, struct hnbgw); - /* strdup so we can easily talloc_free in the VTY code */ - g_hnbgw->config.iuh_local_ip = talloc_strdup(g_hnbgw, HNBGW_LOCAL_IP_DEFAULT); - g_hnbgw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; - g_hnbgw->config.log_prefix_hnb_id = true; - - /* Set zero PLMN to detect a missing PLMN when transmitting RESET */ - g_hnbgw->config.plmn = (struct osmo_plmn_id){ 0, 0, false }; - - g_hnbgw->next_ue_ctx_id = 23; - INIT_LLIST_HEAD(&g_hnbgw->hnb_list); - INIT_LLIST_HEAD(&g_hnbgw->ue_list); - INIT_LLIST_HEAD(&g_hnbgw->sccp.users); - - g_hnbgw->mgw_pool = mgcp_client_pool_alloc(g_hnbgw); - g_hnbgw->config.mgcp_client = mgcp_client_conf_alloc(g_hnbgw); - -#if ENABLE_PFCP - g_hnbgw->config.pfcp.remote_port = OSMO_PFCP_PORT; -#endif - - g_hnbgw->sccp.cnpool_iucs = (struct hnbgw_cnpool){ - .domain = DOMAIN_CS, - .pool_name = "iucs", - .peer_name = "msc", - .default_remote_pc = DEFAULT_PC_MSC, - .vty = { - .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, - .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), - }, - .cnlink_ctrg_desc = &msc_ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, &iucs_ctrg_desc, 0), - }; - INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iucs.cnlinks); - - g_hnbgw->sccp.cnpool_iups = (struct hnbgw_cnpool){ - .domain = DOMAIN_PS, - .pool_name = "iups", - .peer_name = "sgsn", - .default_remote_pc = DEFAULT_PC_SGSN, - .vty = { - .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, - .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), - }, - .cnlink_ctrg_desc = &sgsn_ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), - }; - INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); -} - -static struct hnb_context *hnb_context_by_id(uint32_t cid) -{ - struct hnb_context *hnb; - - llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { - if (hnb->id.cid == cid) - return hnb; - } - - return NULL; -} - -struct hnb_context *hnb_context_by_identity_info(const char *identity_info) -{ - struct hnb_context *hnb; - - llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { - if (strcmp(identity_info, hnb->identity_info) == 0) - return hnb; - } - - return NULL; -} +/*********************************************************************** + * UE Context + ***********************************************************************/ struct ue_context *ue_context_by_id(uint32_t id) { @@ -212,6 +137,141 @@ talloc_free(ue); } + +/*********************************************************************** + * HNB Context + ***********************************************************************/ + +/* look-up HNB context by id. Used from CTRL */ +static struct hnb_context *hnb_context_by_id(uint32_t cid) +{ + struct hnb_context *hnb; + + llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { + if (hnb->id.cid == cid) + return hnb; + } + + return NULL; +} + +/* look-up HNB context by identity_info. Used from VTY */ +struct hnb_context *hnb_context_by_identity_info(const char *identity_info) +{ + struct hnb_context *hnb; + + llist_for_each_entry(hnb, &g_hnbgw->hnb_list, list) { + if (strcmp(identity_info, hnb->identity_info) == 0) + return hnb; + } + + return NULL; +} + +static int hnb_read_cb(struct osmo_stream_srv *conn); +static int hnb_closed_cb(struct osmo_stream_srv *conn); + +static struct hnb_context *hnb_context_alloc(struct osmo_stream_srv_link *link, int new_fd) +{ + struct hnb_context *ctx; + + ctx = talloc_zero(g_hnbgw, struct hnb_context); + if (!ctx) + return NULL; + INIT_LLIST_HEAD(&ctx->map_list); + + ctx->conn = osmo_stream_srv_create(g_hnbgw, link, new_fd, hnb_read_cb, hnb_closed_cb, ctx); + if (!ctx->conn) { + LOGP(DMAIN, LOGL_INFO, "error while creating connection\n"); + talloc_free(ctx); + return NULL; + } + + llist_add_tail(&ctx->list, &g_hnbgw->hnb_list); + return ctx; +} + +const char *umts_cell_id_name(const struct umts_cell_id *ucid) +{ + return talloc_asprintf(OTC_SELECT, "%u-%u-L%u-R%u-S%u-C%u", ucid->mcc, ucid->mnc, ucid->lac, ucid->rac, + ucid->sac, ucid->cid); +} + +const char *hnb_context_name(struct hnb_context *ctx) +{ + char *result; + if (!ctx) + return "NULL"; + + if (ctx->conn) { + char hostbuf_r[INET6_ADDRSTRLEN]; + char portbuf_r[6]; + int fd = osmo_stream_srv_get_ofd(ctx->conn)->fd; + + /* get remote addr */ + if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), portbuf_r, sizeof(portbuf_r), false) == 0) + result = talloc_asprintf(OTC_SELECT, "%s:%s", hostbuf_r, portbuf_r); + else + result = "?"; + } else { + result = "disconnected"; + } + + if (g_hnbgw->config.log_prefix_hnb_id) + result = talloc_asprintf(OTC_SELECT, "%s %s", result, ctx->identity_info); + else + result = talloc_asprintf(OTC_SELECT, "%s %s", result, umts_cell_id_name(&ctx->id)); + return result; +} + +void hnb_context_release_ue_state(struct hnb_context *ctx) +{ + struct hnbgw_context_map *map, *map2; + + /* deactivate all context maps */ + llist_for_each_entry_safe(map, map2, &ctx->map_list, hnb_list) { + context_map_hnb_released(map); + /* hnbgw_context_map will remove itself from lists when it is ready. */ + } + ue_context_free_by_hnb(ctx); +} + +void hnb_context_release(struct hnb_context *ctx) +{ + struct hnbgw_context_map *map; + + LOGHNB(ctx, DMAIN, LOGL_INFO, "Releasing HNB context\n"); + + /* remove from the list of HNB contexts */ + llist_del(&ctx->list); + + hnb_context_release_ue_state(ctx); + + if (ctx->conn) { /* we own a conn, we must free it: */ + LOGHNB(ctx, DMAIN, LOGL_INFO, "Closing HNB SCTP connection %s\n", + osmo_sock_get_name2(osmo_stream_srv_get_ofd(ctx->conn)->fd)); + /* Avoid our closed_cb calling hnb_context_release() again: */ + osmo_stream_srv_set_data(ctx->conn, NULL); + osmo_stream_srv_destroy(ctx->conn); + } /* else: we are called from closed_cb, so conn is being freed separately */ + + /* hnbgw_context_map are still listed in ctx->map_list, but we are freeing ctx. Remove all entries from the + * list, but keep the hnbgw_context_map around for graceful release. They are also listed under + * hnbgw_cnlink->map_list, and will remove themselves when ready. */ + while ((map = llist_first_entry_or_null(&ctx->map_list, struct hnbgw_context_map, hnb_list))) { + llist_del(&map->hnb_list); + map->hnb_ctx = NULL; + } + + talloc_free(ctx); +} + + + +/*********************************************************************** + * SCTP Socket / stream handling + ***********************************************************************/ + static int hnb_read_cb(struct osmo_stream_srv *conn) { struct hnb_context *hnb = osmo_stream_srv_get_data(conn); @@ -331,101 +391,6 @@ return 0; } -static struct hnb_context *hnb_context_alloc(struct osmo_stream_srv_link *link, int new_fd) -{ - struct hnb_context *ctx; - - ctx = talloc_zero(g_hnbgw, struct hnb_context); - if (!ctx) - return NULL; - INIT_LLIST_HEAD(&ctx->map_list); - - ctx->conn = osmo_stream_srv_create(g_hnbgw, link, new_fd, hnb_read_cb, hnb_closed_cb, ctx); - if (!ctx->conn) { - LOGP(DMAIN, LOGL_INFO, "error while creating connection\n"); - talloc_free(ctx); - return NULL; - } - - llist_add_tail(&ctx->list, &g_hnbgw->hnb_list); - return ctx; -} - -const char *umts_cell_id_name(const struct umts_cell_id *ucid) -{ - return talloc_asprintf(OTC_SELECT, "%u-%u-L%u-R%u-S%u-C%u", ucid->mcc, ucid->mnc, ucid->lac, ucid->rac, - ucid->sac, ucid->cid); -} - -const char *hnb_context_name(struct hnb_context *ctx) -{ - char *result; - if (!ctx) - return "NULL"; - - if (ctx->conn) { - char hostbuf_r[INET6_ADDRSTRLEN]; - char portbuf_r[6]; - int fd = osmo_stream_srv_get_ofd(ctx->conn)->fd; - - /* get remote addr */ - if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), portbuf_r, sizeof(portbuf_r), false) == 0) - result = talloc_asprintf(OTC_SELECT, "%s:%s", hostbuf_r, portbuf_r); - else - result = "?"; - } else { - result = "disconnected"; - } - - if (g_hnbgw->config.log_prefix_hnb_id) - result = talloc_asprintf(OTC_SELECT, "%s %s", result, ctx->identity_info); - else - result = talloc_asprintf(OTC_SELECT, "%s %s", result, umts_cell_id_name(&ctx->id)); - return result; -} - -void hnb_context_release_ue_state(struct hnb_context *ctx) -{ - struct hnbgw_context_map *map, *map2; - - /* deactivate all context maps */ - llist_for_each_entry_safe(map, map2, &ctx->map_list, hnb_list) { - context_map_hnb_released(map); - /* hnbgw_context_map will remove itself from lists when it is ready. */ - } - ue_context_free_by_hnb(ctx); -} - -void hnb_context_release(struct hnb_context *ctx) -{ - struct hnbgw_context_map *map; - - LOGHNB(ctx, DMAIN, LOGL_INFO, "Releasing HNB context\n"); - - /* remove from the list of HNB contexts */ - llist_del(&ctx->list); - - hnb_context_release_ue_state(ctx); - - if (ctx->conn) { /* we own a conn, we must free it: */ - LOGHNB(ctx, DMAIN, LOGL_INFO, "Closing HNB SCTP connection %s\n", - osmo_sock_get_name2(osmo_stream_srv_get_ofd(ctx->conn)->fd)); - /* Avoid our closed_cb calling hnb_context_release() again: */ - osmo_stream_srv_set_data(ctx->conn, NULL); - osmo_stream_srv_destroy(ctx->conn); - } /* else: we are called from closed_cb, so conn is being freed separately */ - - /* hnbgw_context_map are still listed in ctx->map_list, but we are freeing ctx. Remove all entries from the - * list, but keep the hnbgw_context_map around for graceful release. They are also listed under - * hnbgw_cnlink->map_list, and will remove themselves when ready. */ - while ((map = llist_first_entry_or_null(&ctx->map_list, struct hnbgw_context_map, hnb_list))) { - llist_del(&map->hnb_list); - map->hnb_ctx = NULL; - } - - talloc_free(ctx); -} - /*! call-back when the listen FD has something to read */ int hnbgw_rua_accept_cb(struct osmo_stream_srv_link *srv, int fd) { @@ -604,3 +569,59 @@ .go_parent_cb = hnbgw_vty_go_parent, .copyright = HNBGW_COPYRIGHT, }; + +void g_hnbgw_alloc(void *ctx) +{ + OSMO_ASSERT(!g_hnbgw); + g_hnbgw = talloc_zero(ctx, struct hnbgw); + + /* strdup so we can easily talloc_free in the VTY code */ + g_hnbgw->config.iuh_local_ip = talloc_strdup(g_hnbgw, HNBGW_LOCAL_IP_DEFAULT); + g_hnbgw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; + g_hnbgw->config.log_prefix_hnb_id = true; + + /* Set zero PLMN to detect a missing PLMN when transmitting RESET */ + g_hnbgw->config.plmn = (struct osmo_plmn_id){ 0, 0, false }; + + g_hnbgw->next_ue_ctx_id = 23; + INIT_LLIST_HEAD(&g_hnbgw->hnb_list); + INIT_LLIST_HEAD(&g_hnbgw->ue_list); + INIT_LLIST_HEAD(&g_hnbgw->sccp.users); + + g_hnbgw->mgw_pool = mgcp_client_pool_alloc(g_hnbgw); + g_hnbgw->config.mgcp_client = mgcp_client_conf_alloc(g_hnbgw); + +#if ENABLE_PFCP + g_hnbgw->config.pfcp.remote_port = OSMO_PFCP_PORT; +#endif + + g_hnbgw->sccp.cnpool_iucs = (struct hnbgw_cnpool){ + .domain = DOMAIN_CS, + .pool_name = "iucs", + .peer_name = "msc", + .default_remote_pc = DEFAULT_PC_MSC, + .vty = { + .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, + .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), + }, + .cnlink_ctrg_desc = &msc_ctrg_desc, + + .ctrs = rate_ctr_group_alloc(g_hnbgw, &iucs_ctrg_desc, 0), + }; + INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iucs.cnlinks); + + g_hnbgw->sccp.cnpool_iups = (struct hnbgw_cnpool){ + .domain = DOMAIN_PS, + .pool_name = "iups", + .peer_name = "sgsn", + .default_remote_pc = DEFAULT_PC_SGSN, + .vty = { + .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, + .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), + }, + .cnlink_ctrg_desc = &sgsn_ctrg_desc, + + .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), + }; + INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); +} -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc Gerrit-Change-Number: 36080 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure
by laforge 24 Feb '24

24 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email ) Change subject: Introduce concept of per-HNB persistent data structure ...................................................................... Introduce concept of per-HNB persistent data structure This allows us to add a new "hnb-policy closed", which means we do not accept any random HNB connection anymore, but only those whose identity is pre-configured explicitly using administrative means. Furthermore, this new data structure will allow us (in future patches) to keep persistent data like uptime / downtime of each HNB. Related: SYS#6773 Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de --- M include/osmocom/hnbgw/hnbgw.h M include/osmocom/hnbgw/vty.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_hnbap.c M src/osmo-hnbgw/hnbgw_rua.c M src/osmo-hnbgw/hnbgw_vty.c 6 files changed, 167 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/81/36081/1 diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index f4f7dc1..59bb96b 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -233,6 +233,18 @@ /* linked list of hnbgw_context_map */ struct llist_head map_list; + + /*! pointer to the associated hnb persistent state */ + struct hnb_persistent *persistent; +}; + +/* persistent data for one HNB. This continues to exist even as conn / hnb_context is deleted on disconnect */ +struct hnb_persistent { + /*! Entry in HNBGW-global list of hnb_persistent */ + struct llist_head list; + + /*! copied from HNB-Identity-Info IE */ + char identity_info[256]; }; struct ue_context { @@ -259,6 +271,7 @@ bool hnbap_allow_tmsi; /*! print hnb-id (true) or MCC-MNC-LAC-RAC-SAC (false) in logs */ bool log_prefix_hnb_id; + bool accept_all_hnb; struct mgcp_client_conf *mgcp_client; struct { char *local_addr; @@ -275,6 +288,8 @@ struct osmo_stream_srv_link *iuh; /* list of struct hnb_context */ struct llist_head hnb_list; + /* list of struct hnb_persistent */ + struct llist_head hnb_persistent_list; /* list of struct ue_context */ struct llist_head ue_list; /* next availble UE Context ID */ @@ -323,6 +338,10 @@ void hnb_context_release(struct hnb_context *ctx); void hnb_context_release_ue_state(struct hnb_context *ctx); +struct hnb_persistent *hnb_persistent_alloc(const char *identity); +struct hnb_persistent *hnb_persistent_find_by_identity(const char *identity); +void hnb_persistent_free(struct hnb_persistent *hnbp); + void hnbgw_vty_init(void); int hnbgw_vty_go_parent(struct vty *vty); diff --git a/include/osmocom/hnbgw/vty.h b/include/osmocom/hnbgw/vty.h index da0c469..9134521 100644 --- a/include/osmocom/hnbgw/vty.h +++ b/include/osmocom/hnbgw/vty.h @@ -4,6 +4,7 @@ enum osmo_iuh_vty_node { HNBGW_NODE = _LAST_OSMOVTY_NODE + 1, + HNB_NODE, IUH_NODE, IUCS_NODE, IUPS_NODE, diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index 695822e..8a7626f 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -1,6 +1,6 @@ /* kitchen sink for OsmoHNBGW implementation */ -/* (C) 2015 by Harald Welte <laforge(a)gnumonks.org> +/* (C) 2015,2024 by Harald Welte <laforge(a)gnumonks.org> * (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de> * All Rights Reserved * @@ -266,7 +266,40 @@ talloc_free(ctx); } +/*********************************************************************** + * HNB Persistent Data + ***********************************************************************/ +struct hnb_persistent *hnb_persistent_alloc(const char *identity) +{ + struct hnb_persistent *hnbp = talloc_zero(g_hnbgw, struct hnb_persistent); + if (!hnbp) + return NULL; + + llist_add(&g_hnbgw->hnb_persistent_list, &hnbp->list); + OSMO_STRLCPY_ARRAY(hnbp->identity_info, identity); + + return hnbp; +} + +struct hnb_persistent *hnb_persistent_find_by_identity(const char *identity) +{ + struct hnb_persistent *hnbp; + + llist_for_each_entry(hnbp, &g_hnbgw->hnb_persistent_list, list) { + if (!strcmp(hnbp->identity_info, identity)) + return hnbp; + } + + return NULL; +} + +void hnb_persistent_free(struct hnb_persistent *hnbp) +{ + /* FIXME: check if in use? */ + llist_del(&hnbp->list); + talloc_free(hnbp); +} /*********************************************************************** * SCTP Socket / stream handling @@ -585,6 +618,7 @@ g_hnbgw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&g_hnbgw->hnb_list); + INIT_LLIST_HEAD(&g_hnbgw->hnb_persistent_list); INIT_LLIST_HEAD(&g_hnbgw->ue_list); INIT_LLIST_HEAD(&g_hnbgw->sccp.users); diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index 06d1a9d..f8c6bd6 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -404,21 +404,34 @@ static int hnbgw_rx_hnb_register_req(struct hnb_context *ctx, ANY_t *in) { + struct hnb_persistent *hnbp; struct hnb_context *hnb, *tmp; HNBAP_HNBRegisterRequestIEs_t ies; int rc; struct osmo_plmn_id plmn; struct osmo_fd *ofd = osmo_stream_srv_get_ofd(ctx->conn); + char identity_str[256]; rc = hnbap_decode_hnbregisterrequesties(&ies, in); if (rc < 0) { LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ: rc=%d\n", rc); return rc; } + asn1_strncpy(identity_str, &ies.hnB_Identity.hNB_Identity_Info, sizeof(identity_str)); + + hnbp = hnb_persistent_find_by_identity(identity_str); + if (!hnbp && g_hnbgw->config.accept_all_hnb) + hnbp = hnb_persistent_alloc(identity_str); + + if (!hnbp) { + LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "Rejecting unknonwn HNB with identity %s\n", identity_str); + hnbap_free_hnbregisterrequesties(&ies); + return hnbgw_tx_hnb_register_rej(ctx); + } + ctx->persistent = hnbp; /* copy all identity parameters from the message to ctx */ - asn1_strncpy(ctx->identity_info, &ies.hnB_Identity.hNB_Identity_Info, - sizeof(ctx->identity_info)); + OSMO_STRLCPY_ARRAY(ctx->identity_info, identity_str); ctx->id.lac = asn1str_to_u16(&ies.lac); ctx->id.sac = asn1str_to_u16(&ies.sac); ctx->id.rac = asn1str_to_u8(&ies.rac); diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c index d73f22d..76e3231 100644 --- a/src/osmo-hnbgw/hnbgw_rua.c +++ b/src/osmo-hnbgw/hnbgw_rua.c @@ -579,6 +579,10 @@ asn_dec_rval_t dec_ret; int rc; + /* RUA is only processed after HNB registration, and as soon as the HNB is registered, + * it should have a persistent config associated with it */ + OSMO_ASSERT(hnb->persistent); + /* decode and handle to _hnbgw_hnbap_rx() */ memset(pdu, 0, sizeof(*pdu)); diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c index cb34d7f..59afd6c 100644 --- a/src/osmo-hnbgw/hnbgw_vty.c +++ b/src/osmo-hnbgw/hnbgw_vty.c @@ -1,6 +1,7 @@ /* HNB-GW interface to quagga VTY */ /* (C) 2016 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de> + * (C) 2024 by Harald Welte <laforge(a)gnumonks.org> * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -53,6 +54,12 @@ return CMD_SUCCESS; } +static struct cmd_node hnb_node = { + HNB_NODE, + "%s(config-hnbgw-hnb)# ", + 1, +}; + static struct cmd_node iuh_node = { IUH_NODE, "%s(config-hnbgw-iuh)# ", @@ -355,6 +362,19 @@ return CMD_SUCCESS; } +DEFUN(cfg_hnbgw_hnb_policy, cfg_hnbgw_hnb_policy_cmd, + "hnb-policy (accept-all|closed)", + "Configure the policy of which HNB connections to accept\n" + "Accept HNB of any identity\n" + "Accept only HNB whose identity is explicitly configured via VTY\n") +{ + if (!strcmp(argv[0], "accept-all")) + g_hnbgw->config.accept_all_hnb = true; + else + g_hnbgw->config.accept_all_hnb = false; + return CMD_SUCCESS; +} + DEFUN_DEPRECATED(cfg_hnbgw_max_sccp_cr_payload_len, cfg_hnbgw_max_sccp_cr_payload_len_cmd, "sccp cr max-payload-len <0-999999>", "Configure SCCP behavior\n" @@ -799,6 +819,43 @@ return CMD_SUCCESS; } +#define HNB_STR "hNodeB specific configuration\n" + +DEFUN(cfg_hnbgw_hnb, cfg_hnbgw_hnb_cmd, + "hnb IDENTITY_INFO", + HNB_STR + "Identity of hNodeB\n") +{ + struct hnb_persistent *hnbp = hnb_persistent_find_by_identity(argv[0]); + if (!hnbp) + hnbp = hnb_persistent_alloc(argv[0]); + if (!hnbp) { + vty_out(vty, "%% Could not create HNB '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + vty->index = hnbp; + vty->node = HNB_NODE; + + return CMD_SUCCESS; +} + +DEFUN(cfg_hnbgw_no_hnb, cfg_hnbgw_no_hnb_cmd, + "no hnb IDENTITY_INFO", + NO_STR "Remve configuration for specified hNodeB\n" + "Identity of hNodeB\n") +{ + struct hnb_persistent *hnbp = hnb_persistent_find_by_identity(argv[0]); + + if (!hnbp) { + vty_out(vty, "%% Could not find any HNB for identity '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + hnb_persistent_free(hnbp); + return CMD_SUCCESS; +} + #if ENABLE_PFCP static struct cmd_node pfcp_node = { @@ -889,8 +946,15 @@ cnpool_write_nri(vty, cnpool, false); } +static void write_one_hnbp(struct vty *vty, const struct hnb_persistent *hnbp) +{ + vty_out(vty, " hnb %s%s", hnbp->identity_info, VTY_NEWLINE); +} + static int config_write_hnbgw(struct vty *vty) { + const struct hnb_persistent *hnbp; + vty_out(vty, "hnbgw%s", VTY_NEWLINE); if (g_hnbgw->config.plmn.mcc) @@ -903,8 +967,15 @@ vty_out(vty, " log-prefix %s%s", g_hnbgw->config.log_prefix_hnb_id ? "hnb-id" : "umts-cell-id", VTY_NEWLINE); + + if (!g_hnbgw->config.accept_all_hnb) + vty_out(vty, " hnb-policy closed%s", VTY_NEWLINE); + osmo_tdef_vty_groups_write(vty, " "); + llist_for_each_entry(hnbp, &g_hnbgw->hnb_persistent_list, list) + write_one_hnbp(vty, hnbp); + _config_write_cnpool(vty, &g_hnbgw->sccp.cnpool_iucs); _config_write_cnpool(vty, &g_hnbgw->sccp.cnpool_iups); @@ -1003,6 +1074,7 @@ install_element(HNBGW_NODE, &cfg_hnbgw_rnc_id_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_log_prefix_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_max_sccp_cr_payload_len_cmd); + install_element(HNBGW_NODE, &cfg_hnbgw_hnb_policy_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_iuh_cmd); install_node(&iuh_node, config_write_hnbgw_iuh); @@ -1027,6 +1099,10 @@ install_element(IUCS_NODE, &cfg_hnbgw_cnpool_remote_addr_cmd); install_element(IUPS_NODE, &cfg_hnbgw_cnpool_remote_addr_cmd); + install_element(HNBGW_NODE, &cfg_hnbgw_hnb_cmd); + install_element(HNBGW_NODE, &cfg_hnbgw_no_hnb_cmd); + install_node(&hnb_node, NULL); + install_element_ve(&show_cnlink_cmd); install_element_ve(&show_hnb_cmd); install_element_ve(&show_one_hnb_cmd); -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de Gerrit-Change-Number: 36081 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-hnbgw[master]: New per-hnb rate_ctr and stat_item groups; track uptime
by laforge 24 Feb '24

24 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email ) Change subject: New per-hnb rate_ctr and stat_item groups; track uptime ...................................................................... New per-hnb rate_ctr and stat_item groups; track uptime Let's asd a per-hnb rate_ctr and stat_item group. Only one initial counter (number of Iuh establishments) and one initial stat_item (uptime/downtime) is implemented. Related: SYS#6773 Change-Id: I26d7c3657cdaf7c6ba5aa10a0677381ab099f8dd --- M include/osmocom/hnbgw/hnbgw.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_hnbap.c 3 files changed, 124 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/82/36082/1 diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index 59bb96b..aa2ff47 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -18,6 +18,8 @@ #include <osmocom/mgcp_client/mgcp_client.h> #include <osmocom/mgcp_client/mgcp_client_pool.h> +#define STORE_UPTIME_INTERVAL 10 /* seconds */ + enum { DMAIN, DHNBAP, @@ -70,6 +72,14 @@ #define IUH_MSGB_SIZE 2048 +enum hnb_rate_ctr { + HNB_CTR_IUH_ESTABLISHED, +}; + +enum hnb_stat { + HNB_STAT_UPTIME_SECONDS, +}; + struct umts_cell_id { uint16_t mcc; /*!< Mobile Country Code */ uint16_t mnc; /*!< Mobile Network Code */ @@ -234,17 +244,30 @@ /* linked list of hnbgw_context_map */ struct llist_head map_list; - /*! pointer to the associated hnb persistent state */ + /*! pointer to the associated hnb persistent state. Always present after HNB-Register */ struct hnb_persistent *persistent; }; +#define HNBP_CTR(hnbp, x) rate_ctr_group_get_ctr((hnbp)->ctrs, x) +#define HNBP_CTR_INC(hnbp, x) rate_ctr_inc(HNBP_CTR(hnbp, x)) + +#define HNBP_STAT(hbp, x) osmo_stat_item_group_get_item((hnbp)->statg, x) +#define HNBP_STAT_SET(hnbp, x, val) osmo_stat_item_set(HNBP_STAT(hnbp, x), val) + /* persistent data for one HNB. This continues to exist even as conn / hnb_context is deleted on disconnect */ struct hnb_persistent { /*! Entry in HNBGW-global list of hnb_persistent */ struct llist_head list; + /*! back-pointer to hnb_context. Can be NULL if no context at this point */ + struct hnb_context *ctx; + /*! copied from HNB-Identity-Info IE */ char identity_info[256]; + time_t updowntime; + + struct rate_ctr_group *ctrs; + struct osmo_stat_item_group *statg; }; struct ue_context { @@ -290,6 +313,7 @@ struct llist_head hnb_list; /* list of struct hnb_persistent */ struct llist_head hnb_persistent_list; + struct osmo_timer_list store_uptime_timer; /* list of struct ue_context */ struct llist_head ue_list; /* next availble UE Context ID */ diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index 8a7626f..91c2930 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -22,6 +22,10 @@ #include <netinet/in.h> #include <netinet/sctp.h> +#include <osmocom/core/stats.h> +#include <osmocom/core/rate_ctr.h> +#include <osmocom/core/stat_item.h> + #include <osmocom/vty/vty.h> #include <osmocom/gsm/gsm23236.h> @@ -239,9 +243,14 @@ void hnb_context_release(struct hnb_context *ctx) { struct hnbgw_context_map *map; + struct timespec tp; + int rc; LOGHNB(ctx, DMAIN, LOGL_INFO, "Releasing HNB context\n"); + rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); + ctx->persistent->updowntime = (rc < 0) ? 0 : tp.tv_sec; + /* remove from the list of HNB contexts */ llist_del(&ctx->list); @@ -263,6 +272,9 @@ map->hnb_ctx = NULL; } + /* remove back reference from hnb_persistent to context */ + ctx->persistent->ctx = NULL; + talloc_free(ctx); } @@ -270,16 +282,54 @@ * HNB Persistent Data ***********************************************************************/ +const struct rate_ctr_desc hnb_ctr_description[] = { + [HNB_CTR_IUH_ESTABLISHED] = { + "iuh:established", "Number of times Iuh link was established" }, +}; + +const struct rate_ctr_group_desc hnb_ctrg_desc = { + "hnb", + "hNodeB", + OSMO_STATS_CLASS_GLOBAL, + ARRAY_SIZE(hnb_ctr_description), + hnb_ctr_description, +}; + +const struct osmo_stat_item_desc hnb_stat_desc[] = { + [HNB_STAT_UPTIME_SECONDS] = { "uptime:seconds", "Seconds of uptime", "s", 60, 0 }, +}; + +const struct osmo_stat_item_group_desc hnb_statg_desc = { + .group_name_prefix = "hnb", + .group_description = "hNodeB", + .class_id = OSMO_STATS_CLASS_GLOBAL, + .num_items = ARRAY_SIZE(hnb_stat_desc), + .item_desc = hnb_stat_desc, +}; + struct hnb_persistent *hnb_persistent_alloc(const char *identity) { struct hnb_persistent *hnbp = talloc_zero(g_hnbgw, struct hnb_persistent); if (!hnbp) return NULL; - llist_add(&g_hnbgw->hnb_persistent_list, &hnbp->list); OSMO_STRLCPY_ARRAY(hnbp->identity_info, identity); + hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, 0); + if (!hnbp->ctrs) + goto out_free; + hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, 0); + if (!hnbp->statg) + goto out_free_ctrs; + + llist_add(&g_hnbgw->hnb_persistent_list, &hnbp->list); return hnbp; + +out_free_ctrs: + rate_ctr_group_free(hnbp->ctrs); +out_free: + talloc_free(hnbp); + return NULL; } struct hnb_persistent *hnb_persistent_find_by_identity(const char *identity) @@ -301,6 +351,32 @@ talloc_free(hnbp); } +/* return the amount of time the HNB is up (hnbp->ctx != NULL) or down (hnbp->ctx == NULL) */ +static unsigned long long hnbp_get_updowntime(const struct hnb_persistent *hnbp) +{ + struct timespec tp; + + if (!hnbp->updowntime) + return 0; + + if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp) != 0) + return 0; + + return difftime(tp.tv_sec, hnbp->updowntime); +} + +/* timer call-back: Update the HNB_STAT_UPTIME_SECONDS stat item of each hnb_persistent */ +static void hnbgw_store_hnb_uptime(void *data) +{ + struct hnb_persistent *hnbp; + + llist_for_each_entry(hnbp, &g_hnbgw->hnb_persistent_list, list) { + HNBP_STAT_SET(hnbp, HNB_STAT_UPTIME_SECONDS, hnbp->ctx != NULL ? hnbp_get_updowntime(hnbp) : 0); + } + + osmo_timer_schedule(&g_hnbgw->store_uptime_timer, STORE_UPTIME_INTERVAL, 0); +} + /*********************************************************************** * SCTP Socket / stream handling ***********************************************************************/ @@ -547,7 +623,7 @@ #define HNBGW_COPYRIGHT \ "OsmoHNBGW - Osmocom Home Node B Gateway implementation\r\n" \ - "Copyright (C) 2016-2023 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de>\r\n" \ + "Copyright (C) 2016-2024 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de>\r\n" \ "Contributions by Daniel Willmann, Harald Welte, Neels Hofmeyr\r\n" \ "License AGPLv3+: GNU AGPL version 3 or later <http://gnu.org/licenses/agpl-3.0.html>\r\n" \ "This is free software: you are free to change and redistribute it.\r\n" \ @@ -658,4 +734,7 @@ .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), }; INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); + + osmo_timer_setup(&g_hnbgw->store_uptime_timer, hnbgw_store_hnb_uptime, g_hnbgw); + osmo_timer_schedule(&g_hnbgw->store_uptime_timer, STORE_UPTIME_INTERVAL, 0); } diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c b/src/osmo-hnbgw/hnbgw_hnbap.c index f8c6bd6..21e3946 100644 --- a/src/osmo-hnbgw/hnbgw_hnbap.c +++ b/src/osmo-hnbgw/hnbgw_hnbap.c @@ -411,6 +411,7 @@ struct osmo_plmn_id plmn; struct osmo_fd *ofd = osmo_stream_srv_get_ofd(ctx->conn); char identity_str[256]; + struct timespec tp; rc = hnbap_decode_hnbregisterrequesties(&ies, in); if (rc < 0) { @@ -429,6 +430,9 @@ return hnbgw_tx_hnb_register_rej(ctx); } ctx->persistent = hnbp; + HNBP_CTR_INC(hnbp, HNB_CTR_IUH_ESTABLISHED); + rc = osmo_clock_gettime(CLOCK_MONOTONIC, &tp); + hnbp->updowntime = (rc < 0) ? 0 : tp.tv_sec; /* copy all identity parameters from the message to ctx */ OSMO_STRLCPY_ARRAY(ctx->identity_info, identity_str); -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I26d7c3657cdaf7c6ba5aa10a0677381ab099f8dd Gerrit-Change-Number: 36082 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-hnbgw[master]: Various new per-hnb RANAP and RUA counters
by laforge 24 Feb '24

24 Feb '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email ) Change subject: Various new per-hnb RANAP and RUA counters ...................................................................... Various new per-hnb RANAP and RUA counters Related: SYS#6773 Change-Id: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b --- M include/osmocom/hnbgw/hnbgw.h M src/osmo-hnbgw/hnbgw.c M src/osmo-hnbgw/hnbgw_ranap.c M src/osmo-hnbgw/hnbgw_rua.c 4 files changed, 90 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/83/36083/1 diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h index aa2ff47..f0b53f6 100644 --- a/include/osmocom/hnbgw/hnbgw.h +++ b/include/osmocom/hnbgw/hnbgw.h @@ -74,6 +74,28 @@ enum hnb_rate_ctr { HNB_CTR_IUH_ESTABLISHED, + HNB_CTR_RANAP_PS_ERR_IND_UL, + HNB_CTR_RANAP_CS_ERR_IND_UL, + HNB_CTR_RANAP_PS_RESET_REQ_UL, + HNB_CTR_RANAP_CS_RESET_REQ_UL, + + HNB_CTR_RUA_ERR_IND, + + HNB_CTR_RUA_PS_CONNECT_UL, + HNB_CTR_RUA_CS_CONNECT_UL, + + HNB_CTR_RUA_PS_DISCONNECT_UL, + HNB_CTR_RUA_CS_DISCONNECT_UL, + HNB_CTR_RUA_PS_DISCONNECT_DL, + HNB_CTR_RUA_CS_DISCONNECT_DL, + + HNB_CTR_RUA_PS_DT_UL, + HNB_CTR_RUA_CS_DT_UL, + HNB_CTR_RUA_PS_DT_DL, + HNB_CTR_RUA_CS_DT_DL, + + HNB_CTR_RUA_UDT_UL, + HNB_CTR_RUA_UDT_DL, }; enum hnb_stat { diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c index 91c2930..8bde72c 100644 --- a/src/osmo-hnbgw/hnbgw.c +++ b/src/osmo-hnbgw/hnbgw.c @@ -285,6 +285,47 @@ const struct rate_ctr_desc hnb_ctr_description[] = { [HNB_CTR_IUH_ESTABLISHED] = { "iuh:established", "Number of times Iuh link was established" }, + + [HNB_CTR_RANAP_PS_ERR_IND_UL] = { + "ranap:ps:error_ind:ul", "Received ERROR Indications in Uplink (PS Domain)" }, + [HNB_CTR_RANAP_CS_ERR_IND_UL] = { + "ranap:cs:error_ind:ul", "Received ERROR Indications in Uplink (PS Domain)" }, + + [HNB_CTR_RANAP_PS_RESET_REQ_UL] = { + "ranap:ps:reset_req:ul", "Received RESET Requests in Uplink (PS Domain)" }, + [HNB_CTR_RANAP_CS_RESET_REQ_UL] = { + "ranap:cs:reset_req:ul", "Received RESET Requests in Uplink (CS Domain)" }, + + [HNB_CTR_RUA_ERR_IND] = { + "rua:error_ind", "Received RUA Error Indications" }, + + [HNB_CTR_RUA_PS_CONNECT_UL] = { + "rua:ps:connect:ul", "Received RUA Connect requests (PS Domain)" }, + [HNB_CTR_RUA_CS_CONNECT_UL] = { + "rua:cs:connect:ul", "Received RUA Connect requests (CS Domain)" }, + + [HNB_CTR_RUA_PS_DISCONNECT_UL] = { + "rua:ps:disconnect:ul", "Received RUA Disconnect requests in uplink (PS Domain)" }, + [HNB_CTR_RUA_CS_DISCONNECT_UL] = { + "rua:cs:disconnect:ul", "Received RUA Disconnect requests in uplink (CS Domain)" }, + [HNB_CTR_RUA_PS_DISCONNECT_DL] = { + "rua:ps:disconnect:dl", "Transmitted RUA Disconnect requests in downlink (PS Domain)" }, + [HNB_CTR_RUA_CS_DISCONNECT_DL] = { + "rua:cs:disconnect:dl", "Transmitted RUA Disconnect requests in downlink (CS Domain)" }, + + [HNB_CTR_RUA_PS_DT_UL] = { + "rua:ps:direct_transfer:ul", "Received RUA DirectTransfer in uplink (PS Domain)" }, + [HNB_CTR_RUA_CS_DT_UL] = { + "rua:cs:direct_transfer:ul", "Received RUA DirectTransfer in uplink (CS Domain)" }, + [HNB_CTR_RUA_PS_DT_DL] = { + "rua:ps:direct_transfer:dl", "Transmitted RUA DirectTransfer in downlink (PS Domain)" }, + [HNB_CTR_RUA_CS_DT_DL] = { + "rua:cs:direct_transfer:dl", "Transmitted RUA DirectTransfer in downlink (CS Domain)" }, + + [HNB_CTR_RUA_UDT_UL] = { + "rua:unit_data:ul", "Received RUA UnitData (UDT) in uplink" }, + [HNB_CTR_RUA_UDT_DL] = { + "rua:unit_data:dl", "Transmitted RUA UnitData (UDT) in downlink" }, }; const struct rate_ctr_group_desc hnb_ctrg_desc = { diff --git a/src/osmo-hnbgw/hnbgw_ranap.c b/src/osmo-hnbgw/hnbgw_ranap.c index 73b5018..2977730 100644 --- a/src/osmo-hnbgw/hnbgw_ranap.c +++ b/src/osmo-hnbgw/hnbgw_ranap.c @@ -66,6 +66,7 @@ LOGHNB(hnb, DRANAP, LOGL_INFO, "Rx RESET.req(%s,%s)\n", is_ps ? "ps" : "cs", ranap_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_RESET_REQ_UL : HNB_CTR_RANAP_CS_RESET_REQ_UL); /* FIXME: Actually we have to wait for some guard time? */ /* FIXME: Reset all resources related to this HNB/RNC */ @@ -78,15 +79,20 @@ { RANAP_ErrorIndicationIEs_t ies; int rc; + bool is_ps = false; rc = ranap_decode_errorindicationies(&ies, in); if (rc < 0) return rc; + if (ies.cN_DomainIndicator == RANAP_CN_DomainIndicator_ps_domain) + is_ps = true; + if (ies.presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) { LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind(%s)\n", ranap_cause_str(&ies.cause)); } else LOGHNB(hnb, DRANAP, LOGL_ERROR, "Rx ERROR.ind\n"); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RANAP_PS_ERR_IND_UL : HNB_CTR_RANAP_CS_ERR_IND_UL); return 0; } diff --git a/src/osmo-hnbgw/hnbgw_rua.c b/src/osmo-hnbgw/hnbgw_rua.c index 76e3231..f07c186 100644 --- a/src/osmo-hnbgw/hnbgw_rua.c +++ b/src/osmo-hnbgw/hnbgw_rua.c @@ -83,6 +83,7 @@ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_ConnectionlessTransfer, &out); LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA payload of %u bytes\n", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -120,6 +121,7 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA DirectTransfer (cn=%s) payload of %u bytes\n", is_ps ? "ps" : "cs", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DT_DL : HNB_CTR_RUA_CS_DT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -157,9 +159,9 @@ &out); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RUA_Disconnect, &out); - LOGHNB(hnb, DRUA, LOGL_DEBUG, "transmitting RUA Disconnect (cn=%s) payload of %u bytes\n", is_ps ? "ps" : "cs", msgb_length(msg)); + HNBP_CTR_INC(hnb->persistent, is_ps ? HNB_CTR_RUA_PS_DISCONNECT_DL : HNB_CTR_RUA_CS_DISCONNECT_DL); return hnbgw_rua_tx(hnb, msg); } @@ -386,6 +388,8 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s)\n", ranap_domain_name(ies.cN_DomainIndicator), context_id, ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_CONNECT_UL : HNB_CTR_RUA_CS_CONNECT_UL); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, RUA_ProcedureCode_id_Connect, context_id, 0, ies.ranaP_Message.buf, @@ -415,6 +419,8 @@ LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA Disconnect.req(ctx=0x%x,cause=%s)\n", context_id, rua_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_DISCONNECT_UL : HNB_CTR_RUA_CS_DISCONNECT_UL); if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { ranap_data = ies.ranaP_Message.buf; @@ -444,6 +450,8 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA Data.req(ctx=0x%x)\n", context_id); + HNBP_CTR_INC(hnb->persistent, ies.cN_DomainIndicator == DOMAIN_PS ? + HNB_CTR_RUA_PS_DT_UL : HNB_CTR_RUA_CS_DT_UL); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, @@ -467,6 +475,7 @@ return rc; LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA UData.req()\n"); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_UDT_UL); /* according tot the spec, we can primarily receive Overload, * Reset, Reset ACK, Error Indication, reset Resource, Reset @@ -493,6 +502,7 @@ return rc; LOGHNB(hnb, DRUA, LOGL_ERROR, "RUA UData.ErrorInd(%s)\n", rua_cause_str(&ies.cause)); + HNBP_CTR_INC(hnb->persistent, HNB_CTR_RUA_ERR_IND); rua_free_errorindicationies(&ies); return rc; -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b Gerrit-Change-Number: 36083 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • ...
  • 175
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.