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

March 2026

  • 1 participants
  • 1933 discussions
[S] Change in osmo-ci[master]: jobs: add build/manuals JOB_TYPEs for osmo-s1gw
by fixeria 19 Mar '26

19 Mar '26
Attention is currently required from: osmith, pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-ci/+/42370?usp=email ) Change subject: jobs: add build/manuals JOB_TYPEs for osmo-s1gw ...................................................................... Patch Set 1: (1 comment) This change is ready for review. Patchset: PS1: > Because `I54f0774575534519a2c40e0588f136c8a5e706f8` is not merged yet. Not it's merged, unsetting the WIP flag. -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/42370?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Id62d806a648c8f3480cb4f162adf65f77c552848 Gerrit-Change-Number: 42370 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Mar 2026 18:42:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: config/sys.config: increase StatsD reporter interval to 10s
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42424?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: config/sys.config: increase StatsD reporter interval to 10s ...................................................................... config/sys.config: increase StatsD reporter interval to 10s When running ttcn3-s1gw-test locally, I noticed OsmoS1GW consuming 30-40% of a CPU core while idle (not serving any eNBs). Profiling with etop pointed to `exometer_report_statsd` as the culprit: with ~1720 metrics registered, it was sending ~1720 datagrams per second. A 1-second reporting interval causes noticeable CPU overhead as the number of active metrics grows. With per-eNB and per-MME counters, the metric set scales with the number of connected eNBs/MMEs. Increase the default StatsD reporting interval from 1s to 10s to reduce that overhead. Update the documentation accordingly. Change-Id: Icd5e1a43d1df4a4909fe742aec67cc51a01bb857 --- M config/sys.config M doc/manuals/chapters/configuration.adoc 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/config/sys.config b/config/sys.config index 3c8f0f3..d428765 100644 --- a/config/sys.config +++ b/config/sys.config @@ -88,11 +88,11 @@ }, {subscribers, [%%{select, {[{ {['_' | '_'],'_','_'}, [], ['$_']}], - %% exometer_report_tty, value, 1000, true}} + %% exometer_report_tty, value, 10_000, true}} {select, {[{ {['_' | '_'],counter,'_'}, [], ['$_']}], exometer_report_statsd, value, - 1000, + 10_000, true, [{report_type, counter}] } @@ -100,7 +100,7 @@ {select, {[{ {['_' | '_'],gauge,'_'}, [], ['$_']}], exometer_report_statsd, value, - 1000, + 10_000, true, [{report_type, gauge}] } diff --git a/doc/manuals/chapters/configuration.adoc b/doc/manuals/chapters/configuration.adoc index 337f8b3..0d4315f 100644 --- a/doc/manuals/chapters/configuration.adoc +++ b/doc/manuals/chapters/configuration.adoc @@ -279,10 +279,10 @@ ]}, {subscribers, [ {select, {[{ {['_'|'_'], counter, '_'}, [], ['$_']}], - exometer_report_statsd, value, 1000, true, + exometer_report_statsd, value, 10_000, true, [{report_type, counter}]}}, {select, {[{ {['_'|'_'], gauge, '_'}, [], ['$_']}], - exometer_report_statsd, value, 1000, true, + exometer_report_statsd, value, 10_000, true, [{report_type, gauge}]}} ]} ]} @@ -301,7 +301,7 @@ The `subscribers` list uses exometer's `select` mechanism to automatically subscribe all counters and gauges to the StatsD reporter -with a reporting interval of 1000 ms. To disable StatsD reporting, +with a reporting interval of 10 000 ms. To disable StatsD reporting, comment out or remove the `exometer_report_statsd` reporter entry. // vim:set ts=4 sw=4 et: -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42424?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Icd5e1a43d1df4a4909fe742aec67cc51a01bb857 Gerrit-Change-Number: 42424 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: rebar.lock: bump exometer_report_statsd version
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42413?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: rebar.lock: bump exometer_report_statsd version ...................................................................... rebar.lock: bump exometer_report_statsd version The new version is using ETS instead of dict for counter lookups. This significantly reduces performance impact when multiple eNBs are registered, since the ETS provides O(1) average-case hash lookups and in-place mutation. Change-Id: I931321a831215012aa8186d851d9a8d38908a4bf --- M rebar.config M rebar.lock 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve diff --git a/rebar.config b/rebar.config index d729401..e51ca22 100644 --- a/rebar.config +++ b/rebar.config @@ -16,7 +16,7 @@ {exometer_core, {git, "https://github.com/Feuerlabs/exometer_core.git", {branch, "master"}}}, {exometer_report_statsd, - {git, "https://github.com/osmocom/exometer_report_statsd.git", {branch, "counters"}}}, + {git, "https://github.com/osmocom/exometer_report_statsd.git", {branch, "osmocom/master"}}}, {erf, {git, "https://github.com/nomasystems/erf.git", {tag, "0.1.2"}}} ]}. diff --git a/rebar.lock b/rebar.lock index 1efe90b..439ea74 100644 --- a/rebar.lock +++ b/rebar.lock @@ -18,7 +18,7 @@ 0}, {<<"exometer_report_statsd">>, {git,"https://github.com/osmocom/exometer_report_statsd.git", - {ref,"d35a98edf87996f2ab9ef0feda93b38677b0d063"}}, + {ref,"bfd6c095bfc404e5fab5c07f5ebe0fe305e58830"}}, 0}, {<<"hut">>,{pkg,<<"hut">>,<<"1.3.0">>},1}, {<<"jiffy">>, -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42413?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I931321a831215012aa8186d851d9a8d38908a4bf Gerrit-Change-Number: 42413 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: pfcp_peer: define ?PFCP_ASSOC_SETUP_TIMEOUT
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42426?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: pfcp_peer: define ?PFCP_ASSOC_SETUP_TIMEOUT ...................................................................... pfcp_peer: define ?PFCP_ASSOC_SETUP_TIMEOUT Change-Id: I0b7299d9f3eaa8c0a3c7e4a4d6331d1ec5a1c779 --- M src/pfcp_peer.erl 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl index 9910f5f..6308f50 100644 --- a/src/pfcp_peer.erl +++ b/src/pfcp_peer.erl @@ -59,6 +59,7 @@ -define(PFCP_PORT, 8805). -define(PFCP_SEQ_NR_MAX, 16#ffffff). -define(PFCP_SEID_MAX, 16#ffffffffffffffff). +-define(PFCP_ASSOC_SETUP_TIMEOUT, 2000). -define(PFCP_HEARTBEAT_REQ_TIMEOUT, 2000). -type pfcp_session_rsp() :: ok | {error, term()}. @@ -196,7 +197,7 @@ s1gw_metrics:gauge_set(?S1GW_GAUGE_PFCP_ASSOCIATED, 0), %% Tx PFCP Association Setup {ok, S1} = send_assoc_setup(S0), - {keep_state, S1, [{state_timeout, 2_000, assoc_setup_timeout}]}; + {keep_state, S1, [{state_timeout, ?PFCP_ASSOC_SETUP_TIMEOUT, assoc_setup_timeout}]}; %% Handle Association Setup timeout connecting(state_timeout, assoc_setup_timeout, S) -> -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42426?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I0b7299d9f3eaa8c0a3c7e4a4d6331d1ec5a1c779 Gerrit-Change-Number: 42426 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy: obtain sctp_client sockopts from the env directly
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42428?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: enb_proxy: obtain sctp_client sockopts from the env directly ...................................................................... enb_proxy: obtain sctp_client sockopts from the env directly Instead of passing the MmeConnCfg (sctp_client:cfg()) all the way from osmo_s1gw_sup through sctp_server (as priv) into enb_proxy (as state), read the sctp_client configuration in-place via osmo_s1gw:get_env/2 when it is actually needed (connecting/enter). This works because osmo_s1gw_sup already normalizes and writes back the complete sctp_client config to the application env (set_env/2) before starting the supervision tree. As a result, mme_conn_cfg is removed from enb_proxy's state record, start_link/2 no longer uses its Priv argument, and server_cfg/1 is simplified to server_cfg/0. Change-Id: Ic77d3eb3351c8981c87fa4b6febcdeb814b9187b --- M src/enb_proxy.erl M src/osmo_s1gw_sup.erl 2 files changed, 9 insertions(+), 12 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index f2c0cbf..c76ac42 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -67,7 +67,6 @@ -record(state, {enb_aid :: gen_sctp:assoc_id(), mme_aid :: undefined | gen_sctp:assoc_id(), enb_conn_info :: sctp_server:conn_info(), - mme_conn_cfg :: sctp_client:cfg(), s1setup_req :: undefined | binary(), tried_mmes :: [mme_registry:mme_name()], enb_tacs :: undefined | [s1ap_utils:tac()], @@ -88,10 +87,10 @@ -spec start_link(ConnInfo, Priv) -> Result when ConnInfo :: sctp_server:conn_info(), - Priv :: sctp_client:cfg(), + Priv :: term(), Result :: gen_statem:start_ret(). -start_link(ConnInfo, Priv) -> - gen_statem:start_link(?MODULE, [ConnInfo, Priv], []). +start_link(ConnInfo, _Priv) -> + gen_statem:start_link(?MODULE, [ConnInfo], []). -spec send_data(pid(), binary()) -> ok. @@ -113,13 +112,12 @@ %% gen_statem API %% ------------------------------------------------------------------ -init([EnbConnInfo, MmeConnCfg]) -> +init([EnbConnInfo]) -> {ok, EnbHandle} = enb_registry:enb_register(), {ok, Pid} = s1ap_proxy:start_link(self()), {ok, wait_s1setup_req, #state{enb_aid = maps:get(aid, EnbConnInfo), enb_conn_info = EnbConnInfo, - mme_conn_cfg = MmeConnCfg, enb_handle = EnbHandle, tried_mmes = [], handler = Pid}}. @@ -198,7 +196,7 @@ %% Close the old connection, if any close_sock(S), %% Initiate connection establishment with the MME - MmeSockOpts = maps:get(sockopts, S#state.mme_conn_cfg), + MmeSockOpts = maps:get(sockopts, osmo_s1gw:get_env(sctp_client, #{})), MmeConnCfg = #{laddr => maps:get(laddr, MmeInfo), raddr => maps:get(raddr, MmeInfo), rport => maps:get(rport, MmeInfo), @@ -208,7 +206,6 @@ {next_state, ?FUNCTION_NAME, %% loop transition to enable state_timeout S#state{sock = Sock, mme_aid = undefined, - mme_conn_cfg = MmeConnCfg, tried_mmes = [MmeName | TriedMMEs]}, [{state_timeout, 2_000, conn_est_timeout}]}; error -> diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index 875e19b..447dfc4 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -67,7 +67,7 @@ PfcpRemAddr = osmo_s1gw:get_env(pfcp_rem_addr, ?ENV_DEFAULT_PFCP_REM_ADDR), ClientCfg = client_cfg(), - ServerCfg = server_cfg(ClientCfg), + ServerCfg = server_cfg(), %% Set a complete 'sctp_client' section with all fields populated. %% This may be used by mme_registry:mme_list_from_sctp_client/0 @@ -144,8 +144,8 @@ sockopts => sctp_common:gen_sockopts(SockOpts)}. --spec server_cfg(term()) -> sctp_server:cfg(). -server_cfg(Priv) -> +-spec server_cfg() -> sctp_server:cfg(). +server_cfg() -> %% parse old/legacy environment options, if any DefCfg = parse_env_map(#{laddr => s1gw_bind_addr, lport => s1gw_bind_port}), @@ -159,7 +159,7 @@ lport => maps:get(lport, Cfg, ?ENV_DEFAULT_S1GW_BIND_PORT), sockopts => sctp_common:gen_sockopts(SockOpts), handler => enb_proxy, - priv => Priv}. + priv => undefined}. -spec gtpu_kpi_cfg() -> gtpu_kpi:cfg(). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42428?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ic77d3eb3351c8981c87fa4b6febcdeb814b9187b Gerrit-Change-Number: 42428 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy: signal mme_info() to the enb_registry
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42427?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: enb_proxy: signal mme_info() to the enb_registry ...................................................................... enb_proxy: signal mme_info() to the enb_registry When an MME is selected from the pool, pass the mme_registry:mme_info() to the enb_registry via notify_mme_connecting/2 (replacing /1). This makes all MME configuration details (name, address, port, TAC list) available to consumers such as the REST server, without having to look them up separately from the mme_registry. Change-Id: I22e705b8196c9dcf436ed3c4d91c5c5a912e7282 Related: SYS#7052 --- M src/enb_proxy.erl M src/enb_registry.erl M src/rest_server.erl 3 files changed, 29 insertions(+), 20 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 1d479d6..f2c0cbf 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -58,12 +58,10 @@ -include("S1AP-Constants.hrl"). -%% XXX: replace/merge with mme_registry:mme_info()? -type conn_info() :: #{handler := pid(), - mme_addr := inet:ip_address(), - mme_port := inet:port_number(), enb_aid := gen_sctp:assoc_id(), mme_aid => gen_sctp:assoc_id() + %% TODO: add mme_saddr / mme_sport }. -record(state, {enb_aid :: gen_sctp:assoc_id(), @@ -206,7 +204,7 @@ rport => maps:get(rport, MmeInfo), sockopts => MmeSockOpts}, {ok, Sock} = sctp_client:connect(MmeConnCfg), - enb_registry:notify_mme_connecting(S#state.enb_handle), + enb_registry:notify_mme_connecting(S#state.enb_handle, MmeInfo), {next_state, ?FUNCTION_NAME, %% loop transition to enable state_timeout S#state{sock = Sock, mme_aid = undefined, @@ -469,10 +467,8 @@ -spec conn_info(state()) -> conn_info(). -conn_info(#state{mme_conn_cfg = MmeConnCfg} = S) -> +conn_info(S) -> Info = #{handler => S#state.handler, - mme_addr => maps:get(raddr, MmeConnCfg), - mme_port => maps:get(rport, MmeConnCfg), enb_aid => S#state.enb_aid, mme_aid => S#state.mme_aid}, maps:filter(fun(_K, V) -> V =/= undefined end, Info). diff --git a/src/enb_registry.erl b/src/enb_registry.erl index 61f0c59..0ad20ba 100644 --- a/src/enb_registry.erl +++ b/src/enb_registry.erl @@ -45,7 +45,7 @@ enb_unregister/1, notify_enb_connected/2, notify_genb_id/2, - notify_mme_connecting/1, + notify_mme_connecting/2, notify_mme_wait_rsp/1, notify_mme_connected/2, fetch_enb_info/1, @@ -66,6 +66,7 @@ -type enb_prop() :: {state, atom()} | {enb_conn_info, sctp_server:conn_info()} | {mme_conn_info, undefined | enb_proxy:conn_info()} + | {mme_info, mme_registry:mme_info()} | {genb_id, s1ap_utils:genb_id()}. -type enb_proplist() :: [enb_prop()]. @@ -84,7 +85,8 @@ genb_id => s1ap_utils:genb_id(), %% Global-eNB-ID genb_id_str => string(), %% Global-eNB-ID string enb_conn_info => sctp_server:conn_info(), %% eNB -> S1GW connection info - mme_conn_info => enb_proxy:conn_info() %% S1GW -> MME connection info + mme_conn_info => enb_proxy:conn_info(), %% S1GW -> MME connection info + mme_info => mme_registry:mme_info() %% selected MME configuration }. -record(state, {enbs :: #{enb_handle() => enb_info()}, @@ -127,10 +129,10 @@ enb_update(Handle, [{genb_id, GENBId}]). -%% MME connection attempt in progress; clears any stale mme_conn_info --spec notify_mme_connecting(enb_handle()) -> ok. -notify_mme_connecting(Handle) -> - enb_update(Handle, [{state, connecting}, {mme_conn_info, undefined}]). +%% MME connection attempt in progress; stores selected MME info, clears any stale mme_conn_info +-spec notify_mme_connecting(enb_handle(), mme_registry:mme_info()) -> ok. +notify_mme_connecting(Handle, MmeInfo) -> + enb_update(Handle, [{state, connecting}, {mme_info, MmeInfo}, {mme_conn_info, undefined}]). %% MME SCTP link established; S1 SETUP REQUEST forwarded, awaiting response @@ -342,6 +344,9 @@ enb_update_prop({mme_conn_info, ConnInfo}, EnbInfo) -> EnbInfo#{mme_conn_info => ConnInfo}; +enb_update_prop({mme_info, MmeInfo}, EnbInfo) -> + EnbInfo#{mme_info => MmeInfo}; + enb_update_prop({genb_id, GENBId}, EnbInfo) -> GlobalENBId = s1ap_utils:genb_id_str(GENBId), enb_metrics_register(GlobalENBId), @@ -374,8 +379,8 @@ enb_filter_by_sub_field({enb_conn_info, port, Port}, Item) end; enb_filter({mme_addr_port, {Addr, Port}}) -> - fun(_, Item) -> enb_filter_by_sub_field({mme_conn_info, mme_addr, Addr}, Item) andalso - enb_filter_by_sub_field({mme_conn_info, mme_port, Port}, Item) end; + fun(_, Item) -> enb_filter_by_sub_field({mme_info, raddr, Addr}, Item) andalso + enb_filter_by_sub_field({mme_info, rport, Port}, Item) end; enb_filter(Filter) -> ?LOG_ERROR("Unknown eNB filter: ~p", [Filter]), diff --git a/src/rest_server.erl b/src/rest_server.erl index 79090e8..e515445 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -328,7 +328,8 @@ M1 = enb_item_add_enb_info(M0, EnbInfo), M2 = enb_item_add_enb_conn_info(M1, EnbInfo), M3 = enb_item_add_mme_conn_info(M2, EnbInfo), - rsp_map(M3). + M4 = enb_item_add_mme_info(M3, EnbInfo), + rsp_map(M4). -spec enb_item_add_enb_info(map(), enb_registry:enb_info()) -> map(). @@ -353,16 +354,23 @@ enb_item_add_mme_conn_info(M0, #{mme_conn_info := ConnInfo}) -> Pid = maps:get(handler, ConnInfo), ERABs = s1ap_proxy:fetch_erab_list(Pid), - M0#{mme_daddr => maps:get(mme_addr, ConnInfo), %% XXX inet:ntoa - mme_dport => maps:get(mme_port, ConnInfo), - %% TODO: mme_sport - mme_sctp_aid => maps:get(mme_aid, ConnInfo), + %% TODO: mme_sport (source port) is not yet available in conn_info() + M0#{mme_sctp_aid => maps:get(mme_aid, ConnInfo), erab_count => length(ERABs) }; enb_item_add_mme_conn_info(M0, _) -> M0. +-spec enb_item_add_mme_info(map(), enb_registry:enb_info()) -> map(). +enb_item_add_mme_info(M0, #{mme_info := MmeInfo}) -> + M0#{mme_daddr => inet:ntoa(maps:get(raddr, MmeInfo)), + mme_dport => maps:get(rport, MmeInfo) + }; + +enb_item_add_mme_info(M0, _) -> M0. + + -spec fetch_enb_info(binary()) -> [enb_registry:enb_info()] | error. fetch_enb_info(<< "handle:", Val/bytes >>) -> Handle = binary_to_integer(Val), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42427?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I22e705b8196c9dcf436ed3c4d91c5c5a912e7282 Gerrit-Change-Number: 42427 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: [REST] Implement eNB/MME selection by addr-port
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42429?usp=email ) Change subject: [REST] Implement eNB/MME selection by addr-port ...................................................................... [REST] Implement eNB/MME selection by addr-port Add support for selecting an MME or eNB by remote address and port in the REST API and CLI. The selector format is `addr:IP:PORT` for MMEs and `enb-conn:IP:PORT` for eNBs, where IP can be an IPv4 or IPv6 address. The colon is used as the address/port separator. Change-Id: If02c8de1e1b7214bba868eee35233a79d0704dc5 Related: SYS#7066 --- M contrib/openapi.yaml M contrib/osmo-s1gw-cli.py M doc/manuals/chapters/cli.adoc M priv/openapi.json M src/rest_server.erl 5 files changed, 99 insertions(+), 33 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml index c50ccce..d07dd21 100644 --- a/contrib/openapi.yaml +++ b/contrib/openapi.yaml @@ -244,9 +244,9 @@ description: MME name example: mme0 - type: string - pattern: '^addr:[0-9a-f:.]+-[0-9]+$' + pattern: '^addr:[0-9a-f:.]+:[0-9]+$' description: MME remote address/port - example: addr:192.168.1.1-36412 + example: addr:192.168.1.1:36412 EnbId: name: EnbId @@ -272,9 +272,9 @@ description: eNB/MME SCTP association identifier example: enb-aid:42 - type: string - pattern: '^enb-conn:[0-9a-f:.]+-[0-9]+$' + pattern: '^enb-conn:[0-9a-f:.]+:[0-9]+$' description: eNB connection address/port - example: enb-conn:192.168.1.1-34650 + example: enb-conn:192.168.1.1:34650 ErabId: name: ErabId diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index 5c37bdc..51a9c4f 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -117,14 +117,14 @@ with self.send_post_req('mme-list', mme_info) as f: return f.status - def mme_info(self, name: str) -> RESTResponse: + def mme_info(self, mme_id: str) -> RESTResponse: ''' MmeInfo :: Get information about a specific MME ''' - with self.send_get_req(f'mme/name:{name}') as f: + with self.send_get_req(f'mme/{mme_id}') as f: return json.load(f) - def mme_delete(self, name: str) -> int: - ''' MmeInfo :: Get information about a specific MME ''' - with self.send_delete_req(f'mme/name:{name}') as f: + def mme_delete(self, mme_id: str) -> int: + ''' MmeDelete :: Delete an MME from the pool ''' + with self.send_delete_req(f'mme/{mme_id}') as f: return f.status def enb_list(self) -> RESTResponse: @@ -349,6 +349,18 @@ self.iface.mme_add(mme_info) @staticmethod + def gen_mme_id(opts) -> str: + ''' Generate the MmeId parameter value (for URL) ''' + if opts.name is not None: + return f'name:{opts.name}' + elif opts.addr is not None: + addr, _, port = opts.addr.rpartition(':') + if addr and port.isdigit(): + return f'addr:{opts.addr}' + return f'addr:{opts.addr}:36412' + raise ValueError # shall not happen + + @staticmethod def add_mme_id_group(parser): ''' Add argparse group for the MmeId parameter ''' mme_id_group = parser.add_argument_group('MME ID') @@ -356,7 +368,10 @@ mme_id_group.add_argument('-N', '--name', type=str, help='MME name (example: mme0)') - # TODO: address/port + mme_id_group.add_argument('-a', '--addr', + type=str, metavar='ADDR[:PORT]', + help='MME address with optional port (default: 36412), ' + 'e.g. 192.168.1.1 or 192.168.1.1:36412') return mme_id_group mme_info_parser = cmd2.Cmd2ArgumentParser() @@ -366,14 +381,14 @@ @cmd2.with_category(CAT_MME) def do_mme_info(self, opts) -> None: ''' Get information about a specific MME ''' - data = self.iface.mme_info(opts.name) + data = self.iface.mme_info(self.gen_mme_id(opts)) self.mme_info_print(data) @cmd2.with_argparser(mme_info_parser) @cmd2.with_category(CAT_MME) def do_mme_delete(self, opts) -> None: ''' Delete an MME from the pool ''' - self.iface.mme_delete(opts.name) + self.iface.mme_delete(self.gen_mme_id(opts)) @staticmethod def enb_list_item(item: dict) -> dict: @@ -429,6 +444,8 @@ return f'enb-sctp-aid:{opts.enb_sctp_aid}' elif opts.mme_sctp_aid is not None: return f'mme-sctp-aid:{opts.mme_sctp_aid}' + elif opts.enb_conn is not None: + return f'enb-conn:{opts.enb_conn}' raise ValueError # shall not happen @staticmethod @@ -451,6 +468,9 @@ enb_id_group.add_argument('--mme-sctp-aid', type=int, metavar='AID', help='MME association identifier (example: 42)') + enb_id_group.add_argument('--enb-conn', + type=str, metavar='ADDR:PORT', + help='eNB connection address/port (example: 192.168.1.1:34650)') return enb_id_group enb_info_parser = cmd2.Cmd2ArgumentParser() diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc index 418cd4b..279c445 100644 --- a/doc/manuals/chapters/cli.adoc +++ b/doc/manuals/chapters/cli.adoc @@ -218,13 +218,15 @@ ==== `mme_info` -Show configuration details for a specific MME, selected by name. +Show configuration details for a specific MME. ---- -Usage: mme_info [-h] -N NAME +Usage: mme_info [-h] (-N NAME | -a ADDR[:PORT]) MME ID: - -N, --name NAME MME name (example: mme0) + -N, --name NAME MME name (example: mme0) + -a, --addr ADDR[:PORT] MME address with optional port (default: 36412), + e.g. 192.168.1.1 or 192.168.1.1:36412 ---- Example: @@ -241,13 +243,15 @@ ==== `mme_delete` -Remove an MME from the pool, selected by name. +Remove an MME from the pool. ---- -Usage: mme_delete [-h] -N NAME +Usage: mme_delete [-h] (-N NAME | -a ADDR[:PORT]) MME ID: - -N, --name NAME MME name (example: mme0) + -N, --name NAME MME name (example: mme0) + -a, --addr ADDR[:PORT] MME address with optional port (default: 36412), + e.g. 192.168.1.1 or 192.168.1.1:36412 ---- Example: @@ -287,14 +291,16 @@ ---- Usage: enb_info [-h] (-H HANDLE | -P PID | -G GENBID | - --enb-sctp-aid AID | --mme-sctp-aid AID) + --enb-sctp-aid AID | --mme-sctp-aid AID | + --enb-conn ADDR:PORT) eNB ID: - -H, --handle HANDLE eNB handle (example: 0) - -P, --pid PID eNB process ID (example: 0.33.1) - -G, --genbid GENBID Global-eNB-ID (example: 262-42-1337) - --enb-sctp-aid AID eNB SCTP association identifier - --mme-sctp-aid AID MME SCTP association identifier + -H, --handle HANDLE eNB handle (example: 0) + -P, --pid PID eNB process ID (example: 0.33.1) + -G, --genbid GENBID Global-eNB-ID (example: 262-42-1337) + --enb-sctp-aid AID eNB SCTP association identifier + --mme-sctp-aid AID MME SCTP association identifier + --enb-conn ADDR:PORT eNB connection address/port (example: 192.168.1.1:34650) ---- Example: selecting by handle. @@ -315,8 +321,8 @@ ==== `enb_delete` -Force-disconnect an eNB, terminating its SCTP connection. The same -selectors as `enb_info` are accepted. +Force-disconnect an eNB, terminating its SCTP connection. Accepts the +same selectors as `enb_info`. ==== `enb_erab_list` @@ -326,7 +332,8 @@ Usage: enb_erab_list [-h] [-f] [-S {pid,state,mme_ue_id,erab_id}] [--reverse] (-H HANDLE | -P PID | -G GENBID | - --enb-sctp-aid AID | --mme-sctp-aid AID) + --enb-sctp-aid AID | --mme-sctp-aid AID | + --enb-conn ADDR:PORT) optional arguments: -f, --full Print full table including PFCP and GTP-U F-TEID columns diff --git a/priv/openapi.json b/priv/openapi.json index 8289c02..cab9fc0 100644 --- a/priv/openapi.json +++ b/priv/openapi.json @@ -379,9 +379,9 @@ }, { "type": "string", - "pattern": "^addr:[0-9a-f:.]+-[0-9]+$", + "pattern": "^addr:[0-9a-f:.]+:[0-9]+$", "description": "MME remote address/port", - "example": "addr:192.168.1.1-36412" + "example": "addr:192.168.1.1:36412" } ] } @@ -419,9 +419,9 @@ }, { "type": "string", - "pattern": "^enb-conn:[0-9a-f:.]+-[0-9]+$", + "pattern": "^enb-conn:[0-9a-f:.]+:[0-9]+$", "description": "eNB connection address/port", - "example": "enb-conn:192.168.1.1-34650" + "example": "enb-conn:192.168.1.1:34650" } ] } diff --git a/src/rest_server.erl b/src/rest_server.erl index 550da3e..0beaaca 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -272,6 +272,25 @@ <<"swagger_ui">> => osmo_s1gw:get_env(rest_srv_swagger_ui, ?ENV_DEFAULT_REST_SRV_SWAGGER_UI)}. +%% parse address/port from a string like "192.168.1.1:36412" +-spec parse_addr_port(Data) -> {ok, {Addr, Port}} | error + when Data :: binary() | string(), + Addr :: inet:ip_address(), + Port :: inet:port_number(). +parse_addr_port(Data) when is_binary(Data) -> + parse_addr_port(binary_to_list(Data)); + +parse_addr_port(Data) when is_list(Data) -> + case string:split(Data, ":", trailing) of + [AddrStr, PortStr] -> + case {inet:parse_address(AddrStr), string:to_integer(PortStr)} of + {{ok, Addr}, {Port, []}} -> {ok, {Addr, Port}}; + _ -> error + end; + _ -> error + end. + + -spec sockopts_to_map([gen_sctp:option()]) -> map(). sockopts_to_map(SockOpts) -> maps:from_list([{atom_to_binary(K), V} || {K, V} <- SockOpts]). @@ -368,7 +387,19 @@ MmeName = binary_to_list(Val), mme_registry:fetch_mme_info(MmeName); -%% TODO: '^addr:[0-9a-f:.]+-[0-9]+$' +fetch_mme_info(<< "addr:", Val/bytes >>) -> + case parse_addr_port(Val) of + {ok, {Addr, Port}} -> + Fun = fun(#{raddr := R, rport := P}) -> R =:= Addr andalso P =:= Port end, + case lists:filter(Fun, mme_registry:fetch_mme_list()) of + [MmeInfo | _] -> {ok, MmeInfo}; + [] -> error + end; + error -> + ?LOG_ERROR("Failed to parse MME addr:port from ~p", [Val]), + error + end; + fetch_mme_info(ID) -> ?LOG_ERROR("Unhandled MME ID ~p", [ID]), error. @@ -454,7 +485,15 @@ Aid = binary_to_integer(Val), enb_registry:fetch_enb_list({mme_sctp_aid, Aid}); -%% TODO: '^enb-conn:[0-9:.]+-[0-9]+$' +fetch_enb_info(<< "enb-conn:", Val/bytes >>) -> + case parse_addr_port(Val) of + {ok, AddrPort} -> + enb_registry:fetch_enb_list({enb_addr_port, AddrPort}); + error -> + ?LOG_ERROR("Failed to parse eNB addr:port from ~p", [Val]), + error + end; + fetch_enb_info(ID) -> ?LOG_ERROR("Unhandled eNB ID ~p", [ID]), error. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42429?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: If02c8de1e1b7214bba868eee35233a79d0704dc5 Gerrit-Change-Number: 42429 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[L] Change in ...osmo-s1gw[master]: [REST] Add GET /config endpoint (ConfigRead)
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42416?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: [REST] Add GET /config endpoint (ConfigRead) ...................................................................... [REST] Add GET /config endpoint (ConfigRead) This endpoint returns the effective runtime configuration that OsmoS1GW is currently using, with all defaults applied. This reflects the values read via `osmo_s1gw:get_env/2` at startup. Change-Id: Ic6c9562a541e4a0728257538887537aac6b99b97 Related: SYS#7066 --- M contrib/openapi.yaml M contrib/osmo-s1gw-cli.py M doc/manuals/chapters/cli.adoc M doc/manuals/chapters/rest.adoc A include/osmo_s1gw.hrl M priv/openapi.json M src/osmo_s1gw_sup.erl M src/rest_server.erl 8 files changed, 472 insertions(+), 13 deletions(-) Approvals: pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml index 6ab1346..c50ccce 100644 --- a/contrib/openapi.yaml +++ b/contrib/openapi.yaml @@ -66,6 +66,18 @@ '200': $ref: '#/components/responses/OperationResult' + /config: + get: + summary: Get the current runtime configuration + operationId: ConfigRead + responses: + '200': + description: Current runtime configuration + content: + application/json: + schema: + $ref: '#/components/schemas/Config' + /mme-list: get: summary: Get a list of registered MMEs @@ -427,6 +439,96 @@ type: integer description: SCTP association identifier of the S1GW-MME connection + Config: + type: object + properties: + sctp_server: + $ref: '#/components/schemas/SctpServerCfg' + sctp_client: + $ref: '#/components/schemas/SctpClientCfg' + pfcp: + $ref: '#/components/schemas/PfcpCfg' + gtpu_kpi: + $ref: '#/components/schemas/GtpuKpiCfg' + rest: + $ref: '#/components/schemas/RestCfg' + + SctpSockOptsCfg: + type: object + properties: + sctp_nodelay: + type: boolean + description: Disable/enable SCTP Nagle algorithm + recbuf: + type: integer + description: Receive buffer size (bytes) + sndbuf: + type: integer + description: Send buffer size (bytes) + + SctpServerCfg: + type: object + properties: + laddr: + type: string + description: Local (bind) IP address for eNB-facing SCTP server + lport: + type: integer + description: Local (bind) port for eNB-facing SCTP server + sockopts: + $ref: '#/components/schemas/SctpSockOptsCfg' + + SctpClientCfg: + description: > + Legacy/deprecated section kept for backwards compatibility. + MME pool entries are managed via the /mme-list endpoint. + type: object + properties: + laddr: + type: string + description: Local (bind) IP address for MME-facing SCTP connections + raddr: + type: string + description: Default remote (MME) IP address + rport: + type: integer + description: Default remote (MME) port + sockopts: + $ref: '#/components/schemas/SctpSockOptsCfg' + + PfcpCfg: + type: object + properties: + laddr: + type: string + description: Local IP address for PFCP communication + raddr: + type: string + description: Remote IP address of the UPF (PFCP peer) + + GtpuKpiCfg: + type: object + properties: + enable: + type: boolean + description: Whether GTP-U KPI reporting is enabled + table_name: + type: string + description: nftables table name for GTP-U KPI counters + interval: + type: integer + description: KPI polling interval in milliseconds + + RestCfg: + type: object + properties: + port: + type: integer + description: REST server listen port + swagger_ui: + type: boolean + description: Whether the Swagger UI is enabled + ErabList: type: array items: diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index 265c5fc..5c37bdc 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -69,6 +69,11 @@ ''' Send an HTTP DELETE request to the given endpoint (path) ''' return self.send_req('DELETE', path, data) + def config_read(self) -> RESTResponse: + ''' ConfigRead :: Get the current runtime configuration ''' + with self.send_get_req('config') as f: + return json.load(f) + def fetch_spec(self) -> RESTResponse: ''' Fetch the OpenAPI specification (JSON) ''' with self.send_get_req('swagger/spec.json') as f: @@ -161,6 +166,7 @@ class OsmoS1GWCli(cmd2.Cmd): DESC = 'Interactive CLI for OsmoS1GW' + CAT_CONFIG = 'Configuration commands' CAT_METRICS = 'Metrics commands' CAT_PFCP = 'PFCP related commands' CAT_MME = 'MME related commands' @@ -184,6 +190,17 @@ self.iface = RestIface(argv.HOST, argv.port) + @cmd2.with_category(CAT_CONFIG) + def do_config_show(self, opts) -> None: + ''' Show the current runtime configuration ''' + data = self.iface.config_read() + for section, params in data.items(): + self.poutput(f'\n[{section}]') + table = [[k, v] for k, v in params.items()] + self.poutput(tabulate.tabulate(table, + headers=['Parameter', 'Value'], + tablefmt=self.tablefmt)) + def do_fetch_openapi_spec(self, opts): ''' Fetch the OpenAPI specification (JSON), dump as text ''' spec = self.iface.fetch_spec() diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc index f9d9f50..418cd4b 100644 --- a/doc/manuals/chapters/cli.adoc +++ b/doc/manuals/chapters/cli.adoc @@ -53,6 +53,50 @@ [[cli_commands]] === Commands +==== `config_show` + +Display the effective runtime configuration (see <<rest_config>>). + +Example: + +---- +OsmoS1GW# config_show + +[gtpu_kpi] +| Parameter | Value | +|-------------|-----------| +| enable | False | +| interval | 3000 | +| table_name | osmo-s1gw | + +[pfcp] +| Parameter | Value | +|-------------|------------| +| laddr | 127.0.3.1 | +| raddr | 127.0.3.10 | + +[rest] +| Parameter | Value | +|-------------|---------| +| port | 8080 | +| swagger_ui | True | + +[sctp_client] +| Parameter | Value | +|-------------|----------------------------------------------------------| +| laddr | 127.0.2.1 | +| raddr | 127.0.2.10 | +| rport | 36412 | +| sockopts | {'recbuf': 65536, 'sctp_nodelay': True, 'sndbuf': 65536} | + +[sctp_server] +| Parameter | Value | +|-------------|----------------------------------------------------------| +| laddr | 127.0.1.1 | +| lport | 36412 | +| sockopts | {'recbuf': 65536, 'sctp_nodelay': True, 'sndbuf': 65536} | +---- + ==== `fetch_openapi_spec` Fetch the OpenAPI specification (JSON) from the server and display it. diff --git a/doc/manuals/chapters/rest.adoc b/doc/manuals/chapters/rest.adoc index e74acc2..c907ece 100644 --- a/doc/manuals/chapters/rest.adoc +++ b/doc/manuals/chapters/rest.adoc @@ -51,6 +51,72 @@ | Process ID | `pid:<x>.<y>.<z>` | `pid:0.33.1` |=== +[[rest_config]] +=== Configuration + +==== `GET /config` — Runtime Configuration + +Returns the effective runtime configuration that OsmoS1GW is currently +using, with all defaults applied. This reflects the values read via +`osmo_s1gw:get_env/2` at startup, which may differ from the raw +`sys.config` if legacy environment variables were merged in. + +Response (HTTP 200): + +---- +{ + "sctp_server": { + "laddr": "127.0.1.1", + "lport": 36412, + "sockopts": {"recbuf": 65536, "sndbuf": 65536, "sctp_nodelay": true} + }, + "sctp_client": { + "laddr": "127.0.2.1", + "raddr": "127.0.2.10", + "rport": 36412, + "sockopts": {"recbuf": 65536, "sndbuf": 65536, "sctp_nodelay": true} + }, + "pfcp": { + "laddr": "127.0.1.1", + "raddr": "127.0.1.2" + }, + "gtpu_kpi": { + "enable": false, + "table_name": "osmo-s1gw", + "interval": 3000 + }, + "rest": { + "port": 8080, + "swagger_ui": true + } +} +---- + +`sctp_server`:: Configuration of the eNB-facing SCTP server. + `laddr`::: Local bind address. + `lport`::: Local bind port. + `sockopts`::: Effective SCTP socket options, including defaults. + +`sctp_client`:: Legacy/deprecated section reflecting the MME-facing SCTP + client defaults. MME pool entries are managed via <<rest_mme>>. + `laddr`::: Local bind address. + `raddr`::: Default remote (MME) address. + `rport`::: Default remote (MME) port. + `sockopts`::: Effective SCTP socket options, including defaults. + +`pfcp`:: + `laddr`::: Local PFCP bind address. + `raddr`::: Remote UPF (PFCP peer) address. + +`gtpu_kpi`:: + `enable`::: Whether GTP-U KPI reporting via nftables counters is active. + `table_name`::: nftables table name used for GTP-U KPI counters. + `interval`::: KPI polling interval in milliseconds. + +`rest`:: + `port`::: REST server listen port. + `swagger_ui`::: Whether the Swagger UI endpoint is enabled. + [[rest_metrics]] === Metrics diff --git a/include/osmo_s1gw.hrl b/include/osmo_s1gw.hrl new file mode 100644 index 0000000..91bd2e6 --- /dev/null +++ b/include/osmo_s1gw.hrl @@ -0,0 +1,50 @@ +%% Copyright (C) 2026 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +%% Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de> +%% +%% All Rights Reserved +%% +%% SPDX-License-Identifier: AGPL-3.0-or-later +%% +%% This program is free software; you can redistribute it and/or modify +%% it under the terms of the GNU Affero General Public License as +%% published by the Free Software Foundation; either version 3 of the +%% License, or (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU Affero General Public License +%% along with this program. If not, see <https://www.gnu.org/licenses/>. +%% +%% Additional Permission under GNU AGPL version 3 section 7: +%% +%% If you modify this Program, or any covered work, by linking or +%% combining it with runtime libraries of Erlang/OTP as released by +%% Ericsson on https://www.erlang.org (or a modified version of these +%% libraries), containing parts covered by the terms of the Erlang Public +%% License (https://www.erlang.org/EPLICENSE) the licensors of this +%% Program grant you additional permission to convey the resulting work +%% without the need to license the runtime libraries of Erlang/OTP under +%% the GNU Affero General Public License. Corresponding Source for a +%% non-source form of such a combination shall include the source code +%% for the parts of the runtime libraries of Erlang/OTP used as well as +%% that of the covered work. + +%% Default values for application environment parameters (osmo_s1gw:get_env/2) + +-define(ENV_DEFAULT_S1GW_BIND_ADDR, "127.0.1.1"). +-define(ENV_DEFAULT_S1GW_BIND_PORT, 36412). +-define(ENV_DEFAULT_MME_LOC_ADDR, "127.0.2.1"). +-define(ENV_DEFAULT_MME_REM_ADDR, "127.0.2.10"). +-define(ENV_DEFAULT_MME_REM_PORT, 36412). +-define(ENV_DEFAULT_PFCP_LOC_ADDR, "127.0.1.1"). +-define(ENV_DEFAULT_PFCP_REM_ADDR, "127.0.1.2"). +-define(ENV_DEFAULT_GTPU_KPI_ENABLE, false). +-define(ENV_DEFAULT_GTPU_KPI_TABLE_NAME, "osmo-s1gw"). +-define(ENV_DEFAULT_GTPU_KPI_INTERVAL, 3000). +-define(ENV_DEFAULT_REST_SRV_PORT, 8080). +-define(ENV_DEFAULT_REST_SRV_SWAGGER_UI, true). + +%% vim:set ts=4 sw=4 et: diff --git a/priv/openapi.json b/priv/openapi.json index 87aafac..8289c02 100644 --- a/priv/openapi.json +++ b/priv/openapi.json @@ -100,6 +100,24 @@ } } }, + "/config": { + "get": { + "summary": "Get the current runtime configuration", + "operationId": "ConfigRead", + "responses": { + "200": { + "description": "Current runtime configuration", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Config" + } + } + } + } + } + } + }, "/mme-list": { "get": { "summary": "Get a list of registered MMEs", @@ -630,6 +648,123 @@ } } }, + "Config": { + "type": "object", + "properties": { + "sctp_server": { + "$ref": "#/components/schemas/SctpServerCfg" + }, + "sctp_client": { + "$ref": "#/components/schemas/SctpClientCfg" + }, + "pfcp": { + "$ref": "#/components/schemas/PfcpCfg" + }, + "gtpu_kpi": { + "$ref": "#/components/schemas/GtpuKpiCfg" + }, + "rest": { + "$ref": "#/components/schemas/RestCfg" + } + } + }, + "SctpSockOptsCfg": { + "type": "object", + "properties": { + "sctp_nodelay": { + "type": "boolean", + "description": "Disable/enable SCTP Nagle algorithm" + }, + "recbuf": { + "type": "integer", + "description": "Receive buffer size (bytes)" + }, + "sndbuf": { + "type": "integer", + "description": "Send buffer size (bytes)" + } + } + }, + "SctpServerCfg": { + "type": "object", + "properties": { + "laddr": { + "type": "string", + "description": "Local (bind) IP address for eNB-facing SCTP server" + }, + "lport": { + "type": "integer", + "description": "Local (bind) port for eNB-facing SCTP server" + }, + "sockopts": { + "$ref": "#/components/schemas/SctpSockOptsCfg" + } + } + }, + "SctpClientCfg": { + "description": "Legacy/deprecated section kept for backwards compatibility. MME pool entries are managed via the /mme-list endpoint.\n", + "type": "object", + "properties": { + "laddr": { + "type": "string", + "description": "Local (bind) IP address for MME-facing SCTP connections" + }, + "raddr": { + "type": "string", + "description": "Default remote (MME) IP address" + }, + "rport": { + "type": "integer", + "description": "Default remote (MME) port" + }, + "sockopts": { + "$ref": "#/components/schemas/SctpSockOptsCfg" + } + } + }, + "PfcpCfg": { + "type": "object", + "properties": { + "laddr": { + "type": "string", + "description": "Local IP address for PFCP communication" + }, + "raddr": { + "type": "string", + "description": "Remote IP address of the UPF (PFCP peer)" + } + } + }, + "GtpuKpiCfg": { + "type": "object", + "properties": { + "enable": { + "type": "boolean", + "description": "Whether GTP-U KPI reporting is enabled" + }, + "table_name": { + "type": "string", + "description": "nftables table name for GTP-U KPI counters" + }, + "interval": { + "type": "integer", + "description": "KPI polling interval in milliseconds" + } + } + }, + "RestCfg": { + "type": "object", + "properties": { + "port": { + "type": "integer", + "description": "REST server listen port" + }, + "swagger_ui": { + "type": "boolean", + "description": "Whether the Swagger UI is enabled" + } + } + }, "ErabList": { "type": "array", "items": { diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index 447dfc4..06174b2 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -38,21 +38,10 @@ -export([init/1, start_link/0]). +-include("osmo_s1gw.hrl"). -include("s1ap.hrl"). -define(SERVER, ?MODULE). --define(ENV_DEFAULT_S1GW_BIND_ADDR, "127.0.1.1"). --define(ENV_DEFAULT_S1GW_BIND_PORT, ?S1AP_PORT). --define(ENV_DEFAULT_MME_LOC_ADDR, "127.0.2.1"). --define(ENV_DEFAULT_MME_REM_ADDR, "127.0.2.10"). --define(ENV_DEFAULT_MME_REM_PORT, ?S1AP_PORT). --define(ENV_DEFAULT_PFCP_LOC_ADDR, "127.0.1.1"). --define(ENV_DEFAULT_PFCP_REM_ADDR, "127.0.1.2"). --define(ENV_DEFAULT_GTPU_KPI_ENABLE, false). --define(ENV_DEFAULT_GTPU_KPI_TABLE_NAME, "osmo-s1gw"). --define(ENV_DEFAULT_GTPU_KPI_INTERVAL, 3000). --define(ENV_DEFAULT_REST_SRV_PORT, 8080). --define(ENV_DEFAULT_REST_SRV_SWAGGER_UI, true). %% ------------------------------------------------------------------ %% supervisor API diff --git a/src/rest_server.erl b/src/rest_server.erl index e515445..550da3e 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -34,7 +34,8 @@ -module(rest_server). --export([metrics_list/1, +-export([config_read/1, + metrics_list/1, pfcp_assoc_state/1, pfcp_heartbeat/1, mme_list/1, @@ -52,6 +53,7 @@ -include_lib("kernel/include/logger.hrl"). +-include("osmo_s1gw.hrl"). -include("s1gw_metrics.hrl"). @@ -59,6 +61,17 @@ %% public API %% ------------------------------------------------------------------ +%% ConfigRead :: Get the current runtime configuration +config_read(#{}) -> + {200, [], #{ + <<"sctp_server">> => config_sctp_server(), + <<"sctp_client">> => config_sctp_client(), + <<"pfcp">> => config_pfcp(), + <<"gtpu_kpi">> => config_gtpu_kpi(), + <<"rest">> => config_rest() + }}. + + %% MetricsList :: Get a list of metrics metrics_list(#{query_parameters := QP}) -> L0 = case proplists:get_value(<< "type" >>, QP, << "all" >>) of @@ -221,6 +234,49 @@ %% private API %% ------------------------------------------------------------------ +-spec config_sctp_server() -> map(). +config_sctp_server() -> + Cfg = osmo_s1gw:get_env(sctp_server, #{}), + SockOptsCfg = maps:get(sockopts, Cfg, #{}), + #{<<"laddr">> => bval(maps:get(laddr, Cfg, ?ENV_DEFAULT_S1GW_BIND_ADDR)), + <<"lport">> => maps:get(lport, Cfg, ?ENV_DEFAULT_S1GW_BIND_PORT), + <<"sockopts">> => sockopts_to_map(sctp_common:gen_sockopts(SockOptsCfg))}. + + +-spec config_sctp_client() -> map(). +config_sctp_client() -> + Cfg = osmo_s1gw:get_env(sctp_client, #{}), + SockOpts = maps:get(sockopts, Cfg, []), + #{<<"laddr">> => bval(maps:get(laddr, Cfg, ?ENV_DEFAULT_MME_LOC_ADDR)), + <<"raddr">> => bval(maps:get(raddr, Cfg, ?ENV_DEFAULT_MME_REM_ADDR)), + <<"rport">> => maps:get(rport, Cfg, ?ENV_DEFAULT_MME_REM_PORT), + <<"sockopts">> => sockopts_to_map(SockOpts)}. + + +-spec config_pfcp() -> map(). +config_pfcp() -> + #{<<"laddr">> => bval(osmo_s1gw:get_env(pfcp_loc_addr, ?ENV_DEFAULT_PFCP_LOC_ADDR)), + <<"raddr">> => bval(osmo_s1gw:get_env(pfcp_rem_addr, ?ENV_DEFAULT_PFCP_REM_ADDR))}. + + +-spec config_gtpu_kpi() -> map(). +config_gtpu_kpi() -> + #{<<"enable">> => osmo_s1gw:get_env(gtpu_kpi_enable, ?ENV_DEFAULT_GTPU_KPI_ENABLE), + <<"table_name">> => bval(osmo_s1gw:get_env(gtpu_kpi_table_name, ?ENV_DEFAULT_GTPU_KPI_TABLE_NAME)), + <<"interval">> => osmo_s1gw:get_env(gtpu_kpi_interval, ?ENV_DEFAULT_GTPU_KPI_INTERVAL)}. + + +-spec config_rest() -> map(). +config_rest() -> + #{<<"port">> => osmo_s1gw:get_env(rest_srv_port, ?ENV_DEFAULT_REST_SRV_PORT), + <<"swagger_ui">> => osmo_s1gw:get_env(rest_srv_swagger_ui, ?ENV_DEFAULT_REST_SRV_SWAGGER_UI)}. + + +-spec sockopts_to_map([gen_sctp:option()]) -> map(). +sockopts_to_map(SockOpts) -> + maps:from_list([{atom_to_binary(K), V} || {K, V} <- SockOpts]). + + -spec metric_list(list()) -> [map()]. metric_list(Path) -> L = exometer:get_values(Path), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42416?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ic6c9562a541e4a0728257538887537aac6b99b97 Gerrit-Change-Number: 42416 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: [REST] Implement PfcpAssoc{Setup,Release}
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42430?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: [REST] Implement PfcpAssoc{Setup,Release} ...................................................................... [REST] Implement PfcpAssoc{Setup,Release} Change-Id: I2e24544563e4c4d23bb3d8a4a7b5434191b482d8 Related: SYS#7066 --- M contrib/osmo-s1gw-cli.py M doc/manuals/chapters/cli.adoc M src/pfcp_peer.erl M src/rest_server.erl 4 files changed, 65 insertions(+), 4 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index 51a9c4f..52d0897 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -250,12 +250,16 @@ @cmd2.with_category(CAT_PFCP) def do_pfcp_assoc_setup(self, opts) -> None: ''' Initiate the PFCP Association Setup procedure ''' - raise NotImplementedError + data = self.iface.pfcp_assoc_setup() + if not data['success']: + self.perror('PFCP Association Setup request failed: {message}'.format(**data)) @cmd2.with_category(CAT_PFCP) def do_pfcp_assoc_release(self, opts) -> None: ''' Initiate the PFCP Association Release procedure ''' - raise NotImplementedError + data = self.iface.pfcp_assoc_release() + if not data['success']: + self.perror('PFCP Association Release request failed: {message}'.format(**data)) @cmd2.with_category(CAT_PFCP) def do_pfcp_heartbeat(self, opts) -> None: diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc index 279c445..2a4951e 100644 --- a/doc/manuals/chapters/cli.adoc +++ b/doc/manuals/chapters/cli.adoc @@ -155,6 +155,14 @@ | Remote Recovery TimeStamp | 3965211123 | ---- +==== `pfcp_assoc_setup` + +Initiate the PFCP Association Setup procedure. + +==== `pfcp_assoc_release` + +Initiate the PFCP Association Release procedure. + ==== `pfcp_heartbeat` Send a PFCP Heartbeat Request to the UPF and display the result. diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl index 6308f50..aee679a 100644 --- a/src/pfcp_peer.erl +++ b/src/pfcp_peer.erl @@ -42,6 +42,8 @@ code_change/4, terminate/3]). -export([start_link/2, + assoc_setup/0, + assoc_release/0, seid_alloc/0, heartbeat_req/0, heartbeat_req/1, @@ -115,6 +117,18 @@ []). +%% Initiate the PFCP Association Setup procedure +-spec assoc_setup() -> ok | {error, term()}. +assoc_setup() -> + gen_statem:call(?MODULE, ?FUNCTION_NAME). + + +%% Initiate the PFCP Association Release procedure +-spec assoc_release() -> ok | {error, term()}. +assoc_release() -> + gen_statem:call(?MODULE, ?FUNCTION_NAME). + + %% Request to allocate a unique SEID -spec seid_alloc() -> {ok, pfcp_seid()} | {error, term()}. @@ -240,6 +254,13 @@ {keep_state, S0} end; +connecting({call, From}, assoc_setup, S) -> + %% Force retransmission of the PFCP Association Setup Request + {repeat_state, S, [{reply, From, ok}]}; + +connecting({call, From}, assoc_release, _S) -> + {keep_state_and_data, [{reply, From, {error, not_connected}}]}; + connecting(Event, EventData, S) -> handle_event(?FUNCTION_NAME, Event, EventData, S). @@ -288,6 +309,14 @@ {keep_state, S0} end; +connected({call, From}, assoc_setup, _S) -> + {keep_state_and_data, [{reply, From, {error, already_connected}}]}; + +connected({call, From}, assoc_release, S) -> + send_assoc_release(S), + {next_state, connecting, S#peer_state{rem_rts = undefined}, + [{reply, From, ok}]}; + %% Catch-all handler for this state connected(Event, EventData, S) -> handle_event(?FUNCTION_NAME, Event, EventData, S). diff --git a/src/rest_server.erl b/src/rest_server.erl index 0beaaca..76c575d 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -37,6 +37,8 @@ -export([config_read/1, metrics_list/1, pfcp_assoc_state/1, + pfcp_assoc_setup/1, + pfcp_assoc_release/1, pfcp_heartbeat/1, mme_list/1, mme_add/1, @@ -97,8 +99,26 @@ Info2 = maps:update_with(raddr, fun inet:ntoa/1, Info1), {200, [], rsp_map(Info2)}. -%% TODO: PfcpAssocSetup :: Initiate the PFCP Association Setup procedure -%% TODO: PfcpAssocRelease :: Initiate the PFCP Association Release procedure +%% PfcpAssocSetup :: Initiate the PFCP Association Setup procedure +pfcp_assoc_setup(#{}) -> + case pfcp_peer:assoc_setup() of + ok -> + {200, [], rsp_map(#{success => true})}; + {error, Error} -> + {200, [], rsp_map(#{success => false, + message => Error})} + end. + + +%% PfcpAssocRelease :: Initiate the PFCP Association Release procedure +pfcp_assoc_release(#{}) -> + case pfcp_peer:assoc_release() of + ok -> + {200, [], rsp_map(#{success => true})}; + {error, Error} -> + {200, [], rsp_map(#{success => false, + message => Error})} + end. %% PfcpHeartbeat :: Send a PFCP Heartbeat Request to the peer -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42430?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I2e24544563e4c4d23bb3d8a4a7b5434191b482d8 Gerrit-Change-Number: 42430 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: [REST] EnbItem: expose name of the selected MME
by fixeria 19 Mar '26

19 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42431?usp=email ) ( 1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: [REST] EnbItem: expose name of the selected MME ...................................................................... [REST] EnbItem: expose name of the selected MME For each eNB connection, include the name of the MME that was selected from the pool. Update the OpenAPI spec, CLI (enb_list/enb_info tables), and user manual accordingly. Change-Id: I4839275efa5d3545e84d684ad1b8b989214ef76a Related: SYS#7066, SYS#7052 --- M contrib/openapi.yaml M contrib/osmo-s1gw-cli.py M doc/manuals/chapters/cli.adoc M doc/manuals/chapters/rest.adoc M priv/openapi.json M src/rest_server.erl 6 files changed, 18 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml index d07dd21..55448f4 100644 --- a/contrib/openapi.yaml +++ b/contrib/openapi.yaml @@ -438,6 +438,9 @@ mme_sctp_aid: type: integer description: SCTP association identifier of the S1GW-MME connection + mme_name: + type: string + description: Human-readable identifier of the selected MME Config: type: object diff --git a/contrib/osmo-s1gw-cli.py b/contrib/osmo-s1gw-cli.py index 52d0897..3878708 100755 --- a/contrib/osmo-s1gw-cli.py +++ b/contrib/osmo-s1gw-cli.py @@ -406,6 +406,7 @@ 'State': item.get('state'), 'eNB addr:port (aid)': enb_addr(item) if 'enb_saddr' in item else None, 'MME addr:port (aid)': mme_addr(item) if 'mme_daddr' in item else None, + 'MME name': item.get('mme_name'), 'Uptime (s)': item.get('uptime'), '# E-RABs': item.get('erab_count'), } diff --git a/doc/manuals/chapters/cli.adoc b/doc/manuals/chapters/cli.adoc index 2a4951e..f24016b 100644 --- a/doc/manuals/chapters/cli.adoc +++ b/doc/manuals/chapters/cli.adoc @@ -285,11 +285,11 @@ ---- OsmoS1GW# enb_list -| handle | PID | Global-eNB-ID | State | eNB addr:port (aid) | MME addr:port (aid) | Uptime | E-RABs | -|----------|-----------|---------------|-----------|-------------------------|-------------------------|----------|----------| -| 0 | <0.699.0> | 001-01-0 | connected | 127.0.1.10:56767 (5706) | 127.0.2.10:36412 (5707) | 418 | 0 | -| 1 | <0.701.0> | 001-01-1 | connected | 127.0.1.10:54140 (5710) | 127.0.2.10:36412 (5711) | 33 | 3 | -| 2 | <0.703.0> | 001-01-2 | connected | 127.0.1.10:34076 (5714) | 127.0.2.10:36412 (5715) | 3600 | 20 | +| handle | PID | Global-eNB-ID | State | eNB addr:port (aid) | MME addr:port (aid) | MME name | Uptime | E-RABs | +|----------|-----------|---------------|-----------|-------------------------|-------------------------|----------|----------|----------| +| 0 | <0.699.0> | 001-01-0 | connected | 127.0.1.10:56767 (5706) | 127.0.2.10:36412 (5707) | mme0 | 418 | 0 | +| 1 | <0.701.0> | 001-01-1 | connected | 127.0.1.10:54140 (5710) | 127.0.2.10:36412 (5711) | mme0 | 33 | 3 | +| 2 | <0.703.0> | 001-01-2 | connected | 127.0.1.10:34076 (5714) | 127.0.2.10:36412 (5715) | mme0 | 3600 | 20 | ---- ==== `enb_info` @@ -323,6 +323,7 @@ | State | connected | | eNB addr:port (aid) | 127.0.1.10:57362 (5734) | | MME addr:port (aid) | 127.0.2.10:36412 (5745) | +| MME name | mme0 | | Uptime (s) | 521 | | # E-RABs | 99 | ---- diff --git a/doc/manuals/chapters/rest.adoc b/doc/manuals/chapters/rest.adoc index c907ece..7c1383b 100644 --- a/doc/manuals/chapters/rest.adoc +++ b/doc/manuals/chapters/rest.adoc @@ -258,6 +258,7 @@ "enb_saddr": "192.168.1.10", "enb_sport": 56767, "enb_sctp_aid": 5706, + "mme_name": "mme0", "mme_daddr": "192.168.2.10", "mme_dport": 36412, "mme_sport": 34500, @@ -276,6 +277,7 @@ `wait_s1setup_rsp`, or `connected`. `enb_saddr` / `enb_sport`:: Source address and port of the eNB's SCTP connection. `enb_sctp_aid`:: SCTP association ID of the eNB-S1GW connection. +`mme_name`:: Name of the selected MME (from the MME pool). `mme_daddr` / `mme_dport`:: Destination address and port of the MME. `mme_sport`:: Local source port of the S1GW-MME SCTP connection. `mme_sctp_aid`:: SCTP association ID of the S1GW-MME connection. diff --git a/priv/openapi.json b/priv/openapi.json index cab9fc0..59c9676 100644 --- a/priv/openapi.json +++ b/priv/openapi.json @@ -645,6 +645,10 @@ "mme_sctp_aid": { "type": "integer", "description": "SCTP association identifier of the S1GW-MME connection" + }, + "mme_name": { + "type": "string", + "description": "Human-readable identifier of the selected MME" } } }, diff --git a/src/rest_server.erl b/src/rest_server.erl index 76c575d..3b14b86 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -471,7 +471,8 @@ -spec enb_item_add_mme_info(map(), enb_registry:enb_info()) -> map(). enb_item_add_mme_info(M0, #{mme_info := MmeInfo}) -> - M0#{mme_daddr => inet:ntoa(maps:get(raddr, MmeInfo)), + M0#{mme_name => maps:get(name, MmeInfo), + mme_daddr => inet:ntoa(maps:get(raddr, MmeInfo)), mme_dport => maps:get(rport, MmeInfo) }; -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42431?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I4839275efa5d3545e84d684ad1b8b989214ef76a Gerrit-Change-Number: 42431 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.