Commit Graph

3743 Commits

Author SHA1 Message Date
Alexander Couzens 1151c6ac0f [dbi]: allow to build without mongodb
The tests won't be build as they depend on mongodb.
To build without mongodb do

meson configure -Dmongodb=false
2022-09-12 00:04:54 +02:00
Alexander Couzens 8960372ed3 [pcrf]: Gx: parse 3GPP Charging Characteristic
Also pass the 3GPP-Charging-Characteristics to the dbi session_data call
2022-09-12 00:04:54 +02:00
Alexander Couzens 1a6ceca4b5 [app/pcrf]: parse json database configuration
To make use of the new json database backend, allow the pcrf to
parse json backend configuration.
2022-09-12 00:04:54 +02:00
Alexander Couzens 9d7737c4b7 [dbi] session_data(): add argument charging characteristics
Add the charging characteristics to the dbi function to allow the
backend to decide the profile based on it.
The charging characteristics can be filled by the HSS and will
be passed by the PCEF towards the PCRF.

This is an API dbi breakage.
2022-09-12 00:04:54 +02:00
Alexander Couzens 0d6ef1e8ac [dbi] add database backend json
Add json based database backend.

TODO: add example json interface
2022-09-12 00:04:54 +02:00
Alexander Couzens c54fb59a87 [dbi]: make all db functions optional
Allow database driver to only implement parts of the database driver.
In preprataion of the json interface which will only implement
session_data as might only be used by the PCRF.
2022-09-11 19:29:04 +02:00
Alexander Couzens 0e0de176fe [dbi]: make ogs_dbi_final depend on the selected database driver 2022-09-11 19:29:04 +02:00
Alexander Couzens f0c97bff19 [dbi]: mongo: merge all parts from ogs_dbi_final() into ogs_mongoc_final()
Nobody is calling ogs_mongoc_final() directly. In preparation of making ogs_dbi_final() more generic
2022-09-11 19:29:04 +02:00
Alexander Couzens 9c66348213 [dbi]: introduce an abstraction layer to allow multiple database backends
The current dbi only supports a single database backend. Add
an abstraction layer to allow multiple database backends.
Introduce a dbi backend struct containing all database functions.
2022-09-11 19:29:04 +02:00
Alexander Couzens 68efeac909 [dbi]: move all mongo related files into subdirectory 2022-09-11 19:29:04 +02:00
Alexander Couzens 8b3abcce2d [dbi]: ogs-dbi.h: add comment to the include of ogs-mongoc.h
The only user of ogs-mongoc.h are the tests. Add comment
to remove the comment as soon they aren't depend on the ogs-mongoc.h
2022-09-11 19:29:04 +02:00
Alexander Couzens c72f41fdd3 [dbi]: ogs_mongoc.h: remove include <mongoc.h>
To allow the include to work even when build without mongo installed.
No data types require mongoc.h to be in ogs_mongoc.h.
2022-09-11 19:29:04 +02:00
Sukchan Lee 53d75e74cb Added Release Notes for v2.4.10 2022-09-09 10:32:40 +09:00
Sukchan Lee a0b7865a43 Release v2.4.10 2022-09-09 09:40:50 +09:00
Sukchan Lee 1f165c1c33 Follow-up on #1747 2022-09-08 23:17:04 +09:00
Bostjan Meglic 31a3788021 [AMF] Handle APN/DNN names as case-insensitive
In case that APN name sent from UE does not case-match with the one
configured in the database, AMF would reject the registration with the
message:

[gmm] WARNING: [imsi-xxx] DNN Not Supported OR Not Subscribed in the
Slice (../src/amf/gmm-handler.c:1051)
2022-09-08 23:13:47 +09:00
Sukchan Lee f54bccacf5 Support service-based NF subscription 2022-09-08 22:12:01 +09:00
Bostjan Meglic 87cd34d300 Minor typo fix 2022-09-07 18:01:21 +09:00
jmasterfunk84 eb55e4ee3a Also format for pcc_rule. UE and SMF look okay as medium_data as first section. 2022-09-07 17:58:32 +09:00
jmasterfunk84 36254e5df4 When using longer APN name, it is obscured due to short field. 2022-09-07 17:58:32 +09:00
Bostjan Meglic 51669d73a0
[AMF] Accept Deregistration Notification from UDM only for registered UE (#1737)
Add additional check when receiving Deregistration Notification from
UDM. UE should already be in registered state before accepting the
request and deregistering the UE.

Also add additional check that PCF association policy exists before
sending a delete request to PCF.
2022-09-06 19:47:42 +09:00
EugeneBogush e55d4d8300 removing extra lines
I did not find the purpose of their use
2022-09-05 23:35:18 +09:00
Sukchan Lee c716a1294a [CORE] Check if timer is double free in SBI module 2022-09-03 15:59:39 +09:00
Sukchan Lee acc36a344f [PCF] Check NF service configuration
* npcf-smpolicycontrol - enabled or disabled
* npcf-policyauthorization - enabled or disabled

Only one of npcf-smpolicycontrol and npcf-policyauthorization cannot be enabled. (../src/pcf/sbi-path.c:151)

They can be enabled or disabled together.
2022-09-03 13:07:00 +09:00
Bostjan Meglic 9c84570a48 [SBI] Send NF discovery query with service-names delimited with comma
OpenAPI specification for sending NF discovery query with
"service-names" parameter is defined as folowing:

- name: service-names
  ...
  style: form
  explode: false

According to OpenAPI specification, this means array items
should be delimited with a comma character (example: /users?id=3,4,5).
2022-09-03 10:43:59 +09:00
Sukchan Lee d87d61e851 Follow-up on #1729 2022-09-03 09:20:48 +09:00
mitmitmitm af1f8d4f4a [SMF] Handle upCnxState=ACTIVATING by replying with 200 instead of 204
According to TS 29.502 5.2.2.3.2.2., we should reply with a 200 response
including the upCnxState attribute.
2022-09-03 09:08:27 +09:00
Sukchan Lee c28faf00ea Added simple test program
./tests/registration/registration simple-test
./tests/vonr/vonr simple-test
./tests/attach/attach simple-test
./tests/volte/volte simple-test
2022-09-03 07:28:48 +09:00
Sukchan Lee fcb15b69f7 [MME] Fixed buffer overflow (#1728) 2022-09-02 23:39:59 +09:00
Sukchan Lee 1d17e68c56 [ALL] Removing trailing whitespace and tab 2022-09-02 23:38:39 +09:00
Sukchan Lee 5295c108ad Added Service-based NF discovery
== Known limitation ==
Placing npcf-smpolicycontrol and pcf-policyauthorization
in different NFs is not supported. Both npcf-smpolicycontrol
and pcf-policyauthorization should be placed in the same NF.
2022-09-02 23:04:57 +09:00
Alexander Couzens b175394839 [SMF] fixup send 3GPP-Charging-Characteristics on Gx if received on S5/8c
- Gy instead of Gx AVP was used.
- Use correct avp position and avp variables.

Fixes: 657eef9169 ("[SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c")
2022-08-31 06:38:08 +09:00
Sukchan Lee c7830a78e6 [Conf] Changed MTU size from 1500 to 1400 2022-08-28 23:10:36 +09:00
Sukchan Lee eab29fad9a Follow up on #1715
* Changed <TAB> to <SPACE>*4

* Changed snprintf to ogs_snprintf
2022-08-27 18:43:34 +09:00
Alexander Couzens 657eef9169 [SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and forwarded by the MME towards the SMF.
2022-08-27 18:36:54 +09:00
Alexander Couzens 41e4460769 diameter: Gx: add AVP 3GPP-Charging-Characteristics
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and pass through to the Gx interface.

See ETSI 29.212 5.4.0.1 for further details.
2022-08-27 18:36:54 +09:00
Sukchan Lee 9f98d421a0 [SBI] Added config for service-names discovery 2022-08-27 10:49:07 +09:00
Sukchan Lee f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Bostjan Meglic e79e35dd74
[metrics] Fix double-free on application exit (#1717) 2022-08-26 18:15:32 +09:00
Sukchan Lee 9b10d70c77 [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
Sukchan Lee 83a20b82c7 Follow up on #1714
* Changed sprintf to ogs_snprintf

* Limited to 80 column
2022-08-25 16:35:27 +09:00
jmasterfunk84 49349cdb75
[MME] Dictionary Updates and IDR Support (#1714)
* Add Diameter Dictionary Elements

* Initial IDR Framework

* Resolve Compile Issues

* Moving Closer

* Compile error

* Somewhat Working stuffing Code

* Add Timestamp Changes

* Cleanup some of this code.  mme_s6a_handle_idr in s6a-handler.c removed for now, since it will only come in handy when IDR flag is set to request current location, which would involve breaking out into paging.  I think there's a few other things we can do just within fd-path first.

* further removal of mme_s6a_handle_idr
2022-08-25 15:43:21 +09:00
Bostjan Meglic def99aff7f [SMF] Fix abort on app exit when no Diameter configuration
In case that SMF was configured to run without Diameter, it would crash
on application exit due to uninitialized variables/pointers.

ERROR  pid:unnamed in fd_sess_handler_destroy@sessions.c:324: ERROR: Invalid parameter '(handler && ( ((*handler) != ((void *)0)) && ( ((struct session_handler *)(*handler))->eyec == 0x53554AD1) ))', 22
[smf] FATAL: smf_gx_final: Assertion `ret == 0' failed. (../src/smf/gx-path.c:1353)
2022-08-24 01:39:24 +09:00
Sukchan Lee 242b138597 [MME] UE-initiated detach removes S1 only (#1698) 2022-08-20 01:08:20 +09:00
Sukchan Lee 9bb9a4cae9 [MME] Detach removed MME-UE context (#1698) 2022-08-20 00:17:55 +09:00
Sukchan Lee 321c8d4cf9 [SGsAP] Changed message if Paging failed (#1701)
The problem occurred in the following scenario:

1. VLR sent PAGING-REQUEST to the MME
2. MME sent S1-Paging to the UE
3. Paging failed
4. MME responded SERVICE-REQUEST to the VLR
5. VLR sent DOWNLINK-UNITDATA to the MME
6. Even though there is no S1 Context,
   MME try to sent DownlinkNASTransport message to the UE.
7. So, the problem occurred.

I've changed the number 4 PAGING-REJECT instead of SERVICE-REQUEST.
2022-08-19 18:58:55 +09:00
Sukchan Lee 909f407c20 [MME] Fixed GTP transaction crash (#1696) 2022-08-19 17:23:10 +09:00
Sukchan Lee a9694d6474 [MME] Follow-up Cancel Location Handling (#1698) 2022-08-19 16:52:39 +09:00
jmasterfunk84 c98333bbfe
[MME] Cancel Location Handling (#1698)
* CLR while idle is broken after 7031856cd7

Cancel Location Request arriving while UE is idle will not proceed to paging due to this check for S1 connection.  Using new flag "isAnswer" to bypass this check to allow paging to occur when we are not doing a AIA/ULA related procedure.

* No Context Setup is required when sending the detach request.  If the paging was due to wanting to send a Detach Request to the UE, then we fast track to sending the detach request.

* emm-sm.c:
In the case of MME initiated detach while UE is idle, there is no initial conext setup.  We go right from the service request after paging into sending the detach request.  TS23.401

mme-path.c:
Using nas_eps.type in the case of MME Initiated Detach while UE is idle does not work.  nas_eps.type would represent the service request.

mme-s11-handler.c:
After S11 action, no action should be taken.  We want to wait for the detach accept from the UE before proceeding with the S1 release (detach).

* InitialContextSetup should occur for detach.
2022-08-19 16:44:06 +09:00
Sukchan Lee 444e182288 [PFCP] security vulnerability continued in d99491a 2022-08-16 20:32:42 +09:00