Compare commits

...

15 Commits

Author SHA1 Message Date
Oliver Smith 25a0169fa5 d/changelog: add 2.6.6~sysmocom2 2024-01-26 16:54:16 +01:00
Pau Espin fa46ca786c [SMF] Fix fixed-0 IPCP identifier in PCO ack
Related: SYS#6582
Related: https://github.com/open5gs/open5gs/pull/2920
2024-01-26 16:51:58 +01:00
Oliver Smith aaad2f710c d/changelog: add 2.6.6~sysmocom1 2023-10-31 14:32:14 +01:00
Oliver Smith 8047a45b86 debian: remove open5gs-hss 2023-10-31 14:32:14 +01:00
Alexander Couzens a1ff911a08 add missing stuff to remove mongodb 2023-10-31 13:26:34 +01:00
Oliver Smith cea38f9be2 Release 2.4.8+nmu5~sysmocom
* d/postinst: don't restart service in chroot
2023-10-31 13:26:34 +01:00
Daniel Willmann 6fb786b160 Release new version 2023-10-31 13:26:34 +01:00
Daniel Willmann 5b219bcc55 Use default APN if the one from the ESM info resp could not be found 2023-10-31 13:26:34 +01:00
Daniel Willmann 08697fc4f2 Release 2.4.8-nmu2-sysmocom
* Remove dependency on mongodb for open5gs-pcrf
2023-10-31 13:26:34 +01:00
Oliver Smith a0556a4aa1 d/changelog: add 2.4.8+nmu1~sysmocom 2023-10-31 13:26:34 +01:00
Alexander Couzens 22ce7a3aa2 example config: some thoughs about static profiles 2023-10-31 13:26:34 +01:00
Alexander Couzens b6f350178e WIP: PCRF: use a harded profile as session data
Allow to attach with default bearer without mongodb. No secondary bearer or IMS is supported
right now.
2023-10-31 13:26:34 +01:00
Alexander Couzens eaf61712e6 FIXME: remove dependency mongodb. FIXME: use get_option() to dynamic depend on mongodb 2023-10-31 13:26:34 +01:00
Alexander Couzens bbcfcf7090 PCRF: allow to build without mongodb 2023-10-31 13:26:34 +01:00
root 663b983c0d FIXME: libsctp: add define HAVE_NETINET_SCTP_H to allow build on debian bullseye
This is a quick fix. Need to investigate why the autodetect doesn't work
or the compilation otherwise fails.
2023-10-31 13:26:34 +01:00
19 changed files with 229 additions and 38 deletions

View File

@ -1,5 +1,36 @@
db_uri: mongodb://localhost/open5gs
db_json:
default:
af:
ambr:
up: 10000
down: 10000
gmbr:
up: 1000
down: 1000
qci: 4
normal:
ambr:
up: 10000
down: 10000
gmbr:
up: 10000
down: 10000
qci: 5
charging_profiles:
af:
- 1
- 2
- 3
- 4
normal:
- 1
- 2
- 3
- 4
dir:
normal: "/tmp/profiles"
af: "/tmp/profiles_af"
#
# o Set OGS_LOG_INFO to all domain level
# - If `level` is omitted, the default level is OGS_LOG_INFO)

44
debian/changelog vendored
View File

@ -1,3 +1,15 @@
open5gs (2.6.6~sysmocom2) unstable; urgency=medium
* Fix fixed-0 IPCP identifier in PCO ack
-- Oliver Smith <osmith@sysmocom.de> Fri, 26 Jan 2024 16:53:27 +0100
open5gs (2.6.6~sysmocom1) unstable; urgency=medium
* Rebase on top of open5gs.git main of 2023-10-31
-- Oliver Smith <osmith@sysmocom.de> Tue, 31 Oct 2023 13:34:37 +0100
open5gs (2.6.6) unstable; urgency=medium
* Ubuntu 23.04(lunar) Release
@ -250,6 +262,38 @@ open5gs (2.4.9~bionic) bionic; urgency=medium
-- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 20:45:33 +0900
open5gs (2.4.8+nmu5~sysmocom) unstable; urgency=medium
* d/postinst: don't restart service in chroot
-- Oliver Smith <osmith@sysmocom.de> Mon, 30 Jan 2023 09:42:49 +0100
open5gs (2.4.8+nmu4~sysmocom) unstable; urgency=medium
* Fix APN selection
-- Daniel Willmann <dwillmann@sysmocom.de> Fri, 27 Jan 2023 13:11:17 +0100
open5gs (2.4.8+nmu3~sysmocom) unstable; urgency=medium
* Use default APN in case the one from ESM info resp is not found
-- Daniel Willmann <dwillmann@sysmocom.de> Fri, 27 Jan 2023 12:15:23 +0100
open5gs (2.4.8+nmu2~sysmocom) unstable; urgency=medium
* Remove mongodb dependency for pcrf
-- Daniel Willmann <dwillmann@sysmocom.de> Fri, 01 Jul 2022 16:15:32 +0200
open5gs (2.4.8+nmu1~sysmocom) unstable; urgency=medium
* Non-maintainer upload.
* WIP pcrf_simple branch 1e33b7dd373908241429c2bdb1e96c19bf551e02
rebased on latest release
-- Oliver Smith <osmith@sysmocom.de> Fri, 01 Jul 2022 15:38:05 +0200
open5gs (2.4.8) unstable; urgency=medium
* Bug Fixed

19
debian/control vendored
View File

@ -121,29 +121,11 @@ Description: UPF (User Plane Function)
.
This package provides the UPF (User Plane Function)
Package: open5gs-hss
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
mongodb-org | mongodb,
open5gs-common (= ${binary:Version})
Description: HSS (Home Subscriber Server)
Open5GS is a C-language implementation of 5G Core and EPC
Packet Core, i.e. the core network of an NR/LTE network (Release-17)
.
This package provides the HSS (Home Subscriber Server) element of the
EPC, i.e. the central database of mobile network subscribers, with
their IMSI, MSISDN, cryptographic key materials, service subscription
information, etc. It implements the S6a interface towards the MME
using the DIAMETER protocol.
Package: open5gs-pcrf
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends},
${misc:Depends},
mongodb-org | mongodb,
open5gs-common (= ${binary:Version})
Description: PCRF (Policy and Charging Rules Function)
Open5GS is a C-language implementation of 5G Core and EPC
@ -261,7 +243,6 @@ Depends: ${misc:Depends},
open5gs-amf (= ${binary:Version}),
open5gs-sgwu (= ${binary:Version}),
open5gs-upf (= ${binary:Version}),
open5gs-hss (= ${binary:Version}),
open5gs-pcrf (= ${binary:Version}),
open5gs-nrf (= ${binary:Version}),
open5gs-scp (= ${binary:Version}),

View File

@ -1,6 +0,0 @@
usr/bin/open5gs-hssd
configs/freeDiameter/hss.* etc/freeDiameter
configs/open5gs/hss.yaml etc/open5gs
configs/open5gs/tls/hss.key etc/open5gs/tls
configs/open5gs/tls/hss.crt etc/open5gs/tls
configs/systemd/open5gs-hssd.service lib/systemd/system

View File

@ -19,6 +19,7 @@
#include "ogs-dbi.h"
#ifdef OGS_DBI_WITH_MONGODB
int ogs_dbi_msisdn_data(
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data)
{
@ -212,3 +213,15 @@ out:
return rv;
}
#else /* OGS_DBI_WITH_MONGODB */
int ogs_dbi_msisdn_data(
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data)
{
return OGS_ERROR;
}
int ogs_dbi_ims_data(char *supi, ogs_ims_data_t *ims_data)
{
return OGS_ERROR;
}
#endif

View File

@ -28,9 +28,6 @@ libdbi_sources = files('''
path.c
timer.c
'''.split())
libmongoc_dep = dependency('libmongoc-1.0')
libdbi_inc = include_directories('.')
libdbi = library('ogsdbi',
@ -38,10 +35,10 @@ libdbi = library('ogsdbi',
version : libogslib_version,
c_args : '-DOGS_DBI_COMPILATION',
include_directories : [libdbi_inc, libinc],
dependencies : [libcrypt_dep, libapp_dep, libmongoc_dep],
dependencies : [libcrypt_dep, libapp_dep],
install : true)
libdbi_dep = declare_dependency(
link_with : libdbi,
include_directories : [libdbi_inc, libinc],
dependencies : [libcrypt_dep, libapp_dep, libmongoc_dep])
dependencies : [libcrypt_dep, libapp_dep])

34
lib/dbi/meson_dummy.h Normal file
View File

@ -0,0 +1,34 @@
/*
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* 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 General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef MESON_DUMMY_H
#define MESON_DUMMY_H
#ifdef __cplusplus
extern "C" {
#endif
struct dummy_bson;
typedef struct dummy_bson bson_t;
#ifdef __cplusplus
}
#endif
#endif /* MESON_DUMMY_H */

View File

@ -17,12 +17,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <mongoc.h>
#include "ogs-dbi.h"
int __ogs_dbi_domain;
#ifdef OGS_DBI_WITH_MONGODB
#include <mongoc.h>
static ogs_mongoc_t self;
/*
@ -251,3 +253,28 @@ int ogs_dbi_poll_change_stream(void)
return OGS_ERROR;
#endif
}
#else /* OGS_DBI_WITH_MONGODB */
int ogs_mongoc_init(const char *db_uri)
{
return OGS_ERROR;
}
void ogs_mongoc_final(void)
{
}
ogs_mongoc_t *ogs_mongoc(void)
{
return NULL;
}
int ogs_dbi_init(const char *db_uri)
{
return OGS_OK;
}
void ogs_dbi_final()
{
}
#endif

View File

@ -24,8 +24,6 @@
#ifndef OGS_MONGOC_H
#define OGS_MONGOC_H
#include <mongoc.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

View File

@ -19,6 +19,8 @@
#include "ogs-dbi.h"
#ifdef OGS_DBI_WITH_MONGODB
int ogs_dbi_process_change_stream(const bson_t *document)
{
int rv;
@ -39,3 +41,5 @@ int ogs_dbi_process_change_stream(const bson_t *document)
return OGS_OK;
}
#endif

View File

@ -20,6 +20,8 @@
#ifndef OGS_DBI_PATH_H
#define OGS_DBI_PATH_H
#include "meson_dummy.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -19,6 +19,7 @@
#include "ogs-dbi.h"
#ifdef OGS_DBI_WITH_MONGODB
int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn,
ogs_session_data_t *session_data)
{
@ -500,3 +501,27 @@ out:
return rv;
}
#else /* OGS_DBI_WITH_MONGODB */
int ogs_dbi_session_data(char *supi, ogs_s_nssai_t *s_nssai, char *dnn,
ogs_session_data_t *session_data)
{
ogs_session_t *session = &session_data->session;
ogs_qos_t *qos = &session->qos;
session->name = ogs_strndup("staticprof", strlen("foobar"));
/* check if have to set type */
session->ambr.downlink = 300 * 1024 * 1024;
session->ambr.uplink = 150 * 1024 * 1024;
session->qos.index = OGS_QOS_INDEX_5;
session->qos.arp.priority_level = 1;
session->qos.mbr.downlink = 10;
session->qos.mbr.uplink = 10;
session->qos.gbr.downlink = 10;
session->qos.gbr.uplink = 10;
return OGS_OK;
}
#endif /* OGS_DBI_WITH_MONGODB */

View File

@ -19,6 +19,7 @@
#include "ogs-dbi.h"
#ifdef OGS_DBI_WITH_MONGODB
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
{
int rv = OGS_OK;
@ -794,3 +795,31 @@ out:
return rv;
}
#else
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
{
return OGS_ERROR;
}
int ogs_dbi_update_sqn(char *supi, uint64_t sqn)
{
return OGS_ERROR;
}
int ogs_dbi_update_imeisv(char *supi, char *imeisv)
{
return OGS_ERROR;
}
int ogs_dbi_increment_sqn(char *supi)
{
return OGS_ERROR;
}
int ogs_dbi_subscription_data(char *supi,
ogs_subscription_data_t *subscription_data)
{
return OGS_ERROR;
}
#endif /* OGS_DBI_WITH_MONGODB */

View File

@ -46,6 +46,7 @@ if host_system == 'darwin'
libsctp_sources += files('ogs-usrsctp.c')
libsctp_conf.set('HAVE_USRSCTP', 1)
else
libsctp_conf.set('HAVE_NETINET_SCTP_H', 1)
sctp_dep = cc.find_library('sctp', required : false)
libsctp_sources += files('ogs-lksctp.c')
endif

View File

@ -127,7 +127,7 @@ subdir('src')
subdir('misc')
# Don't build the tests unless we can run them (either natively or in an exe wrapper)
build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper())
if build_tests
if build_tests and get_option('mongodb')
subdir('tests')
endif

View File

@ -1,2 +1,4 @@
option('fuzzing', type: 'boolean', value: false, description: 'Enable fuzzing tests')
option('lib_fuzzing_engine', type : 'string', value : '', description : 'Path to the libFuzzer engine library')
option('metrics_impl', type : 'combo', choices : ['void', 'prometheus'], value : 'void', description : 'libogsmetrics implementation')
option('mongodb', type : 'boolean', value : 'false', description : 'build with mongo db support')

View File

@ -34,7 +34,9 @@ version_conf.set_quoted('OPEN5GS_VERSION', package_version)
configure_file(output : 'version.h', configuration : version_conf)
subdir('mme')
subdir('hss')
if get_option('mongodb')
subdir('hss')
endif
subdir('sgwc')
subdir('sgwu')
subdir('pcrf')

View File

@ -189,8 +189,14 @@ int esm_handle_information_response(mme_sess_t *sess,
if (rsp->presencemask &
OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_ACCESS_POINT_NAME_PRESENT) {
sess->session = mme_session_find_by_apn(
ogs_session_t *session = mme_session_find_by_apn(
mme_ue, rsp->access_point_name.apn);
if (session) {
sess->session = session;
} else {
ogs_error(" APN[%s] not found, using default!", rsp->access_point_name.apn);
sess->session = mme_default_session(mme_ue);
}
}
if (rsp->presencemask &

View File

@ -2854,6 +2854,7 @@ int smf_pco_build(uint8_t *pco_buf, uint8_t *buffer, int length)
ogs_assert(num_of_ipcp <= OGS_PCO_MAX_NUM_OF_IPCP);
pco_ipcp[num_of_ipcp].code = 2; /* Code : Configuration Ack */
pco_ipcp[num_of_ipcp].identifier = ipcp->identifier; /* ID: Needs to match request */
out_len = 4;
/* Primary DNS Server IP Address */