[M] Change in libosmo-abis[master]: Fix critical bug in default TCP keepalive user timeout
Attention is currently required from: fixeria, laforge, pespin. Hello Jenkins Builder, fixeria, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Code-Review+2 by pespin The change is no longer submittable: Code-Review is unsatisfied now. Change subject: Fix critical bug in default TCP keepalive user timeout .. Fix critical bug in default TCP keepalive user timeout It turns out that our calculation of the TCP_USER_TIMEOUT value was flawed in several ways: * there should have been parenthesis around the + operator (line->keepalive_probe_interval + line->keepalive_idle_timeout) as the keepalive_idle_timeout is in seconds, not milli-seconds. * in the default case, all those values are configured to -1 (E1INP_USE_DEFAULT). This means we're using 1000 * -1 * -1 + -1 = 999 i.e. just below a second which clearly is not enough for a lossy satellite or wifi back-haul. This fixes a regression introduced in Ia7659c209aea0d26eb37d31e771adc91b17ae668 (libosmo-abis >= 1.4.0) when TCP keepalive user timeouts became enabled by default. The initial support for TCP_USER_TIMEOUT was merged in I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f (libosmo-abis >= 0.7.0) but since TCP keepalives were not yet enabled by default, only users with explicit TCP keepalive configuration in their config files would be affected - and then only of the second part of the bug (operator precedence). In addition, let's print the actually-used values to the log, helping to spot unintended values. Change-Id: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf Closes: OS#6375 Related: OS#5785, SYS#6801 Fixes: Ia7659c209aea0d26eb37d31e771adc91b17ae668 --- M src/input/ipaccess.c 1 file changed, 56 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/79/36079/3 -- 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: 3 Gerrit-Owner: laforge Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Attention: laforge Gerrit-Attention: fixeria Gerrit-Attention: pespin Gerrit-MessageType: newpatchset
[S] Change in osmo-trx[master]: ms: update osmocom-bb submodule
Attention is currently required from: Hoernchen. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/36048?usp=email ) Change subject: ms: update osmocom-bb submodule .. Patch Set 3: (1 comment) Patchset: PS3: A similar commit is stuck in Gerrit for a few weeks: https://gerrit.osmocom.org/c/osmo-trx/+/35859 Sadly, nobody else than @pes...@sysmocom.de did code review, and now we end up with another patch doing the same thing. I don't care which one gets merged in the end, just sharing my general disappointment about the lack of code review and duplicated effort. -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/36048?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I0140f0a5333469f356c85a95660e10bbdd67cd25 Gerrit-Change-Number: 36048 Gerrit-PatchSet: 3 Gerrit-Owner: Hoernchen Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria Gerrit-CC: pespin Gerrit-Attention: Hoernchen Gerrit-Comment-Date: Sat, 24 Feb 2024 16:34:11 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/36084?usp=email to look at the new patch set (#3). 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, 224 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/84/36084/3 -- 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: 3 Gerrit-Owner: matanp Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
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 2: (1 comment) File src/osmo-bsc/bsc_ctrl.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14667): https://gerrit.osmocom.org/c/osmo-bsc/+/36084/comment/c33c3843_03e9e9be PS2, Line 848: if (!strlen(bts_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: 2 Gerrit-Owner: matanp Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 14:43:58 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
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 Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 14:43:43 + Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
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 Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 14:40:56 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
[L] Change in osmo-bsc[master]: ctrl: Add lchan show to all ctrl levels
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 +#include 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 , + * ,, ,, + * ,,, + */ +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, _msc0_connection_status); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, _net_notification); rc |= ctrl_cmd_install(CTRL_NODE_ROOT, _net_inform_msc); + rc |= ctrl_cmd_install(CTRL_NODE_ROOT, _net_show_lchan_full); rc |= ctrl_cmd_install(CTRL_NODE_MSC, _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 , + * ,, ,, + * ,,, + */ +static int get_bts_show_lchan_full(struct
[M] Change in libosmo-abis[master]: Fix critical bug in default TCP keepalive user timeout
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 Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Reviewer: pespin Gerrit-Attention: laforge Gerrit-Comment-Date: Sat, 24 Feb 2024 14:20:34 + Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[M] Change in libosmo-abis[master]: Fix critical bug in default TCP keepalive user timeout
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 Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria Gerrit-Attention: laforge Gerrit-Comment-Date: Sat, 24 Feb 2024 13:10:14 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks
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 Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sat, 24 Feb 2024 11:40:12 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks
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(_hnbgw->hnb_list); - INIT_LLIST_HEAD(_hnbgw->ue_list); - INIT_LLIST_HEAD(_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 = _ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, _ctrg_desc, 0), - }; - INIT_LLIST_HEAD(_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 = _ctrg_desc, - - .ctrs = rate_ctr_group_alloc(g_hnbgw, _ctrg_desc, 0), - }; - INIT_LLIST_HEAD(_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, _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, _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, _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, _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(>map_list); + + ctx->conn = osmo_stream_srv_create(g_hnbgw,
[M] Change in osmo-hnbgw[master]: Various new per-hnb RANAP and RUA counters
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()); + 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(, in); if (rc < 0) return rc; + if (ies.cN_DomainIndicator == RANAP_CN_DomainIndicator_ps_domain) +
[M] Change in osmo-hnbgw[master]: New per-hnb rate_ctr and stat_item groups; track uptime
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 #include +#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 #include +#include +#include +#include + #include #include @@ -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, ); + ctx->persistent->updowntime = (rc < 0) ? 0 : tp.tv_sec; + /* remove from the list of HNB contexts */ llist_del(>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(_hnbgw->hnb_persistent_list, >list); OSMO_STRLCPY_ARRAY(hnbp->identity_info, identity); + hnbp->ctrs =
[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure
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 +/* (C) 2015,2024 by Harald Welte * (C) 2016-2023 by sysmocom s.f.m.c. GmbH * 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(_hnbgw->hnb_persistent_list, >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, _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(>list); + talloc_free(hnbp); +} /*** * SCTP Socket / stream handling @@ -585,6 +618,7 @@ g_hnbgw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(_hnbgw->hnb_list); + INIT_LLIST_HEAD(_hnbgw->hnb_persistent_list); INIT_LLIST_HEAD(_hnbgw->ue_list); INIT_LLIST_HEAD(_hnbgw->sccp.users); diff --git a/src/osmo-hnbgw/hnbgw_hnbap.c