mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-03 13:33:26 +00:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb9b780449 | ||
|
|
039b9d0aaa | ||
|
|
1326fc85dc | ||
|
|
4667b99c92 | ||
|
|
7cfeb2e9f9 | ||
|
|
005cd30e02 | ||
|
|
dde0785375 | ||
|
|
16f8d5fa49 | ||
|
|
e71a158ed7 | ||
|
|
c918b4b5b6 | ||
|
|
2471b1b53d | ||
|
|
f278d58a69 | ||
|
|
2aaa8200c2 | ||
|
|
65e96dd75c | ||
|
|
ec377a8849 | ||
|
|
bedd05e654 | ||
|
|
8959c787bc | ||
|
|
f728e5da89 | ||
|
|
442e7d44e7 | ||
|
|
e1e3f254e2 | ||
|
|
997554bbb7 | ||
|
|
38ff2dc6f7 | ||
|
|
a396ea8fc1 | ||
|
|
7f774884ea | ||
|
|
50f403279a | ||
|
|
00c96a3f0f | ||
|
|
4537142929 | ||
|
|
e0869104c6 | ||
|
|
c48f107520 | ||
|
|
780f829962 | ||
|
|
449b5b484f | ||
|
|
d9b5c29a9b | ||
|
|
9e664a744b | ||
|
|
a252fae84f | ||
|
|
47c9f4e4a0 | ||
|
|
e31a8474b2 | ||
|
|
774e1b0ebd | ||
|
|
ac37e00b42 | ||
|
|
118d62d42d | ||
|
|
80a9497afd | ||
|
|
ef07ccfb88 | ||
|
|
5d460b0577 | ||
|
|
8dab1852cc | ||
|
|
899c121478 | ||
|
|
fe89f7cd11 | ||
|
|
611986794b | ||
|
|
caa73e1f5e | ||
|
|
4d6692d8fe | ||
|
|
64508c2e5c | ||
|
|
35d5b7e16e | ||
|
|
3d11b87127 | ||
|
|
873cf398c7 | ||
|
|
dfaf2f1567 | ||
|
|
b6a030d82b | ||
|
|
3df75e37df | ||
|
|
f861919507 | ||
|
|
257f398a11 | ||
|
|
4a1ddb6650 |
24
README.md
24
README.md
@@ -25,26 +25,24 @@ If you find Open5GS useful for work, please consider supporting this Open Source
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<td align="center" valign="middle" width="222px">
|
||||
<a href="https://www.auctionsoftware.com/" target="_blank">
|
||||
<img width="222px" src="https://open5gs.org/assets/img/asLogonew.png">
|
||||
<img src="https://open5gs.org/assets/img/asLogonew.png">
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" valign="middle">
|
||||
<td align="center" valign="middle" width="222px">
|
||||
<a href="https://www.wearetriple.com/" target="_blank">
|
||||
<img width="222px" src="https://open5gs.org/assets/img/triple_logo.png">
|
||||
<img src="https://open5gs.org/assets/img/triple_logo.png">
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" valign="middle">
|
||||
<a href="https://www.accessparks.com/" target="_blank">
|
||||
<img width="222px" src="https://open5gs.org/assets/img/AccessParks.png">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<td align="center" valign="middle" width="222px">
|
||||
<a href="https://skylarkwireless.com/" target="_blank">
|
||||
<img width="222px" src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
|
||||
<img src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" valign="middle" width="222px">
|
||||
<a href="https://sysmocom.de/" target="_blank">
|
||||
<img src="https://open5gs.org/assets/img/sysmocom-logo-only.png">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -89,6 +91,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -152,6 +155,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -169,6 +173,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -214,6 +219,11 @@ nssf:
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -123,6 +125,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -186,6 +189,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -203,6 +207,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -248,6 +253,11 @@ nssf:
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
||||
@@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
||||
@@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
||||
@@ -175,6 +175,7 @@ TLS_CA = "@sysconfdir@/freeDiameter/cacert.pem";
|
||||
# exchanges.
|
||||
# Default: Relaying is enabled.
|
||||
#NoRelay;
|
||||
NoRelay;
|
||||
|
||||
# Number of server threads that can handle incoming messages at the same time.
|
||||
# Default: 4
|
||||
|
||||
@@ -42,6 +42,7 @@ example_conf = '''
|
||||
slice.yaml
|
||||
srslte.yaml
|
||||
sample.yaml
|
||||
non3gpp.yaml
|
||||
'''.split()
|
||||
|
||||
foreach file : example_conf
|
||||
|
||||
233
configs/non3gpp.yaml.in
Normal file
233
configs/non3gpp.yaml.in
Normal file
@@ -0,0 +1,233 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
logger:
|
||||
|
||||
parameter:
|
||||
# no_nrf: true
|
||||
# no_amf: true
|
||||
# no_smf: true
|
||||
# no_upf: true
|
||||
# no_ausf: true
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
# no_sgwu: true
|
||||
# no_pcrf: true
|
||||
# no_hss: true
|
||||
|
||||
mme:
|
||||
freeDiameter:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: hss.localdomain
|
||||
addr: 127.0.0.8
|
||||
|
||||
s1ap:
|
||||
- addr: 127.0.0.2
|
||||
gtpc:
|
||||
- addr: 127.0.0.2
|
||||
gummei:
|
||||
plmn_id:
|
||||
mcc: 901
|
||||
mnc: 70
|
||||
mme_gid: 2
|
||||
mme_code: 1
|
||||
tai:
|
||||
plmn_id:
|
||||
mcc: 901
|
||||
mnc: 70
|
||||
tac: 1
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
|
||||
network_name:
|
||||
full: Open5GS
|
||||
|
||||
sgwc:
|
||||
gtpc:
|
||||
- addr: 127.0.0.3
|
||||
pfcp:
|
||||
- addr: 127.0.0.3
|
||||
|
||||
smf:
|
||||
sbi:
|
||||
- addr: 127.0.0.4
|
||||
port: 7777
|
||||
pfcp:
|
||||
- addr: 127.0.0.4
|
||||
gtpc:
|
||||
- addr: 127.0.0.4
|
||||
- addr: ::1
|
||||
gtpu:
|
||||
- addr: 127.0.0.4
|
||||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
- 2001:4860:4860::8888
|
||||
- 2001:4860:4860::8844
|
||||
mtu: 1400
|
||||
freeDiameter:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: pcrf.localdomain
|
||||
addr: 127.0.0.9
|
||||
- identity: aaa.localdomain
|
||||
addr: 127.0.0.1
|
||||
amf:
|
||||
sbi:
|
||||
- addr: 127.0.0.5
|
||||
port: 7777
|
||||
ngap:
|
||||
- addr: 127.0.0.5
|
||||
guami:
|
||||
- plmn_id:
|
||||
mcc: 901
|
||||
mnc: 70
|
||||
amf_id:
|
||||
region: 2
|
||||
set: 1
|
||||
tai:
|
||||
- plmn_id:
|
||||
mcc: 901
|
||||
mnc: 70
|
||||
tac: 1
|
||||
plmn_support:
|
||||
- plmn_id:
|
||||
mcc: 901
|
||||
mnc: 70
|
||||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ NIA2, NIA1, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
|
||||
sgwu:
|
||||
pfcp:
|
||||
- addr: 127.0.0.6
|
||||
gtpu:
|
||||
- addr: 127.0.0.6
|
||||
|
||||
upf:
|
||||
pfcp:
|
||||
- addr: 127.0.0.7
|
||||
gtpu:
|
||||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: mme.localdomain
|
||||
addr: 127.0.0.2
|
||||
- identity: aaa.localdomain
|
||||
addr: 127.0.0.1
|
||||
pcrf:
|
||||
freeDiameter:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
|
||||
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
|
||||
connect:
|
||||
- identity: smf.localdomain
|
||||
addr: 127.0.0.4
|
||||
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- 127.0.0.10
|
||||
- ::1
|
||||
port: 7777
|
||||
|
||||
ausf:
|
||||
sbi:
|
||||
- addr: 127.0.0.11
|
||||
port: 7777
|
||||
|
||||
udm:
|
||||
sbi:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
nssf:
|
||||
sbi:
|
||||
- addr: 127.0.0.14
|
||||
port: 7777
|
||||
nsi:
|
||||
- addr: ::1
|
||||
port: 7777
|
||||
s_nssai:
|
||||
sst: 1
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
186
configs/open5gs/bsf.yaml.in
Normal file
186
configs/open5gs/bsf.yaml.in
Normal file
@@ -0,0 +1,186 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
#
|
||||
# logger:
|
||||
#
|
||||
# o Set OGS_LOG_INFO to all domain level
|
||||
# - If `level` is omitted, the default level is OGS_LOG_INFO)
|
||||
# - If `domain` is omitted, the all domain level is set from 'level'
|
||||
# (Nothing is needed)
|
||||
#
|
||||
# o Set OGS_LOG_ERROR to all domain level
|
||||
# - `level` can be set with none, fatal, error, warn, info, debug, trace
|
||||
# level: error
|
||||
#
|
||||
# o Set OGS_LOG_DEBUG to mme/emm domain level
|
||||
# level: debug
|
||||
# domain: mme,emm
|
||||
#
|
||||
# o Set OGS_LOG_TRACE to all domain level
|
||||
# level: trace
|
||||
# domain: core,sbi,bsf,event,tlv,mem,sock
|
||||
#
|
||||
logger:
|
||||
file: @localstatedir@/log/open5gs/bsf.log
|
||||
#
|
||||
# bsf:
|
||||
#
|
||||
# <SBI Server>
|
||||
#
|
||||
# o SBI Server(http://<all address available>:80)
|
||||
# sbi:
|
||||
#
|
||||
# o SBI Server(http://<any address>:80)
|
||||
# sbi:
|
||||
# - addr:
|
||||
# - 0.0.0.0
|
||||
# - ::0
|
||||
# port: 7777
|
||||
#
|
||||
# o SBI Server(https://<all address avaiable>:443)
|
||||
# sbi:
|
||||
# - tls:
|
||||
# key: bsf.key
|
||||
# pem: bsf.pem
|
||||
#
|
||||
# o SBI Server(https://127.0.0.15:443, http://[::1]:80)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.15
|
||||
# tls:
|
||||
# key: bsf.key
|
||||
# pem: bsf.pem
|
||||
# - addr: ::1
|
||||
#
|
||||
# o SBI Server(http://bsf.open5gs.org:80)
|
||||
# sbi:
|
||||
# - name: bsf.open5gs.org
|
||||
#
|
||||
# o SBI Server(http://127.0.0.15:7777)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.15
|
||||
# port: 7777
|
||||
#
|
||||
# o SBI Server(http://<eth0 IP address>:80)
|
||||
# sbi:
|
||||
# - dev: eth0
|
||||
#
|
||||
# o Provide custom SBI address to be advertised to NRF
|
||||
# sbi:
|
||||
# - dev: eth0
|
||||
# advertise: open5gs-bsf.svc.local
|
||||
#
|
||||
# sbi:
|
||||
# - addr: localhost
|
||||
# advertise:
|
||||
# - 127.0.0.99
|
||||
# - ::1
|
||||
#
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
#
|
||||
# nrf:
|
||||
#
|
||||
# <SBI Client>>
|
||||
#
|
||||
# o SBI Client(http://127.0.0.10:7777)
|
||||
# sbi:
|
||||
# addr: 127.0.0.10
|
||||
# port: 7777
|
||||
#
|
||||
# o SBI Client(https://127.0.0.10:443, http://nrf.open5gs.org:80)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.10
|
||||
# tls:
|
||||
# key: nrf.key
|
||||
# pem: nrf.pem
|
||||
# - name: nrf.open5gs.org
|
||||
#
|
||||
# o SBI Client(http://[fe80::1%@loopback_devname@]:80)
|
||||
# If prefer_ipv4 is true, http://127.0.0.10:80 is selected.
|
||||
#
|
||||
# sbi:
|
||||
# addr:
|
||||
# - 127.0.0.10
|
||||
# - fe80::1%@loopback_devname@
|
||||
#
|
||||
nrf:
|
||||
sbi:
|
||||
- addr:
|
||||
- 127.0.0.10
|
||||
- ::1
|
||||
port: 7777
|
||||
|
||||
#
|
||||
# parameter:
|
||||
#
|
||||
# o Number of output streams per SCTP associations.
|
||||
# sctp_streams: 30
|
||||
#
|
||||
# o Disable use of IPv4 addresses (only IPv6)
|
||||
# no_ipv4: true
|
||||
#
|
||||
# o Disable use of IPv6 addresses (only IPv4)
|
||||
# no_ipv6: true
|
||||
#
|
||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||
# prefer_ipv4: true
|
||||
#
|
||||
parameter:
|
||||
|
||||
#
|
||||
# max:
|
||||
#
|
||||
# o Maximum Number of UE per AMF/MME
|
||||
# ue: 1024
|
||||
# o Maximum Number of gNB/eNB per AMF/MME
|
||||
# gnb: 32
|
||||
#
|
||||
max:
|
||||
|
||||
#
|
||||
# pool:
|
||||
#
|
||||
# o The default memory pool size was set assuming 1024 UEs.
|
||||
# To connect more UEs, you need to increase the size further.
|
||||
#
|
||||
# - Pool-size 128 => 65536 Number
|
||||
# - Pool-size 256 => 16384 Number
|
||||
# - Pool-size 512 => 4096 Number
|
||||
# - Pool-size 1024 => 1024 Number
|
||||
# - Pool-size 2048 => 512 Number
|
||||
# - Pool-size 8192 => 128 Number
|
||||
# - Pool-size 1024*1024 => 8 Number
|
||||
#
|
||||
# 128: 65536
|
||||
# 256: 16384
|
||||
# 512: 4096
|
||||
# 1024: 1024
|
||||
# 2048: 512
|
||||
# 8192: 128
|
||||
# big: 8
|
||||
#
|
||||
pool:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o NF Instance Heartbeat (Default : 0)
|
||||
# NFs will not send heart-beat timer in NFProfile
|
||||
# NRF will send heart-beat timer in NFProfile
|
||||
#
|
||||
# o NF Instance Heartbeat (20 seconds)
|
||||
# NFs will send heart-beat timer (20 seconds) in NFProfile
|
||||
# NRF can change heart-beat timer in NFProfile
|
||||
#
|
||||
# nf_instance:
|
||||
# heartbeat: 20
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
@@ -34,6 +34,7 @@ open5gs_conf = '''
|
||||
udr.yaml
|
||||
pcf.yaml
|
||||
nssf.yaml
|
||||
bsf.yaml
|
||||
'''.split()
|
||||
|
||||
foreach file : open5gs_conf
|
||||
|
||||
@@ -41,7 +41,8 @@ pcrf:
|
||||
# prefer_ipv4: true
|
||||
#
|
||||
# o Legacy support for pre-release LTE 11 devices to do calling
|
||||
# - Replace IPv4/v6 local addr field in AAR Media-Subcomponent AVP by any
|
||||
# - Replace IPv4/v6 local addr field in AAR Media-Subcomponent AVP
|
||||
# by 'any local port'
|
||||
# no_ipv4v6_local_addr_in_packet_filter: true
|
||||
#
|
||||
parameter:
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -89,6 +91,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -152,6 +155,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -169,6 +173,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -213,6 +218,11 @@ nssf:
|
||||
port: 7777
|
||||
s_nssai:
|
||||
sst: 1
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -89,6 +91,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -156,6 +159,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -173,6 +177,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -228,6 +233,11 @@ nssf:
|
||||
sst: 1
|
||||
sd: 009000
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -89,6 +91,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -152,6 +155,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -169,6 +173,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -214,6 +219,11 @@ nssf:
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -29,6 +29,7 @@ systemd_conf_in = '''
|
||||
open5gs-udmd.service
|
||||
open5gs-pcfd.service
|
||||
open5gs-nssfd.service
|
||||
open5gs-bsfd.service
|
||||
open5gs-udrd.service
|
||||
'''.split()
|
||||
|
||||
|
||||
18
configs/systemd/open5gs-bsfd.service.in
Normal file
18
configs/systemd/open5gs-bsfd.service.in
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Open5GS BSF Daemon
|
||||
Wants=mongodb.service mongod.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
User=open5gs
|
||||
Group=open5gs
|
||||
|
||||
Restart=always
|
||||
ExecStart=@bindir@/open5gs-bsfd -c @sysconfdir@/open5gs/bsf.yaml
|
||||
RestartSec=2
|
||||
RestartPreventExitStatus=1
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -92,6 +94,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -155,6 +158,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -174,6 +178,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -221,6 +226,11 @@ nssf:
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
@@ -11,6 +11,7 @@ parameter:
|
||||
# no_udm: true
|
||||
# no_pcf: true
|
||||
# no_nssf: true
|
||||
# no_bsf: true
|
||||
# no_udr: true
|
||||
# no_mme: true
|
||||
# no_sgwc: true
|
||||
@@ -23,6 +24,7 @@ mme:
|
||||
identity: mme.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.2
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -92,6 +94,7 @@ smf:
|
||||
identity: smf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.4
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -155,6 +158,7 @@ hss:
|
||||
identity: hss.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.8
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -172,6 +176,7 @@ pcrf:
|
||||
identity: pcrf.localdomain
|
||||
realm: localdomain
|
||||
listen_on: 127.0.0.9
|
||||
no_fwd: true
|
||||
load_extension:
|
||||
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
|
||||
conf: 0x8888
|
||||
@@ -219,6 +224,16 @@ nssf:
|
||||
s_nssai:
|
||||
sst: 1
|
||||
|
||||
bsf:
|
||||
sbi:
|
||||
- addr: 127.0.0.15
|
||||
port: 7777
|
||||
|
||||
af:
|
||||
sbi:
|
||||
- addr: 127.0.0.16
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
|
||||
114
debian/changelog
vendored
114
debian/changelog
vendored
@@ -1,3 +1,117 @@
|
||||
open5gs (2.3.2) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 18 Jul 2021 20:24:08 +0900
|
||||
|
||||
open5gs (2.3.2~hirsute) hirsute; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 18 Jul 2021 20:23:04 +0900
|
||||
|
||||
open5gs (2.3.2~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 18 Jul 2021 20:21:54 +0900
|
||||
|
||||
open5gs (2.3.2~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 18 Jul 2021 20:20:38 +0900
|
||||
|
||||
open5gs (2.3.1) unstable; urgency=medium
|
||||
|
||||
* Support ePDG Interface
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 29 Jun 2021 22:12:11 +0900
|
||||
|
||||
open5gs (2.3.1~hirsute) hirsute; urgency=medium
|
||||
|
||||
* Support ePDG Interface
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 29 Jun 2021 22:11:04 +0900
|
||||
|
||||
open5gs (2.3.1~bionic) bionic; urgency=medium
|
||||
|
||||
* Support ePDG Interface
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 29 Jun 2021 22:10:02 +0900
|
||||
|
||||
open5gs (2.3.1~focal) focal; urgency=medium
|
||||
|
||||
* Support ePDG Interface
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 29 Jun 2021 22:08:55 +0900
|
||||
|
||||
open5gs (2.3.0) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 08 Jun 2021 21:19:10 +0900
|
||||
|
||||
open5gs (2.3.0~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 08 Jun 2021 21:18:10 +0900
|
||||
|
||||
open5gs (2.3.0~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 08 Jun 2021 21:16:53 +0900
|
||||
|
||||
open5gs (2.3.0~hirsute) hirsute; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Tue, 08 Jun 2021 21:15:17 +0900
|
||||
|
||||
open5gs (2.2.9) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 14:12:49 +0900
|
||||
|
||||
open5gs (2.2.9~hirsute1) hirsute; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 14:11:46 +0900
|
||||
|
||||
open5gs (2.2.9~bionic1) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 14:10:51 +0900
|
||||
|
||||
open5gs (2.2.9~focal1) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 14:09:29 +0900
|
||||
|
||||
open5gs (2.2.9~hirsute) hirsute; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 14:06:05 +0900
|
||||
|
||||
open5gs (2.2.9~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 13:32:46 +0900
|
||||
|
||||
open5gs (2.2.9~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 19 May 2021 13:31:08 +0900
|
||||
|
||||
open5gs (2.2.8) unstable; urgency=medium
|
||||
|
||||
* Security Protection
|
||||
|
||||
14
debian/control
vendored
14
debian/control
vendored
@@ -20,6 +20,7 @@ Build-Depends: debhelper (>= 11),
|
||||
libmicrohttpd-dev,
|
||||
libcurl4-gnutls-dev,
|
||||
libnghttp2-dev,
|
||||
libtins-dev,
|
||||
Standards-Version: 4.3.0
|
||||
Rules-Requires-Root: no
|
||||
Homepage: https://open5gs.org
|
||||
@@ -211,6 +212,18 @@ Description: NSSF (Network Slice Selection Function)
|
||||
.
|
||||
This package provides the NSSF (Network Slice Selection Function)
|
||||
|
||||
Package: open5gs-bsf
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
open5gs-common (= ${binary:Version})
|
||||
Description: BSF (Binding Support Function)
|
||||
Open5GS is a C-language implementation of 5G Core and EPC
|
||||
Packet Core, i.e. the core network of an NR/LTE network (Release-16)
|
||||
.
|
||||
This package provides the BSF (Binding Support Function)
|
||||
|
||||
Package: open5gs-udr
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
@@ -241,6 +254,7 @@ Depends: ${misc:Depends},
|
||||
open5gs-udm (= ${binary:Version}),
|
||||
open5gs-pcf (= ${binary:Version}),
|
||||
open5gs-nssf (= ${binary:Version}),
|
||||
open5gs-bsf (= ${binary:Version}),
|
||||
open5gs-udr (= ${binary:Version})
|
||||
Description: 5G Core and EPC (metapackage)
|
||||
Open5GS is a C-language implementation of 5G Core and EPC
|
||||
|
||||
3
debian/open5gs-bsf.install
vendored
Normal file
3
debian/open5gs-bsf.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/bin/open5gs-bsfd
|
||||
configs/open5gs/bsf.yaml etc/open5gs
|
||||
configs/systemd/open5gs-bsfd.service lib/systemd/system
|
||||
2
debian/open5gs-common.install
vendored
2
debian/open5gs-common.install
vendored
@@ -3,4 +3,4 @@ usr/lib/*/libfd*.so*
|
||||
usr/lib/*/freeDiameter/*.fdx
|
||||
configs/freeDiameter/cacert.pem /etc/freeDiameter
|
||||
configs/logrotate/open5gs /etc/logrotate.d
|
||||
#misc/db/open5gs-dbctl /usr/bin
|
||||
misc/db/open5gs-dbctl /usr/bin
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
ARG dist=centos
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN yum -y install epel-release
|
||||
#RUN yum -y install https://centos7.iuscommunity.org/ius-release.rpm
|
||||
RUN yum -y update
|
||||
|
||||
RUN yum -y install \
|
||||
python3 \
|
||||
ninja-build \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
meson \
|
||||
lksctp-tools-devel \
|
||||
libidn-devel \
|
||||
gnutls-devel \
|
||||
libgcrypt-devel \
|
||||
openssl-devel \
|
||||
cyrus-sasl-devel \
|
||||
libyaml-devel \
|
||||
mongo-c-driver-devel \
|
||||
libmicrohttpd-devel \
|
||||
libcurl-devel \
|
||||
libnghttp2-devel \
|
||||
iproute
|
||||
@@ -1 +0,0 @@
|
||||
../8/dev
|
||||
@@ -1,37 +0,0 @@
|
||||
ARG dist=centos
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN dnf -y install epel-release && \
|
||||
dnf -y install 'dnf-command(config-manager)' && \
|
||||
dnf config-manager --set-enabled PowerTools && \
|
||||
dnf -y update
|
||||
|
||||
RUN dnf -y install \
|
||||
https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm && \
|
||||
dnf config-manager --set-enabled elrepo-testing && \
|
||||
dnf -y update
|
||||
|
||||
RUN dnf -y install \
|
||||
python3 \
|
||||
ninja-build \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
lksctp-tools-devel \
|
||||
libidn-devel \
|
||||
gnutls-devel \
|
||||
libgcrypt-devel \
|
||||
openssl-devel \
|
||||
cyrus-sasl-devel \
|
||||
libyaml-devel \
|
||||
mongo-c-driver-devel \
|
||||
libmicrohttpd-devel \
|
||||
libcurl-devel \
|
||||
libnghttp2-devel \
|
||||
iproute
|
||||
|
||||
RUN dnf -y install meson
|
||||
@@ -1,22 +0,0 @@
|
||||
ARG dist=centos
|
||||
ARG tag=latest
|
||||
ARG username=acetcom
|
||||
FROM ${username}/${dist}-${tag}-open5gs-base
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN yum -y install \
|
||||
cscope \
|
||||
vim \
|
||||
sudo \
|
||||
iputils \
|
||||
net-tools
|
||||
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG username=acetcom
|
||||
RUN useradd -m --uid=1000 ${username} && \
|
||||
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} && \
|
||||
chmod 0440 /etc/sudoers.d/${username}
|
||||
|
||||
WORKDIR /home/${username}
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name ogstun mode tun
|
||||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
@@ -9,9 +9,6 @@ TAG=bionic docker-compose -f docker-compose.yml -f docker-compose.test.yml run -
|
||||
DIST=fedora TAG=32 docker-compose build
|
||||
DIST=fedora TAG=32 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=centos docker-compose build
|
||||
DIST=centos docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=debian docker-compose build
|
||||
DIST=debian docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ RUN apt-get update && \
|
||||
libmicrohttpd-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libnghttp2-dev \
|
||||
libtins-dev \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
|
||||
1
docker/debian/sid
Symbolic link
1
docker/debian/sid
Symbolic link
@@ -0,0 +1 @@
|
||||
latest
|
||||
1
docker/debian/testing
Symbolic link
1
docker/debian/testing
Symbolic link
@@ -0,0 +1 @@
|
||||
latest
|
||||
@@ -8,6 +8,7 @@ RUN dnf -y install \
|
||||
python3 \
|
||||
ninja-build \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
|
||||
1
docker/ubuntu/hirsute
Symbolic link
1
docker/ubuntu/hirsute
Symbolic link
@@ -0,0 +1 @@
|
||||
latest
|
||||
@@ -28,6 +28,7 @@ RUN apt-get update && \
|
||||
libmicrohttpd-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libnghttp2-dev \
|
||||
libtins-dev \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
|
||||
@@ -53,6 +53,7 @@ The Open5GS 5G SA Core contains the following functions:
|
||||
* UDR - Unified Data Repository
|
||||
* PCF - Policy and Charging Function
|
||||
* NSSF - Network Slice Selection Function
|
||||
* BSF - Binding Support Function
|
||||
|
||||
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice. Finally there is the PCF, used for charging and enforcing subscriber policies.
|
||||
|
||||
@@ -107,10 +108,9 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_Unstable/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_10/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.04/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_19.10/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.10/
|
||||
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.04/
|
||||
```
|
||||
|
||||
#### openSUSE
|
||||
@@ -144,10 +144,9 @@ https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Test
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_Unstable/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Raspbian_10/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_18.04/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.04/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_19.10/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.10/
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.04/
|
||||
```
|
||||
|
||||
|
||||
@@ -221,6 +220,7 @@ AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
||||
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
||||
PCF-sbi = 127.0.0.13:7777 for 5G SBI
|
||||
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
|
||||
BSF-sbi = 127.0.0.15:7777 for 5G SBI
|
||||
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
||||
```
|
||||
|
||||
@@ -467,6 +467,7 @@ $ sudo systemctl stop open5gs-ausfd
|
||||
$ sudo systemctl stop open5gs-udmd
|
||||
$ sudo systemctl stop open5gs-pcfd
|
||||
$ sudo systemctl stop open5gs-nssfd
|
||||
$ sudo systemctl stop open5gs-bsfd
|
||||
$ sudo systemctl stop open5gs-udrd
|
||||
$ sudo systemctl stop open5gs-webui
|
||||
```
|
||||
@@ -485,6 +486,7 @@ $ sudo systemctl restart open5gs-ausfd
|
||||
$ sudo systemctl restart open5gs-udmd
|
||||
$ sudo systemctl restart open5gs-pcfd
|
||||
$ sudo systemctl restart open5gs-nssfd
|
||||
$ sudo systemctl restart open5gs-bsfd
|
||||
$ sudo systemctl restart open5gs-udrd
|
||||
$ sudo systemctl restart open5gs-webui
|
||||
```
|
||||
|
||||
@@ -44,7 +44,7 @@ $ sudo ip link set ogstun up
|
||||
Install the dependencies for building the source code.
|
||||
|
||||
```bash
|
||||
$ sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev meson
|
||||
$ sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev meson
|
||||
```
|
||||
|
||||
Git clone.
|
||||
@@ -329,6 +329,14 @@ Open5GS daemon v2.1.0
|
||||
08/21 22:56:02.155: [app] INFO: NSSF initialize...done (../src/nssfd/app.c:31)
|
||||
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
|
||||
|
||||
$ ./install/bin/open5gs-bsfd
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../src/main.c:54)
|
||||
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../src/main.c:57)
|
||||
08/21 22:56:02.155: [app] INFO: BSF initialize...done (../src/bsf/app.c:31)
|
||||
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
|
||||
|
||||
$ ./install/bin/open5gs-udrd
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
||||
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
||||
PCF-sbi = 127.0.0.13:7777 for 5G SBI
|
||||
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
|
||||
BSF-sbi = 127.0.0.15:7777 for 5G SBI
|
||||
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
||||
```
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
|
||||
* Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06 AirVelocity 2700 RU
|
||||
* NOKIA AEQE (SW: 5G20A)
|
||||
* NOKIA AEQD (SW: 5G20A)
|
||||
* Huawei BTS5900
|
||||
|
||||
### Commercial 4G
|
||||
---
|
||||
@@ -28,10 +29,13 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
|
||||
* Baicells Nova 436Q
|
||||
* Baicells Nova 227 (EBS & CBRS)
|
||||
* Baicells Nova 233
|
||||
* Ericsson BaseBand 6630 (21Q1 Software)
|
||||
* Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)
|
||||
* Huawei BTS 3900 (S/W version V100R011C10SPC230)
|
||||
* NOKIA FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
|
||||
* NOKIA FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
|
||||
* Huawei BTS3900 (S/W version V100R011C10SPC230)
|
||||
* Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10
|
||||
* Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
|
||||
* Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
|
||||
* Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0
|
||||
|
||||
### 4G/5G Software Stacks + SDRs
|
||||
---
|
||||
|
||||
@@ -109,7 +109,7 @@ a base CentOS 8 installation.
|
||||
|
||||
|
||||
```bash
|
||||
$ sudo dnf install python3 meson ninja-build gcc flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel mongo-c-driver-devel libmicrohttpd-devel libcurl-devel libnghttp2-devel
|
||||
$ sudo dnf install python3 meson ninja-build gcc gcc-c++ flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel mongo-c-driver-devel libmicrohttpd-devel libcurl-devel libnghttp2-devel
|
||||
```
|
||||
|
||||
### Install the SCTP kernel module in kernel-modules-extra.
|
||||
@@ -325,7 +325,7 @@ $ cd ../
|
||||
$ ls install/bin
|
||||
open5gs-amfd open5gs-hssd open5gs-nrfd open5gs-sgwcd open5gs-smfd open5gs-udrd
|
||||
open5gs-ausfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-udmd open5gs-pcfd
|
||||
open5gs-upfd open5gs-nssfd
|
||||
open5gs-upfd open5gs-nssfd open5gs-bsfd
|
||||
```
|
||||
|
||||
## Building WebUI of Open5GS
|
||||
|
||||
@@ -70,7 +70,7 @@ $ ip link show
|
||||
|
||||
Install the depedencies for building the source code.
|
||||
```bash
|
||||
$ sudo dnf install python3 ninja-build gcc flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel mongo-c-driver-devel libmicrohttpd-devel libcurl-devel libnghttp2-devel iproute
|
||||
$ sudo dnf install python3 ninja-build gcc gcc-c++ flex bison git lksctp-tools-devel libidn-devel gnutls-devel libgcrypt-devel openssl-devel cyrus-sasl-devel libyaml-devel mongo-c-driver-devel libmicrohttpd-devel libcurl-devel libnghttp2-devel iproute
|
||||
```
|
||||
|
||||
Install Meson
|
||||
|
||||
@@ -89,7 +89,7 @@ $ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
|
||||
Install the depedencies for building the source code.
|
||||
```bash
|
||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config bison libusrsctp
|
||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config bison libusrsctp libtins
|
||||
```
|
||||
|
||||
Configure Homebrew PATH
|
||||
@@ -97,6 +97,7 @@ Configure Homebrew PATH
|
||||
$ export PATH="/opt/homebrew/opt/bison/bin:/opt/homebrew/bin:$PATH"
|
||||
$ export LIBRARY_PATH=/opt/homebrew/lib
|
||||
$ export C_INCLUDE_PATH=/opt/homebrew/include
|
||||
$ export CPLUS_INCLUDE_PATH=/opt/homebrew/include
|
||||
```
|
||||
|
||||
Install Meson using Homebrew.
|
||||
|
||||
@@ -89,7 +89,7 @@ $ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
|
||||
Install the depedencies for building the source code.
|
||||
```bash
|
||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config libusrsctp
|
||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config libusrsctp libtins
|
||||
```
|
||||
|
||||
Install Bison and Create soft link.
|
||||
|
||||
@@ -25,10 +25,11 @@ open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5g
|
||||
open5gs 27600 0.0 0.0 222328 9668 ? Ssl 12:13 0:00 /usr/bin/open5gs-udmd -c /etc/open5gs/udm.yaml
|
||||
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
|
||||
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-nssfd -c /etc/open5gs/nssf.yaml
|
||||
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-bsfd -c /etc/open5gs/bsf.yaml
|
||||
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
|
||||
```
|
||||
|
||||
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF, NSSF & UDR are all running.
|
||||
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF, NSSF, BSF & UDR are all running.
|
||||
|
||||
If your instance doesn't show this make sure you're started each service:
|
||||
```bash
|
||||
@@ -45,6 +46,7 @@ $ systemctl start open5gs-ausfd.service
|
||||
$ systemctl start open5gs-udmd.service
|
||||
$ systemctl start open5gs-pcfd.service
|
||||
$ systemctl start open5gs-nssfd.service
|
||||
$ systemctl start open5gs-bsfd.service
|
||||
$ systemctl start open5gs-udrd.service
|
||||
```
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ head_inline: "<style> .blue { color: blue; } </style>"
|
||||
}
|
||||
</style>
|
||||
|
||||
#### MME Diameter Error using v2.2.x
|
||||
#### MME sends Attach reject(EMM-Cause:15) with Diameter error(Result-Code:3002)
|
||||
|
||||
If you see the Attach reject [EMM_CAUSE:15] with Diameter Error [Result-Code:3002], it means that you may use the old format DB schema.
|
||||
If you see the Attach reject(EMM-Cause:15] with Diameter error(Result-Code:3002), it means that HSS is not running.
|
||||
|
||||
```
|
||||
...
|
||||
@@ -31,6 +31,64 @@ If you see the Attach reject [EMM_CAUSE:15] with Diameter Error [Result-Code:300
|
||||
...
|
||||
```
|
||||
|
||||
Please check the status of HSS and restart it.
|
||||
```
|
||||
$ sudo systemctl status open5gs-hssd.service
|
||||
● open5gs-hssd.service - Open5GS HSS Daemon
|
||||
Loaded: loaded (/lib/systemd/system/open5gs-hssd.service; disabled; vendor preset: enabled)
|
||||
Active: inactive (dead)
|
||||
sudo systemctl status open5gs-hssd.service
|
||||
● open5gs-hssd.service - Open5GS HSS Daemon
|
||||
Loaded: loaded (/lib/systemd/system/open5gs-hssd.service; disabled; vendor preset: enabled)
|
||||
Active: active (running) since Sun 2021-05-09 18:36:49 KST; 1s ago
|
||||
Main PID: 6011 (open5gs-hssd)
|
||||
Tasks: 37 (limit: 19047)
|
||||
Memory: 14.6M
|
||||
CGroup: /system.slice/open5gs-hssd.service
|
||||
└─6011 /usr/bin/open5gs-hssd -c /etc/open5gs/hss.yaml
|
||||
|
||||
May 09 18:36:49 open5gs systemd[1]: Started Open5GS HSS Daemon.
|
||||
May 09 18:36:49 open5gs open5gs-hssd[6011]: Open5GS daemon v2.2.7
|
||||
May 09 18:36:49 open5gs open5gs-hssd[6011]: 05/09 18:36:49.987: [app] INFO: Configuration: '/etc/ope>
|
||||
May 09 18:36:49 open5gs open5gs-hssd[6011]: 05/09 18:36:49.987: [app] INFO: File Logging: '/var/log/>
|
||||
May 09 18:36:49 open5gs open5gs-hssd[6011]: 05/09 18:36:49.994: [dbi] INFO: MongoDB URI: 'mongodb://>
|
||||
May 09 18:36:50 open5gs open5gs-hssd[6011]: 05/09 18:36:50.116: [app] INFO: HSS initialize...done
|
||||
```
|
||||
|
||||
#### MME Diameter-Error with HSS-crash using v2.2.x package
|
||||
|
||||
If the following MME log occurs while connecting to the UE, it means that you may use the old format DB schema.
|
||||
|
||||
```
|
||||
04/14 20:14:21.981: [diam] ERROR: pid:PSM/hss.localdomain in fd_psm_change_state@p_psm.c:287: 'STATE_OPEN' -> 'STATE_CLOSED' 'hss.localdomain'
|
||||
((null):0)
|
||||
04/14 20:14:21.982: [diam] ERROR: pid:PSM/hss.localdomain in md_hook_cb_tree@dbg_msg_dumps.c:89: FAILOVER from 'hss.localdomain':
|
||||
((null):0)
|
||||
04/14 20:14:21.982: [diam] ERROR: pid:PSM/hss.localdomain in md_hook_cb_tree@dbg_msg_dumps.c:90: 'Update-Location-Request'
|
||||
((null):0)
|
||||
```
|
||||
|
||||
In this case, the HSS may crash as shown below.
|
||||
|
||||
```
|
||||
04/12 10:13:45.025: [app] INFO: Configuration: '/home/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:129)
|
||||
04/12 10:13:45.025: [app] INFO: File Logging: '/home/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:132)
|
||||
04/12 10:13:45.028: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:129)
|
||||
04/12 10:13:45.068: [diam] INFO: CONNECTED TO 'mme.epc.mnc001.mcc001.3gppnetwork.org' (SCTP,soc#17): (../lib/diameter/common/logger.c:108)
|
||||
04/12 10:13:45.069: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
|
||||
04/12 10:14:27.167: [core] FATAL: ogs_slice_find_by_s_nssai: Assertion `num_of_slice_data' failed. (../lib/core/ogs-3gpp-types.c:529)
|
||||
04/12 10:14:27.168: [core] FATAL: backtrace() returned 10 addresses (../lib/core/ogs-abort.c:37)
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.2(ogs_slice_find_by_s_nssai+0xd2) [0x7f3b720a126e]
|
||||
./install/bin/open5gs-hssd(+0xd12e) [0x55a57bb6f12e]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdproto.so.7(fd_disp_call_cb_int+0x270) [0x7f3b7135acb3]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdproto.so.7(fd_msg_dispatch+0xdca) [0x7f3b7137442f]
|
||||
home/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x67c3c) [0x7f3b715f9c3c]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x6ca99) [0x7f3b715fea99]
|
||||
/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x6cd06) [0x7f3b715fed06]
|
||||
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f3b70d016db]
|
||||
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f3b70a2a71f]
|
||||
```
|
||||
|
||||
At this time, you need to check the DB schema is in the form below by using the command the below.
|
||||
|
||||
```
|
||||
@@ -98,7 +156,7 @@ $ mongo
|
||||
}
|
||||
```
|
||||
|
||||
If you see below, you are using the old format DB schema. Therefore, MME sends Attach Reject [EMM_CAUSE:15] with Diameter Error [Result-Code: 3002] and it does not work properly.
|
||||
If you see below, you are using the old format DB schema.
|
||||
|
||||
```
|
||||
$ mongo
|
||||
@@ -147,7 +205,7 @@ $ mongo
|
||||
|
||||
If you are using old format DB schema, please perform the following step.
|
||||
|
||||
1. Delete all DB subscriber info
|
||||
1. First of all, it is recommended to use the following command to remove all existing subscription DB.
|
||||
```
|
||||
$ mongo
|
||||
> use open5gs
|
||||
@@ -155,13 +213,12 @@ switched to db open5gs
|
||||
> db.subscribers.drop()
|
||||
true
|
||||
```
|
||||
2. WebUI logout
|
||||
3. Install new WebUI with the following command.
|
||||
2. Then, if you are using a version of WebUI prior to v2.1.7, you need to do a WebUI logout from your web browser.
|
||||
3. Finally, install the latest version of WebUI with the following command.
|
||||
```
|
||||
$ curl -fsSL https://open5gs.org/open5gs/assets/webui/install | sudo -E bash -
|
||||
```
|
||||
|
||||
4. Log in to the new WebUI and add new subscriber information.
|
||||
4. Log in to the new WebUI and add new subscriber information using your web browser.
|
||||
5. Make sure it is a new DB schema as below:
|
||||
```
|
||||
$ mongo
|
||||
@@ -179,52 +236,6 @@ $ mongo
|
||||
}
|
||||
```
|
||||
|
||||
#### HSS crash using v2.2.x
|
||||
|
||||
If the following MME log occurs while connecting to the UE, it means that the Open5GS upgrade was not properly performed.
|
||||
|
||||
```
|
||||
04/14 20:14:21.981: [diam] ERROR: pid:PSM/hss.localdomain in fd_psm_change_state@p_psm.c:287: 'STATE_OPEN' -> 'STATE_CLOSED' 'hss.localdomain'
|
||||
((null):0)
|
||||
04/14 20:14:21.982: [diam] ERROR: pid:PSM/hss.localdomain in md_hook_cb_tree@dbg_msg_dumps.c:89: FAILOVER from 'hss.localdomain':
|
||||
((null):0)
|
||||
04/14 20:14:21.982: [diam] ERROR: pid:PSM/hss.localdomain in md_hook_cb_tree@dbg_msg_dumps.c:90: 'Update-Location-Request'
|
||||
((null):0)
|
||||
```
|
||||
|
||||
In this case, the HSS may crash as shown below.
|
||||
|
||||
```
|
||||
04/12 10:13:45.025: [app] INFO: Configuration: '/home/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:129)
|
||||
04/12 10:13:45.025: [app] INFO: File Logging: '/home/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:132)
|
||||
04/12 10:13:45.028: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:129)
|
||||
04/12 10:13:45.068: [diam] INFO: CONNECTED TO 'mme.epc.mnc001.mcc001.3gppnetwork.org' (SCTP,soc#17): (../lib/diameter/common/logger.c:108)
|
||||
04/12 10:13:45.069: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
|
||||
04/12 10:14:27.167: [core] FATAL: ogs_slice_find_by_s_nssai: Assertion `num_of_slice_data' failed. (../lib/core/ogs-3gpp-types.c:529)
|
||||
04/12 10:14:27.168: [core] FATAL: backtrace() returned 10 addresses (../lib/core/ogs-abort.c:37)
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.2(ogs_slice_find_by_s_nssai+0xd2) [0x7f3b720a126e]
|
||||
./install/bin/open5gs-hssd(+0xd12e) [0x55a57bb6f12e]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdproto.so.7(fd_disp_call_cb_int+0x270) [0x7f3b7135acb3]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdproto.so.7(fd_msg_dispatch+0xdca) [0x7f3b7137442f]
|
||||
home/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x67c3c) [0x7f3b715f9c3c]
|
||||
/home/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x6ca99) [0x7f3b715fea99]
|
||||
/open5gs/install/lib/x86_64-linux-gnu/libfdcore.so.7(+0x6cd06) [0x7f3b715fed06]
|
||||
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f3b70d016db]
|
||||
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f3b70a2a71f]
|
||||
```
|
||||
|
||||
First of all, it is recommended to use the following command to remove all existing subscription DB.
|
||||
|
||||
```
|
||||
$ mongo
|
||||
> use open5gs
|
||||
switched to db open5gs
|
||||
> db.subscribers.drop()
|
||||
true
|
||||
```
|
||||
|
||||
Then, if you are using a version of WebUI prior to v2.1.7, you need to log out. Finally, install the latest version of WebUI and add subscriber information.
|
||||
|
||||
If the above problem still occurs, we recommend that you delete all Open5GS and start from scratch.
|
||||
|
||||
#### 5G Core test failed (e.g. `./build/tests/registration/registration`)
|
||||
@@ -269,6 +280,7 @@ $ sudo pkill -9 open5gs-ausfd
|
||||
$ sudo pkill -9 open5gs-udmd
|
||||
$ sudo pkill -9 open5gs-pcfd
|
||||
$ sudo pkill -9 open5gs-nssfd
|
||||
$ sudo pkill -9 open5gs-bsfd
|
||||
$ sudo pkill -9 open5gs-udrd
|
||||
```
|
||||
|
||||
@@ -402,6 +414,7 @@ $ open5gs-ausfd
|
||||
$ open5gs-udmd
|
||||
$ open5gs-pcfd
|
||||
$ open5gs-nssfd
|
||||
$ open5gs-bsfd
|
||||
$ open5gs-udrd
|
||||
```
|
||||
|
||||
@@ -607,6 +620,7 @@ $ sudo pkill -9 open5gs-ausfd
|
||||
$ sudo pkill -9 open5gs-udmd
|
||||
$ sudo pkill -9 open5gs-pcfd
|
||||
$ sudo pkill -9 open5gs-nssfd
|
||||
$ sudo pkill -9 open5gs-bsfd
|
||||
$ sudo pkill -9 open5gs-udrd
|
||||
```
|
||||
|
||||
@@ -1067,6 +1081,7 @@ Currently, the number of UE is limited to `128*128`.
|
||||
* UDM : 127.0.0.12
|
||||
* PCF : 127.0.0.13
|
||||
* NSSF : 127.0.0.14
|
||||
* BSF : 127.0.0.15
|
||||
* UDR : 127.0.0.20
|
||||
```
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ Open5GS is a C-language Open Source implementation of 5GC and EPC, i.e. the core
|
||||
- Multiple PDU session
|
||||
- Handover(5GC Xn/N2 and EPC S1/X2)
|
||||
- CSFB(Circuit Switched Fall Back) and SMSoS(SMS Over SGs)
|
||||
- VoLTE(Voice over LTE)
|
||||
- VoLTE(Voice over LTE) with HSS-Cx interface
|
||||
- Support ePDG Interface(SWx, S6b, S2b)
|
||||
|
||||
#### Known Limitations
|
||||
---
|
||||
@@ -29,4 +30,3 @@ Open5GS is a C-language Open Source implementation of 5GC and EPC, i.e. the core
|
||||
- No SRVCC
|
||||
- No Roaming
|
||||
- No Emergency Call
|
||||
- No ePDG Gateway
|
||||
|
||||
77
docs/_posts/2021-05-19-release-v2.2.9.md
Normal file
77
docs/_posts/2021-05-19-release-v2.2.9.md
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: "v2.2.9 - Ubuntu 21.04(hirsute) Release"
|
||||
date: 2021-05-19 14:13:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||
---
|
||||
|
||||
#### Bug Fixes
|
||||
- [AMF] Fix the bug related to Cleartext and Non-cleartext IEs
|
||||
([#1006](https://github.com/open5gs/open5gs/issues/1006), [#958](https://github.com/open5gs/open5gs/issues/958), [UERANSIM#316](https://github.com/aligungr/UERANSIM/issues/316)) -- [ramonss](https://github.com/ramonss), [p1-bmu](https://github.com/p1-bmu), [aligungr](https://github.com/aligungr)
|
||||
- [AMF] Add protection code for message(asn1c, nas, gtp, pfcp) encoding ([#991](https://github.com/open5gs/open5gs/issues/991)) -- [shuimoshusheng](https://github.com/shuimoshusheng)
|
||||
- [MME] Packet filter (flow) precedence should be assigned within the session, not bearer. ([#1001](https://github.com/open5gs/open5gs/pull/1001)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
- [MME/SGW-C/SGW-U/SMF/UPF] Force shutdown when UDP port duplicated with other process ([#986](https://github.com/open5gs/open5gs/issues/986), [#992](https://github.com/open5gs/open5gs/issues/992)) -- [ybouhamza](https://github.com/ybouhamza), [polhenarejos](https://github.com/polhenarejos)
|
||||
- [AMF] Fix the error of decoding Extended-RANNodeName ([#994](https://github.com/open5gs/open5gs/issues/994)) -- [fefer](https://github.com/fefer)
|
||||
- [AMF] Add more buffer for 5GMM capability ([#959](https://github.com/open5gs/open5gs/issues/959)) -- [p1-bmu](https://github.com/p1-bmu)
|
||||
|
||||
#### IMPORTANT Using v2.2.x
|
||||
|
||||
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||
{: .blue}
|
||||
```
|
||||
$ mongo
|
||||
> use open5gs
|
||||
switched to db open5gs
|
||||
> db.subscribers.drop()
|
||||
true
|
||||
```
|
||||
|
||||
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||
{: .blue}
|
||||
```
|
||||
$ git checkout v2.1.7
|
||||
$ cd webui
|
||||
$ rm -Rf ./node_modules
|
||||
$ npm ci --no-optional
|
||||
$ npm run dev
|
||||
|
||||
## You should log out
|
||||
|
||||
$ git checkout main
|
||||
$ cd webui
|
||||
$ rm -Rf ./node_modules
|
||||
$ npm ci --no-optional
|
||||
$ npm run dev
|
||||
|
||||
## You can log back in
|
||||
```
|
||||
|
||||
- freeDiameter version has changed from 1.3.2 to 1.5.0. If you want to compile the source code, you need to update meson subprojects as shown below.
|
||||
{: .blue}
|
||||
|
||||
```
|
||||
$ cd open5gs
|
||||
$ git pull
|
||||
$ meson subprojects update
|
||||
$ cd build
|
||||
$ ninja
|
||||
```
|
||||
|
||||
Or just use a clean github repository.
|
||||
|
||||
```
|
||||
$ rm -Rf open5gs
|
||||
$ git clone https://github.com/open5gs/open5gs
|
||||
$ cd open5gs
|
||||
$ meson build --prefix=`pwd`/install
|
||||
$ cd build
|
||||
$ ninja
|
||||
```
|
||||
|
||||
|
||||
Download -- [v2.2.9.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.9.tar.gz)
|
||||
{: .notice--info}
|
||||
27
docs/_posts/2021-06-08-release-v2.3.0.md
Normal file
27
docs/_posts/2021-06-08-release-v2.3.0.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: "v2.3.0 - BSF Added in 5G Core"
|
||||
date: 2021-06-08 21:37:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||
---
|
||||
|
||||
#### New Features
|
||||
- [BSF] New NF is added ([commit-6119867](https://github.com/open5gs/open5gs/commit/fe89f7cd11d415ae89da2724fc67aa573efa83c3))
|
||||
- [UPF] Support TAP interfaces with ARP/ND ([#1022](https://github.com/open5gs/open5gs/pull/1022)) -- [anarkiwi](https://github.com/anarkiwi)
|
||||
|
||||
#### Enhancement
|
||||
- [ALL] Add more memory log ([commit-118d62d](https://github.com/open5gs/open5gs/commit/118d62d42df5037665b93698cfaa67d34a7519ec))
|
||||
- [ALL] Add more error log ([commit-80a9497](https://github.com/open5gs/open5gs/commit/80a9497afdefe72e9deacbaa66ebc1c203de23ea))
|
||||
|
||||
#### Bug Fixes
|
||||
- [SMF] Fix the crash bug ([#1034](https://github.com/open5gs/open5gs/issues/1034), [#1006](https://github.com/open5gs/open5gs/issues/1006)) -- [mcatalancid](https://github.com/mcatalancid), [ramonss](https://github.com/ramonss)
|
||||
- [SBI] Fix the default SBI port number ([#1008](https://github.com/open5gs/open5gs/issues/1008), [#997](https://github.com/open5gs/open5gs/issues/997)) -- [mmailand](https://github.com/mmailand), [plutec](https://github.com/plutec)
|
||||
- [SMF] Fix DRB lost issue when additional TFTs needs to be added to existing bearer with TFTs ([#1019](https://github.com/open5gs/open5gs/pull/1019)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
|
||||
|
||||
Download -- [v2.3.0.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.0.tar.gz)
|
||||
{: .notice--info}
|
||||
30
docs/_posts/2021-06-29-release-v2.3.1.md
Normal file
30
docs/_posts/2021-06-29-release-v2.3.1.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "v2.3.1 - Support ePDG Interface"
|
||||
date: 2021-06-29 22:13:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||
---
|
||||
|
||||
#### New Features
|
||||
- [Non3GPP] Support ePDG Interface ([#1039](https://github.com/open5gs/open5gs/discussions/1039)) -- [herlesupreeth](https://github.com/herlesupreeth), [fasferraz](https://github.com/fasferraz)
|
||||
|
||||
#### Enhancement
|
||||
- [GTP] Add Indication (Dual Address Bearer and Handover) ([#1049](https://github.com/open5gs/open5gs/pull/1049)) -- [medeiros405](https://github.com/medeiros405)
|
||||
|
||||
#### Bug Fixes
|
||||
- [freeDiameter] Need to ASSERT on FD_LOG_FATAL ([#1069](https://github.com/open5gs/open5gs/pull/1069)) -- [spencersevilla](https://github.com/spencersevilla)
|
||||
- [UPF] Trim buffer to correct size after creating ARP or ND reply ([#1068](https://github.com/open5gs/open5gs/pull/1068)) -- [anarkiwi](https://github.com/anarkiwi)
|
||||
- [AMF] NG Setup Failure with proper cause "Slice not supported" ([#1064](https://github.com/open5gs/open5gs/issues/1064)) -- [irazairspan](https://github.com/irazairspan)
|
||||
- [ALL] Increase the number of 1024-memory pool (1024 --> 2048) ([#1062](https://github.com/open5gs/open5gs/issues/1062)) -- [UmakantKulkarni](https://github.com/UmakantKulkarni)
|
||||
- [AMF] fix the crash if 'ran_ue' context was removed ([#1061](https://github.com/open5gs/open5gs/issues/1061)) -- [aminssl](https://github.com/aminssl)
|
||||
- [PCF] fix the crash if PEI is not avaiable ([#1059](https://github.com/open5gs/open5gs/issues/1059)) -- [Spectranis](https://github.com/Spectranis)
|
||||
- [MME] fix the crash when release a UE ([#1058](https://github.com/open5gs/open5gs/issues/1058)) -- [duocpv89](https://github.com/duocpv89)
|
||||
- [UPF] Need to 'continue' during matching rule ([#1052](https://github.com/open5gs/open5gs/pull/1052)) -- [spencersevilla](https://github.com/spencersevilla)
|
||||
|
||||
|
||||
Download -- [v2.3.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.1.tar.gz)
|
||||
{: .notice--info}
|
||||
24
docs/_posts/2021-07-18-release-v2.3.2.md
Normal file
24
docs/_posts/2021-07-18-release-v2.3.2.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "v2.3.2 - Upgrade SBI to r16.8.0-20210629"
|
||||
date: 2021-07-18 20:28:00 +0900
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||
---
|
||||
|
||||
#### Enhancement
|
||||
- [SBI] Add priority/capacity/load/AllowedNfTypes in NFProfile/NFService ([commit-039b9d0](https://github.com/open5gs/open5gs/commit/039b9d0aaa8849b27d5fee38e85bef9c4a895456))
|
||||
- [SBI] Upgrade specification r16.8.0-20210629 with OpenAPI Geneartor 5.2.0 ([commit-f278d58](https://github.com/open5gs/open5gs/commit/f278d58a699e9b4d5ca0923bb2750a41cb62b0f7))
|
||||
|
||||
#### Bug Fixes
|
||||
- Fix the bug when GTPv2 conflict between Delete Bearer Request and Downlink Data Notification ([#1095](https://github.com/open5gs/open5gs/issues/1095)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
- Fix Vendor-Specific-Application-ID as Cx rather than SWx ([#1039](https://github.com/open5gs/open5gs/discussions/1039)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
- Fix the bug for Real PCF unable to PATCH ([#1086](https://github.com/open5gs/open5gs/issues/1086)) -- [marcodoliveira](https://github.com/marcodoliveira)
|
||||
- BSF mis-typo in Debian Package Name ([commit-2aaa820](https://github.com/open5gs/open5gs/commit/2aaa8200c2d0eaff675d165146e1457c1047e97a))
|
||||
- fix the bug for making allowed NSSAI ([commit-65e96dd](https://github.com/open5gs/open5gs/commit/65e96dd75c72dfb780e297107a8f51db5e63ab8e))
|
||||
|
||||
Download -- [v2.3.2.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.2.tar.gz)
|
||||
{: .notice--info}
|
||||
@@ -81,6 +81,9 @@ void pcf_terminate(void);
|
||||
int nssf_initialize(void);
|
||||
void nssf_terminate(void);
|
||||
|
||||
int bsf_initialize(void);
|
||||
void bsf_terminate(void);
|
||||
|
||||
int upf_initialize(void);
|
||||
void upf_terminate(void);
|
||||
|
||||
|
||||
@@ -332,6 +332,9 @@ int ogs_app_context_parse_config(void)
|
||||
} else if (!strcmp(parameter_key, "no_nssf")) {
|
||||
self.parameter.no_nssf =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else if (!strcmp(parameter_key, "no_bsf")) {
|
||||
self.parameter.no_bsf =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else if (!strcmp(parameter_key, "no_udr")) {
|
||||
self.parameter.no_udr =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
|
||||
@@ -64,6 +64,7 @@ typedef struct ogs_app_context_s {
|
||||
int no_udm;
|
||||
int no_pcf;
|
||||
int no_nssf;
|
||||
int no_bsf;
|
||||
int no_udr;
|
||||
int no_nrf;
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ int get_asn1c_environment_version(void); /* Run-time version */
|
||||
#define FREEMEM(ptr) free(ptr)
|
||||
#else
|
||||
#include "ogs-core.h"
|
||||
#define CALLOC(nmemb, size) ogs_calloc(nmemb, size)
|
||||
#define MALLOC(size) ogs_malloc(size)
|
||||
#define REALLOC(oldptr, size) ogs_realloc(oldptr, size)
|
||||
#define CALLOC(nmemb, size) ogs_calloc_or_assert(nmemb, size)
|
||||
#define MALLOC(size) ogs_malloc_or_assert(size)
|
||||
#define REALLOC(oldptr, size) ogs_realloc_or_assert(oldptr, size)
|
||||
#define FREEMEM(ptr) ogs_free(ptr)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,7 +46,11 @@ NGAP_AMFNameUTF8String_constraint(const asn_TYPE_descriptor_t *td, const void *s
|
||||
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||
asn_per_constraints_t asn_PER_type_NGAP_AMFNameUTF8String_constr_1 CC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
#else
|
||||
{ APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */,
|
||||
#endif
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||
|
||||
@@ -46,7 +46,11 @@ NGAP_RANNodeNameUTF8String_constraint(const asn_TYPE_descriptor_t *td, const voi
|
||||
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||
asn_per_constraints_t asn_PER_type_NGAP_RANNodeNameUTF8String_constr_1 CC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
#else
|
||||
{ APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */,
|
||||
#endif
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||
|
||||
@@ -116,6 +116,40 @@ index 67ad9db5..1adbdde6 100644
|
||||
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
|
||||
} else {
|
||||
|
||||
Fix NGAP_RANNodeNameUTF8String.c/NGAP_AMFNameUTF8String.c
|
||||
===========================================
|
||||
diff --git a/lib/asn1c/ngap/NGAP_RANNodeNameUTF8String.c b/lib/asn1c/ngap/NGAP_RANNodeNameUTF8String.c
|
||||
index 9e469f7f..79ebd028 100644
|
||||
--- a/lib/asn1c/ngap/NGAP_RANNodeNameUTF8String.c
|
||||
+++ b/lib/asn1c/ngap/NGAP_RANNodeNameUTF8String.c
|
||||
@@ -46,7 +46,11 @@ NGAP_RANNodeNameUTF8String_constraint(const asn_TYPE_descriptor_t *td, const voi
|
||||
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||
asn_per_constraints_t asn_PER_type_NGAP_RANNodeNameUTF8String_constr_1 CC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
+#if 0 /* modified by acetcom */
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
+#else
|
||||
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */,
|
||||
+#endif
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||
diff --git a/lib/asn1c/ngap/NGAP_AMFNameUTF8String.c b/lib/asn1c/ngap/NGAP_AMFNameUTF8String.c
|
||||
index 1df33a4d..a74f97ea 100644
|
||||
--- a/lib/asn1c/ngap/NGAP_AMFNameUTF8String.c
|
||||
+++ b/lib/asn1c/ngap/NGAP_AMFNameUTF8String.c
|
||||
@@ -46,7 +46,11 @@ NGAP_AMFNameUTF8String_constraint(const asn_TYPE_descriptor_t *td, const void *s
|
||||
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||
asn_per_constraints_t asn_PER_type_NGAP_AMFNameUTF8String_constr_1 CC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
+#if 0 /* modified by acetcom */
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
+#else
|
||||
+ { APC_CONSTRAINED | APC_EXTENSIBLE, 8, 8, 1, 150 } /* (SIZE(1..150,...)) */,
|
||||
+#endif
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||
|
||||
Fix NGAP_ProtocolExtensionField.c
|
||||
===========================================
|
||||
|
||||
@@ -28,7 +28,7 @@ ogs_pkbuf_t *ogs_asn_encode(const asn_TYPE_descriptor_t *td, void *sptr)
|
||||
ogs_assert(sptr);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_expect_or_return_val(pkbuf, NULL);
|
||||
ogs_pkbuf_put(pkbuf, OGS_MAX_SDU_LEN);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(td, NULL,
|
||||
|
||||
@@ -137,7 +137,7 @@ char *ogs_amf_id_to_string(ogs_amf_id_t *amf_id)
|
||||
ogs_assert(amf_id);
|
||||
|
||||
str = ogs_calloc(1, OGS_AMFIDSTRLEN);
|
||||
ogs_assert(str);
|
||||
ogs_expect_or_return_val(str, NULL);
|
||||
|
||||
ogs_hex_to_ascii(amf_id, sizeof(ogs_amf_id_t), str, OGS_AMFIDSTRLEN);
|
||||
|
||||
@@ -182,6 +182,7 @@ char *ogs_supi_from_suci(char *suci)
|
||||
|
||||
ogs_assert(suci);
|
||||
tmp = ogs_strdup(suci);
|
||||
ogs_expect_or_return_val(tmp, NULL);
|
||||
|
||||
p = strtok_r(tmp, "-", &saveptr);
|
||||
|
||||
@@ -222,10 +223,12 @@ char *ogs_id_get_type(char *str)
|
||||
|
||||
ogs_assert(str);
|
||||
tmp = ogs_strdup(str);
|
||||
ogs_expect_or_return_val(tmp, NULL);
|
||||
|
||||
p = strtok_r(tmp, "-", &saveptr);
|
||||
ogs_assert(p);
|
||||
type = ogs_strdup(p);
|
||||
ogs_expect_or_return_val(type, NULL);
|
||||
|
||||
ogs_free(tmp);
|
||||
return type;
|
||||
@@ -239,12 +242,14 @@ char *ogs_id_get_value(char *str)
|
||||
|
||||
ogs_assert(str);
|
||||
tmp = ogs_strdup(str);
|
||||
ogs_expect_or_return_val(tmp, NULL);
|
||||
|
||||
p = strtok_r(tmp, "-", &saveptr);
|
||||
ogs_assert(p);
|
||||
p = strtok_r(NULL, "-", &saveptr);
|
||||
ogs_assert(p);
|
||||
ueid = ogs_strdup(p);
|
||||
ogs_expect_or_return_val(ueid, NULL);
|
||||
|
||||
ogs_free(tmp);
|
||||
return ueid;
|
||||
@@ -252,10 +257,15 @@ char *ogs_id_get_value(char *str)
|
||||
|
||||
char *ogs_s_nssai_sd_to_string(ogs_uint24_t sd)
|
||||
{
|
||||
char *string = NULL;
|
||||
|
||||
if (sd.v == OGS_S_NSSAI_NO_SD_VALUE)
|
||||
return NULL;
|
||||
|
||||
return ogs_uint24_to_0string(sd);
|
||||
string = ogs_uint24_to_0string(sd);
|
||||
ogs_expect(string);
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
ogs_uint24_t ogs_s_nssai_sd_from_string(const char *hex)
|
||||
@@ -391,12 +401,12 @@ int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list)
|
||||
ogs_assert(list);
|
||||
|
||||
addr = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_assert(addr);
|
||||
ogs_expect_or_return_val(addr, OGS_ERROR);
|
||||
addr->ogs_sa_family = AF_INET;
|
||||
addr->ogs_sin_port = htobe16(port);
|
||||
|
||||
addr6 = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_assert(addr6);
|
||||
ogs_expect_or_return_val(addr6, OGS_ERROR);
|
||||
addr6->ogs_sa_family = AF_INET6;
|
||||
addr6->ogs_sin_port = htobe16(port);
|
||||
|
||||
@@ -457,22 +467,112 @@ char *ogs_ipv4_to_string(uint32_t addr)
|
||||
char *buf = NULL;
|
||||
|
||||
buf = ogs_calloc(1, OGS_ADDRSTRLEN);
|
||||
ogs_assert(buf);
|
||||
ogs_expect_or_return_val(buf, NULL);
|
||||
|
||||
return (char*)OGS_INET_NTOP(&addr, buf);
|
||||
}
|
||||
|
||||
char *ogs_ipv6_to_string(uint8_t *addr6)
|
||||
char *ogs_ipv6addr_to_string(uint8_t *addr6)
|
||||
{
|
||||
char *buf = NULL;
|
||||
ogs_assert(addr6);
|
||||
|
||||
buf = ogs_calloc(1, OGS_ADDRSTRLEN);
|
||||
ogs_assert(buf);
|
||||
ogs_expect_or_return_val(buf, NULL);
|
||||
|
||||
return (char *)OGS_INET6_NTOP(addr6, buf);
|
||||
}
|
||||
|
||||
char *ogs_ipv6prefix_to_string(uint8_t *addr6, uint8_t prefixlen)
|
||||
{
|
||||
char *buf = NULL;
|
||||
uint8_t tmp[OGS_IPV6_LEN];
|
||||
ogs_assert(addr6);
|
||||
|
||||
memset(tmp, 0, OGS_IPV6_LEN);
|
||||
memcpy(tmp, addr6, prefixlen >> 3);
|
||||
|
||||
buf = ogs_calloc(1, OGS_ADDRSTRLEN);
|
||||
ogs_expect_or_return_val(buf, NULL);
|
||||
|
||||
if (OGS_INET6_NTOP(tmp, buf) == NULL) {
|
||||
ogs_fatal("Invalid IPv6 address");
|
||||
ogs_log_hexdump(OGS_LOG_FATAL, addr6, OGS_IPV6_LEN);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
return ogs_mstrcatf(buf, "/%d", prefixlen);
|
||||
}
|
||||
|
||||
int ogs_ipv4_from_string(uint32_t *addr, char *string)
|
||||
{
|
||||
int rv;
|
||||
ogs_sockaddr_t tmp;
|
||||
|
||||
ogs_assert(addr);
|
||||
ogs_assert(string);
|
||||
|
||||
rv = ogs_inet_pton(AF_INET, string, &tmp);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Invalid IPv4 string = %s", string);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
*addr = tmp.sin.sin_addr.s_addr;
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_ipv6addr_from_string(uint8_t *addr6, char *string)
|
||||
{
|
||||
int rv;
|
||||
ogs_sockaddr_t tmp;
|
||||
|
||||
ogs_assert(addr6);
|
||||
ogs_assert(string);
|
||||
|
||||
rv = ogs_inet_pton(AF_INET6, string, &tmp);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_error("Invalid IPv6 string = %s", string);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
memcpy(addr6, tmp.sin6.sin6_addr.s6_addr, OGS_IPV6_LEN);
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_ipv6prefix_from_string(uint8_t *addr6, uint8_t *prefixlen, char *string)
|
||||
{
|
||||
int rv;
|
||||
ogs_sockaddr_t tmp;
|
||||
char *v = NULL, *pv = NULL, *ipstr = NULL, *mask_or_numbits = NULL;
|
||||
|
||||
ogs_assert(addr6);
|
||||
ogs_assert(prefixlen);
|
||||
ogs_assert(string);
|
||||
pv = v = ogs_strdup(string);
|
||||
ogs_expect_or_return_val(v, OGS_ERROR);
|
||||
|
||||
ipstr = strsep(&v, "/");
|
||||
if (ipstr)
|
||||
mask_or_numbits = v;
|
||||
|
||||
if (!ipstr || !mask_or_numbits) {
|
||||
ogs_error("Invalid IPv6 Prefix string = %s", v);
|
||||
ogs_free(v);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
rv = ogs_inet_pton(AF_INET6, ipstr, &tmp);
|
||||
ogs_expect_or_return_val(rv == OGS_OK, rv);
|
||||
|
||||
memcpy(addr6, tmp.sin6.sin6_addr.s6_addr, OGS_IPV6_LEN);
|
||||
*prefixlen = atoi(mask_or_numbits);
|
||||
|
||||
ogs_free(pv);
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_sockaddr_to_user_plane_ip_resource_info(
|
||||
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6,
|
||||
ogs_user_plane_ip_resource_info_t *info)
|
||||
@@ -574,3 +674,27 @@ void ogs_session_data_free(ogs_session_data_t *session_data)
|
||||
for (i = 0; i < session_data->num_of_pcc_rule; i++)
|
||||
OGS_PCC_RULE_FREE(&session_data->pcc_rule[i]);
|
||||
}
|
||||
|
||||
void ogs_ims_data_free(ogs_ims_data_t *ims_data)
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
ogs_assert(ims_data);
|
||||
|
||||
for (i = 0; i < ims_data->num_of_media_component; i++) {
|
||||
ogs_media_component_t *media_component = &ims_data->media_component[i];
|
||||
|
||||
for (j = 0; j < media_component->num_of_sub; j++) {
|
||||
ogs_media_sub_component_t *sub = &media_component->sub[j];
|
||||
|
||||
for (k = 0; k < sub->num_of_flow; k++) {
|
||||
ogs_flow_t *flow = &sub->flow[k];
|
||||
|
||||
if (flow->description) {
|
||||
ogs_free(flow->description);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,7 @@ ogs_uint24_t ogs_s_nssai_sd_from_string(const char *hex);
|
||||
#define OGS_IPV4_LEN 4
|
||||
#define OGS_IPV6_LEN 16
|
||||
#define OGS_IPV6_DEFAULT_PREFIX_LEN 64
|
||||
#define OGS_IPV6_128_PREFIX_LEN 128
|
||||
#define OGS_IPV4V6_LEN 20
|
||||
typedef struct ogs_ip_s {
|
||||
uint32_t addr;
|
||||
@@ -212,8 +213,14 @@ ED3(uint8_t ipv4:1;,
|
||||
int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list);
|
||||
void ogs_sockaddr_to_ip(
|
||||
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_ip_t *ip);
|
||||
|
||||
char *ogs_ipv4_to_string(uint32_t addr);
|
||||
char *ogs_ipv6_to_string(uint8_t *addr6);
|
||||
char *ogs_ipv6addr_to_string(uint8_t *addr6);
|
||||
char *ogs_ipv6prefix_to_string(uint8_t *addr6, uint8_t prefixlen);
|
||||
int ogs_ipv4_from_string(uint32_t *addr, char *string);
|
||||
int ogs_ipv6addr_from_string(uint8_t *addr6, char *string);
|
||||
int ogs_ipv6prefix_from_string(
|
||||
uint8_t *addr6, uint8_t *prefixlen, char *string);
|
||||
|
||||
/**************************************************
|
||||
* 8.14 PDN Address Allocation (PAA) */
|
||||
@@ -314,8 +321,7 @@ typedef struct ogs_flow_s {
|
||||
|
||||
#define OGS_FLOW_FREE(__fLOW) \
|
||||
do { \
|
||||
if ((__fLOW)->description) \
|
||||
{ \
|
||||
if ((__fLOW)->description) { \
|
||||
ogs_free((__fLOW)->description); \
|
||||
} \
|
||||
else \
|
||||
@@ -337,11 +343,6 @@ typedef struct ogs_pcc_rule_s {
|
||||
ogs_flow_t flow[OGS_MAX_NUM_OF_FLOW];
|
||||
int num_of_flow;
|
||||
|
||||
#define OGS_FLOW_STATUS_ENABLED_UPLINK 0
|
||||
#define OGS_FLOW_STATUS_ENABLED_DOWNLINK 1
|
||||
#define OGS_FLOW_STATUS_ENABLED 2
|
||||
#define OGS_FLOW_STATUS_DISABLED 3
|
||||
#define OGS_FLOW_STATUS_REMOVE 4
|
||||
int flow_status;
|
||||
uint32_t precedence;
|
||||
|
||||
@@ -624,6 +625,46 @@ typedef struct ogs_session_data_s {
|
||||
|
||||
void ogs_session_data_free(ogs_session_data_t *session_data);
|
||||
|
||||
typedef struct ogs_media_sub_component_s {
|
||||
uint32_t flow_number;
|
||||
uint32_t flow_usage;
|
||||
ogs_flow_t flow[OGS_MAX_NUM_OF_FLOW];
|
||||
int num_of_flow;
|
||||
} ogs_media_sub_component_t;
|
||||
|
||||
typedef struct ogs_media_component_s {
|
||||
uint32_t media_component_number;
|
||||
uint32_t media_type;
|
||||
|
||||
uint64_t max_requested_bandwidth_dl;
|
||||
uint64_t max_requested_bandwidth_ul;
|
||||
uint64_t min_requested_bandwidth_dl;
|
||||
uint64_t min_requested_bandwidth_ul;
|
||||
uint64_t rr_bandwidth;
|
||||
uint64_t rs_bandwidth;
|
||||
|
||||
int flow_status;
|
||||
|
||||
#define OGS_MAX_NUM_OF_MEDIA_SUB_COMPONENT 8
|
||||
ogs_media_sub_component_t sub[OGS_MAX_NUM_OF_MEDIA_SUB_COMPONENT];
|
||||
int num_of_sub;
|
||||
} ogs_media_component_t;
|
||||
|
||||
typedef struct ogs_ims_data_s {
|
||||
int num_of_msisdn;
|
||||
struct {
|
||||
uint8_t buf[OGS_MAX_MSISDN_LEN];
|
||||
int len;
|
||||
char bcd[OGS_MAX_MSISDN_BCD_LEN+1];
|
||||
} msisdn[OGS_MAX_NUM_OF_MSISDN];
|
||||
|
||||
#define OGS_MAX_NUM_OF_MEDIA_COMPONENT 16
|
||||
ogs_media_component_t media_component[OGS_MAX_NUM_OF_MEDIA_COMPONENT];
|
||||
int num_of_media_component;
|
||||
} ogs_ims_data_t;
|
||||
|
||||
void ogs_ims_data_free(ogs_ims_data_t *ims_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -190,10 +190,10 @@ char *ogs_uint64_to_string(uint64_t x)
|
||||
char *str, *p;
|
||||
|
||||
str = ogs_uint64_to_0string(x);
|
||||
ogs_assert(str);
|
||||
ogs_expect_or_return_val(str, NULL);
|
||||
|
||||
p = ogs_left_trimcharacter(str, '0');
|
||||
ogs_assert(p);
|
||||
ogs_expect_or_return_val(p, NULL);
|
||||
|
||||
ogs_free(str);
|
||||
return ogs_strdup(p);
|
||||
|
||||
@@ -112,7 +112,7 @@ static int epoll_add(ogs_poll_t *poll)
|
||||
map = ogs_hash_get(context->map_hash, &poll->fd, sizeof(poll->fd));
|
||||
if (!map) {
|
||||
map = ogs_calloc(1, sizeof(*map));
|
||||
ogs_assert(map);
|
||||
ogs_expect_or_return_val(map, OGS_ERROR);
|
||||
|
||||
op = EPOLL_CTL_ADD;
|
||||
ogs_hash_set(context->map_hash, &poll->fd, sizeof(poll->fd), map);
|
||||
|
||||
@@ -61,7 +61,7 @@ struct ogs_hash_t {
|
||||
|
||||
static ogs_hash_entry_t **alloc_array(ogs_hash_t *ht, unsigned int max)
|
||||
{
|
||||
return ogs_calloc(1, sizeof(*ht->array) * (max + 1));
|
||||
return ogs_calloc_or_assert(1, sizeof(*ht->array) * (max + 1));
|
||||
}
|
||||
|
||||
ogs_hash_t *ogs_hash_make()
|
||||
@@ -70,6 +70,7 @@ ogs_hash_t *ogs_hash_make()
|
||||
ogs_time_t now = ogs_get_monotonic_time();
|
||||
|
||||
ht = ogs_malloc(sizeof(ogs_hash_t));
|
||||
ogs_expect_or_return_val(ht, NULL);
|
||||
|
||||
ht->free = NULL;
|
||||
ht->count = 0;
|
||||
@@ -85,6 +86,7 @@ ogs_hash_t *ogs_hash_make()
|
||||
ogs_hash_t *ogs_hash_make_custom(ogs_hashfunc_t hash_func)
|
||||
{
|
||||
ogs_hash_t *ht = ogs_hash_make();
|
||||
ogs_expect_or_return_val(ht, NULL);
|
||||
ht->hash_func = hash_func;
|
||||
return ht;
|
||||
}
|
||||
@@ -283,7 +285,7 @@ static ogs_hash_entry_t **find_entry(ogs_hash_t *ht,
|
||||
if ((he = ht->free) != NULL)
|
||||
ht->free = he->next;
|
||||
else
|
||||
he = ogs_malloc_debug(sizeof(*he), file_line);
|
||||
he = ogs_malloc_debug(sizeof(*he), file_line, true);
|
||||
he->next = NULL;
|
||||
he->hash = hash;
|
||||
he->key = key;
|
||||
|
||||
@@ -68,6 +68,7 @@ static void kqueue_init(ogs_pollset_t *pollset)
|
||||
|
||||
context->change_list = ogs_calloc(
|
||||
pollset->capacity, sizeof(struct kevent));
|
||||
ogs_assert(context->change_list);
|
||||
context->event_list = ogs_calloc(
|
||||
pollset->capacity, sizeof(struct kevent));
|
||||
ogs_assert(context->change_list);
|
||||
|
||||
@@ -64,15 +64,30 @@ static ogs_inline void *ogs_list_prev(void *lnode)
|
||||
return node->prev;
|
||||
}
|
||||
|
||||
#define ogs_list_entry(ptr, type, member) ogs_container_of(ptr, type, member)
|
||||
|
||||
#define ogs_list_for_each(list, node) \
|
||||
for (node = ogs_list_first(list); (node); \
|
||||
node = ogs_list_next(node))
|
||||
|
||||
#define ogs_list_for_each_entry(list, node, member) \
|
||||
for (node = ogs_list_entry(ogs_list_first(list), typeof(*node), member); \
|
||||
(&node->member); \
|
||||
node = ogs_list_entry( \
|
||||
ogs_list_next(&node->member), typeof(*node), member))
|
||||
|
||||
#define ogs_list_for_each_safe(list, n, node) \
|
||||
for (node = ogs_list_first(list); \
|
||||
(node) && (n = ogs_list_next(node), 1); \
|
||||
node = n)
|
||||
|
||||
#define ogs_list_for_each_entry_safe(list, n, node, member) \
|
||||
for (node = ogs_list_entry(ogs_list_first(list), typeof(*node), member); \
|
||||
(&node->member) && \
|
||||
(n = ogs_list_entry( \
|
||||
ogs_list_next(&node->member), typeof(*node), member), 1); \
|
||||
node = n)
|
||||
|
||||
static ogs_inline void ogs_list_prepend(ogs_list_t *list, void *lnode)
|
||||
{
|
||||
ogs_list_t *node = lnode;
|
||||
|
||||
@@ -134,6 +134,15 @@ void ogs_log_hexdump_func(ogs_log_level_e level, int domain_id,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ogs_expect_or_return_val(expr, val) \
|
||||
do { \
|
||||
if (ogs_likely(expr)) ; \
|
||||
else { \
|
||||
ogs_error("%s: Expectation `%s' failed.", OGS_FUNC, #expr); \
|
||||
return (val); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#undef OGS_LOG_DOMAIN
|
||||
#define OGS_LOG_DOMAIN __ogs_mem_domain
|
||||
|
||||
void *ogs_malloc_debug(size_t size, const char *file_line)
|
||||
void *ogs_malloc_debug(size_t size, const char *file_line, bool abort)
|
||||
{
|
||||
size_t headroom = 0;
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
@@ -31,7 +31,12 @@ void *ogs_malloc_debug(size_t size, const char *file_line)
|
||||
|
||||
headroom = sizeof(ogs_pkbuf_t *);
|
||||
pkbuf = ogs_pkbuf_alloc_debug(NULL, headroom + size, file_line);
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
if (abort == true)
|
||||
ogs_assert(pkbuf);
|
||||
else
|
||||
ogs_expect_or_return_val(pkbuf, NULL);
|
||||
|
||||
ogs_pkbuf_reserve(pkbuf, headroom);
|
||||
memcpy(pkbuf->head, &pkbuf, headroom);
|
||||
ogs_pkbuf_put(pkbuf, size);
|
||||
@@ -54,18 +59,23 @@ void ogs_free(void *ptr)
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
}
|
||||
|
||||
void *ogs_calloc_debug(size_t nmemb, size_t size, const char *file_line)
|
||||
void *ogs_calloc_debug(
|
||||
size_t nmemb, size_t size, const char *file_line, bool abort)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
ptr = ogs_malloc_debug(nmemb * size, file_line);
|
||||
ogs_assert(ptr);
|
||||
ptr = ogs_malloc_debug(nmemb * size, file_line, abort);
|
||||
if (abort == true)
|
||||
ogs_assert(ptr);
|
||||
else
|
||||
ogs_expect_or_return_val(ptr, NULL);
|
||||
|
||||
memset(ptr, 0, nmemb * size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *ogs_realloc_debug(void *ptr, size_t size, const char *file_line)
|
||||
void *ogs_realloc_debug(
|
||||
void *ptr, size_t size, const char *file_line, bool abort)
|
||||
{
|
||||
size_t headroom = 0;
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
@@ -77,9 +87,17 @@ void *ogs_realloc_debug(void *ptr, size_t size, const char *file_line)
|
||||
headroom = sizeof(ogs_pkbuf_t *);
|
||||
|
||||
memcpy(&pkbuf, (unsigned char*)ptr - headroom, headroom);
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
if (abort == true)
|
||||
ogs_assert(pkbuf);
|
||||
else
|
||||
ogs_expect_or_return_val(pkbuf, NULL);
|
||||
|
||||
cluster = pkbuf->cluster;
|
||||
ogs_assert(cluster);
|
||||
if (abort == true)
|
||||
ogs_assert(cluster);
|
||||
else
|
||||
ogs_expect_or_return_val(cluster, NULL);
|
||||
|
||||
if (!size) {
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
@@ -89,8 +107,13 @@ void *ogs_realloc_debug(void *ptr, size_t size, const char *file_line)
|
||||
if (size > (cluster->size - headroom)) {
|
||||
void *new = NULL;
|
||||
|
||||
new = ogs_malloc_debug(size, file_line);
|
||||
ogs_assert(new);
|
||||
new = ogs_malloc_debug(size, file_line, abort);
|
||||
|
||||
if (abort == true)
|
||||
ogs_assert(new);
|
||||
else
|
||||
ogs_expect_or_return_val(new, NULL);
|
||||
|
||||
memcpy(new, ptr, pkbuf->len);
|
||||
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
|
||||
@@ -44,13 +44,23 @@ extern "C" {
|
||||
memcpy((__dST), (__sRC), sizeof(*(__sRC))*sizeof(uint8_t)); \
|
||||
} while(0)
|
||||
|
||||
#define ogs_malloc(size) ogs_malloc_debug(size, OGS_FILE_LINE)
|
||||
void *ogs_malloc_debug(size_t size, const char *file_line);
|
||||
#define ogs_malloc(size) ogs_malloc_debug(size, OGS_FILE_LINE, false)
|
||||
#define ogs_malloc_or_assert(size) \
|
||||
ogs_malloc_debug(size, OGS_FILE_LINE, true)
|
||||
void *ogs_malloc_debug(size_t size, const char *file_line, bool abort);
|
||||
void ogs_free(void *ptr);
|
||||
#define ogs_calloc(nmemb, size) ogs_calloc_debug(nmemb, size, OGS_FILE_LINE)
|
||||
void *ogs_calloc_debug(size_t nmemb, size_t size, const char *file_line);
|
||||
#define ogs_realloc(ptr, size) ogs_realloc_debug(ptr, size, OGS_FILE_LINE)
|
||||
void *ogs_realloc_debug(void *ptr, size_t size, const char *file_line);
|
||||
#define ogs_calloc(nmemb, size) \
|
||||
ogs_calloc_debug(nmemb, size, OGS_FILE_LINE, false)
|
||||
#define ogs_calloc_or_assert(nmemb, size) \
|
||||
ogs_calloc_debug(nmemb, size, OGS_FILE_LINE, true)
|
||||
void *ogs_calloc_debug(
|
||||
size_t nmemb, size_t size, const char *file_line, bool abort);
|
||||
#define ogs_realloc(ptr, size) \
|
||||
ogs_realloc_debug(ptr, size, OGS_FILE_LINE, false)
|
||||
#define ogs_realloc_or_assert(ptr, size) \
|
||||
ogs_realloc_debug(ptr, size, OGS_FILE_LINE, true)
|
||||
void *ogs_realloc_debug(
|
||||
void *ptr, size_t size, const char *file_line, bool abort);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ void ogs_pkbuf_default_init(ogs_pkbuf_config_t *config)
|
||||
config->cluster_128_pool = 65536;
|
||||
config->cluster_256_pool = 16384;
|
||||
config->cluster_512_pool = 4096;
|
||||
config->cluster_1024_pool = 1024;
|
||||
config->cluster_1024_pool = 2048;
|
||||
config->cluster_2048_pool = 512;
|
||||
config->cluster_8192_pool = 512;
|
||||
config->cluster_big_pool = 8;
|
||||
@@ -199,10 +199,13 @@ ogs_pkbuf_t *ogs_pkbuf_alloc_debug(
|
||||
ogs_thread_mutex_unlock(&pool->mutex);
|
||||
return NULL;
|
||||
}
|
||||
ogs_assert(cluster);
|
||||
|
||||
ogs_pool_alloc(&pool->pkbuf, &pkbuf);
|
||||
ogs_assert(pkbuf);
|
||||
if (!pkbuf) {
|
||||
ogs_error("ogs_pkbuf_alloc() failed [size=%d]", size);
|
||||
ogs_thread_mutex_unlock(&pool->mutex);
|
||||
return NULL;
|
||||
}
|
||||
memset(pkbuf, 0, sizeof(*pkbuf));
|
||||
|
||||
cluster->ref++;
|
||||
@@ -248,7 +251,7 @@ void ogs_pkbuf_free(ogs_pkbuf_t *pkbuf)
|
||||
ogs_thread_mutex_unlock(&pool->mutex);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ogs_pkbuf_copy(ogs_pkbuf_t *pkbuf)
|
||||
ogs_pkbuf_t *ogs_pkbuf_copy_debug(ogs_pkbuf_t *pkbuf, const char *file_line)
|
||||
{
|
||||
ogs_pkbuf_pool_t *pool = NULL;
|
||||
ogs_pkbuf_t *newbuf = NULL;
|
||||
@@ -288,51 +291,31 @@ static ogs_cluster_t *cluster_alloc(
|
||||
|
||||
if (size <= OGS_CLUSTER_128_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_128, (ogs_cluster_128_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_128_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_128_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_256_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_256, (ogs_cluster_256_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_256_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_256_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_512_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_512, (ogs_cluster_512_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_512_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_512_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_1024_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_1024, (ogs_cluster_1024_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_1024_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_1024_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_2048_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_2048, (ogs_cluster_2048_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_2048_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_2048_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_8192_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_8192, (ogs_cluster_8192_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_8192_SIZE");
|
||||
return NULL;
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_8192_SIZE;
|
||||
} else if (size <= OGS_CLUSTER_BIG_SIZE) {
|
||||
ogs_pool_alloc(&pool->cluster_big, (ogs_cluster_big_t**)&buffer);
|
||||
if (!buffer) {
|
||||
ogs_fatal("No OGS_CLUSTER_BIG_SIZE");
|
||||
}
|
||||
ogs_expect_or_return_val(buffer, NULL);
|
||||
cluster->size = OGS_CLUSTER_BIG_SIZE;
|
||||
} else {
|
||||
ogs_fatal("invalid size = %d", size);
|
||||
|
||||
@@ -84,7 +84,9 @@ void ogs_pkbuf_free(ogs_pkbuf_t *pkbuf);
|
||||
|
||||
void *ogs_pkbuf_put_data(
|
||||
ogs_pkbuf_t *pkbuf, const void *data, unsigned int len);
|
||||
ogs_pkbuf_t *ogs_pkbuf_copy(ogs_pkbuf_t *pkbuf);
|
||||
#define ogs_pkbuf_copy(pkbuf) \
|
||||
ogs_pkbuf_copy_debug(pkbuf, OGS_FILE_LINE)
|
||||
ogs_pkbuf_t *ogs_pkbuf_copy_debug(ogs_pkbuf_t *pkbuf, const char *file_line);
|
||||
|
||||
static ogs_inline int ogs_pkbuf_tailroom(const ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ bool ogs_pollset_actions_initialized = false;
|
||||
ogs_pollset_t *ogs_pollset_create(unsigned int capacity)
|
||||
{
|
||||
ogs_pollset_t *pollset = ogs_calloc(1, sizeof *pollset);
|
||||
ogs_assert(pollset);
|
||||
ogs_expect_or_return_val(pollset, NULL);
|
||||
|
||||
pollset->capacity = capacity;
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ typedef struct ogs_queue_s {
|
||||
ogs_queue_t *ogs_queue_create(unsigned int capacity)
|
||||
{
|
||||
ogs_queue_t *queue = ogs_calloc(1, sizeof *queue);
|
||||
ogs_expect_or_return_val(queue, NULL);
|
||||
ogs_assert(queue);
|
||||
|
||||
ogs_thread_mutex_init(&queue->one_big_mutex);
|
||||
@@ -77,6 +78,7 @@ ogs_queue_t *ogs_queue_create(unsigned int capacity)
|
||||
ogs_thread_cond_init(&queue->not_full);
|
||||
|
||||
queue->data = ogs_calloc(1, capacity * sizeof(void*));
|
||||
ogs_expect_or_return_val(queue->data, NULL);
|
||||
queue->bounds = capacity;
|
||||
queue->nelts = 0;
|
||||
queue->in = 0;
|
||||
|
||||
@@ -130,6 +130,7 @@ int ogs_addaddrinfo(ogs_sockaddr_t **sa_list,
|
||||
continue;
|
||||
|
||||
new = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_expect_or_return_val(new, OGS_ERROR);
|
||||
memcpy(&new->sa, ai->ai_addr, ai->ai_addrlen);
|
||||
new->ogs_sin_port = htobe16(port);
|
||||
|
||||
@@ -203,12 +204,15 @@ int ogs_copyaddrinfo(ogs_sockaddr_t **dst, const ogs_sockaddr_t *src)
|
||||
for (*dst = d = NULL, s = src; s; s = s->next) {
|
||||
if (!d) {
|
||||
*dst = d = ogs_memdup(s, sizeof *s);
|
||||
ogs_expect_or_return_val(*dst, OGS_ERROR);
|
||||
} else {
|
||||
d = d->next = ogs_memdup(s, sizeof *s);
|
||||
ogs_expect_or_return_val(d, OGS_ERROR);
|
||||
}
|
||||
if (s->hostname) {
|
||||
if (s == src || s->hostname != src->hostname) {
|
||||
d->hostname = ogs_strdup(s->hostname);
|
||||
ogs_expect_or_return_val(d->hostname, OGS_ERROR);
|
||||
} else {
|
||||
d->hostname = (*dst)->hostname;
|
||||
}
|
||||
@@ -279,6 +283,7 @@ ogs_sockaddr_t *ogs_link_local_addr_by_dev(const char *dev)
|
||||
continue;
|
||||
|
||||
addr = ogs_calloc(1, sizeof(ogs_sockaddr_t));
|
||||
ogs_expect_or_return_val(addr, NULL);
|
||||
ogs_assert(addr);
|
||||
memcpy(&addr->sa, cur->ifa_addr, ogs_sockaddr_len(cur->ifa_addr));
|
||||
|
||||
@@ -288,6 +293,7 @@ ogs_sockaddr_t *ogs_link_local_addr_by_dev(const char *dev)
|
||||
|
||||
freeifaddrs(iflist);
|
||||
#endif
|
||||
ogs_error("ogs_link_local_addr_by_dev() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ ogs_sock_t *ogs_sock_create(void)
|
||||
ogs_sock_t *sock = NULL;
|
||||
|
||||
sock = ogs_calloc(1, sizeof(*sock));
|
||||
ogs_assert(sock);
|
||||
ogs_expect_or_return_val(sock, NULL);
|
||||
|
||||
sock->fd = INVALID_SOCKET;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ ogs_socknode_t *ogs_socknode_new(ogs_sockaddr_t *addr)
|
||||
ogs_assert(addr);
|
||||
|
||||
node = ogs_calloc(1, sizeof(ogs_socknode_t));
|
||||
ogs_assert(node);
|
||||
ogs_expect_or_return_val(node, NULL);
|
||||
|
||||
node->addr = addr;
|
||||
|
||||
@@ -71,12 +71,13 @@ ogs_socknode_t *ogs_socknode_add(
|
||||
ogs_assert(list);
|
||||
ogs_assert(addr);
|
||||
|
||||
ogs_copyaddrinfo(&dup, addr);
|
||||
ogs_assert(OGS_OK == ogs_copyaddrinfo(&dup, addr));
|
||||
if (family != AF_UNSPEC)
|
||||
ogs_filteraddrinfo(&dup, family);
|
||||
|
||||
if (dup) {
|
||||
node = ogs_socknode_new(dup);
|
||||
ogs_assert(node);
|
||||
ogs_list_add(list, node);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ char *ogs_slprintf(char *str, char *last, const char *format, ...)
|
||||
return r;
|
||||
}
|
||||
|
||||
char *ogs_strdup_debug(const char *s, const char *file_line)
|
||||
char *ogs_strdup_debug(const char *s, const char *file_line, bool abort)
|
||||
{
|
||||
char *res;
|
||||
size_t len;
|
||||
@@ -129,11 +129,13 @@ char *ogs_strdup_debug(const char *s, const char *file_line)
|
||||
return NULL;
|
||||
|
||||
len = strlen(s) + 1;
|
||||
res = ogs_memdup_debug(s, len, file_line);
|
||||
res = ogs_memdup_debug(s, len, file_line, abort);
|
||||
ogs_expect_or_return_val(res, res);
|
||||
return res;
|
||||
}
|
||||
|
||||
char *ogs_strndup_debug(const char *s, size_t n, const char *file_line)
|
||||
char *ogs_strndup_debug(
|
||||
const char *s, size_t n, const char *file_line, bool abort)
|
||||
{
|
||||
char *res;
|
||||
const char *end;
|
||||
@@ -144,20 +146,23 @@ char *ogs_strndup_debug(const char *s, size_t n, const char *file_line)
|
||||
end = memchr(s, '\0', n);
|
||||
if (end != NULL)
|
||||
n = end - s;
|
||||
res = ogs_malloc_debug(n + 1, file_line);
|
||||
res = ogs_malloc_debug(n + 1, file_line, abort);
|
||||
ogs_expect_or_return_val(res, res);
|
||||
memcpy(res, s, n);
|
||||
res[n] = '\0';
|
||||
return res;
|
||||
}
|
||||
|
||||
void *ogs_memdup_debug(const void *m, size_t n, const char *file_line)
|
||||
void *ogs_memdup_debug(
|
||||
const void *m, size_t n, const char *file_line, bool abort)
|
||||
{
|
||||
void *res;
|
||||
|
||||
if (m == NULL)
|
||||
return NULL;
|
||||
|
||||
res = ogs_malloc_debug(n, file_line);
|
||||
res = ogs_malloc_debug(n, file_line, abort);
|
||||
ogs_expect_or_return_val(res, res);
|
||||
memcpy(res, m, n);
|
||||
return res;
|
||||
}
|
||||
@@ -195,7 +200,8 @@ char *ogs_cpystrn(char *dst, const char *src, size_t dst_size)
|
||||
*
|
||||
* https://github.com/babelouest/orcania.git
|
||||
*/
|
||||
char *ogs_msprintf_debug(const char *file_line, const char *message, ...)
|
||||
char *ogs_msprintf_debug(
|
||||
const char *file_line, bool abort, const char *message, ...)
|
||||
{
|
||||
va_list argp, argp_cpy;
|
||||
size_t out_len = 0;
|
||||
@@ -206,7 +212,7 @@ char *ogs_msprintf_debug(const char *file_line, const char *message, ...)
|
||||
in some architectures,
|
||||
vsnprintf can modify argp */
|
||||
out_len = vsnprintf(NULL, 0, message, argp);
|
||||
out = ogs_malloc_debug(out_len + sizeof(char), file_line);
|
||||
out = ogs_malloc_debug(out_len + sizeof(char), file_line, abort);
|
||||
if (out == NULL) {
|
||||
va_end(argp);
|
||||
va_end(argp_cpy);
|
||||
@@ -220,7 +226,8 @@ char *ogs_msprintf_debug(const char *file_line, const char *message, ...)
|
||||
}
|
||||
|
||||
char *ogs_mstrcatf_debug(
|
||||
char *source, const char *file_line, const char *message, ...)
|
||||
char *source, const char *file_line, bool abort,
|
||||
const char *message, ...)
|
||||
{
|
||||
va_list argp, argp_cpy;
|
||||
char *out = NULL, *message_formatted = NULL;
|
||||
@@ -238,7 +245,7 @@ char *ogs_mstrcatf_debug(
|
||||
vsnprintf(message_formatted,
|
||||
(message_formatted_len+sizeof(char)), message, argp_cpy);
|
||||
out = ogs_msprintf_debug(
|
||||
file_line, "%s%s", source, message_formatted);
|
||||
file_line, abort, "%s%s", source, message_formatted);
|
||||
ogs_free(message_formatted);
|
||||
ogs_free(source);
|
||||
}
|
||||
@@ -250,7 +257,7 @@ char *ogs_mstrcatf_debug(
|
||||
in some architectures,
|
||||
vsnprintf can modify argp */
|
||||
out_len = vsnprintf(NULL, 0, message, argp);
|
||||
out = ogs_malloc_debug(out_len+sizeof(char), file_line);
|
||||
out = ogs_malloc_debug(out_len+sizeof(char), file_line, abort);
|
||||
if (out != NULL) {
|
||||
vsnprintf(out, (out_len+sizeof(char)), message, argp_cpy);
|
||||
}
|
||||
|
||||
@@ -75,12 +75,17 @@ char *ogs_vslprintf(char *str, char *last, const char *format, va_list ap)
|
||||
char *ogs_slprintf(char *str, char *last, const char *format, ...)
|
||||
OGS_GNUC_PRINTF(3, 4);
|
||||
|
||||
#define ogs_strdup(s) ogs_strdup_debug(s, OGS_FILE_LINE)
|
||||
char *ogs_strdup_debug(const char *s, const char *file_line);
|
||||
#define ogs_strndup(s, n) ogs_strndup_debug(s, n, OGS_FILE_LINE)
|
||||
char *ogs_strndup_debug(const char *s, size_t n, const char *file_line);
|
||||
#define ogs_memdup(m, n) ogs_memdup_debug(m, n, OGS_FILE_LINE)
|
||||
void *ogs_memdup_debug(const void *m, size_t n, const char *file_line);
|
||||
#define ogs_strdup(s) ogs_strdup_debug(s, OGS_FILE_LINE, false)
|
||||
#define ogs_strdup_or_assert(s) ogs_strdup_debug(s, OGS_FILE_LINE, true)
|
||||
char *ogs_strdup_debug(const char *s, const char *file_line, bool abort);
|
||||
#define ogs_strndup(s, n) ogs_strndup_debug(s, n, OGS_FILE_LINE, false)
|
||||
#define ogs_strndup_or_assert(s, n) ogs_strndup_debug(s, n, OGS_FILE_LINE, true)
|
||||
char *ogs_strndup_debug
|
||||
(const char *s, size_t n, const char *file_line, bool abort);
|
||||
#define ogs_memdup(m, n) ogs_memdup_debug(m, n, OGS_FILE_LINE, false)
|
||||
#define ogs_memdup_or_assert(m, n) ogs_memdup_debug(m, n, OGS_FILE_LINE, true)
|
||||
void *ogs_memdup_debug
|
||||
(const void *m, size_t n, const char *file_line, bool abort);
|
||||
|
||||
char *ogs_cpystrn(char *dst, const char *src, size_t dst_size);
|
||||
|
||||
@@ -94,14 +99,20 @@ char *ogs_cpystrn(char *dst, const char *src, size_t dst_size);
|
||||
*
|
||||
* https://github.com/babelouest/orcania.git
|
||||
*/
|
||||
#define ogs_msprintf(...) ogs_msprintf_debug(OGS_FILE_LINE, __VA_ARGS__)
|
||||
char *ogs_msprintf_debug(const char *file_line, const char *message, ...)
|
||||
OGS_GNUC_PRINTF(2, 3);
|
||||
#define ogs_mstrcatf(source, ...) \
|
||||
ogs_mstrcatf_debug(source, OGS_FILE_LINE, __VA_ARGS__)
|
||||
char *ogs_mstrcatf_debug(
|
||||
char *source, const char *file_line, const char *message, ...)
|
||||
#define ogs_msprintf(...) ogs_msprintf_debug(OGS_FILE_LINE, false, __VA_ARGS__)
|
||||
#define ogs_msprintf_or_assert(...) \
|
||||
ogs_msprintf_debug(OGS_FILE_LINE, true, __VA_ARGS__)
|
||||
char *ogs_msprintf_debug
|
||||
(const char *file_line, bool abort, const char *message, ...)
|
||||
OGS_GNUC_PRINTF(3, 4);
|
||||
#define ogs_mstrcatf(source, ...) \
|
||||
ogs_mstrcatf_debug(source, OGS_FILE_LINE, false, __VA_ARGS__)
|
||||
#define ogs_mstrcatf_or_assert(source, ...) \
|
||||
ogs_mstrcatf_debug(source, OGS_FILE_LINE, true, __VA_ARGS__)
|
||||
char *ogs_mstrcatf_debug(
|
||||
char *source, const char *file_line, bool abort,
|
||||
const char *message, ...)
|
||||
OGS_GNUC_PRINTF(4, 5);
|
||||
|
||||
char *ogs_trimwhitespace(char *str);
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ static void *thread_worker(void *arg)
|
||||
ogs_thread_t *ogs_thread_create(void (*func)(void *), void *data)
|
||||
{
|
||||
ogs_thread_t *thread = ogs_calloc(1, sizeof *thread);
|
||||
ogs_assert(thread);
|
||||
ogs_expect_or_return_val(thread, NULL);
|
||||
|
||||
ogs_thread_mutex_init(&thread->mutex);
|
||||
ogs_thread_cond_init(&thread->cond);
|
||||
|
||||
@@ -55,7 +55,7 @@ static void add_timer_node(
|
||||
ogs_timer_mgr_t *ogs_timer_mgr_create(unsigned int capacity)
|
||||
{
|
||||
ogs_timer_mgr_t *manager = ogs_calloc(1, sizeof *manager);
|
||||
ogs_assert(manager);
|
||||
ogs_expect_or_return_val(manager, NULL);
|
||||
|
||||
ogs_pool_init(&manager->pool, capacity);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
desc->type, 1, desc->instance, &v->u8);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 1, desc->instance, &v->u8);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_UINT16:
|
||||
@@ -63,7 +63,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
desc->type, 2, desc->instance, &v->u16);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 2, desc->instance, &v->u16);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_UINT24:
|
||||
@@ -79,7 +79,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
desc->type, 3, desc->instance, &v->u24);
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv, desc->type, 3, desc->instance, &v->u24);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_UINT32:
|
||||
@@ -95,7 +95,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 4, desc->instance, &v->u32);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_FIXED_STR:
|
||||
@@ -108,7 +108,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, desc->length, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_VAR_STR:
|
||||
@@ -116,9 +116,9 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
ogs_tlv_octet_t *v = (ogs_tlv_octet_t *)msg;
|
||||
|
||||
if (v->len == 0) {
|
||||
ogs_fatal("No TLV length - [%s] T:%d I:%d (vsz=%d)",
|
||||
ogs_error("No TLV length - [%s] T:%d I:%d (vsz=%d)",
|
||||
desc->name, desc->type, desc->instance, desc->vsize);
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return_val(0, NULL);
|
||||
}
|
||||
|
||||
if (parent_tlv)
|
||||
@@ -127,7 +127,7 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, v->len, desc->instance, v->data);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
case OGS_TLV_NULL:
|
||||
@@ -138,11 +138,11 @@ static ogs_tlv_t *tlv_add_leaf(
|
||||
else
|
||||
tlv = ogs_tlv_add(tlv,
|
||||
desc->type, 0, desc->instance, NULL);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, NULL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ogs_assert_if_reached();
|
||||
ogs_expect_or_return_val(0, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
r = tlv_add_compound(&emb_tlv, tlv, desc,
|
||||
p + offset2 + sizeof(ogs_tlv_presence_t),
|
||||
depth + 1);
|
||||
ogs_assert(r > 0 && emb_tlv);
|
||||
ogs_expect_or_return_val(r > 0 && emb_tlv, 0);
|
||||
count += 1 + r;
|
||||
} else {
|
||||
ogs_trace("BUILD %sL#%d [%s] T:%d L:%d I:%d "
|
||||
@@ -205,7 +205,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
p + offset2);
|
||||
|
||||
tlv = tlv_add_leaf(parent_tlv, tlv, desc, p + offset2);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, 0);
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
r = tlv_add_compound(&emb_tlv, tlv, desc,
|
||||
p + offset + sizeof(ogs_tlv_presence_t),
|
||||
depth + 1);
|
||||
ogs_assert(r > 0 && emb_tlv);
|
||||
ogs_expect_or_return_val(r > 0 && emb_tlv, 0);
|
||||
count += 1 + r;
|
||||
} else {
|
||||
ogs_trace("BUILD %sL#%d [%s] T:%d L:%d I:%d "
|
||||
@@ -245,7 +245,7 @@ static uint32_t tlv_add_compound(ogs_tlv_t **root, ogs_tlv_t *parent_tlv,
|
||||
p + offset);
|
||||
|
||||
tlv = tlv_add_leaf(parent_tlv, tlv, desc, p + offset);
|
||||
ogs_assert(tlv);
|
||||
ogs_expect_or_return_val(tlv, 0);
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -272,20 +272,20 @@ ogs_pkbuf_t *ogs_tlv_build_msg(ogs_tlv_desc_t *desc, void *msg, int mode)
|
||||
|
||||
if (desc->child_descs[0]) {
|
||||
r = tlv_add_compound(&root, NULL, desc, msg, 0);
|
||||
ogs_assert(r > 0 && root);
|
||||
ogs_expect_or_return_val(r > 0 && root, NULL);
|
||||
|
||||
length = ogs_tlv_calc_length(root, mode);
|
||||
} else {
|
||||
length = 0;
|
||||
}
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_TLV_MAX_HEADROOM+length);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_expect_or_return_val(pkbuf, NULL);
|
||||
ogs_pkbuf_reserve(pkbuf, OGS_TLV_MAX_HEADROOM);
|
||||
ogs_pkbuf_put(pkbuf, length);
|
||||
|
||||
if (desc->child_descs[0]) {
|
||||
rendlen = ogs_tlv_render(root, pkbuf->data, length, mode);
|
||||
ogs_assert(rendlen == length);
|
||||
ogs_expect_or_return_val(rendlen == length, NULL);
|
||||
|
||||
ogs_tlv_free_all(root);
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ typedef struct ogs_tlv_int32_s {
|
||||
(__dST)->presence = (__sRC)->presence; \
|
||||
(__dST)->len = (__sRC)->len; \
|
||||
(__dST)->data = ogs_calloc((__dST)->len, sizeof(uint8_t)); \
|
||||
ogs_assert((__dST)->data); \
|
||||
memcpy((__dST)->data, (__sRC)->data, (__dST)->len); \
|
||||
} while(0)
|
||||
typedef struct ogs_tlv_octet_s {
|
||||
|
||||
@@ -35,7 +35,6 @@ ogs_sock_t *ogs_udp_socket(int family, ogs_socknode_t *node)
|
||||
|
||||
ogs_sock_t *ogs_udp_server(ogs_socknode_t *node)
|
||||
{
|
||||
int rv;
|
||||
ogs_sock_t *new = NULL;
|
||||
ogs_sockaddr_t *addr;
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
@@ -47,9 +46,6 @@ ogs_sock_t *ogs_udp_server(ogs_socknode_t *node)
|
||||
while (addr) {
|
||||
new = ogs_udp_socket(addr->ogs_sa_family, node);
|
||||
if (new) {
|
||||
rv = ogs_listen_reusable(new->fd);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
if (ogs_sock_bind(new, addr) == OGS_OK) {
|
||||
ogs_debug("udp_server() [%s]:%d",
|
||||
OGS_ADDR(addr, buf), OGS_PORT(addr));
|
||||
|
||||
@@ -413,7 +413,7 @@ void snow_3g_f8(u8 *key, u32 count, u32 bearer, u32 dir, u8 *data, u32 length)
|
||||
|
||||
/* Run SNOW 3G algorithm to generate sequence of key stream bits KS*/
|
||||
snow_3g_initialize(K,IV);
|
||||
KS = (u32 *)ogs_malloc(4*n);
|
||||
KS = (u32 *)ogs_malloc_or_assert(4*n);
|
||||
snow_3g_generate_key_stream(n,(u32*)KS);
|
||||
|
||||
/* Exclusive-OR the input data with keystream to generate the output bit
|
||||
|
||||
@@ -296,7 +296,7 @@ void zuc_eea3(u8* CK, u32 COUNT, u32 BEARER, u32 DIRECTION,
|
||||
u32 lastbits = (8-(LENGTH%8))%8;
|
||||
|
||||
L = (LENGTH+31)/32;
|
||||
z = (u32 *) ogs_malloc(L*sizeof(u32));
|
||||
z = (u32 *) ogs_malloc_or_assert(L*sizeof(u32));
|
||||
|
||||
L8 = (LENGTH+7)/8;
|
||||
|
||||
@@ -387,7 +387,7 @@ void zuc_eia3(u8* IK, u32 COUNT, u32 BEARER, u32 DIRECTION,
|
||||
|
||||
N = LENGTH + 64;
|
||||
L = (N + 31) / 32;
|
||||
z = (u32 *) ogs_malloc(L*sizeof(u32));
|
||||
z = (u32 *) ogs_malloc_or_assert(L*sizeof(u32));
|
||||
ZUC(IK, IV, z, L);
|
||||
|
||||
T = 0;
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* The ogs_msisdn_data_s structure is always used with the db library. */
|
||||
typedef struct ogs_msisdn_data_s {
|
||||
struct {
|
||||
uint8_t buf[OGS_MAX_IMSI_LEN];
|
||||
@@ -46,15 +48,6 @@ typedef struct ogs_msisdn_data_s {
|
||||
int ogs_dbi_msisdn_data(
|
||||
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data);
|
||||
|
||||
typedef struct ogs_ims_data_s {
|
||||
int num_of_msisdn;
|
||||
struct {
|
||||
uint8_t buf[OGS_MAX_MSISDN_LEN];
|
||||
int len;
|
||||
char bcd[OGS_MAX_MSISDN_BCD_LEN+1];
|
||||
} msisdn[OGS_MAX_NUM_OF_MSISDN];
|
||||
} ogs_ims_data_t;
|
||||
|
||||
int ogs_dbi_ims_data(char *supi, ogs_ims_data_t *ims_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -57,6 +57,7 @@ static char *masked_db_uri(const char *db_uri)
|
||||
ogs_assert(db_uri);
|
||||
|
||||
tmp = ogs_strdup(db_uri);
|
||||
ogs_assert(tmp);
|
||||
|
||||
memset(array, 0, sizeof(array));
|
||||
array[0] = strtok_r(tmp, "@", &saveptr);
|
||||
|
||||
@@ -452,6 +452,7 @@ done:
|
||||
utf8 = bson_iter_utf8(
|
||||
&child8_iter, &length);
|
||||
flow->description = ogs_malloc(length+1);
|
||||
ogs_assert(flow->description);
|
||||
ogs_cpystrn((char*)flow->description,
|
||||
utf8, length+1);
|
||||
}
|
||||
@@ -479,7 +480,6 @@ done:
|
||||
ogs_assert(pcc_rule->id);
|
||||
|
||||
pcc_rule->precedence = pcc_rule_index+1;
|
||||
pcc_rule->flow_status = OGS_FLOW_STATUS_ENABLED;
|
||||
pcc_rule_index++;
|
||||
}
|
||||
session_data->num_of_pcc_rule = pcc_rule_index;
|
||||
|
||||
@@ -43,9 +43,12 @@ typedef struct ogs_diam_config_s {
|
||||
/* the local port for Diameter/TLS (default: 5658) in host byte order */
|
||||
uint16_t cnf_port_tls;
|
||||
|
||||
struct {
|
||||
unsigned no_sctp: 1; /* disable the use of SCTP */
|
||||
} cnf_flags;
|
||||
struct {
|
||||
/* the peer does not relay messages (0xffffff app id) */
|
||||
unsigned no_fwd: 1;
|
||||
/* disable the use of SCTP */
|
||||
unsigned no_sctp: 1;
|
||||
} cnf_flags;
|
||||
|
||||
#define MAX_NUM_OF_FD_EXTENSION 32
|
||||
struct {
|
||||
@@ -66,10 +69,11 @@ typedef struct ogs_diam_config_s {
|
||||
} ogs_diam_config_t;
|
||||
|
||||
int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config);
|
||||
int ogs_diam_start(void);
|
||||
void ogs_diam_final(void);
|
||||
|
||||
int ogs_diam_config_init(ogs_diam_config_t *fd_config);
|
||||
bool ogs_diam_peer_connected(void);
|
||||
bool ogs_diam_app_connected(uint32_t app_id);
|
||||
|
||||
int fd_avp_search_avp ( struct avp * groupedavp,
|
||||
struct dict_object * what, struct avp ** avp );
|
||||
|
||||
@@ -66,6 +66,9 @@ static int diam_config_apply(ogs_diam_config_t *fd_config)
|
||||
if (fd_config->cnf_flags.no_sctp)
|
||||
fd_g_config->cnf_flags.no_sctp = fd_config->cnf_flags.no_sctp;
|
||||
|
||||
if (fd_config->cnf_flags.no_fwd)
|
||||
fd_g_config->cnf_flags.no_fwd = fd_config->cnf_flags.no_fwd;
|
||||
|
||||
/********************************************************************
|
||||
* Diameter Client
|
||||
*/
|
||||
|
||||
@@ -57,6 +57,16 @@ int ogs_diam_init(int mode, const char *conffile, ogs_diam_config_t *fd_config)
|
||||
/* Initialize FD logger */
|
||||
CHECK_FCT_DO( ogs_diam_logger_init(mode), goto error );
|
||||
|
||||
return 0;
|
||||
error:
|
||||
CHECK_FCT_DO( fd_core_shutdown(), );
|
||||
CHECK_FCT_DO( fd_core_wait_shutdown_complete(), );
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int ogs_diam_start(void)
|
||||
{
|
||||
/* Start the servers */
|
||||
CHECK_FCT_DO( fd_core_start(), goto error );
|
||||
|
||||
@@ -126,6 +136,7 @@ static void diam_log_func(int printlevel, const char *format, va_list ap)
|
||||
break;
|
||||
case FD_LOG_FATAL:
|
||||
diam_log_printf(OGS_LOG_FATAL, "%s\n", buffer);
|
||||
ogs_assert_if_reached();
|
||||
break;
|
||||
default:
|
||||
diam_log_printf(OGS_LOG_ERROR, "[%d] %s\n", printlevel, buffer);
|
||||
|
||||
@@ -28,6 +28,9 @@ struct dict_object *ogs_diam_origin_realm = NULL;
|
||||
struct dict_object *ogs_diam_destination_host = NULL;
|
||||
struct dict_object *ogs_diam_destination_realm = NULL;
|
||||
struct dict_object *ogs_diam_user_name = NULL;
|
||||
struct dict_object *ogs_diam_subscription_id = NULL;
|
||||
struct dict_object *ogs_diam_subscription_id_type = NULL;
|
||||
struct dict_object *ogs_diam_subscription_id_data = NULL;
|
||||
struct dict_object *ogs_diam_auth_session_state = NULL;
|
||||
struct dict_object *ogs_diam_auth_application_id = NULL;
|
||||
struct dict_object *ogs_diam_auth_request_type = NULL;
|
||||
@@ -41,6 +44,10 @@ struct dict_object *ogs_diam_mip_home_agent_address = NULL;
|
||||
struct dict_object *ogs_diam_authorization_lifetime = NULL;
|
||||
struct dict_object *ogs_diam_auth_grace_period = NULL;
|
||||
struct dict_object *ogs_diam_session_timeout = NULL;
|
||||
struct dict_object *ogs_diam_rat_type = NULL;
|
||||
struct dict_object *ogs_diam_service_selection = NULL;
|
||||
struct dict_object *ogs_diam_visited_plmn_id = NULL;
|
||||
struct dict_object *ogs_diam_visited_network_identifier = NULL;
|
||||
|
||||
struct dict_object *ogs_diam_vendor = NULL;
|
||||
struct dict_object *ogs_diam_vendor_id = NULL;
|
||||
@@ -62,6 +69,9 @@ int ogs_diam_message_init()
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Destination-Host", &ogs_diam_destination_host);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Destination-Realm", &ogs_diam_destination_realm);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "User-Name", &ogs_diam_user_name);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id", &ogs_diam_subscription_id);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id-Type", &ogs_diam_subscription_id_type);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Subscription-Id-Data", &ogs_diam_subscription_id_data);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Session-State", &ogs_diam_auth_session_state);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Application-Id", &ogs_diam_auth_application_id);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Request-Type", &ogs_diam_auth_request_type);
|
||||
@@ -75,6 +85,10 @@ int ogs_diam_message_init()
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Authorization-Lifetime", &ogs_diam_authorization_lifetime);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Auth-Grace-Period", &ogs_diam_auth_grace_period);
|
||||
CHECK_dict_search( DICT_AVP, AVP_BY_NAME, "Session-Timeout", &ogs_diam_session_timeout);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_rat_type);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Service-Selection", &ogs_diam_service_selection);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-PLMN-Id", &ogs_diam_visited_plmn_id);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Visited-Network-Identifier", &ogs_diam_visited_network_identifier);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,13 @@ extern struct dict_object *ogs_diam_origin_realm;
|
||||
extern struct dict_object *ogs_diam_destination_host;
|
||||
extern struct dict_object *ogs_diam_destination_realm;
|
||||
extern struct dict_object *ogs_diam_user_name;
|
||||
extern struct dict_object *ogs_diam_subscription_id;
|
||||
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
|
||||
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
|
||||
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
|
||||
#define OGS_DIAM_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
|
||||
extern struct dict_object *ogs_diam_subscription_id_type;
|
||||
extern struct dict_object *ogs_diam_subscription_id_data;
|
||||
#define OGS_DIAM_AUTH_SESSION_STATE_MAINTAINED 0
|
||||
#define OGS_DIAM_AUTH_SESSION_NO_STATE_MAINTAINED 1
|
||||
extern struct dict_object *ogs_diam_auth_session_state;
|
||||
@@ -67,6 +74,22 @@ extern struct dict_object *ogs_diam_mip_home_agent_address;
|
||||
extern struct dict_object *ogs_diam_authorization_lifetime;
|
||||
extern struct dict_object *ogs_diam_auth_grace_period;
|
||||
extern struct dict_object *ogs_diam_session_timeout;
|
||||
#define OGS_DIAM_RAT_TYPE_WLAN 0
|
||||
#define OGS_DIAM_RAT_TYPE_VIRTUAL 1
|
||||
#define OGS_DIAM_RAT_TYPE_UTRAN 1000
|
||||
#define OGS_DIAM_RAT_TYPE_GERAN 1001
|
||||
#define OGS_DIAM_RAT_TYPE_GAN 1002
|
||||
#define OGS_DIAM_RAT_TYPE_HSPA_EVOLUTION 1003
|
||||
#define OGS_DIAM_RAT_TYPE_EUTRAN 1004
|
||||
#define OGS_DIAM_RAT_TYPE_EUTRAN_NB_IoT 1005
|
||||
#define OGS_DIAM_RAT_TYPE_CDMA2000_1X 2000
|
||||
#define OGS_DIAM_RAT_TYPE_HRPD 2001
|
||||
#define OGS_DIAM_RAT_TYPE_UMB 2002
|
||||
#define OGS_DIAM_RAT_TYPE_EHRPD 2003
|
||||
extern struct dict_object *ogs_diam_rat_type;
|
||||
extern struct dict_object *ogs_diam_service_selection;
|
||||
extern struct dict_object *ogs_diam_visited_plmn_id;
|
||||
extern struct dict_object *ogs_diam_visited_network_identifier;
|
||||
|
||||
extern struct dict_object *ogs_diam_vendor;
|
||||
extern struct dict_object *ogs_diam_vendor_id;
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
|
||||
#include "ogs-diameter-common.h"
|
||||
|
||||
bool ogs_diam_peer_connected(void)
|
||||
bool ogs_diam_app_connected(uint32_t app_id)
|
||||
{
|
||||
struct fd_list *li;
|
||||
bool connected = false;
|
||||
struct fd_list *li = NULL;
|
||||
struct fd_app *found = NULL;
|
||||
|
||||
CHECK_POSIX( pthread_rwlock_rdlock(&fd_g_peers_rw) );
|
||||
for (li = fd_g_peers.next; li != &fd_g_peers; li = li->next) {
|
||||
@@ -35,13 +35,19 @@ bool ogs_diam_peer_connected(void)
|
||||
|
||||
if (state == STATE_OPEN) {
|
||||
ogs_debug("'%s' STATE is OPEN", p->info.pi_diamid);
|
||||
connected = true;
|
||||
|
||||
/* Check if the remote peer advertised the message's appli */
|
||||
fd_app_check(&p->info.runtime.pir_apps, app_id, &found);
|
||||
|
||||
if (found) break;
|
||||
} else {
|
||||
ogs_debug("'%s' STATE[%d] is NOT open ", p->info.pi_diamid, state);
|
||||
}
|
||||
}
|
||||
CHECK_POSIX( pthread_rwlock_unlock(&fd_g_peers_rw) );
|
||||
|
||||
return connected;
|
||||
if (found)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,8 +151,10 @@ int ogs_dict_cx_entry(char *conffile)
|
||||
{
|
||||
struct dict_object * vendor;
|
||||
CHECK_FCT(fd_dict_search(fd_g_config->cnf_dict, DICT_VENDOR, VENDOR_BY_NAME, "3GPP", &vendor, ENOENT));
|
||||
struct dict_application_data app_data = { 16777216, "Cx" };
|
||||
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &app_data, vendor, NULL));
|
||||
struct dict_application_data cx = { 16777216, "Cx" };
|
||||
struct dict_application_data swx = { 16777265, "SWx" };
|
||||
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &cx, vendor, NULL));
|
||||
CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_APPLICATION, &swx, vendor, NULL));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -312,10 +314,18 @@ int ogs_dict_cx_entry(char *conffile)
|
||||
{ { .avp_name = "Destination-Host" }, RULE_OPTIONAL, -1, 1 },
|
||||
{ { .avp_name = "User-Name" }, RULE_REQUIRED, -1, 1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_REQUIRED, -1, 1 },
|
||||
#else
|
||||
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, 1 },
|
||||
#endif
|
||||
{ { .avp_vendor = 10415, .avp_name = "SIP-Auth-Data-Item" }, RULE_REQUIRED, -1, 1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "SIP-Number-Auth-Items" }, RULE_REQUIRED, -1, 1 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
|
||||
#else
|
||||
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
|
||||
#endif
|
||||
{ { .avp_name = "Proxy-Info" }, RULE_OPTIONAL, -1, -1 },
|
||||
{ { .avp_name = "Route-Record" }, RULE_OPTIONAL, -1, -1 },
|
||||
};
|
||||
@@ -380,9 +390,17 @@ int ogs_dict_cx_entry(char *conffile)
|
||||
{ { .avp_vendor = 10415, .avp_name = "Supported-Features" }, RULE_OPTIONAL, -1, -1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "Public-Identity" }, RULE_OPTIONAL, -1, -1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "Wildcarded-Public-Identity" }, RULE_OPTIONAL, -1, 1 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_REQUIRED, -1, 1 },
|
||||
#else
|
||||
{ { .avp_vendor = 10415, .avp_name = "Server-Name" }, RULE_OPTIONAL, -1, 1 },
|
||||
#endif
|
||||
{ { .avp_vendor = 10415, .avp_name = "Server-Assignment-Type" }, RULE_REQUIRED, -1, 1 },
|
||||
#if 0 /* modified by acetcom */
|
||||
{ { .avp_vendor = 10415, .avp_name = "User-Data-Already-Available" }, RULE_REQUIRED, -1, 1 },
|
||||
#else
|
||||
{ { .avp_vendor = 10415, .avp_name = "User-Data-Already-Available" }, RULE_OPTIONAL, -1, 1 },
|
||||
#endif
|
||||
{ { .avp_vendor = 10415, .avp_name = "SCSCF-Restoration-Info" }, RULE_OPTIONAL, -1, 1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "Multiple-Registration-Indication" }, RULE_OPTIONAL, -1, 1 },
|
||||
{ { .avp_vendor = 10415, .avp_name = "Session-Priority" }, RULE_OPTIONAL, -1, 1 },
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
libdiameter_cx_sources = files('''
|
||||
ogs-diameter-cx.h
|
||||
|
||||
message.h
|
||||
|
||||
dict.c
|
||||
|
||||
@@ -37,7 +37,6 @@ struct dict_object *ogs_diam_cx_cmd_lir = NULL;
|
||||
struct dict_object *ogs_diam_cx_cmd_lia = NULL;
|
||||
|
||||
struct dict_object *ogs_diam_cx_public_identity = NULL;
|
||||
struct dict_object *ogs_diam_cx_visited_network_identifier = NULL;
|
||||
struct dict_object *ogs_diam_cx_server_name = NULL;
|
||||
|
||||
struct dict_object *ogs_diam_cx_sip_number_auth_items = NULL;
|
||||
@@ -170,9 +169,6 @@ int ogs_diam_cx_init(void)
|
||||
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
|
||||
"Public-Identity", &ogs_diam_cx_public_identity);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
|
||||
"Visited-Network-Identifier",
|
||||
&ogs_diam_cx_visited_network_identifier);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS,
|
||||
"Server-Name", &ogs_diam_cx_server_name);
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ extern struct dict_object *ogs_diam_cx_cmd_lir;
|
||||
extern struct dict_object *ogs_diam_cx_cmd_lia;
|
||||
|
||||
extern struct dict_object *ogs_diam_cx_public_identity;
|
||||
extern struct dict_object *ogs_diam_cx_visited_network_identifier;
|
||||
extern struct dict_object *ogs_diam_cx_server_name;
|
||||
|
||||
extern struct dict_object *ogs_diam_cx_sip_number_auth_items;
|
||||
|
||||
@@ -32,16 +32,12 @@ struct dict_object *ogs_diam_gx_cmd_raa = NULL;
|
||||
struct dict_object *ogs_diam_gx_cc_request_type = NULL;
|
||||
struct dict_object *ogs_diam_gx_cc_request_number = NULL;
|
||||
struct dict_object *ogs_diam_gx_network_request_support = NULL;
|
||||
struct dict_object *ogs_diam_gx_subscription_id = NULL;
|
||||
struct dict_object *ogs_diam_gx_subscription_id_type = NULL;
|
||||
struct dict_object *ogs_diam_gx_subscription_id_data = NULL;
|
||||
struct dict_object *ogs_diam_gx_supported_features = NULL;
|
||||
struct dict_object *ogs_diam_gx_feature_list_id = NULL;
|
||||
struct dict_object *ogs_diam_gx_feature_list = NULL;
|
||||
struct dict_object *ogs_diam_gx_framed_ip_address = NULL;
|
||||
struct dict_object *ogs_diam_gx_framed_ipv6_prefix = NULL;
|
||||
struct dict_object *ogs_diam_gx_ip_can_type = NULL;
|
||||
struct dict_object *ogs_diam_gx_rat_type = NULL;
|
||||
struct dict_object *ogs_diam_gx_qos_information = NULL;
|
||||
struct dict_object *ogs_diam_gx_qos_class_identifier = NULL;
|
||||
struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul = NULL;
|
||||
@@ -82,6 +78,14 @@ struct dict_object *ogs_diam_gx_codec_data = NULL;
|
||||
struct dict_object *ogs_diam_gx_media_sub_component = NULL;
|
||||
struct dict_object *ogs_diam_gx_flow_number = NULL;
|
||||
struct dict_object *ogs_diam_gx_flow_usage = NULL;
|
||||
struct dict_object *ogs_diam_gx_3gpp_sgsn_mcc_mnc = NULL;
|
||||
struct dict_object *ogs_diam_gx_an_gw_address = NULL;
|
||||
struct dict_object *ogs_diam_gx_online = NULL;
|
||||
struct dict_object *ogs_diam_gx_offline = NULL;
|
||||
struct dict_object *ogs_diam_gx_access_network_charging_address = NULL;
|
||||
struct dict_object *ogs_diam_gx_access_network_charging_identifier_gx = NULL;
|
||||
struct dict_object *ogs_diam_gx_access_network_charging_identifier_value = NULL;
|
||||
struct dict_object *ogs_diam_gx_an_trusted = NULL;
|
||||
|
||||
extern int ogs_dict_gx_entry(char *conffile);
|
||||
|
||||
@@ -101,16 +105,12 @@ int ogs_diam_gx_init(void)
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Type", &ogs_diam_gx_cc_request_type);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "CC-Request-Number", &ogs_diam_gx_cc_request_number);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Network-Request-Support", &ogs_diam_gx_network_request_support);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id", &ogs_diam_gx_subscription_id);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Type", &ogs_diam_gx_subscription_id_type);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Subscription-Id-Data", &ogs_diam_gx_subscription_id_data);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Supported-Features", &ogs_diam_gx_supported_features);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List-ID", &ogs_diam_gx_feature_list_id);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Feature-List", &ogs_diam_gx_feature_list);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IP-Address", &ogs_diam_gx_framed_ip_address);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Framed-IPv6-Prefix", &ogs_diam_gx_framed_ipv6_prefix);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "IP-CAN-Type", &ogs_diam_gx_ip_can_type);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "RAT-Type", &ogs_diam_gx_rat_type);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Information", &ogs_diam_gx_qos_information);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "QoS-Class-Identifier" , &ogs_diam_gx_qos_class_identifier);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Max-Requested-Bandwidth-UL" , &ogs_diam_gx_max_requested_bandwidth_ul);
|
||||
@@ -154,6 +154,14 @@ int ogs_diam_gx_init(void)
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Media-Sub-Component", &ogs_diam_gx_media_sub_component);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Number", &ogs_diam_gx_flow_number);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Flow-Usage", &ogs_diam_gx_flow_usage);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "3GPP-SGSN-MCC-MNC", &ogs_diam_gx_3gpp_sgsn_mcc_mnc);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AN-GW-Address", &ogs_diam_gx_an_gw_address);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Online", &ogs_diam_gx_online);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Offline", &ogs_diam_gx_offline);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Address", &ogs_diam_gx_access_network_charging_address);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Identifier-Gx", &ogs_diam_gx_access_network_charging_identifier_gx);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "Access-Network-Charging-Identifier-Value", &ogs_diam_gx_access_network_charging_identifier_value);
|
||||
CHECK_dict_search(DICT_AVP, AVP_BY_NAME_ALL_VENDORS, "AN-Trusted", &ogs_diam_gx_an_trusted);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -54,13 +54,6 @@ extern struct dict_object *ogs_diam_gx_cmd_raa;
|
||||
extern struct dict_object *ogs_diam_gx_cc_request_type;
|
||||
extern struct dict_object *ogs_diam_gx_cc_request_number;
|
||||
extern struct dict_object *ogs_diam_gx_network_request_support;
|
||||
extern struct dict_object *ogs_diam_gx_subscription_id;
|
||||
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_E164 0
|
||||
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI 1
|
||||
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_SIP_URI 2
|
||||
#define OGS_DIAM_GX_SUBSCRIPTION_ID_TYPE_END_USER_NAI 3
|
||||
extern struct dict_object *ogs_diam_gx_subscription_id_type;
|
||||
extern struct dict_object *ogs_diam_gx_subscription_id_data;
|
||||
extern struct dict_object *ogs_diam_gx_supported_features;
|
||||
extern struct dict_object *ogs_diam_gx_feature_list_id;
|
||||
extern struct dict_object *ogs_diam_gx_feature_list;
|
||||
@@ -72,21 +65,8 @@ extern struct dict_object *ogs_diam_gx_framed_ipv6_prefix;
|
||||
#define OGS_DIAM_GX_IP_CAN_TYPE_WiMAX 3
|
||||
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP2 4
|
||||
#define OGS_DIAM_GX_IP_CAN_TYPE_3GPP_EPS 5
|
||||
#define OGS_DIAM_GX_IP_CAN_TYPE_Non_3GPP_EPS 6
|
||||
#define OGS_DIAM_GX_IP_CAN_TYPE_NON_3GPP_EPS 6
|
||||
extern struct dict_object *ogs_diam_gx_ip_can_type;
|
||||
#define OGS_DIAM_GX_RAT_TYPE_WLAN 0
|
||||
#define OGS_DIAM_GX_RAT_TYPE_VIRTUAL 1
|
||||
#define OGS_DIAM_GX_RAT_TYPE_UTRAN 1000
|
||||
#define OGS_DIAM_GX_RAT_TYPE_GERAN 1001
|
||||
#define OGS_DIAM_GX_RAT_TYPE_GAN 1002
|
||||
#define OGS_DIAM_GX_RAT_TYPE_HSPA_EVOLUTION 1003
|
||||
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN 1004
|
||||
#define OGS_DIAM_GX_RAT_TYPE_EUTRAN_NB_IoT 1005
|
||||
#define OGS_DIAM_GX_RAT_TYPE_CDMA2000_1X 2000
|
||||
#define OGS_DIAM_GX_RAT_TYPE_HRPD 2001
|
||||
#define OGS_DIAM_GX_RAT_TYPE_UMB 2002
|
||||
#define OGS_DIAM_GX_RAT_TYPE_EHRPD 2003
|
||||
extern struct dict_object *ogs_diam_gx_rat_type;
|
||||
extern struct dict_object *ogs_diam_gx_qos_information;
|
||||
extern struct dict_object *ogs_diam_gx_qos_class_identifier;
|
||||
extern struct dict_object *ogs_diam_gx_max_requested_bandwidth_ul;
|
||||
@@ -128,6 +108,20 @@ extern struct dict_object *ogs_diam_gx_codec_data;
|
||||
extern struct dict_object *ogs_diam_gx_media_sub_component;
|
||||
extern struct dict_object *ogs_diam_gx_flow_number;
|
||||
extern struct dict_object *ogs_diam_gx_flow_usage;
|
||||
extern struct dict_object *ogs_diam_gx_3gpp_sgsn_mcc_mnc;
|
||||
extern struct dict_object *ogs_diam_gx_an_gw_address;
|
||||
#define OGS_DIAM_GX_DISABLE_ONLINE 0
|
||||
#define OGS_DIAM_GX_ENABLE_ONLINE 1
|
||||
extern struct dict_object *ogs_diam_gx_online;
|
||||
#define OGS_DIAM_GX_DISABLE_OFFLINE 0
|
||||
#define OGS_DIAM_GX_ENABLE_OFFLINE 1
|
||||
extern struct dict_object *ogs_diam_gx_offline;
|
||||
extern struct dict_object *ogs_diam_gx_access_network_charging_address;
|
||||
extern struct dict_object *ogs_diam_gx_access_network_charging_identifier_gx;
|
||||
extern struct dict_object *ogs_diam_gx_access_network_charging_identifier_value;
|
||||
#define OGS_DIAM_GX_AN_TRUSTED 0
|
||||
#define OGS_DIAM_GX_AN_UNTRUSTED 1
|
||||
extern struct dict_object *ogs_diam_gx_an_trusted;
|
||||
|
||||
typedef struct ogs_diam_gx_message_s {
|
||||
#define OGS_DIAM_GX_CMD_CODE_CREDIT_CONTROL 272
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user