Projects
osmocom:master
osmo-hnbgw
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 155
View file
commit_5827f97eb0ba1606302376dd1d3c666dc9be3949.txt
Added
View file
commit_6f5d14500dd82a0a2a95e02b32ad68de2d3db4b6.txt
Deleted
View file
osmo-hnbgw_1.7.0.69.6f5d.dsc -> osmo-hnbgw_1.7.0.70.5827.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hnbgw Binary: osmo-hnbgw, osmo-hnbgw-dbg, osmo-hnbgw-doc Architecture: any all -Version: 1.7.0.69.6f5d +Version: 1.7.0.70.5827 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: - 19a180083df0e456c132fea138b5ea9ff3952ca7 126828 osmo-hnbgw_1.7.0.69.6f5d.tar.xz + df014229f0daff190aca7fdcf938f109bfc06881 127036 osmo-hnbgw_1.7.0.70.5827.tar.xz Checksums-Sha256: - 58bd8a784ff3132328f1fe4407e2b01fd829ab6e374b640f5cd11c73eeb66c68 126828 osmo-hnbgw_1.7.0.69.6f5d.tar.xz + e44e3ecdfde4c865ec76b5943cc6b114e3b6200659023a668549218ce0e8d63b 127036 osmo-hnbgw_1.7.0.70.5827.tar.xz Files: - ddd91d0355fab152dfe4bcfc91b76fcb 126828 osmo-hnbgw_1.7.0.69.6f5d.tar.xz + 4b4430233a10b28aa08cfa5d79bb54a1 127036 osmo-hnbgw_1.7.0.70.5827.tar.xz
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/.tarball-version -> osmo-hnbgw_1.7.0.70.5827.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.7.0.69-6f5d +1.7.0.70-5827
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/TODO-RELEASE -> osmo-hnbgw_1.7.0.70.5827.tar.xz/TODO-RELEASE
Changed
@@ -9,3 +9,4 @@ #library what description / commit summary line libosmo-sigtran >2.1.0 osmo_sccp_addr_{create,update}() libosmo-netif >1.6.0 osmo_stream_srv_set_tx_queue_max_length() +libosmo-pfcp >0.5.0 osmo_pfcp_cp_peer_free()
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/debian/changelog -> osmo-hnbgw_1.7.0.70.5827.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.7.0.69.6f5d) unstable; urgency=medium +osmo-hnbgw (1.7.0.70.5827) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Fri, 21 Nov 2025 11:53:18 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Thu, 27 Nov 2025 13:15:48 +0000 osmo-hnbgw (1.7.0) unstable; urgency=medium
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/include/osmocom/hnbgw/hnbgw.h -> osmo-hnbgw_1.7.0.70.5827.tar.xz/include/osmocom/hnbgw/hnbgw.h
Changed
@@ -147,9 +147,7 @@ struct { struct osmo_pfcp_endpoint *ep; - struct osmo_pfcp_cp_peer *cp_peer; - /* Running counters for the PFCP conn */ - struct osmo_stat_item_group *statg; + struct hnbgw_upf *upf; } pfcp; struct osmo_timer_list hnb_store_rab_durations_timer;
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/include/osmocom/hnbgw/hnbgw_pfcp.h -> osmo-hnbgw_1.7.0.70.5827.tar.xz/include/osmocom/hnbgw/hnbgw_pfcp.h
Changed
@@ -1,9 +1,27 @@ #pragma once +#include <osmocom/core/fsm.h> +#include <osmocom/core/socket.h> +#include <osmocom/core/stat_item.h> +#include <osmocom/pfcp/pfcp_endpoint.h> +#include <osmocom/pfcp/pfcp_cp_peer.h> + enum hnbgw_upf_stats { HNBGW_UPF_STAT_ASSOCIATED, }; -#define HNBGW_UPF_STAT_SET(stat, val) osmo_stat_item_set(osmo_stat_item_group_get_item(g_hnbgw->pfcp.statg, (stat)), (val)) +#define HNBGW_UPF_STAT_SET(stat, val) osmo_stat_item_set(osmo_stat_item_group_get_item(g_hnbgw->pfcp.upf->statg, (stat)), (val)) + +struct hnbgw_upf { + struct osmo_pfcp_cp_peer *cp_peer; + /* Running counters for the PFCP conn */ + struct osmo_stat_item_group *statg; +}; + +struct hnbgw_upf *hnbgw_upf_alloc(struct osmo_pfcp_endpoint *ep, const struct osmo_sockaddr *rem_addr); +void hnbgw_upf_free(struct hnbgw_upf *upf); int hnbgw_pfcp_init(void); void hnbgw_pfcp_release(void); + +#define LOGUPF(upf, ss, lvl, fmt, args ...) \ + LOGP(ss, lvl, "UPF(%s) " fmt, osmo_sockaddr_to_str_c(OTC_SELECT, osmo_pfcp_cp_peer_get_remote_addr(upf->cp_peer)), ## args)
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/src/osmo-hnbgw/hnbgw_pfcp.c -> osmo-hnbgw_1.7.0.70.5827.tar.xz/src/osmo-hnbgw/hnbgw_pfcp.c
Changed
@@ -45,7 +45,7 @@ static void pfcp_set_msg_ctx(struct osmo_pfcp_endpoint *ep, struct osmo_pfcp_msg *m, struct osmo_pfcp_msg *req) { if (!m->ctx.peer_fi) - osmo_pfcp_cp_peer_set_msg_ctx(g_hnbgw->pfcp.cp_peer, m); + osmo_pfcp_cp_peer_set_msg_ctx(g_hnbgw->pfcp.upf->cp_peer, m); /* If this is a response to an earlier request, just take the msg context from the request message. * In osmo-hnbgw, a session_fi always points at a ps_rab FSM. */ @@ -79,10 +79,58 @@ static void pfcp_cp_peer_assoc_cb(struct osmo_pfcp_cp_peer *cp_peer, bool associated) { - LOGP(DLPFCP, LOGL_NOTICE, "PFCP Peer associated: %s\n", associated ? "true" : "false"); + struct hnbgw_upf *upf = osmo_pfcp_cp_peer_get_priv(cp_peer); + OSMO_ASSERT(upf); + + LOGUPF(upf, DLPFCP, LOGL_NOTICE, "PFCP Peer associated: %s\n", associated ? "true" : "false"); HNBGW_UPF_STAT_SET(HNBGW_UPF_STAT_ASSOCIATED, associated ? 1 : 0); } +struct hnbgw_upf *hnbgw_upf_alloc(struct osmo_pfcp_endpoint *ep, const struct osmo_sockaddr *upf_addr) +{ + struct hnbgw_upf *upf = talloc_zero(g_hnbgw, struct hnbgw_upf); + OSMO_ASSERT(upf); + + upf->statg = osmo_stat_item_group_alloc(g_hnbgw, &hnbgw_upf_statg_desc, 0); + if (!upf->statg) { + LOGP(DLPFCP, LOGL_ERROR, "Failed creating UPF stats item group\n"); + goto free_ret; + } + + upf->cp_peer = osmo_pfcp_cp_peer_alloc(g_hnbgw, ep, upf_addr); + if (!upf->cp_peer) { + LOGP(DLPFCP, LOGL_ERROR, "Cannot allocate PFCP CP Peer FSM\n"); + goto free_ret; + } + osmo_pfcp_cp_peer_set_priv(upf->cp_peer, upf); + + if (osmo_pfcp_cp_peer_set_associated_cb(upf->cp_peer, pfcp_cp_peer_assoc_cb)) { + LOGUPF(upf, DLPFCP, LOGL_ERROR, "Cannot Set PFCP CP Peer associated callback\n"); + goto free_ret; + } + + if (osmo_pfcp_cp_peer_associate(upf->cp_peer)) { + LOGUPF(upf, DLPFCP, LOGL_ERROR, "Cannot start PFCP CP Peer FSM\n"); + goto free_ret; + } + + return upf; +free_ret: + osmo_pfcp_cp_peer_free(upf->cp_peer); + osmo_stat_item_group_free(upf->statg); + talloc_free(upf); + return NULL; +} + +void hnbgw_upf_free(struct hnbgw_upf *upf) +{ + if (!upf) + return; + + osmo_pfcp_cp_peer_free(upf->cp_peer); + osmo_stat_item_group_free(upf->statg); +} + int hnbgw_pfcp_init(void) { struct osmo_pfcp_endpoint_cfg cfg; @@ -102,12 +150,6 @@ return -1; } - g_hnbgw->pfcp.statg = osmo_stat_item_group_alloc(g_hnbgw, &hnbgw_upf_statg_desc, 0); - if (!g_hnbgw->pfcp.statg) { - LOGP(DLPFCP, LOGL_ERROR, "Failed creating UPF stats item group\n"); - return -1; - } - cfg = (struct osmo_pfcp_endpoint_cfg){ .set_msg_ctx_cb = pfcp_set_msg_ctx, .rx_msg_cb = pfcp_rx_msg, @@ -132,12 +174,6 @@ return -1; } - g_hnbgw->pfcp.ep = ep = osmo_pfcp_endpoint_create(g_hnbgw, &cfg); - if (!ep) { - LOGP(DLPFCP, LOGL_ERROR, "Failed to allocate PFCP endpoint\n"); - return -1; - } - /* Set up remote PFCP address to reach UPF at. First parse the string into upf_addr_str. */ if (osmo_sockaddr_str_from_str(&upf_addr_str, g_hnbgw->config.pfcp.remote_addr, g_hnbgw->config.pfcp.remote_port)) { LOGP(DLPFCP, LOGL_ERROR, "Error in PFCP remote IP: %s\n", @@ -151,6 +187,12 @@ return -1; } + g_hnbgw->pfcp.ep = ep = osmo_pfcp_endpoint_create(g_hnbgw, &cfg); + if (!ep) { + LOGP(DLPFCP, LOGL_ERROR, "Failed to allocate PFCP endpoint\n"); + return -1; + } + /* Start the socket */ if (osmo_pfcp_endpoint_bind(ep)) { LOGP(DLPFCP, LOGL_ERROR, "Cannot bind PFCP endpoint\n"); @@ -158,18 +200,9 @@ } /* Associate with UPF */ - g_hnbgw->pfcp.cp_peer = osmo_pfcp_cp_peer_alloc(g_hnbgw, ep, &upf_addr); - if (!g_hnbgw->pfcp.cp_peer) { - LOGP(DLPFCP, LOGL_ERROR, "Cannot allocate PFCP CP Peer FSM\n"); - return -1; - } - if (osmo_pfcp_cp_peer_set_associated_cb(g_hnbgw->pfcp.cp_peer, pfcp_cp_peer_assoc_cb)) { - LOGP(DLPFCP, LOGL_ERROR, "Cannot Set PFCP CP Peer associated callback\n"); - return -1; - } - - if (osmo_pfcp_cp_peer_associate(g_hnbgw->pfcp.cp_peer)) { - LOGP(DLPFCP, LOGL_ERROR, "Cannot start PFCP CP Peer FSM\n"); + g_hnbgw->pfcp.upf = hnbgw_upf_alloc(ep, &upf_addr); + if (!g_hnbgw->pfcp.upf) { + LOGP(DLPFCP, LOGL_ERROR, "Failed creating UPF\n"); return -1; } @@ -180,5 +213,6 @@ { if (!hnb_gw_is_gtp_mapping_enabled()) return; - osmo_stat_item_group_free(g_hnbgw->pfcp.statg); + hnbgw_upf_free(g_hnbgw->pfcp.upf); + g_hnbgw->pfcp.upf = NULL; }
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/src/osmo-hnbgw/hnbgw_ranap.c -> osmo-hnbgw_1.7.0.70.5827.tar.xz/src/osmo-hnbgw/hnbgw_ranap.c
Changed
@@ -37,6 +37,7 @@ #if ENABLE_PFCP #include <osmocom/pfcp/pfcp_cp_peer.h> +#include <osmocom/hnbgw/hnbgw_pfcp.h> #endif #include <osmocom/hnbgw/hnb.h> @@ -655,7 +656,7 @@ if (hnb_gw_is_gtp_mapping_enabled()) { LOG_MAP(map, DCN, LOGL_DEBUG, "RAB Assignment: setting up GTP tunnel mapping via UPF %s\n", - osmo_sockaddr_to_str_c(OTC_SELECT, osmo_pfcp_cp_peer_get_remote_addr(g_hnbgw->pfcp.cp_peer))); + osmo_sockaddr_to_str_c(OTC_SELECT, osmo_pfcp_cp_peer_get_remote_addr(g_hnbgw->pfcp.upf->cp_peer))); return hnbgw_gtpmap_rx_rab_ass_req(map, ranap_msg, message); } /* If no UPF is configured, directly forward the message as-is (no GTP mapping). */
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c -> osmo-hnbgw_1.7.0.70.5827.tar.xz/src/osmo-hnbgw/osmo_hnbgw_main.c
Changed
@@ -48,7 +48,9 @@ #include <osmocom/hnbgw/hnb.h> #include <osmocom/hnbgw/hnbgw.h> #include <osmocom/hnbgw/hnbgw_cn.h> +#if ENABLE_PFCP #include <osmocom/hnbgw/hnbgw_pfcp.h> +#endif static struct { int daemonize;
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/src/osmo-hnbgw/ps_rab_ass_fsm.c -> osmo-hnbgw_1.7.0.70.5827.tar.xz/src/osmo-hnbgw/ps_rab_ass_fsm.c
Changed
@@ -43,6 +43,7 @@ #include <osmocom/pfcp/pfcp_cp_peer.h> #include <osmocom/hnbgw/hnbgw.h> +#include <osmocom/hnbgw/hnbgw_pfcp.h> #include <osmocom/hnbgw/context_map.h> #include <osmocom/hnbgw/ranap_rab_ass.h> #include <osmocom/hnbgw/ps_rab_ass_fsm.h> @@ -230,7 +231,7 @@ rab_ass->ranap_rab_ass_req_message = message; /* Now rab_ass owns message and will clean it up */ - if (!osmo_pfcp_cp_peer_is_associated(g_hnbgw->pfcp.cp_peer)) { + if (!osmo_pfcp_cp_peer_is_associated(g_hnbgw->pfcp.upf->cp_peer)) { LOG_MAP(map, DLPFCP, LOGL_ERROR, "PFCP is not associated, cannot set up GTP mapping\n"); goto no_rab; } @@ -432,7 +433,7 @@ rab_ass->ranap_rab_ass_resp_msgb = ranap_msg; /* Now rab_ass owns message and will clean it up */ - if (!osmo_pfcp_cp_peer_is_associated(g_hnbgw->pfcp.cp_peer)) { + if (!osmo_pfcp_cp_peer_is_associated(g_hnbgw->pfcp.upf->cp_peer)) { LOG_PS_RAB_ASS(rab_ass, LOGL_ERROR, "PFCP is not associated, cannot set up GTP mapping\n"); goto no_rab; }
View file
osmo-hnbgw_1.7.0.69.6f5d.tar.xz/src/osmo-hnbgw/ps_rab_fsm.c -> osmo-hnbgw_1.7.0.70.5827.tar.xz/src/osmo-hnbgw/ps_rab_fsm.c
Changed
@@ -23,6 +23,7 @@ #include <osmocom/pfcp/pfcp_cp_peer.h> #include <osmocom/hnbgw/hnbgw.h> +#include <osmocom/hnbgw/hnbgw_pfcp.h> #include <osmocom/hnbgw/context_map.h> #include <osmocom/hnbgw/tdefs.h> #include <osmocom/hnbgw/ps_rab_fsm.h> @@ -143,7 +144,7 @@ static struct osmo_pfcp_msg *ps_rab_new_pfcp_msg_req(struct ps_rab *rab, enum osmo_pfcp_message_type msg_type) { - struct osmo_pfcp_msg *m = osmo_pfcp_cp_peer_new_req(g_hnbgw->pfcp.cp_peer, msg_type); + struct osmo_pfcp_msg *m = osmo_pfcp_cp_peer_new_req(g_hnbgw->pfcp.upf->cp_peer, msg_type); m->h.seid_present = true; m->h.seid = rab->up_f_seid.seid; @@ -320,7 +321,7 @@ m->h.seid = 0; /* Make a new CP-SEID, our local reference for the PFCP session. */ - rab->cp_seid = osmo_pfcp_cp_peer_next_seid(g_hnbgw->pfcp.cp_peer); + rab->cp_seid = osmo_pfcp_cp_peer_next_seid(g_hnbgw->pfcp.upf->cp_peer); cp_f_seid = (struct osmo_pfcp_ie_f_seid){ .seid = rab->cp_seid, };
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
.