mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +00:00
[SBI] Re-factor NF Instance Context (#3093)
Fixed not using Reference Count for adding/deleting NF Instances.
Up until now, NF Instances have been managed by referencing the Reference Count.
Initially, when an NF Instance is added, the Reference Count is incremented and
when it is deleted, the Reference Count is decremented.
If a UE discovers another NF Instance through the NF Discovery function,
the Reference Count is incremented. And if a UE de-registers,
the Reference Count of the discovered NF is decremented.
However, there's a problem with this approach.
When other NF is de-registered,
there is no guarantee that it will be 100% notified.
For example, if a UDM is de-registered, but an SCP is de-registered before it,
the AMF will not be notified that the UDM has been de-registered.
In situations where this is not clear, Reference Count cannot be used.
Therefore, we have modified it to not use the Reference Count method.
Also, when a UE connects, it is modified to always search
whether an NF Instance exists by NF Instance ID whenever it is discovered.
To do this, we modified lib/sbi/path.c as shown below.
```diff
@@ -281,13 +281,15 @@ int ogs_sbi_discover_and_send(ogs_sbi_xact_t *xact)
}
/* Target NF-Instance */
- nf_instance = sbi_object->service_type_array[service_type].nf_instance;
+ nf_instance = ogs_sbi_nf_instance_find(
+ sbi_object->service_type_array[service_type].nf_instance_id);
if (!nf_instance) {
nf_instance = ogs_sbi_nf_instance_find_by_discovery_param(
target_nf_type, requester_nf_type, discovery_option);
- if (nf_instance)
- OGS_SBI_SETUP_NF_INSTANCE(
- sbi_object->service_type_array[service_type], nf_instance);
+ if (nf_instance) {
+ OGS_SBI_SETUP_NF_INSTANCE_ID(
+ sbi_object->service_type_array[service_type], nf_instance->id);
+ }
}
```
This commit is contained in:
parent
9d8d560be7
commit
7a9fea8aec
21 changed files with 149 additions and 169 deletions
88
.github/workflows/meson-ci.yml
vendored
88
.github/workflows/meson-ci.yml
vendored
|
|
@ -2,51 +2,51 @@ name: Meson Continuous Integration
|
|||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
macos-latest:
|
||||
name: Build and Test on MacOS Latest
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
# - name: Install MongoDB with Package Manager
|
||||
# macos-latest:
|
||||
# name: Build and Test on MacOS Latest
|
||||
# runs-on: macos-latest
|
||||
# steps:
|
||||
## - name: Install MongoDB with Package Manager
|
||||
## run: |
|
||||
## brew tap mongodb/brew
|
||||
## brew install mongodb-community
|
||||
## brew services start mongodb-community
|
||||
# - name: Create the TUN device with the interface name `ogstun`.
|
||||
# run: |
|
||||
# brew tap mongodb/brew
|
||||
# brew install mongodb-community
|
||||
# brew services start mongodb-community
|
||||
- name: Create the TUN device with the interface name `ogstun`.
|
||||
run: |
|
||||
sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
|
||||
sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
|
||||
- name: Install the dependencies for building the source code.
|
||||
run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@main
|
||||
- name: Setup Meson Build
|
||||
run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build
|
||||
env:
|
||||
CC: gcc
|
||||
- name : Build Open5GS
|
||||
run: ninja -C build
|
||||
- name: Test Open5GS
|
||||
run: sudo meson test -C build -v crypt unit
|
||||
|
||||
# sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
|
||||
# sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
|
||||
# - name: Install the dependencies for building the source code.
|
||||
# run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
|
||||
# - name: Check out repository code
|
||||
# uses: actions/checkout@main
|
||||
# - name: Setup Meson Build
|
||||
# run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build
|
||||
# env:
|
||||
# CC: gcc
|
||||
# - name : Build Open5GS
|
||||
# run: ninja -C build
|
||||
# - name: Test Open5GS
|
||||
# run: sudo meson test -C build -v crypt unit
|
||||
#
|
||||
ubuntu-latest:
|
||||
name: Build and Test on Ubuntu Latest
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue