Projects
osmocom:nightly
osmo-hnbgw
Log In
Username
Password
Error getting diff: tar:
×
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 365
View file
osmo-hnbgw.spec
Changed
@@ -17,14 +17,14 @@ %define _lto_cflags %{nil} Name: osmo-hnbgw -Requires: osmocom-nightly = 202306220026 -Version: 1.4.0.86.ee1a.202306220026 +Requires: osmocom-nightly = 202306230026 +Version: 1.4.0.105.3a084.202306230026 Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Hardware/Mobile URL: https://osmocom.org/projects/osmohnbgw -Source: osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz +Source: osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2 @@ -96,6 +96,7 @@ %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw.cfg %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg +%{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg %dir %{_sysconfdir}/osmocom %config(noreplace) %{_sysconfdir}/osmocom/osmo-hnbgw.cfg %{_unitdir}/%{name}.service
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.dsc -> osmo-hnbgw_1.4.0.105.3a084.202306230026.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hnbgw Binary: osmo-hnbgw, osmo-hnbgw-dbg, osmo-hnbgw-doc Architecture: any all -Version: 1.4.0.86.ee1a.202306220026 +Version: 1.4.0.105.3a084.202306230026 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hnbgw Standards-Version: 3.9.8 @@ -14,8 +14,8 @@ osmo-hnbgw-dbg deb debug extra arch=any osmo-hnbgw-doc deb doc optional arch=all Checksums-Sha1: - 85589e157d32eed0cec8baafe6e716e844991de8 88116 osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz + 1e49f8a3f1b016bcdcd6771bae08da2c31991e2e 96972 osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz Checksums-Sha256: - e4d26ec6d8438d7c7227ec87845ca3f0ea15c8fc5b380fc1fde2c3efef36d911 88116 osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz + 23404ff06b3c4213d3af00b834e7a2c15268a72f5125611ee6f13174de005c24 96972 osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz Files: - 558d2aea9867af43423487e6c54c2b1f 88116 osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz + a42c3b466c004e6781b99461b8acc436 96972 osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/.tarball-version -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.4.0.86-ee1a.202306220026 +1.4.0.105-3a084.202306230026
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/TODO-RELEASE -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/TODO-RELEASE
Changed
@@ -12,3 +12,4 @@ Uses osmo_scu_prim_hdr_name_c() libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty(), mgcp_client_conf_alloc() libosmo-sigtran >1.7.0 Require presence of vty 'cs7 instance'/'sccp max-optional-data' that the deprecated+fatal 'hnbgw'/'sccp cr...' tells the user to use instead. +libosmo-ranap >1.4.0 ranap_new_msg_reset2()
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/contrib/osmo-hnbgw.spec.in -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/contrib/osmo-hnbgw.spec.in
Changed
@@ -17,7 +17,7 @@ %define _lto_cflags %{nil} Name: osmo-hnbgw -Requires: osmocom-nightly = 202306220026 +Requires: osmocom-nightly = 202306230026 Version: @VERSION@ Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks @@ -95,6 +95,7 @@ %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw.cfg %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg %{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg +%{_docdir}/%{name}/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg %dir %{_sysconfdir}/osmocom %config(noreplace) %{_sysconfdir}/osmocom/osmo-hnbgw.cfg %{_unitdir}/%{name}.service
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/debian/changelog -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.4.0.86.ee1a.202306220026) unstable; urgency=medium +osmo-hnbgw (1.4.0.105.3a084.202306230026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Thu, 22 Jun 2023 00:26:42 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 23 Jun 2023 00:26:47 +0000 osmo-hnbgw (1.4.0) unstable; urgency=medium
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/debian/control -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/debian/control
Changed
@@ -31,7 +31,7 @@ Package: osmo-hnbgw Architecture: any Multi-Arch: foreign -Depends: osmocom-nightly (= 202306220026), ${misc:Depends}, ${shlibs:Depends} +Depends: osmocom-nightly (= 202306230026), ${misc:Depends}, ${shlibs:Depends} Recommends: osmo-mgw Description: OsmoHNBGW: Osmocom Home Node B Gateway @@ -39,14 +39,14 @@ Section: debug Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 202306220026), osmo-hnbgw (= ${binary:Version}), ${misc:Depends} +Depends: osmocom-nightly (= 202306230026), osmo-hnbgw (= ${binary:Version}), ${misc:Depends} Description: OsmoHNBGW: Osmocom Home Node B Gateway Package: osmo-hnbgw-doc Architecture: all Section: doc Priority: optional -Depends: osmocom-nightly (= 202306220026), ${misc:Depends} +Depends: osmocom-nightly (= 202306230026), ${misc:Depends} Description: ${misc:Package} PDF documentation Various manuals: user manual, VTY reference manual and/or protocol/interface manuals.
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/debian/osmo-hnbgw.install -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/debian/osmo-hnbgw.install
Changed
@@ -4,3 +4,4 @@ usr/share/doc/osmo-hnbgw/examples/osmo-hnbgw/osmo-hnbgw.cfg usr/share/doc/osmo-hnbgw/examples usr/share/doc/osmo-hnbgw/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg usr/share/doc/osmo-hnbgw/examples usr/share/doc/osmo-hnbgw/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg usr/share/doc/osmo-hnbgw/examples +usr/share/doc/osmo-hnbgw/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg usr/share/doc/osmo-hnbgw/examples
View file
osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg
Added
@@ -0,0 +1,40 @@ +log stderr + logging filter all 1 + logging color 1 + logging print level 1 + logging print category 1 + logging print category-hex 0 + logging print file basename last + logging print extended-timestamp 1 + logging level set-all notice + +cs7 instance 0 + point-code 0.42.0 + + sccp-address my-msc-0 + point-code 0.1.0 + sccp-address my-msc-1 + point-code 0.1.1 + sccp-address my-sgsn-0 + point-code 0.2.0 + +hnbgw + plmn 001 01 + iucs + nri bitlen 10 + nri null add 0 7 + iups + nri bitlen 8 + nri null add 0 5 + +msc 0 + remote-addr my-msc-0 + nri add 128 255 + +msc 1 + remote-addr my-msc-1 + nri add 256 511 + +sgsn 0 + remote-addr my-sgsn-0 + nri add 128 255
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw-cs7.cfg
Changed
@@ -10,6 +10,7 @@ point-code 1.4.2 hnbgw + plmn 001 01 iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg
Changed
@@ -8,6 +8,7 @@ logging print extended-timestamp 1 logging level set-all notice hnbgw + plmn 001 01 iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/doc/examples/osmo-hnbgw/osmo-hnbgw.cfg
Changed
@@ -8,6 +8,7 @@ logging print extended-timestamp 1 logging level set-all notice hnbgw + plmn 001 01 iuh local-ip 0.0.0.0 hnbap-allow-tmsi 1
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/include/osmocom/hnbgw/context_map.h -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/include/osmocom/hnbgw/context_map.h
Changed
@@ -3,12 +3,20 @@ #include <stdint.h> #include <osmocom/core/linuxlist.h> #include <osmocom/hnbgw/hnbgw.h> +#include <osmocom/gsm/gsm48.h> #define LOG_MAP(HNB_CTX_MAP, SUBSYS, LEVEL, FMT, ARGS...) \ LOGHNB((HNB_CTX_MAP) ? (HNB_CTX_MAP)->hnb_ctx : NULL, \ - SUBSYS, LEVEL, "RUA-%u %s: " FMT, \ + SUBSYS, LEVEL, "RUA-%u SCCP-%u %s MI=%s%s%s: " FMT, \ (HNB_CTX_MAP) ? (HNB_CTX_MAP)->rua_ctx_id : 0, \ - (HNB_CTX_MAP) ? ((HNB_CTX_MAP)->is_ps ? "PS" : "CS") : "NULL", \ + (HNB_CTX_MAP) ? (HNB_CTX_MAP)->scu_conn_id : 0, \ + (HNB_CTX_MAP) ? \ + ((HNB_CTX_MAP)->cnlink ? (HNB_CTX_MAP)->cnlink->name \ + : ((HNB_CTX_MAP)->is_ps ? "PS" : "CS")) \ + : "NULL", \ + (HNB_CTX_MAP) ? osmo_mobile_identity_to_str_c(OTC_SELECT, &(HNB_CTX_MAP)->l3.mi) : "null", \ + (HNB_CTX_MAP) && (HNB_CTX_MAP)->l3.from_other_plmn ? " (from other PLMN)" : "", \ + (HNB_CTX_MAP) && (HNB_CTX_MAP)->l3.is_emerg ? " EMERGENCY" : "", \ ##ARGS) /* All these events' data argument may either be NULL, or point to a RANAP msgb. @@ -58,6 +66,9 @@ /* The human admin asks to drop the current SCCP connection, by telnet VTY 'apply sccp' in presence of SCCP * config changes. */ MAP_SCCP_EV_USER_ABORT, + /* The CN link can no longer work, for example a RANAP RESET was received from the cnlink that hosts this + * context map. */ + MAP_SCCP_EV_CN_LINK_LOST, }; /* For context_map_get_state(), to combine the RUA and SCCP states, for VTY reporting only. */ @@ -75,6 +86,21 @@ struct hnb_context; struct hnbgw_cnlink; +struct hnbgw_l3_peek { + /* L3 message type, like GSM48_PDISC_MM+GSM48_MT_MM_LOC_UPD_REQUEST... / GSM48_PDISC_MM_GPRS+GSM48_MT_GMM_ATTACH_REQ... */ + uint8_t gsm48_pdisc; + uint8_t gsm48_msg_type; + /* The Mobile Identity from MM and GMM messages */ + struct osmo_mobile_identity mi; + /* On PS, the "TMSI Based NRI Container", 10 bit integer, or -1 if not present. + * This is only for PS -- for CS, the NRI is in the TMSI obtained from 'mi' above. */ + int gmm_nri_container; + /* For a CM Service Request for voice call, true if this is for an Emergency Call, false otherwise. */ + bool is_emerg; + /* True if the NAS PDU indicates that the UE was previously attached to a different PLMN than the local PLMN. */ + bool from_other_plmn; +}; + struct hnbgw_context_map { /* entry in the per-CN list of mappings */ struct llist_head hnbgw_cnlink_entry; @@ -103,6 +129,9 @@ /* False for CS, true for PS */ bool is_ps; + /* Information extracted from RUA Connect's RANAP InitialUE message */ + struct hnbgw_l3_peek l3; + /* When an FSM is asked to disconnect but must still wait for a response, it may set this flag, to continue to * disconnect once the response is in. In particular, when SCCP is asked to disconnect after an SCCP Connection * Request was already sent and while waiting for a Connection Confirmed, we should still wait for the SCCP CC @@ -160,6 +189,7 @@ bool map_rua_is_active(struct hnbgw_context_map *map); bool map_sccp_is_active(struct hnbgw_context_map *map); +void context_map_cnlink_lost(struct hnbgw_context_map *map); void context_map_free(struct hnbgw_context_map *map); unsigned int msg_has_l2_data(const struct msgb *msg);
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/include/osmocom/hnbgw/hnbgw.h -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/include/osmocom/hnbgw/hnbgw.h
Changed
@@ -5,6 +5,8 @@ #include <osmocom/core/hashtable.h> #include <osmocom/core/write_queue.h> #include <osmocom/core/timer.h> +#include <osmocom/core/rate_ctr.h> +#include <osmocom/gsm/gsm23003.h> #include <osmocom/sigtran/sccp_sap.h> #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/ctrl/control_if.h> @@ -35,6 +37,12 @@ #define DOMAIN_CS RANAP_CN_DomainIndicator_cs_domain #define DOMAIN_PS RANAP_CN_DomainIndicator_ps_domain +extern const struct value_string ranap_domain_names; +static inline const char *ranap_domain_name(RANAP_CN_DomainIndicator_t domain) +{ + return get_value_string(ranap_domain_names, domain); +} + enum hnb_ctrl_node { CTRL_NODE_HNB = _LAST_CTRL_NODE, _LAST_CTRL_NODE_HNB @@ -70,6 +78,7 @@ uint16_t sac; /*!< Service Area Code */ uint32_t cid; /*!< Cell ID */ }; +const char *umts_cell_id_name(const struct umts_cell_id *ucid); struct hnbgw_context_map; @@ -135,6 +144,12 @@ /* Emergency calls potentially select a different set of MSCs, so to not mess up the normal round-robin * behavior, emergency calls need a separate round-robin counter. */ unsigned int round_robin_next_emerg_nr; + + /* rate counter group that child hnbgw_cnlinks should use (points to msc_ctrg_desc or sgsn_ctrg_desc) */ + const struct rate_ctr_group_desc *cnlink_ctrg_desc; + + /* Running counters for this pool */ + struct rate_ctr_group *ctrs; }; /* A CN peer, like 'msc 0' or 'sgsn 23' */ @@ -144,6 +159,8 @@ /* backpointer to CS or PS CN pool. */ struct hnbgw_cnpool *pool; + struct osmo_fsm_inst *fi; + int nr; struct hnbgw_cnlink_cfg vty; @@ -164,6 +181,9 @@ bool allow_attach; bool allow_emerg; + struct llist_head paging; + + struct rate_ctr_group *ctrs; }; #define LOG_CNLINK(CNLINK, SUBSYS, LEVEL, FMT, ARGS...) \ @@ -234,6 +254,7 @@ /*! The UDP port where we receive multiplexed CS user * plane traffic from HNBs */ uint16_t iuh_cs_mux_port; + struct osmo_plmn_id plmn; uint16_t rnc_id; bool hnbap_allow_tmsi; /*! print hnb-id (true) or MCC-MNC-LAC-RAC-SAC (false) in logs */ @@ -312,3 +333,5 @@ } struct msgb *hnbgw_ranap_msg_alloc(const char *name); + +int hnbgw_peek_l3(struct hnbgw_context_map *map, struct msgb *ranap_msg);
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/include/osmocom/hnbgw/hnbgw_cn.h -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/include/osmocom/hnbgw/hnbgw_cn.h
Changed
@@ -1,7 +1,9 @@ #pragma once +#include <osmocom/core/rate_ctr.h> #include <osmocom/hnbgw/hnbgw.h> +struct hnbgw_cnlink *cnlink_alloc(struct hnbgw_cnpool *cnpool, int nr); struct hnbgw_cnlink *hnbgw_cnlink_find_by_addr(const struct hnbgw_sccp_user *hsu, const struct osmo_sccp_addr *remote_addr); struct hnbgw_cnlink *hnbgw_cnlink_select(struct hnbgw_context_map *map); @@ -13,3 +15,39 @@ char *cnlink_sccp_addr_to_str(struct hnbgw_cnlink *cnlink, const struct osmo_sccp_addr *addr); +bool cnlink_is_conn_ready(const struct hnbgw_cnlink *cnlink); +void cnlink_rx_reset_cmd(struct hnbgw_cnlink *cnlink); +void cnlink_rx_reset_ack(struct hnbgw_cnlink *cnlink); +void cnlink_resend_reset(struct hnbgw_cnlink *cnlink); +void cnlink_set_disconnected(struct hnbgw_cnlink *cnlink); + +enum hnbgw_cnpool_ctr { + /* TODO: basic counters completely missing + * ... + */ + + /* Counters related to link selection from a CN pool. */ + CNPOOL_CTR_SUBSCR_NO_CNLINK, + CNPOOL_CTR_EMERG_FORWARDED, + CNPOOL_CTR_EMERG_LOST, +}; + +extern const struct rate_ctr_group_desc iucs_ctrg_desc; +extern const struct rate_ctr_group_desc iups_ctrg_desc; + +enum hnbgw_cnlink_ctr { + /* TODO: basic counters completely missing + * ... + */ + + /* Counters related to link selection from a CN pool. */ + CNLINK_CTR_CNPOOL_SUBSCR_NEW, + CNLINK_CTR_CNPOOL_SUBSCR_REATTACH, + CNLINK_CTR_CNPOOL_SUBSCR_KNOWN, + CNLINK_CTR_CNPOOL_SUBSCR_PAGED, + CNLINK_CTR_CNPOOL_SUBSCR_ATTACH_LOST, + CNLINK_CTR_CNPOOL_EMERG_FORWARDED, +}; + +extern const struct rate_ctr_group_desc msc_ctrg_desc; +extern const struct rate_ctr_group_desc sgsn_ctrg_desc;
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/Makefile.am -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/Makefile.am
Changed
@@ -33,6 +33,7 @@ libhnbgw_la_SOURCES = \ hnbgw.c \ hnbgw_hnbap.c \ + hnbgw_l3.c \ hnbgw_rua.c \ hnbgw_ranap.c \ hnbgw_vty.c \ @@ -40,6 +41,7 @@ context_map_rua.c \ context_map_sccp.c \ hnbgw_cn.c \ + cnlink.c \ ranap_rab_ass.c \ mgw_fsm.c \ tdefs.c \
View file
osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/cnlink.c
Added
@@ -0,0 +1,374 @@ +/* (C) 2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * 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 Affero 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 <http://www.gnu.org/licenses/>. + * + */ + +#include <osmocom/core/fsm.h> +#include <osmocom/core/tdef.h> + +#include <osmocom/gsm/gsm23236.h> + +#include <osmocom/sigtran/sccp_helpers.h> + +#include <asn1c/asn1helpers.h> +#include <osmocom/ranap/ranap_ies_defs.h> +#include <osmocom/ranap/ranap_msg_factory.h> + +#include <osmocom/hnbgw/hnbgw.h> +#include <osmocom/hnbgw/hnbgw_cn.h> +#include <osmocom/hnbgw/tdefs.h> +#include <osmocom/hnbgw/context_map.h> + +static struct osmo_fsm cnlink_fsm; + +enum cnlink_fsm_state { + CNLINK_ST_DISC, + CNLINK_ST_CONN, +}; + +enum cnlink_fsm_event { + CNLINK_EV_RX_RESET, + CNLINK_EV_RX_RESET_ACK, +}; + +static const struct value_string cnlink_fsm_event_names = { + OSMO_VALUE_STRING(CNLINK_EV_RX_RESET), + OSMO_VALUE_STRING(CNLINK_EV_RX_RESET_ACK), + {} +}; + +static const struct osmo_tdef_state_timeout cnlink_timeouts32 = { + CNLINK_ST_DISC = { .T = 4 }, +}; + +#define cnlink_fsm_state_chg(FI, STATE) \ + osmo_tdef_fsm_inst_state_chg(FI, STATE, \ + cnlink_timeouts, \ + hnbgw_T_defs, \ + -1) + +struct hnbgw_cnlink *cnlink_alloc(struct hnbgw_cnpool *cnpool, int nr) +{ + struct osmo_fsm_inst *fi; + struct hnbgw_cnlink *cnlink; + + char *name = talloc_asprintf(OTC_SELECT, "%s-%d", cnpool->peer_name, nr); + + fi = osmo_fsm_inst_alloc(&cnlink_fsm, g_hnbgw, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(fi); + cnlink = talloc_zero(g_hnbgw, struct hnbgw_cnlink); + fi->priv = cnlink; + + *cnlink = (struct hnbgw_cnlink){ + .name = name, + .pool = cnpool, + .fi = fi, + .nr = nr, + .vty = { + /* VTY config defaults for the new cnlink */ + .nri_ranges = osmo_nri_ranges_alloc(cnlink), + }, + .allow_attach = true, + .ctrs = rate_ctr_group_alloc(g_hnbgw, cnpool->cnlink_ctrg_desc, nr), + }; + talloc_steal(cnlink, name); + INIT_LLIST_HEAD(&cnlink->map_list); + INIT_LLIST_HEAD(&cnlink->paging); + + llist_add_tail(&cnlink->entry, &cnpool->cnlinks); + LOG_CNLINK(cnlink, DCN, LOGL_DEBUG, "allocated\n"); + + /* Immediately (1ms) kick off reset sending mechanism */ + osmo_fsm_inst_state_chg_ms(fi, CNLINK_ST_DISC, 1, 0); + return cnlink; +} + +void cnlink_term_and_free(struct hnbgw_cnlink *cnlink) +{ + if (!cnlink) + return; + osmo_fsm_inst_term(cnlink->fi, OSMO_FSM_TERM_REQUEST, NULL); + talloc_free(cnlink); +} + +static void link_up(struct hnbgw_cnlink *cnlink) +{ + LOGPFSML(cnlink->fi, LOGL_NOTICE, "link up\n"); +} + +static void link_lost(struct hnbgw_cnlink *cnlink) +{ + struct hnbgw_context_map *map, *map2; + + LOGPFSML(cnlink->fi, LOGL_NOTICE, "link lost\n"); + + llist_for_each_entry_safe(map, map2, &cnlink->map_list, hnbgw_cnlink_entry) + context_map_cnlink_lost(map); +} + +static void tx_reset(struct hnbgw_cnlink *cnlink) +{ + struct msgb *msg; + RANAP_Cause_t cause = { + .present = RANAP_Cause_PR_transmissionNetwork, + .choice. transmissionNetwork = RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure, + }; + RANAP_GlobalRNC_ID_t grnc_id; + RANAP_GlobalRNC_ID_t *use_grnc_id = NULL; + uint8_t plmn_buf3; + + if (!cnlink) + return; + + /* We need to have chosen an SCCP instance, and the remote SCCP address needs to be set. + * Only check the remote_addr, allowing use.remote_addr_name to be NULL: if the user has not set an explicit + * remote address book entry, auto-configuration may still have chosen a default remote point-code. */ + if (!cnlink->hnbgw_sccp_user + || !osmo_sccp_check_addr(&cnlink->remote_addr, OSMO_SCCP_ADDR_T_PC | OSMO_SCCP_ADDR_T_SSN)) { + LOG_CNLINK(cnlink, DRANAP, LOGL_DEBUG, "not yet configured, not sending RANAP RESET\n"); + return; + } + + LOG_CNLINK(cnlink, DRANAP, LOGL_DEBUG, "Tx RANAP RESET to %s %s\n", + cnlink_is_cs(cnlink) ? "IuCS" : "IuPS", + cnlink_sccp_addr_to_str(cnlink, &cnlink->remote_addr)); + + if (g_hnbgw->config.plmn.mcc) { + osmo_plmn_to_bcd(plmn_buf, &g_hnbgw->config.plmn); + grnc_id = (RANAP_GlobalRNC_ID_t){ + .pLMNidentity = { + .buf = plmn_buf, + .size = 3, + }, + .rNC_ID = g_hnbgw->config.rnc_id, + }; + use_grnc_id = &grnc_id; + } else { + /* If no PLMN is configured, omit the Global RNC Id from the RESET message. + * + * According to 3GPP TS 25.413 8.26.2.2, "The RNC shall include the Global RNC-ID IE in the RESET + * message", so it should be considered a mandatory IE when coming from us, the RNC. + * + * But osmo-hnbgw < v1.5 worked well with osmo-hnbgw.cfg files that have no PLMN configured, and we are + * trying to stay backwards compatible for those users. Such a site should still work, but they should + * now see these error logs and can adjust the config. + */ + LOG_CNLINK(cnlink, DRANAP, LOGL_ERROR, + "No local PLMN is configured, so outgoing RESET messages omit the mandatory Global RNC-ID" + " IE. You should set a 'hnbgw' / 'plmn' in your config file (since v1.5)\n"); + } + + msg = ranap_new_msg_reset2(cnlink->pool->domain, &cause, use_grnc_id); + + osmo_sccp_tx_unitdata_msg(cnlink->hnbgw_sccp_user->sccp_user, + &cnlink->hnbgw_sccp_user->local_addr, + &cnlink->remote_addr, + msg); +} + +static void tx_reset_ack(struct hnbgw_cnlink *cnlink) +{ + struct msgb *msg; + struct osmo_sccp_instance *sccp = cnlink_sccp(cnlink); + RANAP_GlobalRNC_ID_t grnc_id; + RANAP_GlobalRNC_ID_t *use_grnc_id = NULL; + uint8_t plmn_buf3; + + if (!sccp) { + LOG_CNLINK(cnlink, DRANAP, LOGL_ERROR, "cannot send RANAP RESET ACK: no CN link\n"); + return; + } + + LOG_CNLINK(cnlink, DRANAP, LOGL_NOTICE, "Tx RANAP RESET ACK %s %s --> %s\n", + cnlink_is_cs(cnlink) ? "IuCS" : "IuPS", + cnlink_sccp_addr_to_str(cnlink, &cnlink->hnbgw_sccp_user->local_addr),
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/context_map.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/context_map.c
Changed
@@ -26,6 +26,8 @@ #include <osmocom/core/timer.h> +#include <osmocom/netif/stream.h> + #include <osmocom/sigtran/sccp_helpers.h> #include <osmocom/hnbgw/hnbgw_cn.h> @@ -92,7 +94,7 @@ llist_add_tail(&map->hnb_list, &hnb->map_list); - LOG_MAP(map, DRUA, LOGL_INFO, "New RUA CTX\n"); + LOG_MAP(map, DRUA, LOGL_DEBUG, "New RUA CTX\n"); return map; } @@ -123,8 +125,18 @@ hash_add(hsu->hnbgw_context_map_by_conn_id, &map->hnbgw_sccp_user_entry, new_scu_conn_id); - LOG_MAP(map, DMAIN, LOGL_INFO, "Creating new Mapping RUA CTX %u <-> SCU Conn ID %u to %s on %s\n", - map->rua_ctx_id, new_scu_conn_id, cnlink_selected->name, hsu->name); + LOGP(DRUA, LOGL_NOTICE, "New conn: %s '%s' RUA-%u <-> SCCP-%u %s%s%s %s l=%s<->r=%s\n", + osmo_sock_get_name2_c(OTC_SELECT, osmo_stream_srv_get_ofd(map->hnb_ctx->conn)->fd), + hnb_context_name(map->hnb_ctx), map->rua_ctx_id, + new_scu_conn_id, + cnlink_selected->name, + cnlink_selected->use.remote_addr_name ? " " : "", + cnlink_selected->use.remote_addr_name ? : "", + hsu->name, + /* printing the entire SCCP address is quite long, rather just print the point-code */ + osmo_ss7_pointcode_print(hsu->ss7, hsu->local_addr.pc), + osmo_ss7_pointcode_print2(hsu->ss7, cnlink_selected->remote_addr.pc) + ); return 0; } @@ -172,6 +184,11 @@ map_rua_dispatch(map, MAP_RUA_EV_HNB_LINK_LOST, NULL); } +void context_map_cnlink_lost(struct hnbgw_context_map *map) +{ + map_sccp_dispatch(map, MAP_SCCP_EV_RAN_LINK_LOST, NULL); +} + void context_map_free(struct hnbgw_context_map *map) { /* guard against FSM termination infinitely looping back here */
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/context_map_rua.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/context_map_rua.c
Changed
@@ -262,6 +262,7 @@ .present = RUA_Cause_PR_radioNetwork, .choice.radioNetwork = RUA_CauseRadioNetwork_network_release, }; + LOGPFSML(fi, LOGL_INFO, "Tx RUA Disconnect\n"); if (rua_tx_disc(map->hnb_ctx, map->is_ps, map->rua_ctx_id, &rua_cause, NULL, 0)) LOGPFSML(fi, LOGL_ERROR, "Failed to send Disconnect to RUA\n"); }
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/context_map_sccp.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/context_map_sccp.c
Changed
@@ -55,6 +55,7 @@ OSMO_VALUE_STRING(MAP_SCCP_EV_RAN_LINK_LOST), OSMO_VALUE_STRING(MAP_SCCP_EV_RX_RELEASED), OSMO_VALUE_STRING(MAP_SCCP_EV_USER_ABORT), + OSMO_VALUE_STRING(MAP_SCCP_EV_CN_LINK_LOST), {} }; @@ -81,7 +82,8 @@ struct osmo_fsm_inst *fi = osmo_fsm_inst_alloc(&map_sccp_fsm, map, map, LOGL_DEBUG, NULL); OSMO_ASSERT(fi); osmo_fsm_inst_update_id_f_sanitize(fi, '-', "%s-%s-SCCP-%u", hnb_context_name(map->hnb_ctx), - map->is_ps ? "PS" : "CS", map->scu_conn_id); + map->cnlink ? map->cnlink->name : (map->is_ps ? "PS" : "CS"), + map->scu_conn_id); OSMO_ASSERT(map->sccp_fi == NULL); map->sccp_fi = fi; @@ -283,6 +285,7 @@ case MAP_SCCP_EV_RAN_LINK_LOST: case MAP_SCCP_EV_RAN_DISC: case MAP_SCCP_EV_USER_ABORT: + case MAP_SCCP_EV_CN_LINK_LOST: /* No CR has been sent yet, just go to disconnected state. */ if (msg_has_l2_data(ranap_msg)) LOG_MAP(map, DLSCCP, LOGL_ERROR, "SCCP not connected, cannot dispatch RANAP message\n"); @@ -320,6 +323,7 @@ case MAP_SCCP_EV_RAN_LINK_LOST: case MAP_SCCP_EV_RAN_DISC: case MAP_SCCP_EV_USER_ABORT: + case MAP_SCCP_EV_CN_LINK_LOST: /* RUA connection was terminated. First wait for the CC before releasing the SCCP conn. */ if (msg_has_l2_data(ranap_msg)) LOGPFSML(fi, LOGL_ERROR, "Connection not yet confirmed, cannot forward RANAP to CN\n"); @@ -378,6 +382,8 @@ * Disconnect on the SCCP layer, ungracefully. */ case MAP_SCCP_EV_USER_ABORT: /* The user is asking for disconnection, so there is no Iu Release in progress. Disconnect now. */ + case MAP_SCCP_EV_CN_LINK_LOST: + /* The CN peer has sent a RANAP RESET, so the old link that this map ran on is lost */ /* There won't be any ranap_msg, but if a caller wants to dispatch a msg, forward it before * disconnecting. */ @@ -447,6 +453,7 @@ return; case MAP_SCCP_EV_USER_ABORT: + case MAP_SCCP_EV_CN_LINK_LOST: /* Stop waiting for RLSD, send RLSD now. */ tx_sccp_rlsd(fi); map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED); @@ -524,6 +531,7 @@ | S(MAP_SCCP_EV_RAN_LINK_LOST) | S(MAP_SCCP_EV_RX_RELEASED) | S(MAP_SCCP_EV_USER_ABORT) + | S(MAP_SCCP_EV_CN_LINK_LOST) , .out_state_mask = 0 | S(MAP_SCCP_ST_INIT) @@ -541,6 +549,7 @@ | S(MAP_SCCP_EV_RAN_LINK_LOST) | S(MAP_SCCP_EV_RX_RELEASED) | S(MAP_SCCP_EV_USER_ABORT) + | S(MAP_SCCP_EV_CN_LINK_LOST) , .out_state_mask = 0 | S(MAP_SCCP_ST_CONNECTED) @@ -558,6 +567,7 @@ | S(MAP_SCCP_EV_RX_RELEASED) | S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM) | S(MAP_SCCP_EV_USER_ABORT) + | S(MAP_SCCP_EV_CN_LINK_LOST) , .out_state_mask = 0 | S(MAP_SCCP_ST_WAIT_RLSD) @@ -576,6 +586,7 @@ | S(MAP_SCCP_EV_RAN_LINK_LOST) | S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM) | S(MAP_SCCP_EV_USER_ABORT) + | S(MAP_SCCP_EV_CN_LINK_LOST) , .out_state_mask = 0 | S(MAP_SCCP_ST_DISCONNECTED) @@ -590,6 +601,7 @@ | S(MAP_SCCP_EV_RAN_DISC) | S(MAP_SCCP_EV_RAN_LINK_LOST) | S(MAP_SCCP_EV_USER_ABORT) + | S(MAP_SCCP_EV_CN_LINK_LOST) , .onenter = map_sccp_disconnected_onenter, .action = map_sccp_disconnected_action,
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/hnbgw.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw.c
Changed
@@ -36,10 +36,17 @@ #include <osmocom/hnbgw/hnbgw.h> #include <osmocom/hnbgw/hnbgw_hnbap.h> #include <osmocom/hnbgw/hnbgw_rua.h> +#include <osmocom/hnbgw/hnbgw_cn.h> #include <osmocom/hnbgw/context_map.h> struct hnbgw *g_hnbgw = NULL; +const struct value_string ranap_domain_names = { + { DOMAIN_CS, "CS" }, + { DOMAIN_PS, "PS" }, + {} +}; + void g_hnbgw_alloc(void *ctx) { OSMO_ASSERT(!g_hnbgw); @@ -50,6 +57,9 @@ g_hnbgw->config.iuh_local_port = IUH_DEFAULT_SCTP_PORT; g_hnbgw->config.log_prefix_hnb_id = true; + /* Set zero PLMN to detect a missing PLMN when transmitting RESET */ + g_hnbgw->config.plmn = (struct osmo_plmn_id){ 0, 0, false }; + g_hnbgw->next_ue_ctx_id = 23; INIT_LLIST_HEAD(&g_hnbgw->hnb_list); INIT_LLIST_HEAD(&g_hnbgw->ue_list); @@ -71,6 +81,9 @@ .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), }, + .cnlink_ctrg_desc = &msc_ctrg_desc, + + .ctrs = rate_ctr_group_alloc(g_hnbgw, &iucs_ctrg_desc, 0), }; INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iucs.cnlinks); @@ -83,6 +96,9 @@ .nri_bitlen = OSMO_NRI_BITLEN_DEFAULT, .null_nri_ranges = osmo_nri_ranges_alloc(g_hnbgw), }, + .cnlink_ctrg_desc = &sgsn_ctrg_desc, + + .ctrs = rate_ctr_group_alloc(g_hnbgw, &iups_ctrg_desc, 0), }; INIT_LLIST_HEAD(&g_hnbgw->sccp.cnpool_iups.cnlinks); } @@ -335,23 +351,37 @@ return ctx; } -static const char *umts_cell_id_name(const struct umts_cell_id *ucid) +const char *umts_cell_id_name(const struct umts_cell_id *ucid) { - static __thread char buf40; - - snprintf(buf, sizeof(buf), "%u-%u-L%u-R%u-S%u", ucid->mcc, ucid->mnc, ucid->lac, ucid->rac, ucid->sac); - return buf; + return talloc_asprintf(OTC_SELECT, "%u-%u-L%u-R%u-S%u-C%u", ucid->mcc, ucid->mnc, ucid->lac, ucid->rac, + ucid->sac, ucid->cid); } const char *hnb_context_name(struct hnb_context *ctx) { + char *result; if (!ctx) return "NULL"; + if (ctx->conn) { + char hostbuf_rINET6_ADDRSTRLEN; + char portbuf_r6; + int fd = osmo_stream_srv_get_ofd(ctx->conn)->fd; + + /* get remote addr */ + if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), portbuf_r, sizeof(portbuf_r), false) == 0) + result = talloc_asprintf(OTC_SELECT, "%s:%s", hostbuf_r, portbuf_r); + else + result = "?"; + } else { + result = "disconnected"; + } + if (g_hnbgw->config.log_prefix_hnb_id) - return ctx->identity_info; + result = talloc_asprintf(OTC_SELECT, "%s %s", result, ctx->identity_info); else - return umts_cell_id_name(&ctx->id); + result = talloc_asprintf(OTC_SELECT, "%s %s", result, umts_cell_id_name(&ctx->id)); + return result; } void hnb_context_release_ue_state(struct hnb_context *ctx)
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/hnbgw_cn.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw_cn.c
Changed
@@ -23,9 +23,12 @@ #include <arpa/inet.h> #include <errno.h> +#include <asn1c/asn1helpers.h> + #include <osmocom/core/msgb.h> #include <osmocom/core/utils.h> #include <osmocom/core/timer.h> +#include <osmocom/core/stats.h> #include <osmocom/gsm/gsm23236.h> @@ -36,128 +39,275 @@ #include <osmocom/hnbgw/hnbgw.h> #include <osmocom/hnbgw/hnbgw_rua.h> #include <osmocom/hnbgw/hnbgw_cn.h> +#include <osmocom/hnbgw/tdefs.h> #include <osmocom/ranap/ranap_ies_defs.h> #include <osmocom/ranap/ranap_msg_factory.h> +#include <osmocom/ranap/iu_helpers.h> #include <osmocom/hnbgw/context_map.h> -#if 0 -this code will soon move to new file cnlink.c -static int transmit_rst(struct hnbgw_cnlink *cnlink) -{ - struct msgb *msg; - RANAP_Cause_t cause = { - .present = RANAP_Cause_PR_transmissionNetwork, - .choice. transmissionNetwork = RANAP_CauseTransmissionNetwork_signalling_transport_resource_failure, - }; +/*********************************************************************** + * Incoming primitives from SCCP User SAP + ***********************************************************************/ - if (!cnlink) +static int cn_ranap_rx_reset_cmd(struct hnbgw_cnlink *cnlink, + const struct osmo_scu_unitdata_param *unitdata, + RANAP_InitiatingMessage_t *imsg) +{ + RANAP_CN_DomainIndicator_t domain; + RANAP_ResetIEs_t ies; + int rc; + + rc = ranap_decode_reseties(&ies, &imsg->value); + domain = ies.cN_DomainIndicator; + ranap_free_reseties(&ies); + + if (rc) { + LOG_CNLINK(cnlink, DCN, LOGL_ERROR, "Rx RESET: cannot decode IEs\n"); return -1; + } - if (!cnlink->hnbgw_sccp_user) { - LOG_CNLINK(cnlink, DRANAP, LOGL_ERROR, "cannot send RANAP RESET: no CN link\n"); + if (cnlink->pool->domain != domain) { + LOG_CNLINK(cnlink, DCN, LOGL_ERROR, "Rx RESET indicates domain %s, but this is %s on domain %s\n", + ranap_domain_name(domain), cnlink->name, ranap_domain_name(cnlink->pool->domain)); return -1; } - LOG_CNLINK(cnlink, DRANAP, LOGL_NOTICE, "Tx RANAP RESET to %s %s\n", - cnlink_is_cs(cnlink) ? "IuCS" : "IuPS", - osmo_sccp_inst_addr_name(cnlink->hnbgw_sccp_user->sccp, &cnlink->remote_addr)); + cnlink_rx_reset_cmd(cnlink); + return 0; +} - msg = ranap_new_msg_reset(cnlink->pool->domain, &cause); +static int cn_ranap_rx_reset_ack(struct hnbgw_cnlink *cnlink, + RANAP_SuccessfulOutcome_t *omsg) +{ + RANAP_CN_DomainIndicator_t domain; + RANAP_ResetAcknowledgeIEs_t ies; + int rc; + + rc = ranap_decode_resetacknowledgeies(&ies, &omsg->value); + domain = ies.cN_DomainIndicator; + ranap_free_resetacknowledgeies(&ies); + + if (rc) { + LOG_CNLINK(cnlink, DCN, LOGL_ERROR, "Rx RESET ACK: cannot decode IEs\n"); + return -1; + } + + if (cnlink->pool->domain != domain) { + LOG_CNLINK(cnlink, DCN, LOGL_ERROR, "Rx RESET ACK indicates domain %s, but this is %s on domain %s\n", + ranap_domain_name(domain), cnlink->name, ranap_domain_name(cnlink->pool->domain)); + return -1; + } - return osmo_sccp_tx_unitdata_msg(cnlink->hnbgw_sccp_user->sccp_user, - &cnlink->local_addr, - &cnlink->remote_addr, - msg); + cnlink_rx_reset_ack(cnlink); + return 0; } -#endif -static int transmit_reset_ack(struct hnbgw_cnlink *cnlink) +struct cnlink_paging { + struct llist_head entry; + + struct osmo_mobile_identity mi; + struct osmo_mobile_identity mi2; + time_t timestamp; +}; + +static int cnlink_paging_destructor(struct cnlink_paging *p) { - struct msgb *msg; - struct osmo_sccp_instance *sccp = cnlink_sccp(cnlink); + llist_del(&p->entry); + return 0; +} - if (!sccp) { - LOG_CNLINK(cnlink, DRANAP, LOGL_ERROR, "cannot send RANAP RESET ACK: no CN link\n"); - return -1; +/* Return current timestamp in *timestamp, and the oldest still valid timestamp according to T3113 timeout. */ +static const char *cnlink_paging_gettime(time_t *timestamp_p, time_t *timeout_p) +{ + struct timespec now; + time_t timestamp; + + /* get timestamp */ + if (osmo_clock_gettime(CLOCK_MONOTONIC, &now) != 0) + return "cannot get timestamp"; + timestamp = now.tv_sec; + + if (timestamp_p) + *timestamp_p = timestamp; + if (timeout_p) + *timeout_p = timestamp - osmo_tdef_get(hnbgw_T_defs, 3113, OSMO_TDEF_S, 15); + return NULL; +} + +static const char *cnlink_paging_add(struct hnbgw_cnlink *cnlink, const struct osmo_mobile_identity *mi, + const struct osmo_mobile_identity *mi2) +{ + struct cnlink_paging *p, *p2; + time_t timestamp; + time_t timeout; + const char *errmsg; + + errmsg = cnlink_paging_gettime(×tamp, &timeout); + if (errmsg) + return errmsg; + + /* Prune all paging records that are older than the configured timeout. */ + llist_for_each_entry_safe(p, p2, &cnlink->paging, entry) { + if (p->timestamp >= timeout) + continue; + talloc_free(p); } - LOG_CNLINK(cnlink, DRANAP, LOGL_NOTICE, "Tx RANAP RESET ACK %s %s --> %s\n", - cnlink_is_cs(cnlink) ? "IuCS" : "IuPS", - cnlink_sccp_addr_to_str(cnlink, &cnlink->hnbgw_sccp_user->local_addr), - cnlink_sccp_addr_to_str(cnlink, &cnlink->remote_addr)); + /* Add new entry */ + p = talloc_zero(cnlink, struct cnlink_paging); + *p = (struct cnlink_paging){ + .timestamp = timestamp, + .mi = *mi, + .mi2 = *mi2, + }; + llist_add_tail(&p->entry, &cnlink->paging); + talloc_set_destructor(p, cnlink_paging_destructor); + + LOG_CNLINK(cnlink, DCN, LOGL_INFO, "Rx Paging from CN for %s %s\n", + osmo_mobile_identity_to_str_c(OTC_SELECT, mi), + osmo_mobile_identity_to_str_c(OTC_SELECT, mi2)); + return NULL; +} + +static const char *omi_from_ranap_ue_id(struct osmo_mobile_identity *mi, const RANAP_PermanentNAS_UE_ID_t *ranap_mi) +{ + if (!ranap_mi) + return "null UE ID"; + + if (ranap_mi->present != RANAP_PermanentNAS_UE_ID_PR_iMSI) + return talloc_asprintf(OTC_SELECT, "unsupported UE ID type %u in RANAP Paging", ranap_mi->present); - msg = ranap_new_msg_reset_ack(cnlink->pool->domain, NULL); + if (ranap_mi->choice.iMSI.size > sizeof(mi->imsi)) + return talloc_asprintf(OTC_SELECT, "invalid IMSI size %d > %zu", + ranap_mi->choice.iMSI.size, sizeof(mi->imsi)); - return osmo_sccp_tx_unitdata_msg(cnlink->hnbgw_sccp_user->sccp_user, - &cnlink->hnbgw_sccp_user->local_addr, - &cnlink->remote_addr, - msg); + *mi = (struct osmo_mobile_identity){ + .type = GSM_MI_TYPE_IMSI, + }; + ranap_bcd_decode(mi->imsi, sizeof(mi->imsi), ranap_mi->choice.iMSI.buf, ranap_mi->choice.iMSI.size); + LOGP(DCN, LOGL_DEBUG, "ranap MI %s = %s\n", osmo_hexdump(ranap_mi->choice.iMSI.buf, ranap_mi->choice.iMSI.size),
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c
Changed
@@ -119,7 +119,7 @@ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_HNBAP_HNBRegisterAccept, &accept_out); - LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "Accepting HNB-REGISTER-REQ from %s\n", ctx->identity_info); + LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "Accepting HNB-REGISTER-REQ\n"); return hnbgw_hnbap_tx(ctx, msg); } @@ -409,14 +409,10 @@ int rc; struct osmo_plmn_id plmn; struct osmo_fd *ofd = osmo_stream_srv_get_ofd(ctx->conn); - char nameOSMO_SOCK_NAME_MAXLEN; - - osmo_sock_get_name_buf(name, sizeof(name), ofd->fd); rc = hnbap_decode_hnbregisterrequesties(&ies, in); if (rc < 0) { - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ %s from %s: rc=%d\n", - ctx->identity_info, name, rc); + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ: rc=%d\n", rc); return rc; } @@ -460,17 +456,15 @@ /* If new conn registering same HNB is from anoter remote addr+port, let's reject it to avoid * misconfigurations or someone trying to impersonate an already working HNB: */ - LOGHNB(ctx, DHNBAP, LOGL_ERROR, "rejecting HNB-REGISTER-REQ with duplicate cell identity " - "MCC=%u,MNC=%u,LAC=%u,RAC=%u,SAC=%u,CID=%u from %s\n", - ctx->id.mcc, ctx->id.mnc, ctx->id.lac, ctx->id.rac, ctx->id.sac, ctx->id.cid, name); + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "rejecting HNB-REGISTER-REQ with duplicate cell identity %s\n", + umts_cell_id_name(&ctx->id)); hnbap_free_hnbregisterrequesties(&ies); return hnbgw_tx_hnb_register_rej(ctx); } } - LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "HNB-REGISTER-REQ %s MCC=%u,MNC=%u,LAC=%u,RAC=%u,SAC=%u,CID=%u from %s%s\n", - ctx->identity_info, ctx->id.mcc, ctx->id.mnc, ctx->id.lac, ctx->id.rac, ctx->id.sac, ctx->id.cid, - name, ctx->hnb_registered ? " (re-connecting)" : ""); + LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "HNB-REGISTER-REQ %s %s%s\n", + ctx->identity_info, umts_cell_id_name(&ctx->id), ctx->hnb_registered ? " (re-connecting)" : ""); /* The HNB is already registered, and we are seeing a new HNB Register Request. The HNB has restarted * without us noticing. Clearly, the HNB does not expect any UE state to be active here, so discard any
View file
osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw_l3.c
Added
@@ -0,0 +1,317 @@ +/* OsmoHNBGW implementation of CS and PS Level3 message decoding (NAS PDU) */ + +/* Copyright 2023 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * Author: Neels Janosch Hofmeyr <nhofmeyr@sysmocom.de> + * + * 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 Affero 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 <http://www.gnu.org/licenses/>. + * + */ + +#include "config.h" + +#include "asn1helpers.h" + +#include <osmocom/gsm/gsm48.h> +#include <osmocom/gsm/protocol/gsm_04_08_gprs.h> + +#include <osmocom/hnbgw/hnbgw.h> +#include <osmocom/hnbgw/hnbgw_rua.h> +#include <osmocom/hnbgw/context_map.h> +#include <osmocom/ranap/ranap_ies_defs.h> + +static const struct tlv_definition gsm48_gmm_att_tlvdef = { + .def = { + GSM48_IE_GMM_CIPH_CKSN = { TLV_TYPE_FIXED, 1 }, + GSM48_IE_GMM_TIMER_READY = { TLV_TYPE_TV, 1 }, + GSM48_IE_GMM_TMSI_BASED_NRI_C = { TLV_TYPE_TLV }, + GSM48_IE_GMM_ALLOC_PTMSI = { TLV_TYPE_TLV, 0 }, + GSM48_IE_GMM_PTMSI_SIG = { TLV_TYPE_FIXED, 3 }, + GSM48_IE_GMM_AUTH_RAND = { TLV_TYPE_FIXED, 16 }, + GSM48_IE_GMM_AUTH_SRES = { TLV_TYPE_FIXED, 4 }, + GSM48_IE_GMM_IMEISV = { TLV_TYPE_TLV, 0 }, + GSM48_IE_GMM_DRX_PARAM = { TLV_TYPE_FIXED, 2 }, + GSM48_IE_GMM_MS_NET_CAPA = { TLV_TYPE_TLV, 0 }, + GSM48_IE_GMM_PDP_CTX_STATUS = { TLV_TYPE_TLV, 0 }, + GSM48_IE_GMM_PS_LCS_CAPA = { TLV_TYPE_TLV, 0 }, + GSM48_IE_GMM_GMM_MBMS_CTX_ST = { TLV_TYPE_TLV, 0 }, + }, +}; + +static void decode_gmm_tlv(struct osmo_mobile_identity *mi, + struct osmo_routing_area_id *old_ra, + int *nri, + const uint8_t *tlv_data, size_t tlv_len, bool allow_hex) +{ + struct tlv_parsed tp; + struct tlv_p_entry *e; + + tlv_parse(&tp, &gsm48_gmm_att_tlvdef, tlv_data, tlv_len, 0, 0); + + e = TLVP_GET(&tp, GSM48_IE_GMM_TMSI_BASED_NRI_C); + if (e) { + *nri = e->val0; + *nri <<= 2; + *nri |= e->val1 >> 6; + } +} + +static int mobile_identity_decode_from_gmm_att_req(struct osmo_mobile_identity *mi, + struct osmo_routing_area_id *old_ra, + int *nri, + const uint8_t *l3_data, size_t l3_len, bool allow_hex) +{ + const struct gsm48_hdr *gh = (void *)l3_data; + const uint8_t *cur = gh->data; + const uint8_t *end = l3_data + l3_len; + const uint8_t *mi_data; + uint8_t mi_len; + uint8_t msnc_len; + uint8_t ms_ra_acc_cap_len; + int rc; + + /* MS network capability 10.5.5.12 */ + msnc_len = *cur++; + cur += msnc_len; + + /* aTTACH Type 10.5.5.2 */ + cur++; + + /* DRX parameter 10.5.5.6 */ + cur += 2; + + /* Mobile Identity (P-TMSI or IMSI) 10.5.1.4 */ + mi_len = *cur++; + mi_data = cur; + cur += mi_len; + + if (cur >= end) + return -ENOSPC; + + rc = osmo_mobile_identity_decode(mi, mi_data, mi_len, allow_hex); + if (rc) + return rc; + + /* Old routing area identification 10.5.5.15. */ + rc = osmo_routing_area_id_decode(old_ra, cur, end - cur); + if (rc < 0) + return rc; + cur += rc; + + /* MS Radio Access Capability 10.5.5.12a */ + ms_ra_acc_cap_len = *cur++; + cur += ms_ra_acc_cap_len; + + if (cur > end) + return -ENOSPC; + + decode_gmm_tlv(mi, old_ra, nri, cur, end - cur, allow_hex); + return 0; +} + +static int mobile_identity_decode_from_gmm_rau_req(struct osmo_mobile_identity *mi, + struct osmo_routing_area_id *old_ra, + int *nri, + const uint8_t *l3_data, size_t l3_len, bool allow_hex) +{ + const struct gsm48_hdr *gh = (void *)l3_data; + const uint8_t *cur = gh->data; + const uint8_t *end = l3_data + l3_len; + uint8_t ms_ra_acc_cap_len; + int rc; + + /* Update Type 10.5.5.18 */ + cur++; + if (cur >= end) + return -ENOSPC; + + /* Old routing area identification 10.5.5.15 */ + rc = osmo_routing_area_id_decode(old_ra, cur, end - cur); + if (rc < 0) + return rc; + cur += rc; + if (cur >= end) + return -ENOSPC; + + /* MS Radio Access Capability 10.5.5.12a */ + ms_ra_acc_cap_len = *cur++; + cur += ms_ra_acc_cap_len; + + if (cur > end) + return -ENOSPC; + + decode_gmm_tlv(mi, old_ra, nri, cur, end - cur, allow_hex); + return 0; +} + +static int peek_l3_nas(struct hnbgw_context_map *map, const uint8_t *nas_pdu, size_t len, + const struct osmo_plmn_id *local_plmn) +{ + const struct gsm48_hdr *gh; + int8_t pdisc; + uint8_t mtype; + const struct gsm48_loc_upd_req *lu; + struct gsm48_service_request *cm; + struct osmo_location_area_id old_lai; + struct osmo_routing_area_id old_ra = {}; + int nri = -1; + + map->l3 = (struct hnbgw_l3_peek){ + .gmm_nri_container = -1, + }; + + /* Get the mobile identity from CS MM -- the PS GMM happens further down. + * This will return an error for GMM messages, ignore that. */ + if (!map->is_ps) + osmo_mobile_identity_decode_from_l3_buf(&map->l3.mi, nas_pdu, len, false); + + /* Get is_emerg and from_other_plmn */ + if (len < sizeof(*gh)) { + LOGP(DCN, LOGL_ERROR, "Layer 3 message too short for header\n"); + return -EINVAL; + } + + gh = (void *)nas_pdu; + pdisc = gsm48_hdr_pdisc(gh); + mtype = gsm48_hdr_msg_type(gh); + + map->l3.gsm48_pdisc = pdisc; + map->l3.gsm48_msg_type = mtype; + + /* Determine from_other_plmn and is_emerg */ + switch (pdisc) { + case GSM48_PDISC_MM: + + switch (mtype) { + case GSM48_MT_MM_LOC_UPD_REQUEST: + if (len < sizeof(*gh) + sizeof(*lu)) {
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/hnbgw_rua.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw_rua.c
Changed
@@ -38,19 +38,9 @@ #include <osmocom/rua/rua_common.h> #include <osmocom/rua/rua_ies_defs.h> #include <osmocom/hnbgw/context_map.h> +#include <osmocom/hnbgw/hnbgw_rua.h> #include <osmocom/hnbap/HNBAP_CN-DomainIndicator.h> - -static const char *cn_domain_indicator_to_str(RUA_CN_DomainIndicator_t cN_DomainIndicator) -{ - switch (cN_DomainIndicator) { - case RUA_CN_DomainIndicator_cs_domain: - return "IuCS"; - case RUA_CN_DomainIndicator_ps_domain: - return "IuPS"; - default: - return "(unknown-domain)"; - } -} +#include <osmocom/ranap/ranap_ies_defs.h> static int hnbgw_rua_tx(struct hnb_context *ctx, struct msgb *msg) { @@ -208,7 +198,11 @@ map = context_map_alloc(hnb, rua_ctx_id, is_ps); OSMO_ASSERT(map); - /* FUTURE: extract mobile identity and store in map-> */ + if (hnbgw_peek_l3(map, ranap_msg)) + LOGP(DCN, LOGL_NOTICE, "Failed to extract Mobile Identity from RUA Connect message's RANAP payload\n"); + /* map->l3 now contains all the interesting information from the NAS PDU, if any. + * If no useful information could be decoded, still continue to select a hopefully adequate link by round robin. + */ cnlink = hnbgw_cnlink_select(map); if (!cnlink) { @@ -223,7 +217,6 @@ return NULL; } - LOG_MAP(map, DCN, LOGL_INFO, "establishing SCCP link: selected %s\n", cnlink->name); return map; } @@ -366,7 +359,7 @@ context_id = asn1bitstr_to_u24(&ies.context_ID); LOGHNB(hnb, DRUA, LOGL_DEBUG, "RUA %s Connect.req(ctx=0x%x, %s)\n", - cn_domain_indicator_to_str(ies.cN_DomainIndicator), context_id, + ranap_domain_name(ies.cN_DomainIndicator), context_id, ies.establishment_Cause == RUA_Establishment_Cause_emergency_call ? "emergency" : "normal"); rc = rua_to_scu(hnb, ies.cN_DomainIndicator, RUA_ProcedureCode_id_Connect,
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/hnbgw_vty.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/hnbgw_vty.c
Changed
@@ -281,6 +281,28 @@ return CMD_SUCCESS; } +DEFUN(cfg_hnbgw_plmn, cfg_hnbgw_plmn_cmd, + "plmn <1-999> <0-999>", + "Configure the HNBGW's PLMN. The PLMN is transmitted in RANAP RESET towards the CN.\n" + "MCC, Mobile Country Code\n" + "MNC, Mobile Network Code\n") +{ + struct osmo_plmn_id plmn; + + if (osmo_mcc_from_str(argv0, &plmn.mcc)) { + vty_out(vty, "%% Error decoding MCC: %s%s", argv0, VTY_NEWLINE); + return CMD_WARNING; + } + + if (osmo_mnc_from_str(argv1, &plmn.mnc, &plmn.mnc_3_digits)) { + vty_out(vty, "%% Error decoding MNC: %s%s", argv1, VTY_NEWLINE); + return CMD_WARNING; + } + + g_hnbgw->config.plmn = plmn; + return CMD_SUCCESS; +} + DEFUN(cfg_hnbgw_rnc_id, cfg_hnbgw_rnc_id_cmd, "rnc-id <0-65535>", "Configure the HNBGW's RNC Id, the common RNC Id used for all connected hNodeB. It is sent to" @@ -710,6 +732,35 @@ return CMD_SUCCESS; } +DEFUN(cnlink_ranap_reset, cnlink_ranap_reset_cmd, + "(msc|sgsn) " CNLINK_NR_RANGE " ranap reset", + "Manipulate an IuCS link to an MSC\n" + "Manipulate an IuPS link to an SGSN\n" + "MSC/SGSN nr\n" + "Manipulate RANAP layer of Iu-interface\n" + "Flip this CN link to disconnected state and re-send RANAP RESET\n") +{ + struct hnbgw_cnpool *cnpool; + struct hnbgw_cnlink *cnlink; + const char *msc_sgsn = argv0; + int nr = atoi(argv1); + + if (!strcmp("msc", msc_sgsn)) + cnpool = &g_hnbgw->sccp.cnpool_iucs; + else + cnpool = &g_hnbgw->sccp.cnpool_iups; + + cnlink = cnlink_get_nr(cnpool, nr, false); + if (!cnlink) { + vty_out(vty, "%% No such %s: nr %d\n", msc_sgsn, nr); + return CMD_WARNING; + } + + LOG_CNLINK(cnlink, DCN, LOGL_NOTICE, "VTY requests BSSMAP RESET\n"); + cnlink_resend_reset(cnlink); + return CMD_SUCCESS; +} + #define APPLY_STR "Immediately use configuration modified via telnet VTY, and restart components as needed.\n" #define SCCP_RESTART_STR \ " If 'remote-addr' changed, related SCCP links will be restarted, possibly dropping active UE contexts." @@ -820,6 +871,12 @@ { vty_out(vty, "hnbgw%s", VTY_NEWLINE); + if (g_hnbgw->config.plmn.mcc) + vty_out(vty, " plmn %s %s%s", + osmo_mcc_name_c(OTC_SELECT, g_hnbgw->config.plmn.mcc), + osmo_mnc_name_c(OTC_SELECT, g_hnbgw->config.plmn.mnc, g_hnbgw->config.plmn.mnc_3_digits), + VTY_NEWLINE); + vty_out(vty, " rnc-id %u%s", g_hnbgw->config.rnc_id, VTY_NEWLINE); vty_out(vty, " log-prefix %s%s", g_hnbgw->config.log_prefix_hnb_id ? "hnb-id" : "umts-cell-id", @@ -912,6 +969,7 @@ install_element(CONFIG_NODE, &cfg_hnbgw_cmd); install_node(&hnbgw_node, config_write_hnbgw); + install_element(HNBGW_NODE, &cfg_hnbgw_plmn_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_rnc_id_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_log_prefix_cmd); install_element(HNBGW_NODE, &cfg_hnbgw_max_sccp_cr_payload_len_cmd); @@ -976,4 +1034,5 @@ install_element_ve(&show_nri_cmd); install_element(ENABLE_NODE, &cnpool_roundrobin_next_cmd); + install_element(ENABLE_NODE, &cnlink_ranap_reset_cmd); }
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c
Changed
@@ -25,6 +25,7 @@ #include <osmocom/core/application.h> #include <osmocom/core/logging.h> +#include <osmocom/core/stats.h> #include <osmocom/vty/vty.h> #include <osmocom/vty/command.h> @@ -32,6 +33,7 @@ #include <osmocom/vty/misc.h> #include <osmocom/vty/telnet_interface.h> #include <osmocom/vty/ports.h> +#include <osmocom/vty/stats.h> #include <osmocom/ctrl/control_vty.h> #include <osmocom/ctrl/ports.h> @@ -194,6 +196,13 @@ if (rc < 0) exit(1); + osmo_stats_init(g_hnbgw); + rc = rate_ctr_init(g_hnbgw); + if (rc) { + LOGP(DMAIN, LOGL_FATAL, "rate_ctr_init() failed with rc=%d\n", rc); + exit(1); + } + osmo_fsm_log_timeouts(true); rc = osmo_ss7_init(); @@ -211,6 +220,7 @@ ctrl_vty_init(g_hnbgw); logging_vty_add_cmds(); osmo_talloc_vty_add_cmds(); + osmo_stats_vty_add_cmds(); /* Handle options after vty_init(), for --version */ handle_options(argc, argv);
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/src/osmo-hnbgw/tdefs.c -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/src/osmo-hnbgw/tdefs.c
Changed
@@ -32,6 +32,8 @@ }; struct osmo_tdef hnbgw_T_defs = { + {.T = 3113, .default_val = 15, .desc = "Time to keep Paging record, for CN pools with more than one link" }, + {.T = 4, .default_val = 5, .desc = "Timeout to receive RANAP RESET ACKNOWLEDGE from an MSC/SGSN" }, {.T = -31, .default_val = 5, .desc = "Timeout for discarding a partially released context map (RUA <-> SCCP)" }, {.T = -1002, .default_val = 10, .desc = "Timeout for the HNB to respond to PS RAB Assignment Request" }, { }
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/Makefile.am -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/Makefile.am
Changed
@@ -26,6 +26,7 @@ $(TESTSUITE) \ osmo-hnbgw-vty-test.cfg \ $(srcdir)/*.vty \ + $(srcdir)/*.ctrl \ $(srcdir)/config/*.cfg \ $(srcdir)/config/*.vty \ $(srcdir)/config/run_tests.sh \ @@ -68,6 +69,18 @@ config-tests: $(srcdir)/config/run_tests.sh "$(top_builddir)/src/osmo-hnbgw/osmo-hnbgw" "$(srcdir)/config/" $U +# Run a specific test with: 'make ctrl-test CTRL_TEST=osmo-hnbgw.ctrl' +CTRL_TEST ?= *.ctrl + +# To update the CTRL script from current application behavior, +# pass -u to ctrl_script_runner.py by doing: +# make ctrl-test U=-u +ctrl-test: $(top_builddir)/src/osmo-hnbgw/osmo-hnbgw + osmo_verify_transcript_ctrl.py -v \ + -p 4262 \ + -r "$(top_builddir)/src/osmo-hnbgw/osmo-hnbgw -c $(top_srcdir)/doc/examples/osmo-hnbgw/osmo-hnbgw-cnpool.cfg" \ + $(U) $(srcdir)/$(CTRL_TEST) + check-local: atconfig $(TESTSUITE) $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) $(MAKE) $(AM_MAKEFLAGS) python-tests
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/cnpool.vty -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/cnpool.vty
Changed
@@ -1,4 +1,26 @@ OsmoHNBGW> enable +OsmoHNBGW# list +... + (msc|sgsn) <0-1000> ranap reset +... +OsmoHNBGW# msc? + msc Manipulate an IuCS link to an MSC +OsmoHNBGW# msc ? + <0-1000> MSC/SGSN nr +OsmoHNBGW# msc 0 ? + ranap Manipulate RANAP layer of Iu-interface +OsmoHNBGW# msc 0 ranap ? + reset Flip this CN link to disconnected state and re-send RANAP RESET + +OsmoHNBGW# sgsn? + sgsn Manipulate an IuPS link to an SGSN +OsmoHNBGW# sgsn ? + <0-1000> MSC/SGSN nr +OsmoHNBGW# sgsn 0 ? + ranap Manipulate RANAP layer of Iu-interface +OsmoHNBGW# sgsn 0 ranap ? + reset Flip this CN link to disconnected state and re-send RANAP RESET + OsmoHNBGW# configure terminal OsmoHNBGW(config)# ### cnpool doc strings
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/config/defaults.vty -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/config/defaults.vty
Changed
@@ -30,3 +30,6 @@ iuh mgw 0 ... +msc 0 +sgsn 0 +...
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/config/one_cs7.vty -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/config/one_cs7.vty
Changed
@@ -24,3 +24,6 @@ point-code 1.1.1 hnbgw ... +msc 0 +sgsn 0 +...
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/config/two_cs7.vty -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/config/two_cs7.vty
Changed
@@ -30,3 +30,6 @@ point-code 2.2.2 hnbgw ... +msc 0 +sgsn 0 +...
View file
osmo-hnbgw_1.4.0.86.ee1a.202306220026.tar.xz/tests/osmo-hnbgw.vty -> osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/osmo-hnbgw.vty
Changed
@@ -11,6 +11,7 @@ OsmoHNBGW(config)# hnbgw OsmoHNBGW(config-hnbgw)# list ... + plmn <1-999> <0-999> rnc-id <0-65535> log-prefix (hnb-id|umts-cell-id) iuh @@ -18,6 +19,46 @@ iups ... +OsmoHNBGW(config-hnbgw)# plmn? + plmn Configure the HNBGW's PLMN. The PLMN is transmitted in RANAP RESET towards the CN. +OsmoHNBGW(config-hnbgw)# plmn ? + <1-999> MCC, Mobile Country Code +OsmoHNBGW(config-hnbgw)# plmn 1 ? + <0-999> MNC, Mobile Network Code +OsmoHNBGW(config-hnbgw)# show running-config +... !plmn +OsmoHNBGW(config-hnbgw)# plmn 001 01 +OsmoHNBGW(config-hnbgw)# show running-config +... +hnbgw +... + plmn 001 01 +... + +OsmoHNBGW(config-hnbgw)# plmn 001 001 +OsmoHNBGW(config-hnbgw)# show running-config +... +hnbgw +... + plmn 001 001 +... + +OsmoHNBGW(config-hnbgw)# plmn 999 999 +OsmoHNBGW(config-hnbgw)# show running-config +... +hnbgw +... + plmn 999 999 +... + +OsmoHNBGW(config-hnbgw)# plmn 23 42 +OsmoHNBGW(config-hnbgw)# show running-config +... +hnbgw +... + plmn 023 42 +... + OsmoHNBGW(config-hnbgw)# rnc-id? rnc-id Configure the HNBGW's RNC Id, the common RNC Id used for all connected hNodeB. It is sent to each hNodeB upon HNBAP HNB-Register-Accept, and the hNodeB will subsequently send this as RANAP InitialUE Messages' GlobalRNC-ID IE. Takes effect as soon as the hNodeB re-registers.
View file
osmo-hnbgw_1.4.0.105.3a084.202306230026.tar.xz/tests/test_nodes.ctrl
Added
@@ -0,0 +1,14 @@ +GET 1 rate_ctr.abs.iucs.0.cnpool:subscr:no_cnlink +GET_REPLY 1 rate_ctr.abs.iucs.0.cnpool:subscr:no_cnlink 0 + +GET 2 rate_ctr.abs.iups.0.cnpool:emerg:lost +GET_REPLY 2 rate_ctr.abs.iups.0.cnpool:emerg:lost 0 + +GET 3 rate_ctr.abs.msc.0.cnpool:subscr:new +GET_REPLY 3 rate_ctr.abs.msc.0.cnpool:subscr:new 0 + +GET 4 rate_ctr.abs.sgsn.0.cnpool:emerg:forwarded +GET_REPLY 4 rate_ctr.abs.sgsn.0.cnpool:emerg:forwarded 0 + +GET 5 rate_ctr.abs.msc.1.cnpool:subscr:new +GET_REPLY 5 rate_ctr.abs.msc.1.cnpool:subscr:new 0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.