Compare commits

...

95 Commits

Author SHA1 Message Date
Sukchan Lee
7d9a651f6c Release v2.3.6 2021-10-16 22:55:49 +09:00
Sukchan Lee
489b633e08 Update Supported-Feature AVP (#1202)
Add the Vendor-Id AVP in Supported-Features AVP in
CCR(Credit-Control-Request)
2021-10-16 17:41:53 +09:00
Sukchan Lee
9ba4b317d2 Improve GTP message (#1201)
Extended Indication
Add Delay Value
2021-10-16 17:26:30 +09:00
Sukchan Lee
b35febd9c4 [MME] fix the crash during GTP no context (#1205)
This bug occurs when SGW-C restarts and the next signal occurs
between MME and SGW-C
- Create Session Request/Response
- Modify Bearer Request/Response
2021-10-16 14:11:43 +09:00
Sukchan Lee
f05accc7f3 MME/AMF will not crash with no APN length (#1199) 2021-10-13 23:01:24 +09:00
Sukchan Lee
7db0c039a1 Add ng-voice logo 2021-10-13 17:22:56 +09:00
Sukchan Lee
35f4cf8deb Release v2.3.4 2021-10-06 22:12:48 +09:00
Nick
ec7735d447 Added links to two new tutorials in docs page. (#1194) 2021-10-06 18:49:04 +09:00
Spencer Sevilla
b600ab5724 removing diameter includes from upf (#1193) 2021-10-06 07:01:05 +09:00
Mehmet Hakan Doğan
3cb2808ebf this commit is made to reflect the contribution on pull request #1190 (#1192) 2021-10-05 18:11:03 +09:00
Sukchan Lee
013b4dc8e9 update coding style 2021-10-04 22:33:57 +09:00
Sukchan Lee
5e016937c7 Update URR contribution (#1190) 2021-10-04 22:28:32 +09:00
Sukchan Lee
13f1b390ae CVE-2021-41794 from NCC Group by Mark Tedman
When connecting to the UPF port for the PFCP protocol (8805) and sending
an association setup request followed by a session establishment request
with a PDI Network Instance set to ‘internet’, it causes a stack corruption
to occur.

So, ogs_fqdn_parse() fixed.
2021-10-01 22:41:03 +09:00
Carlos Giraldo
7dcde91057 Improve open5gs-dbctl (#1181)
* fix exit code in open5gs-dbctl

* enable non-local mongodb in open5gs-dbctl through DB_URI
2021-09-26 20:36:40 +09:00
Sukchan Lee
127685f908 [SGW-C] fix the crash after restarting UPF (#1177) 2021-09-26 20:25:51 +09:00
Sukchan Lee
9e4a791c2b P1 Security becomes Open5GS Sponsor 2021-09-11 08:12:37 +09:00
Sukchan Lee
9c589ac584 [PFCP] include outer header removal(ext-deletion) 2021-09-04 18:03:04 +09:00
Sukchan Lee
e730530f7b [SMF] Exception handling in session release(#1155)
- UE changes the airplain-mode. However, it does not send PDU
    session complete message
    - Added exception handling for PDU session release
2021-09-04 16:14:18 +09:00
Sukchan Lee
1354947164 Improve Milenage library for [R1-R5] (#1153) 2021-09-01 19:38:36 +09:00
Sukchan Lee
233db575ea [SMF] fix crash when BSF is not running [#1149] 2021-08-29 00:02:39 +09:00
Sukchan Lee
e2fe15d2ae [SMF] TAI/ECGI is not required in WLAN (#1039) 2021-08-27 11:40:58 +09:00
Sukchan Lee
7615869c94 LIONS have successfully connected gNB to Open5GS. 2021-08-23 19:24:36 +09:00
Sukchan Lee
77955d01f8 Document update for 'your first LTE' 2021-08-23 14:37:29 +09:00
Umakant Kulkarni
5234001b0a Increase cluster_2048_pool to 1024 (#1143) 2021-08-23 08:06:14 +09:00
Sukchan Lee
fa67341263 Documentation errata update 2021-08-21 18:48:21 +09:00
Sukchan Lee
a797578b60 Release v2.3.3 2021-08-21 18:44:46 +09:00
Sukchan Lee
1c07e4c6b2 Update README.md 2021-08-21 18:14:36 +09:00
Sukchan Lee
ab7f565dd6 [MME/AMF] Use Non-UE signalling in Paging (#1134) 2021-08-18 19:42:27 +09:00
Sukchan Lee
5af66be7b5 [Docs] Update @s5uishida channel (#1133) 2021-08-17 22:24:54 +09:00
Sukchan Lee
ced4a6f945 [SGW-C] fix the shared object error (#595)
nas-common library includes libcrypt. However, SGW-C don't have to use
crypt library. As such, ogs_nas_plmn_id function was moved to
3gpp-core-types.[ch]

For more information,

$ ./install/bin/open5gs-sgwcd
./install/bin/open5gs-sgwcd: error while loading shared libraries: libogscrypt.so.2: cannot open shared object file: No such file or directory

$ ldd ./install/bin/open5gs-sgwcd
	linux-vdso.so.1 (0x00007ffc749ad000)
	libogsapp.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.2 (0x00007f1f92277000)
	libogscore.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.2 (0x00007f1f92240000)
	libogsgtp.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsgtp.so.2 (0x00007f1f921eb000)
	libogsnas-common.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsnas-common.so.2 (0x00007f1f921e5000)
	libogspfcp.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogspfcp.so.2 (0x00007f1f92177000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1f92134000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1f91f42000)
	libyaml-0.so.2 => /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 (0x00007f1f91f20000)
	libogscrypt.so.2 => not found
	libogsipfw.so.2 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsipfw.so.2 (0x00007f1f91ef5000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1f922b1000)
2021-08-17 21:58:31 +09:00
Sukchan Lee
72c5f80f26 Add Ruckus Q710/Q910 [#1131] 2021-08-14 16:54:36 +09:00
Sukchan Lee
3564fe5c8c [SMF/UPF] Clarify FALLBACK SUBNET [#1128] 2021-08-14 16:52:53 +09:00
Sukchan Lee
e5594a57b9 [AMF] fix an invalid GSM reject aligungr#375
TS24.501
8.2.11 DL NAS transport
8.2.11.4 5GMM cause

The AMF shall include this IE when the Payload container IE
contains an uplink payload which was not forwarded and
the Payload container type IE is not set to "Multiple payloads".

-0-
As such, this function 'nas_5gs_send_gsm_reject()' must be used
only when an N1 SM message has been forwarded to the SMF.
2021-08-14 12:01:13 +09:00
Sukchan Lee
af5b3aa931 [MME/AMF] fix the crash during timeout (#1122) 2021-08-08 12:38:15 +09:00
Sukchan Lee
831b29973f [PCF] fix the 'NULL' AfEvent in VoNR (#1120) 2021-08-08 09:10:37 +09:00
Sukchan Lee
68edcd6438 fix the SMF crash when num of flow > 8 (#1108) 2021-08-07 14:23:20 +09:00
Jose Carlos
e9dbe5a3d7 Update 01-genodebs.md (#1124) 2021-08-07 07:51:19 +09:00
Sukchan Lee
7e5a5d7511 fix the SMF/PCRF crash when bearer > 8 (#1108) 2021-07-29 18:10:28 +09:00
Sukchan Lee
acb4db5dd1 Fix the crash when number of flow > 8 (#1108) 2021-07-28 14:00:03 +09:00
Sukchan Lee
3e7d2398a2 Merge branch 'herlesupreeth-issue1099' into main 2021-07-27 20:34:46 +09:00
Sukchan Lee
c6b13be92a do the finishing touches (#1108) 2021-07-27 20:33:46 +09:00
herlesupreeth
0db09f5c25 Fix stash smashing when number of PFs for bearer > 8 2021-07-23 14:22:55 +02:00
herlesupreeth
bd6eea4fa5 Introduce checks for maximum accepted flow rules for a bearer in Gx path 2021-07-23 14:22:55 +02:00
Sukchan Lee
e1c79647e2 [SMF] session data was accessed when NULL (#1105) 2021-07-23 16:24:59 +09:00
Supreeth Herle
362393d0ff fix: session data was accessed when NULL resulting in crash (#1105) 2021-07-23 16:22:46 +09:00
Sukchan Lee
0c1a3d7f95 Add OAI(gNodeBs) tested on Open5GS (#1988) 2021-07-19 16:05:30 +09:00
Sukchan Lee
eb9b780449 Release v2.3.2 2021-07-18 20:42:50 +09:00
Sukchan Lee
039b9d0aaa SBI updated
- openapi-generator version 5.2.0
- add priority/capacity/load in NFProfile/NFService
- add AllowedNfTypes in NFProfile/NFService
2021-07-16 17:02:33 +09:00
Sukchan Lee
1326fc85dc [MME] fix the bug when GTPv2 conflict (#1095) 2021-07-15 21:20:56 +09:00
Sukchan Lee
4667b99c92 fix the BUG in SWx diameter (#1039) 2021-07-13 22:00:04 +09:00
Sukchan Lee
7cfeb2e9f9 Change SIGWINCH log-level from ERROR to INFO 2021-07-12 19:52:28 +09:00
Sukchan Lee
005cd30e02 fix the bug for Real PCF unable to PATCH (#1086) 2021-07-12 17:30:45 +09:00
Sukchan Lee
dde0785375 Tested with 4G commercial (#c918b4b)
- Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0
- Huawei BBU5900 with RRU5304W Band 7 FDD 2600Mhz 40W Version V100R016C10
2021-07-11 19:01:38 +09:00
Sukchan Lee
16f8d5fa49 Merge branch 'main' of https://github.com/open5gs/open5gs into main 2021-07-09 19:00:53 +09:00
Sukchan Lee
e71a158ed7 Update sysmocom(sponsor) logo 2021-07-09 19:00:32 +09:00
Sukchan Lee
c918b4b5b6 Tested Ericsson Baseband 6630 on Open5GS 2021-07-09 09:50:11 +09:00
Sukchan Lee
2471b1b53d comply with coding standard 2021-07-08 15:00:59 +09:00
Sukchan Lee
f278d58a69 Upgrade SBI(Service-based Interface)
* OpenAPI Generator version: 4.3.1 ==> 5.5.1
* Specification : r16.8.0 (20210629)
2021-07-07 17:32:55 +09:00
Sukchan Lee
2aaa8200c2 BSF mis-type in Debian Pakcage Name 2021-07-06 10:00:03 +09:00
Sukchan Lee
65e96dd75c [AMF] fix the bug for making allowed NSSAI (#910) 2021-07-01 16:23:27 +09:00
Sukchan Lee
ec377a8849 Remove Ubuntu 19.x in OBS 2021-06-29 23:07:15 +09:00
Sukchan Lee
bedd05e654 Document update for v2.3.1 2021-06-29 22:14:04 +09:00
Sukchan Lee
8959c787bc Release v2.3.1 2021-06-29 22:07:06 +09:00
Sukchan Lee
f728e5da89 Tested on more debian/ubuntu distributions
- Debian : bullseye, sid
- Ubuntu : hirsute
2021-06-27 16:52:09 +09:00
Sukchan Lee
442e7d44e7 Change Open5GS API for exit (#1069) 2021-06-24 12:44:52 +09:00
Spencer Sevilla
e1e3f254e2 need to exit (and therefore restart HSS) on FD_LOG_FATAL (#1069) 2021-06-24 12:44:24 +09:00
Sukchan Lee
997554bbb7 Avoid defining variables in the middle (#1068) 2021-06-24 12:42:31 +09:00
Josh Bailey
38ff2dc6f7 trim buffer to correct size after creating ARP or ND reply. (#1068) 2021-06-24 12:37:58 +09:00
Sukchan Lee
a396ea8fc1 [AMF] NG Setup Failure with proper cause (#1064) 2021-06-22 17:56:45 +09:00
Sukchan Lee
7f774884ea [MEM] increase memory pool (#1062) 2021-06-22 16:56:18 +09:00
Sukchan Lee
50f403279a [AMF/MME] fix the crash bug (#1061) 2021-06-22 16:13:06 +09:00
Sukchan Lee
00c96a3f0f [NAS] fix the security issue (ZDI-CAN-14043) 2021-06-21 14:56:03 +09:00
Sukchan Lee
4537142929 [EPC] Support ePDG Interface (#1039) 2021-06-21 22:36:38 +09:00
Sukchan Lee
e0869104c6 [PCF] fix the crash during UE attach (#1059) 2021-06-17 21:26:34 +09:00
Sukchan Lee
c48f107520 [MME] fix the crash when release a UE (#1058) 2021-06-17 17:16:16 +09:00
Sukchan Lee
780f829962 use 'continue' instead of 'return' (#1052) 2021-06-15 11:04:56 +09:00
Spencer Sevilla
449b5b484f need to return here to prevent segfault (#1052) 2021-06-15 11:04:36 +09:00
Spencer Sevilla
d9b5c29a9b add open5gs-dbctl back into packages (#1051)
Co-authored-by: Spencer Sevilla <spencer@Spencers-MacBook-Air.local>
2021-06-15 10:27:10 +09:00
Sukchan Lee
9e664a744b [MME] refine the pull request #1049 2021-06-13 12:03:36 +09:00
R. Medeiros
a252fae84f Indication Dual Address Bearer for create session request. (#1049)
* Update mme-s11-build.c

Add indication Dual Address Bearer in the create session request when the PDN is IPv4v6 Type, Info: 3GPP TS 29.274

* Update mme-s11-build.c
2021-06-13 11:52:23 +09:00
Sukchan Lee
47c9f4e4a0 Release v2.3.0 2021-06-08 21:53:23 +09:00
Sukchan Lee
e31a8474b2 [SMF/UPF] fix the crash bug (#1034, #1006) 2021-06-08 21:14:18 +09:00
Sukchan Lee
774e1b0ebd [Sponsor] Add sysmocom logo 2021-06-07 22:10:01 +09:00
Sukchan Lee
ac37e00b42 [Sponsor] Add sysmocom logo 2021-06-07 21:44:02 +09:00
Sukchan Lee
118d62d42d Add more memory log 2021-06-06 22:35:46 +09:00
Sukchan Lee
80a9497afd [PFCP] Add more error log (#1012) 2021-05-30 20:35:30 +09:00
Sukchan Lee
ef07ccfb88 fix the default SBI port (#997, #1008) 2021-05-30 10:35:01 +09:00
Sukchan Lee
5d460b0577 [UPF] Tested all platforms on open5gs (#1022) 2021-05-29 23:08:22 +09:00
Sukchan Lee
8dab1852cc Merge branch 'tap' of https://github.com/anarkiwi/open5gs into pull1022 2021-05-29 18:06:43 +09:00
Sukchan Lee
899c121478 remove warning in MacOSX 2021-05-29 16:03:40 +09:00
Sukchan Lee
fe89f7cd11 [5GC] Added BSF(Binding Support Function) 2021-05-29 15:56:12 +09:00
Sukchan Lee
611986794b Squashed commit of the following:
commit 183d8b8344122f25f77be79b1b698c71f48c1656
Author: Sukchan Lee <acetcom@gmail.com>
Date:   Fri May 28 23:44:26 2021 +0900

    [SMF] introduce new list API [#1019]

    Sometimes we may need two lists for same node.
    To do this, I created a new list API, and applied it this pull request.
2021-05-28 23:46:48 +09:00
Josh Bailey
caa73e1f5e Support TAP interfaces, with ARP/ND. 2021-05-28 05:59:03 +00:00
herlesupreeth
4d6692d8fe fix: DRB lost issue when additional TFTs needs to be added to existing bearer with TFTs
This commit address the issue where a bearer with particular
PCC rule name exists with TFTs and addtional TFTs needs to be added
to same bearer and DRB lost is reported by UE.

This is achieved by creating EPS Bearer Level Traffic Flow Template
with TFT operation code as 'OGS_GTP_TFT_CODE_ADD_PACKET_FILTERS_TO_EXISTING_TFT' in
above scenario rather than use 'OGS_GTP_TFT_CODE_CREATE_NEW_TFT' at all times.
And, not remove existing packet filters for the bearer.
2021-05-27 15:57:32 +02:00
Sukchan Lee
64508c2e5c [DOC] Add Huawei BTS 5900 (#994) 2021-05-19 23:33:10 +09:00
2426 changed files with 132490 additions and 58848 deletions

View File

@@ -1,4 +1,4 @@
<h2 align="center">Supporting Open5GS</h2>
<h1 align="center">Open5GS</h1>
If you find Open5GS useful for work, please consider supporting this Open Source project by [Becoming a sponsor](https://github.com/sponsors/acetcom). To manage the funding transactions transparently, you can donate through [OpenCollective](https://opencollective.com/open5gs).
@@ -25,26 +25,36 @@ 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">
<td align="center" valign="middle" width="222px">
<a href="https://skylarkwireless.com/" target="_blank">
<img src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
</a>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<a href="https://skylarkwireless.com/" target="_blank">
<img width="222px" src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
<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>
<td align="center" valign="middle" width="222px">
<a href="https://www.p1sec.com/" target="_blank">
<img src="https://open5gs.org/assets/img/2021-logo-P1.svg">
</a>
</td>
<td align="center" valign="middle" width="222px">
<a href="https://www.ng-voice.com/" target="_blank">
<img src="https://open5gs.org/assets/img/ng-voice-logo_color.png">
</a>
</td>
</tr>

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
View 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
View 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:

View File

@@ -34,6 +34,7 @@ open5gs_conf = '''
udr.yaml
pcf.yaml
nssf.yaml
bsf.yaml
'''.split()
foreach file : open5gs_conf

View File

@@ -122,6 +122,7 @@ logger:
#
#
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.
#
# subnet:
# - addr: 10.45.0.1/16
@@ -133,6 +134,16 @@ logger:
# - addr: 2001:230:babe::1/48
# dnn: ims
#
# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16)
# ; Note that put the FALLBACK SUBNET last to avoid SMF/UPF crash.
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
# - addr: 10.46.0.1/16
# dnn: ims
# - addr: 10.50.0.1/16 ## FALLBACK SUBNET
#
# o Pool Range Sample
# subnet:
# - addr: 10.45.0.1/24

View File

@@ -107,6 +107,8 @@ logger:
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
#
# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
@@ -117,6 +119,16 @@ logger:
# - addr: 2001:230:babe::1/48
# dnn: ims
#
# o Specific DNN/APN with the FALLBACK SUBNET(10.47.0.1/16)
# ; Note that put the FALLBACK SUBNET last to avoid SMF/UPF crash.
#
# subnet:
# - addr: 10.45.0.1/16
# dnn: internet
# - addr: 10.46.0.1/16
# dnn: ims
# - addr: 10.50.0.1/16 ## FALLBACK SUBNET
#
# o Multiple Devices (default: ogstun)
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun2

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -29,6 +29,7 @@ systemd_conf_in = '''
open5gs-udmd.service
open5gs-pcfd.service
open5gs-nssfd.service
open5gs-bsfd.service
open5gs-udrd.service
'''.split()

View 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

View File

@@ -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

View File

@@ -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

144
debian/changelog vendored
View File

@@ -1,3 +1,147 @@
open5gs (2.3.6) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 16 Oct 2021 22:45:37 +0900
open5gs (2.3.6~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 16 Oct 2021 22:44:14 +0900
open5gs (2.3.6~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 16 Oct 2021 22:43:17 +0900
open5gs (2.3.6~hirsute) hirsute; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 16 Oct 2021 22:42:02 +0900
open5gs (2.3.4) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 06 Oct 2021 21:46:16 +0900
open5gs (2.3.4~hirsute) hirsute; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 06 Oct 2021 21:44:21 +0900
open5gs (2.3.4~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 06 Oct 2021 21:43:06 +0900
open5gs (2.3.4~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Wed, 06 Oct 2021 21:41:20 +0900
open5gs (2.3.3) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 Aug 2021 18:20:49 +0900
open5gs (2.3.3~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 Aug 2021 18:19:35 +0900
open5gs (2.3.3~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 Aug 2021 18:17:53 +0900
open5gs (2.3.3~hirsute) hirsute; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 Aug 2021 18:16:18 +0900
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

14
debian/control vendored
View File

@@ -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
View File

@@ -0,0 +1,3 @@
usr/bin/open5gs-bsfd
configs/open5gs/bsf.yaml etc/open5gs
configs/systemd/open5gs-bsfd.service lib/systemd/system

View File

@@ -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

View File

@@ -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

View File

@@ -1 +0,0 @@
../8/dev

View File

@@ -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

View File

@@ -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}

View File

@@ -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

View File

@@ -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

View File

@@ -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
View File

@@ -0,0 +1 @@
latest

1
docker/debian/testing Symbolic link
View File

@@ -0,0 +1 @@
latest

View File

@@ -8,6 +8,7 @@ RUN dnf -y install \
python3 \
ninja-build \
gcc \
gcc-c++ \
flex \
bison \
git \

1
docker/ubuntu/hirsute Symbolic link
View File

@@ -0,0 +1 @@
latest

View File

@@ -28,6 +28,7 @@ RUN apt-get update && \
libmicrohttpd-dev \
libcurl4-gnutls-dev \
libnghttp2-dev \
libtins-dev \
iproute2 \
ca-certificates \
netbase \

View File

@@ -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
```

View File

@@ -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

View File

@@ -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
```

View File

@@ -10,8 +10,11 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
### Commercial 5G
---
* Airspan 5G OpenRange vCU + Airspan 5G OpenRange vDU + Airspan 5G OpenRANGE06 AirVelocity 2700 RU
* LIONS RANathon O-CU and O-DU + RANathon RS8601 Indoor O-RU + RANathon XG8600 Fronthaul Gateway
* NOKIA AEQE (SW: 5G20A)
* NOKIA AEQD (SW: 5G20A)
* NOKIA AEQP (SW: 5G21A)
* Huawei BTS5900
### Commercial 4G
---
@@ -28,16 +31,21 @@ 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
* Ruckus Q710 and Q910
### 4G/5G Software Stacks + SDRs
---
* [Amarisoft](https://www.amarisoft.com/) + LimeSDR, USRP, Amarisoft PCI Express Card
* [srsLTE / srsENB](https://github.com/srsLTE/srsLTE) + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)
* Open Air Interface 5G ([NR_SA_F1AP_5GRECORDS branch](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/NR_SA_F1AP_5GRECORDS)) + USRP B210
### Misc Radio Hardware
---

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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
```

View File

@@ -280,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
```
@@ -413,6 +414,7 @@ $ open5gs-ausfd
$ open5gs-udmd
$ open5gs-pcfd
$ open5gs-nssfd
$ open5gs-bsfd
$ open5gs-udrd
```
@@ -618,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
```
@@ -1078,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
```

View File

@@ -8,12 +8,12 @@ This post is the perfect starting point for learning to build your own LTE netwo
### Prerequisites
---
First, you have to prepare USRP B200/B210 to run srsENB. However, please keep in mind that you would still need a fairly high-end PC (at least dual-core i5, better quad-core i7) with USB 3.0 to attach the USRP B200/B210.
First, you have to prepare USRP B200/B210 to run srsRAN. However, please keep in mind that you would still need a fairly high-end PC (at least dual-core i5, better quad-core i7) with USB 3.0 to attach the USRP B200/B210.
For USRP B200/B210, you can use a GPS antenna for clock synchronization. Of course, it can work without a GPS antenna, but if you have that antenna, it's a good to have a window near your desk where you can put the small GPS patch antenna. In my case, a 1 to 2 meters antenna cable is used between desk/computer and the window.
This document will be described with the following equipment.
- i5-8500 PC with Ubuntu 18.04(bionic)
- i5-8500 PC with Ubuntu 20.04(focal)
- USRP B200/B210 with USB 3.0
- iPhone XS
- sysmoUSIM-SJS1
@@ -112,7 +112,7 @@ Done !
### Installation
---
We will use *Ubuntu 18.04(Bionic)* installed PC.
We will use *Ubuntu 20.04(focal)* installed PC.
{: .blue .bold}
#### 1. USRP Hardware Driver
@@ -131,9 +131,9 @@ After installing, you need to download the FPGA images packages by running _uhd
$ sudo /usr/lib/uhd/utils/uhd_images_downloader.py
```
#### 2. srsENB
#### 2. srsRAN
On *Ubuntu 18.04(Bionic)*, one can install the required libraries with:
On *Ubuntu 20.04(focal)*, one can install the required libraries with:
```bash
$ sudo apt install cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev
@@ -142,11 +142,11 @@ $ sudo apt install cmake libfftw3-dev libmbedtls-dev libboost-program-options-de
Download and build srsLTE:
```bash
$ git clone https://github.com/srsLTE/srsLTE.git
$ cd srsLTE
$ git checkout release_19_12
$ git clone https://github.com/srsRAN/srsRAN.git
$ cd srsRAN
$ git checkout release_21_04
$ git rev-parse HEAD
d045213fb9cbf98c83c06d7c17197a9dcbfddacf
1c6dd8c4adc8419d4a431f382283539f1719582a
$ mkdir build
$ cd build
$ cmake ../
@@ -161,11 +161,11 @@ The Open5GS package is available on the recent versions of *Ubuntu*.
```bash
# Getting the authentication key
$ sudo apt install wget
$ wget https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/Release.key
$ wget https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/Release.key
$ sudo apt-key add Release.key
# Installing Open5GS
$ sudo sh -c "echo 'deb https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo sh -c "echo 'deb https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/ ./' > /etc/apt/sources.list.d/open5gs.list"
$ sudo apt update
$ sudo apt install open5gs
```
@@ -320,46 +320,62 @@ $ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQ
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
{: .notice--danger}
#### 2. srsENB
Change back to the srsENB source directory and copy the main config example as well as all additional config files for RR, SIB and DRB.
#### 2. srsRAN
Change back to the srsRAN source directory and copy the main config example as well as all additional config files for RR, SIB and DRB.
```bash
$ cp srsenb/enb.conf.example srsenb/enb.conf
$ cp srsenb/rr.conf.example srsenb/rr.conf
$ cp srsenb/sib.conf.example srsenb/sib.conf
$ cp srsenb/drb.conf.example srsenb/drb.conf
$ cp srsenb/sib.conf.example srsenb/sib.conf
$ cp srsenb/sib.conf.mbsfn.example srsenb/sib.conf.mbsfn
```
You should check your phone frequency. If your phone does not support Band-3, you should use a different DL EARFCN value.
```diff
--- enb.conf.example 2018-11-19 18:16:06.953631893 +0900
+++ enb.conf 2019-04-08 11:15:18.051261318 +0900
@@ -23,8 +23,8 @@
cell_id = 0x01
phy_cell_id = 1
tac = 0x0007
$ diff -u enb.conf.example enb.conf
--- enb.conf.example 2021-08-23 12:00:03.975297244 +0900
+++ enb.conf 2021-08-23 14:34:01.794290668 +0900
@@ -19,8 +19,10 @@
#####################################################################
[enb]
enb_id = 0x19B
-mcc = 001
-mnc = 01
+mcc = 310
+mnc = 789
+#mcc = 001
+#mnc = 01
+mcc = 901
+mnc = 70
mme_addr = 127.0.1.100
gtp_bind_addr = 127.0.1.1
s1c_bind_addr = 127.0.1.1
@@ -66,12 +66,13 @@
# Default "auto". B210 USRP: 400 us, bladeRF: 0 us.
#####################################################################
[rf]
-dl_earfcn = 3400
+dl_earfcn = 1600
@@ -65,7 +67,7 @@
tx_gain = 80
rx_gain = 40
#device_name = auto
#device_args = auto
+device_args="clock=external"
#time_adv_nsamples = auto
#burst_preamble_us = auto
-#device_name = auto
+device_name = auto
# For best performance in 2x2 MIMO and >= 15 MHz use the following device_args settings:
# USRP B210: num_recv_frames=64,num_send_frames=64
@@ -80,6 +82,7 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples
#device_name = zmq
#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
+device_args = clock=external
#####################################################################
```
```diff
$ diff -u rr.conf.example rr.conf
diff rr.conf.example rr.conf
61c61,62
< dl_earfcn = 3350;
---
> // dl_earfcn = 3350;
> dl_earfcn = 1600;
```
PLMN ID, DL EARFCN, and Device Argument are updated as belows.
@@ -372,14 +388,20 @@ Device Argument : Clock source from external GPS-DO
If you do not use the GPS-DO, you should use:
```diff
#device_name = auto
-#device_args = auto
+device_args = auto
#time_adv_nsamples = auto
#burst_preamble_us = auto
$ diff -u enb.conf.example enb.conf
--- enb.conf.example 2021-08-23 14:32:35.585438813 +0900
+++ enb.conf 2021-08-23 14:32:08.350450409 +0900
@@ -82,7 +82,6 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples
#device_name = zmq
#device_args = fail_on_disconnect=true,tx_port=tcp://*:2000,rx_port=tcp://localhost:2001,id=enb,base_srate=23.04e6
-device_args = clock=external
#####################################################################
# Packet capture configuration
```
Now, run the srsENB as follows:
Now, run the srsRAN as follows:
```bash
$ cd srsenb/

View File

@@ -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

View File

@@ -35,11 +35,13 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- @nickvsnetworking
- [My first 5G Core : Open5GS and UERANSIM](http://nickvsnetworking.com/my-first-5g-core-open5gs-and-ueransim/)
- [Backing up and restoring Open5GS](https://nickvsnetworking.com/backing-up-and-restoring-open5gs/)
- [Open5Gs Without NAT](https://nickvsnetworking.com/open5gs-without-nat/)
- [Sending SMS in Open5GS LTE Networks using the SGs Interface and OsmoMSC](https://nickvsnetworking.com/sending-sms-in-open5gs-lte-networks-using-the-sgs-interface-and-osmomsc-with-smsos/)
- [OsmoMSC and Open5GS MME SGs Interface for CSCF / InterRAT Handover](https://nickvsnetworking.com/osmomsc-and-open5gs-mme-sgs-interface-for-cscf-interran-handover/)
- [Static IPs for UEs](http://nickvsnetworking.com/open5gs-epc-static-ip-addresses-for-ues-apns-subscribers/)
- @s5uishida
- [EPC Advanced Example with OpenAirInterface UE/RAN](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
- [5GC Advanced Example with UERANSIM](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
- [Open5GS EPC & OpenAirInterface UE/RAN Sample configuration](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
- [Open5GS 5GC & UERANSIM UE/RAN Sample Configuration](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
- [Open5GS & UERANSIM - Select nearby UPF according to the connected gNodeB](https://github.com/s5uishida/open5gs_5gc_ueransim_nearby_upf_sample_config)

View File

@@ -11,8 +11,7 @@ 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)
([#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)

View 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}

View 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}

View 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}

View File

@@ -0,0 +1,23 @@
---
title: "v2.3.3 - Bug Fixes"
date: 2021-08-21 18:26:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Bug Fixes
- [MME/AMF] Use Non-UE signalling connection when S1-Paging message ([#1134](https://github.com/open5gs/open5gs/issues/1134)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
- [SGW-C] Fixes the shared object error ([#595](https://github.com/open5gs/open5gs/issues/595)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
- [SMF] Configuration update for clarifying FALLBACK SUBNET ([#1128](https://github.com/open5gs/open5gs/issues/1128)) -- [kbarlee](https://github.com/kbarlee)
- [AMF] Fixes an invalid GSM reject in DL NAS Transport ([aligungr#375](https://github.com/aligungr/UERANSIM/issues/375)) -- [infinitydon] (https://github.com/infinitydon)
- [MME/AMF] Fixes the crash if eNB context is released and timer is expred ([#1122](https://github.com/open5gs/open5gs/issues/1122)) -- [SpeedFI-101](https://github.com/SpeedFI-101)
- [PCF] 'NULL' events on successful N5 (npcf) request ([#1120](https://github.com/open5gs/open5gs/issues/1120)) -- [oktavlachs](https://github.com/oktavlachs)
- [SMF/PCRF] Fixes the crash when number of flow > 8 ([#1108](https://github.com/open5gs/open5gs/pull/1108)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [SMF] Session data was accessed when NULL resulting in crash ([#1105](https://github.com/open5gs/open5gs/pull/1105)) -- [herlesupreeth](https://github.com/herlesupreeth)
Download -- [v2.3.3.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.3.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,28 @@
---
title: "v2.3.4 - Bug Fixes 2"
date: 2021-10-06 21:52:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Enhancement
- [PFCP] Support URR in PFCP protocol ([#1190](https://github.com/open5gs/open5gs/pull/1190)) -- [mhkndgn](https://github.com/mhkndgn)
- [MGMT] Improve open5gs-dbctl ([#1181](https://github.com/open5gs/open5gs/pull/1181)) -- [cgiraldo](https://github.com/cgiraldo)
- [SEC] Support of configuring authentication parameter(R1-R5)([#1153](https://github.com/open5gs/open5gs/issues/1153)) -- [Mozartor2](https://github.com/Mozartor2)
#### Bug Fixes
- [UPF] Remove Diameter dependencies from UPF ([#1193](https://github.com/open5gs/open5gs/pull/1193)) -- [spencersevilla](https://github.com/spencersevilla)
- [CVE-2021-41794] Stack overflow in ogs_fqdn_parse() -- [13f1b390](https://github.com/open5gs/open5gs/commit/13f1b390ae96b02115932b1548b3768e6903e344)
- [SGW-C] fix the SGW-C crash in Delete Session process when UPF was restarted ([#1177](https://github.com/open5gs/open5gs/issues/1177)) -- [kuanghanqian](https://github.com/kuanghanqian)
- [SMF] Add GTP-U Extension Header Deletion field -- [9c589ac](https://github.com/open5gs/open5gs/commit/9c589ac584cb7d53a32ceb23c818ee1a00124bb0)
- [SMF] Consider after airplain-mode if UE does not send PDU session complete message ([#1155](https://github.com/open5gs/open5gs/issues/1155)) -- [wanfude](https://github.com/wanfude)
- [SMF] fix the crash when BSF is not running ([#1149](https://github.com/open5gs/open5gs/issues/1149)) -- [inkms](https://github.com/inkms)
- [SMF] TAI/ECGI is not required in WLAN([#1039](https://github.com/open5gs/open5gs/discussions/1039)) -- [fasferraz](https://github.com/fasferraz)
- [MEM] Increase Cluster2048 pool from 512 to 1024 ([#1143](https://github.com/open5gs/open5gs/pull/1143)) -- [UmakantKulkarni](https://github.com/UmakantKulkarni)
Download -- [v2.3.4.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.4.tar.gz)
{: .notice--info}

View File

@@ -0,0 +1,19 @@
---
title: "v2.3.6 - Bug Fixes 3"
date: 2021-10-16 22:49:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### Bug Fixes
- [MME] Fix the GTP module crash after SGW-C restarts and Modify Bearer Request/Response ([#1205](https://github.com/open5gs/open5gs/issues/1205)) -- [cecrevier](https://github.com/cecrevier)
- [SMF/SGW-C] Add Vendor-Id in Supported-Features AVP in Gx ([#1202](https://github.com/open5gs/open5gs/issues/1202)) -- [oktavlachs](https://github.com/oktavlachs)
- [SMF/SGW-C] Expand Indications and Add Delay Value ([#1201](https://github.com/open5gs/open5gs/issues/1201)) -- [cbrasho](https://github.com/cbrasho)
- [MME/AMF] Fix the NAS module crash when APN lenth is zero([#1199](https://github.com/open5gs/open5gs/discussions/1199)) -- [ipinfotelecom](https://github.com/ipinfotelecom)
Download -- [v2.3.6.tar.gz](https://github.com/open5gs/open5gs/archive/v2.3.6.tar.gz)
{: .notice--info}

Binary file not shown.

View File

@@ -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);

View File

@@ -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(&parameter_iter);
} else if (!strcmp(parameter_key, "no_bsf")) {
self.parameter.no_bsf =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_udr")) {
self.parameter.no_udr =
ogs_yaml_iter_bool(&parameter_iter);

View File

@@ -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;

View File

@@ -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

View File

@@ -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,

View File

@@ -64,6 +64,29 @@ void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id,
return plmn_id;
}
void *ogs_nas_from_plmn_id(
ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *plmn_id)
{
memcpy(ogs_nas_plmn_id, plmn_id, OGS_PLMN_ID_LEN);
if (plmn_id->mnc1 != 0xf) {
ogs_nas_plmn_id->mnc1 = plmn_id->mnc1;
ogs_nas_plmn_id->mnc2 = plmn_id->mnc2;
ogs_nas_plmn_id->mnc3 = plmn_id->mnc3;
}
return ogs_nas_plmn_id;
}
void *ogs_nas_to_plmn_id(
ogs_plmn_id_t *plmn_id, ogs_nas_plmn_id_t *ogs_nas_plmn_id)
{
memcpy(plmn_id, ogs_nas_plmn_id, OGS_PLMN_ID_LEN);
if (plmn_id->mnc1 != 0xf) {
plmn_id->mnc1 = ogs_nas_plmn_id->mnc1;
plmn_id->mnc2 = ogs_nas_plmn_id->mnc2;
plmn_id->mnc3 = ogs_nas_plmn_id->mnc3;
}
return plmn_id;
}
char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id)
{
ogs_assert(plmn_id);
@@ -137,7 +160,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 +205,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 +246,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 +265,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 +280,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)
@@ -291,8 +324,13 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
int i = 0, j = 0;
uint8_t len = 0;
do {
while (i < length) {
len = src[i++];
if ((j + len + 1) > length) {
ogs_error("Invalid APN encoding[len:%d] + 1 > length[%d]",
len, length);
return 0;
}
memcpy(&dst[j], &src[i], len);
i += len;
@@ -302,7 +340,7 @@ int ogs_fqdn_parse(char *dst, char *src, int length)
dst[j++] = '.';
else
dst[j] = 0;
} while (i < length);
}
return j;
}
@@ -391,12 +429,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 +495,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 +702,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();
}
}
}
}

View File

@@ -30,12 +30,23 @@ extern "C" {
#define OGS_MAX_NUM_OF_SESS 4 /* Num of APN(Session) per UE */
#define OGS_MAX_NUM_OF_BEARER 4 /* Num of Bearer per Session */
#define OGS_MAX_NUM_OF_RULE 4 /* Num of Rule per Session */
#define OGS_MAX_NUM_OF_PF 16 /* Num of PacketFilter per Bearer */
#define OGS_MAX_NUM_OF_PACKET_BUFFER 64 /* Num of PacketBuffer per UE */
/* Num of PacketFilter per Bearer(GTP) or QoS(NAS-5GS) */
#define OGS_MAX_NUM_OF_PACKET_FILTER 16
/*
* The array of TLV messages is limited to 8.
* So, Flow(PDI.SDF_Filter) in PDR is limited to 8.
*
* However, the number of flow in bearer context seems to need more than 16.
*
* Therefore, the maximum number of flows of messages is defined as 8,
* and the maximum number of flows stored by the context is 16.
*/
#define OGS_MAX_NUM_OF_FLOW_IN_PDR 8
#define OGS_MAX_NUM_OF_FLOW_IN_GTP OGS_MAX_NUM_OF_FLOW_IN_PDR
#define OGS_MAX_NUM_OF_FLOW_IN_NAS OGS_MAX_NUM_OF_FLOW_IN_PDR
#define OGS_MAX_NUM_OF_FLOW_IN_PCC_RULE OGS_MAX_NUM_OF_FLOW_IN_PDR
#define OGS_MAX_NUM_OF_FLOW_IN_MEDIA_SUB_COMPONENT OGS_MAX_NUM_OF_FLOW_IN_PDR
#define OGS_MAX_NUM_OF_FLOW_IN_BEARER 16
#define OGS_MAX_NUM_OF_GTPU_RESOURCE 4
@@ -120,6 +131,22 @@ char *ogs_plmn_id_mnc_string(ogs_plmn_id_t *plmn_id);
#define OGS_PLMNIDSTRLEN (sizeof(ogs_plmn_id_t)*2+1)
char *ogs_plmn_id_to_string(ogs_plmn_id_t *plmn_id, char *buf);
/*************************
* NAS PLMN_ID Structure */
typedef struct ogs_nas_plmn_id_s {
ED2(uint8_t mcc2:4;,
uint8_t mcc1:4;)
ED2(uint8_t mnc3:4;,
uint8_t mcc3:4;)
ED2(uint8_t mnc2:4;,
uint8_t mnc1:4;)
} __attribute__ ((packed)) ogs_nas_plmn_id_t;
void *ogs_nas_from_plmn_id(
ogs_nas_plmn_id_t *ogs_nas_plmn_id, ogs_plmn_id_t *plmn_id);
void *ogs_nas_to_plmn_id(
ogs_plmn_id_t *plmn_id, ogs_nas_plmn_id_t *ogs_nas_plmn_id);
/************************************
* AMF_ID Structure */
typedef struct ogs_amf_id_s {
@@ -199,6 +226,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 +240,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 +348,7 @@ typedef struct ogs_flow_s {
#define OGS_FLOW_FREE(__fLOW) \
do { \
if ((__fLOW)->description) \
{ \
if ((__fLOW)->description) { \
ogs_free((__fLOW)->description); \
} \
else \
@@ -332,16 +365,9 @@ typedef struct ogs_pcc_rule_s {
char *id; /* 5GC */
char *name; /* EPC */
/* Num of Flow per PCC Rule */
#define OGS_MAX_NUM_OF_FLOW 8
ogs_flow_t flow[OGS_MAX_NUM_OF_FLOW];
ogs_flow_t flow[OGS_MAX_NUM_OF_FLOW_IN_PCC_RULE];
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 +650,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_IN_MEDIA_SUB_COMPONENT];
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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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
}

View File

@@ -95,8 +95,8 @@ 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_2048_pool = 512;
config->cluster_1024_pool = 2048;
config->cluster_2048_pool = 1024;
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);

View File

@@ -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)
{

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 {

View File

@@ -22,10 +22,12 @@
#define os_memcmp memcmp
#define os_memcmp_const memcmp
int aes_128_encrypt_block(const uint8_t *key,
const uint8_t *in, uint8_t *out);
static void ShiftBits(uint8_t r, uint8_t rijndaelInput[16],
uint8_t temp[16], const uint8_t opc[16]);
static uint8_t *bits_shift(uint32_t bit_valid, uint8_t *dst,
uint8_t *src, uint32_t numBits);
int aes_128_encrypt_block(const uint8_t *key,
static int aes_128_encrypt_block(const uint8_t *key,
const uint8_t *in, uint8_t *out)
{
const int key_bits = 128;
@@ -55,8 +57,10 @@ int milenage_f1(const uint8_t *opc, const uint8_t *k,
{
uint8_t tmp1[16], tmp2[16], tmp3[16];
int i;
#if 1 /* R1-R5 issues1153 */
uint8_t r1 = 64;
#endif
/* tmp1 = TEMP = E_K(RAND XOR OP_C) */
for (i = 0; i < 16; i++)
tmp1[i] = _rand[i] ^ opc[i];
if (aes_128_encrypt_block(k, tmp1, tmp1))
@@ -70,8 +74,12 @@ int milenage_f1(const uint8_t *opc, const uint8_t *k,
/* OUT1 = E_K(TEMP XOR rot(IN1 XOR OP_C, r1) XOR c1) XOR OP_C */
/* rotate (tmp2 XOR OP_C) by r1 (= 0x40 = 8 bytes) */
#if 0 /* R1-R5 issues1153 */
for (i = 0; i < 16; i++)
tmp3[(i + 8) % 16] = tmp2[i] ^ opc[i];
#else
ShiftBits(r1, tmp3, tmp2, opc);
#endif
/* XOR with TEMP = E_K(RAND XOR OP_C) */
for (i = 0; i < 16; i++)
tmp3[i] ^= tmp1[i];
@@ -109,6 +117,13 @@ int milenage_f2345(const uint8_t *opc, const uint8_t *k,
uint8_t tmp1[16], tmp2[16], tmp3[16];
int i;
#if 1 /* R1-R5 issues1153 */
uint8_t r2 = 0;
uint8_t r3 = 32;
uint8_t r4 = 64;
uint8_t r5 = 96;
#endif
/* tmp2 = TEMP = E_K(RAND XOR OP_C) */
for (i = 0; i < 16; i++)
tmp1[i] = _rand[i] ^ opc[i];
@@ -122,8 +137,12 @@ int milenage_f2345(const uint8_t *opc, const uint8_t *k,
/* f2 and f5 */
/* rotate by r2 (= 0, i.e., NOP) */
#if 0 /* R1-R5 issues1153 */
for (i = 0; i < 16; i++)
tmp1[i] = tmp2[i] ^ opc[i];
#else
ShiftBits(r2, tmp1, tmp2, opc);
#endif
tmp1[15] ^= 1; /* XOR c2 (= ..01) */
/* f5 || f2 = E_K(tmp1) XOR OP_c */
if (aes_128_encrypt_block(k, tmp1, tmp3))
@@ -138,8 +157,12 @@ int milenage_f2345(const uint8_t *opc, const uint8_t *k,
/* f3 */
if (ck) {
/* rotate by r3 = 0x20 = 4 bytes */
#if 0 /* R1-R5 issues1153 */
for (i = 0; i < 16; i++)
tmp1[(i + 12) % 16] = tmp2[i] ^ opc[i];
#else
ShiftBits(r3, tmp1, tmp2, opc);
#endif
tmp1[15] ^= 2; /* XOR c3 (= ..02) */
if (aes_128_encrypt_block(k, tmp1, ck))
return -1;
@@ -150,8 +173,12 @@ int milenage_f2345(const uint8_t *opc, const uint8_t *k,
/* f4 */
if (ik) {
/* rotate by r4 = 0x40 = 8 bytes */
#if 0 /* R1-R5 issues1153 */
for (i = 0; i < 16; i++)
tmp1[(i + 8) % 16] = tmp2[i] ^ opc[i];
#else
ShiftBits(r4, tmp1, tmp2, opc);
#endif
tmp1[15] ^= 4; /* XOR c4 (= ..04) */
if (aes_128_encrypt_block(k, tmp1, ik))
return -1;
@@ -162,8 +189,12 @@ int milenage_f2345(const uint8_t *opc, const uint8_t *k,
/* f5* */
if (akstar) {
/* rotate by r5 = 0x60 = 12 bytes */
#if 0 /* R1-R5 issues1153 */
for (i = 0; i < 16; i++)
tmp1[(i + 4) % 16] = tmp2[i] ^ opc[i];
#else
ShiftBits(r5, tmp1, tmp2, opc);
#endif
tmp1[15] ^= 8; /* XOR c5 (= ..08) */
if (aes_128_encrypt_block(k, tmp1, tmp1))
return -1;
@@ -364,3 +395,67 @@ void milenage_opc(const uint8_t *k, const uint8_t *op, uint8_t *opc)
opc[i] ^= op[i];
}
}
static void ShiftBits(uint8_t r, uint8_t rijndaelInput[16],
uint8_t temp[16], const uint8_t opc[16])
{
uint32_t deltlen = 16 - (r / 8);
uint32_t leftout = r % 8;
uint32_t i;
if (leftout == 0) {
for (i = 0; i < 16; i++) {
rijndaelInput[(i+deltlen) % 16] = temp[i] ^ opc[i];
}
} else {
uint8_t temp1[16];
uint32_t move_bits;
uint8_t temp2;
for (i = 0; i < 16; i++) {
temp1[(i + deltlen) % 16] = temp[i] ^ opc[i];
}
rijndaelInput[15] = 0;
move_bits = 8 - leftout;
bits_shift(move_bits, &rijndaelInput[0], temp1, (128 - leftout));
temp2 = temp1[0] >> (8-leftout);
rijndaelInput[15] |= temp2;
}
}
static uint8_t *bits_shift(uint32_t bit_valid, uint8_t *dst,
uint8_t *src, uint32_t numBits)
{
uint32_t bit_used = bit_valid;
uint32_t bit_empty = 8 - bit_used;
uint32_t numBytes = numBits >> 3;
uint32_t leftBits = numBits & 0x7;
uint32_t i = 0;
uint8_t *newDst = 0;
for (i = 0; i < numBytes; i++) {
dst[i] = (src[i] << bit_empty) | (src[i+1] >> bit_used);
}
if (leftBits) {
if (leftBits == bit_used) {
dst[numBytes] = src[numBytes] << bit_empty;
bit_valid = 8;
newDst = &src[numBytes+1];
} else if (leftBits < bit_used) {
dst[numBytes] = src[numBytes] << bit_empty;
bit_valid = bit_used - leftBits;
newDst = &src[numBytes];
} else {
dst[numBytes] = src[numBytes] << bit_empty |
(src[numBytes+1] >> bit_used);
bit_valid = 8 - (leftBits - bit_used);
newDst = &src[numBytes+1];
}
} else {
bit_valid = bit_used;
newDst = &src[numBytes];
}
return newDst;
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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);

View File

@@ -436,7 +436,8 @@ done:
while (bson_iter_next(&child7_iter)) {
ogs_flow_t *flow = NULL;
ogs_assert(flow_index < OGS_MAX_NUM_OF_FLOW);
ogs_assert(
flow_index < OGS_MAX_NUM_OF_FLOW_IN_PCC_RULE);
flow = &pcc_rule->flow[flow_index];
bson_iter_recurse(&child7_iter, &child8_iter);
@@ -452,6 +453,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 +481,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;

View File

@@ -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 );

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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 },

View File

@@ -17,7 +17,6 @@
libdiameter_cx_sources = files('''
ogs-diameter-cx.h
message.h
dict.c

View File

@@ -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);

View File

@@ -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;

Some files were not shown because too many files have changed in this diff Show More