mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-28 18:43:40 +00:00
Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
191f109f7f | ||
|
|
198abc6e8b | ||
|
|
fb95725ca4 | ||
|
|
41fd851b7f | ||
|
|
d16d295708 | ||
|
|
5999bd22f9 | ||
|
|
33edd12335 | ||
|
|
b2d012c253 | ||
|
|
e5a9156444 | ||
|
|
90123efae3 | ||
|
|
c424796955 | ||
|
|
1c997c4069 | ||
|
|
3be76db08a | ||
|
|
0742c6208c | ||
|
|
2c2b6dfcaf | ||
|
|
0c47098c4a | ||
|
|
1a7b4de7c6 | ||
|
|
19a3680c60 | ||
|
|
520d9cd2c3 | ||
|
|
3c99af7736 | ||
|
|
dcf0a714aa | ||
|
|
e1a2e3803f | ||
|
|
f0b9a35962 | ||
|
|
70f7e2d5d4 | ||
|
|
f4c6791227 | ||
|
|
ee964d825c | ||
|
|
b9fdc0ab44 | ||
|
|
0b2ba07f97 | ||
|
|
fe7525a784 | ||
|
|
d7c188dc00 | ||
|
|
961db54c2f | ||
|
|
1f1a741e53 | ||
|
|
e6e825c6a3 | ||
|
|
cbb3758c9c | ||
|
|
6f11a78079 | ||
|
|
9a1824f6aa | ||
|
|
23e8e6577c | ||
|
|
830587a250 | ||
|
|
f1a207fd9b | ||
|
|
2d3b8eed81 | ||
|
|
18c3a4d5d9 | ||
|
|
8975613ae9 | ||
|
|
621145d8b0 | ||
|
|
5af01d1a71 | ||
|
|
ad85c12513 | ||
|
|
b80554e955 | ||
|
|
13c7f30e39 | ||
|
|
21595426b2 | ||
|
|
d1e643ed6c | ||
|
|
22e98d612a | ||
|
|
48bf4a763a | ||
|
|
3fef5848b8 | ||
|
|
a679ea56a8 | ||
|
|
080c6a9002 | ||
|
|
5fd6dac961 | ||
|
|
f137d1947f | ||
|
|
0ec0b2dc69 | ||
|
|
93312e8f3d | ||
|
|
3cbec5f2e6 | ||
|
|
4f2803c058 | ||
|
|
a470131489 | ||
|
|
aa81bb2c89 | ||
|
|
15e42bc4a9 | ||
|
|
bdeea7ce8b | ||
|
|
39aa726543 | ||
|
|
1bed0d5872 | ||
|
|
c244dcc5e9 | ||
|
|
c052193a37 | ||
|
|
50149dd1a7 | ||
|
|
5bfaac17e0 | ||
|
|
c424099200 | ||
|
|
06ec924466 | ||
|
|
6ff129e9da | ||
|
|
fae76f9e9d | ||
|
|
f294a5f55c | ||
|
|
5c9b3d09d8 |
@@ -2,7 +2,7 @@
|
||||
|
||||
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).
|
||||
|
||||
<h3 align="center">Special Sponsors</h3>
|
||||
<h3 align="center">Special Sponsor</h3>
|
||||
<!--special start-->
|
||||
|
||||
<p align="center">
|
||||
@@ -20,6 +20,11 @@ If you find Open5GS useful for work, please consider supporting this Open Source
|
||||
<img width="222px" src="https://open5gs.org/assets/img/asLogonew.png">
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" valign="middle">
|
||||
<a href="https://www.wearetriple.com/" target="_blank">
|
||||
<img width="222px" 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">
|
||||
@@ -35,7 +40,7 @@ If you don't understand something about Open5GS, the [https://open5gs.org/open5g
|
||||
|
||||
## Technical Discussion
|
||||
|
||||
Problem with Open5GS can be filed as [issues](https://github.com/open5gs/open5gs/issues) in this repository. Voice and text chat available in Open5GS's [Discord](https://discordapp.com/) workspace. Use [this link](https://discord.gg/GreNkuc) to get started.
|
||||
Problem with Open5GS can be filed as [issues](https://github.com/open5gs/open5gs/issues) in this repository. Voice and text chat are available in Open5GS's [Discord](https://discordapp.com/) workspace. Use [this link](https://discord.gg/GreNkuc) to get started.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -194,7 +194,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
@@ -228,7 +228,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
@@ -197,7 +197,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
@@ -293,7 +293,7 @@ pool:
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
@@ -169,7 +169,7 @@ pool:
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
@@ -32,6 +32,7 @@ open5gs_conf = '''
|
||||
ausf.yaml
|
||||
udm.yaml
|
||||
udr.yaml
|
||||
pcf.yaml
|
||||
'''.split()
|
||||
|
||||
foreach file : open5gs_conf
|
||||
|
||||
@@ -349,6 +349,11 @@ smf:
|
||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
||||
# no_slaac: true
|
||||
#
|
||||
# o Use OAI UE
|
||||
# - Remove HashMME in Security-mode command message
|
||||
# - Use the length 1 of EPS network feature support in Attach accept message
|
||||
# use_openair: true
|
||||
#
|
||||
parameter:
|
||||
|
||||
#
|
||||
@@ -398,3 +403,13 @@ pool:
|
||||
# o usrsctp_udp_port : 9899
|
||||
#
|
||||
sctp:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
db_uri: mongodb://localhost/open5gs
|
||||
|
||||
#
|
||||
# logger:
|
||||
#
|
||||
@@ -145,7 +147,7 @@ pool:
|
||||
# subscription:
|
||||
# validity: 3600
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
179
configs/open5gs/pcf.yaml.in
Normal file
179
configs/open5gs/pcf.yaml.in
Normal file
@@ -0,0 +1,179 @@
|
||||
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,pcf,event,tlv,mem,sock
|
||||
#
|
||||
logger:
|
||||
file: @localstatedir@/log/open5gs/pcf.log
|
||||
#
|
||||
# pcf:
|
||||
#
|
||||
# <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: pcf.key
|
||||
# pem: pcf.pem
|
||||
#
|
||||
# o SBI Server(https://127.0.0.13:443, http://[::1]:80)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.13
|
||||
# tls:
|
||||
# key: pcf.key
|
||||
# pem: pcf.pem
|
||||
# - addr: ::1
|
||||
#
|
||||
# o SBI Server(http://pcf.open5gs.org:80)
|
||||
# sbi:
|
||||
# name: pcf.open5gs.org
|
||||
#
|
||||
# o SBI Server(http://127.0.0.13:7777)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.13
|
||||
# port: 7777
|
||||
#
|
||||
# o SBI Server(http://<eth0 IP address>:80)
|
||||
# sbi:
|
||||
# dev: eth0
|
||||
#
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
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
|
||||
#
|
||||
# o Enable Multicast traffic to the UE
|
||||
# multicast: true
|
||||
#
|
||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
||||
# no_slaac: 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 Number of Default Memory Pool Size
|
||||
#
|
||||
# - Pool-size 128 => 32768 Number
|
||||
# - Pool-size 256 => 4096 Number
|
||||
# - Pool-size 512 => 2048 Number
|
||||
# - Pool-size 1024 => 1024 Number
|
||||
# - Pool-size 2048 => 512 Number
|
||||
# - Pool-size 8192 => 128 Number
|
||||
# - Pool-size 1024*1024 => 8 Number
|
||||
#
|
||||
# 128: 32768
|
||||
# 256: 4096
|
||||
# 512: 2048
|
||||
# 1024: 1024
|
||||
# 2048: 512
|
||||
# 8192: 128
|
||||
# big: 8
|
||||
#
|
||||
pool:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o NF Instance Heartbeat (Default : 10 seconds)
|
||||
#
|
||||
# o NF Instance Heartbeat (Disabled)
|
||||
# nf_instance:
|
||||
# heartbeat: 0
|
||||
#
|
||||
# o NF Instance Heartbeat (10 seconds)
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
@@ -162,3 +162,13 @@ max:
|
||||
# big: 8
|
||||
#
|
||||
pool:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
|
||||
@@ -29,18 +29,49 @@ logger:
|
||||
# o GTP-U Server(all address available)
|
||||
# gtpu:
|
||||
#
|
||||
# o Provide custom SGW GTP-U address to be advertised inside S1AP messages
|
||||
# o GTP-U Server(127.0.0.6:2152, [::1]:2152)
|
||||
# gtpu:
|
||||
# addr: 10.4.128.21
|
||||
# advertise_addr: 172.24.15.30
|
||||
# - addr:
|
||||
# - 127.0.0.6
|
||||
# - ::1
|
||||
#
|
||||
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||
# gtpu:
|
||||
# - name: localhost
|
||||
#
|
||||
# o User Plane IP Resource information
|
||||
# gtpu:
|
||||
# - addr:
|
||||
# - 127.0.0.6
|
||||
# - ::1
|
||||
# teid_range_indication: 4
|
||||
# teid_range: 10
|
||||
# network_instance: internet
|
||||
# source_interface: 0
|
||||
# - addr: 127.0.10.4
|
||||
# teid_range_indication: 4
|
||||
# teid_range: 5
|
||||
# network_instance: ims
|
||||
# source_interface: 1
|
||||
#
|
||||
# o Provide custom SGW-U GTP-U address to be advertised inside S1AP messages
|
||||
# gtpu:
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_addr: 172.24.15.30
|
||||
#
|
||||
# gtpu:
|
||||
# addr: 10.4.128.21
|
||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_addr:
|
||||
# - 127.0.0.1
|
||||
# - ::1
|
||||
#
|
||||
# gtpu:
|
||||
# dev: ens3
|
||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||
#
|
||||
# gtpu:
|
||||
# - dev: ens3
|
||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||
#
|
||||
# <PFCP Server>
|
||||
#
|
||||
@@ -122,3 +153,13 @@ max:
|
||||
# big: 8
|
||||
#
|
||||
pool:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
|
||||
@@ -98,26 +98,26 @@ logger:
|
||||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, cafe:2::1/64
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: cafe:1::1/64
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
#
|
||||
# o Multiple Devices (default: ogstun)
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: cafe:1::1/64
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# dev: ogstun2
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
#
|
||||
# o Pool Range Sample
|
||||
@@ -261,7 +261,7 @@ nrf:
|
||||
# - addr: 127.0.0.7
|
||||
# dnn: ims
|
||||
# - addr: 127.0.0.12
|
||||
# apn: [internet, web]
|
||||
# dnn: [internet, web]
|
||||
#
|
||||
# o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit)
|
||||
# (either single enb_id or multiple enb_ids, HEX representation)
|
||||
@@ -346,7 +346,7 @@ pool:
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
@@ -169,7 +169,7 @@ pool:
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
@@ -43,9 +43,9 @@ logger:
|
||||
# key: udr.key
|
||||
# pem: udr.pem
|
||||
#
|
||||
# o SBI Server(https://127.0.0.13:443, http://[::1]:80)
|
||||
# o SBI Server(https://127.0.0.20:443, http://[::1]:80)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.13
|
||||
# - addr: 127.0.0.20
|
||||
# tls:
|
||||
# key: udr.key
|
||||
# pem: udr.pem
|
||||
@@ -55,9 +55,9 @@ logger:
|
||||
# sbi:
|
||||
# name: udr.open5gs.org
|
||||
#
|
||||
# o SBI Server(http://127.0.0.13:7777)
|
||||
# o SBI Server(http://127.0.0.20:7777)
|
||||
# sbi:
|
||||
# - addr: 127.0.0.13
|
||||
# - addr: 127.0.0.20
|
||||
# port: 7777
|
||||
#
|
||||
# o SBI Server(http://<eth0 IP address>:80)
|
||||
@@ -66,7 +66,7 @@ logger:
|
||||
#
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
#
|
||||
@@ -171,7 +171,7 @@ pool:
|
||||
# nf_instance:
|
||||
# heartbeat: 10
|
||||
#
|
||||
# o Message Wait Duration (Default : 2000ms = 2 seconds)
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
|
||||
@@ -26,19 +26,23 @@ logger:
|
||||
#
|
||||
# <PFCP Server>
|
||||
#
|
||||
# o PFCP Server(127.0.0.7:8805)
|
||||
# o PFCP Server(127.0.0.7:8805, ::1:8805)
|
||||
# pfcp:
|
||||
# addr: 127.0.0.7
|
||||
# - addr: 127.0.0.7
|
||||
# - addr: ::1
|
||||
#
|
||||
# <GTP-U Server>>
|
||||
#
|
||||
# o GTP-U Server(all address available)
|
||||
# gtpu:
|
||||
#
|
||||
# o GTP-U Server(127.0.0.7:2152, [::1]:2152)
|
||||
# gtpu:
|
||||
# - addr:
|
||||
# - 127.0.0.7
|
||||
# - ::1
|
||||
#
|
||||
# o Same configuration(127.0.0.7:2152, [::1]:2152) as below.
|
||||
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||
# gtpu:
|
||||
# name: localhost
|
||||
#
|
||||
@@ -57,6 +61,26 @@ logger:
|
||||
# network_instance: ims
|
||||
# source_interface: 1
|
||||
#
|
||||
# o Provide custom UPF GTP-U address to be advertised inside NGAP messages
|
||||
# gtpu:
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_addr: 172.24.15.30
|
||||
#
|
||||
# gtpu:
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_addr:
|
||||
# - 127.0.0.1
|
||||
# - ::1
|
||||
#
|
||||
# gtpu:
|
||||
# - addr: 10.4.128.21
|
||||
# advertise_name: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
#
|
||||
# gtpu:
|
||||
# - dev: ens3
|
||||
# advertise_name: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
||||
#
|
||||
#
|
||||
# <PDN Configuration with UE Pool>
|
||||
#
|
||||
# o IPv4 Pool
|
||||
@@ -83,13 +107,13 @@ logger:
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: cafe:1::1/64
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
#
|
||||
# o Multiple Devices (default: ogstun)
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
@@ -99,15 +123,15 @@ logger:
|
||||
#
|
||||
# pdn:
|
||||
# - addr: 10.45.0.1/16
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: cafe:1::1/64
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# dev: ogstun2
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: ims
|
||||
# dnn: ims
|
||||
# dev: ogstun3
|
||||
#
|
||||
# o Pool Range Sample
|
||||
@@ -214,3 +238,13 @@ max:
|
||||
# big: 8
|
||||
#
|
||||
pool:
|
||||
|
||||
#
|
||||
# time:
|
||||
#
|
||||
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
|
||||
#
|
||||
# o Message Wait Duration (3000 ms)
|
||||
# message:
|
||||
# duration: 3000
|
||||
time:
|
||||
|
||||
@@ -194,7 +194,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
@@ -194,7 +194,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
@@ -27,6 +27,7 @@ systemd_conf_in = '''
|
||||
open5gs-nrfd.service
|
||||
open5gs-ausfd.service
|
||||
open5gs-udmd.service
|
||||
open5gs-pcfd.service
|
||||
open5gs-udrd.service
|
||||
'''.split()
|
||||
|
||||
|
||||
18
configs/systemd/open5gs-pcfd.service.in
Normal file
18
configs/systemd/open5gs-pcfd.service.in
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=Open5GS PCF Daemon
|
||||
After=networking.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
User=open5gs
|
||||
Group=open5gs
|
||||
|
||||
Restart=always
|
||||
ExecStart=@bindir@/open5gs-pcfd -c @sysconfdir@/open5gs/pcf.yaml
|
||||
RestartSec=2
|
||||
RestartPreventExitStatus=1
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -199,7 +199,12 @@ udm:
|
||||
- addr: 127.0.0.12
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
pcf:
|
||||
sbi:
|
||||
- addr: 127.0.0.13
|
||||
port: 7777
|
||||
|
||||
udr:
|
||||
sbi:
|
||||
- addr: 127.0.0.20
|
||||
port: 7777
|
||||
|
||||
90
debian/changelog
vendored
90
debian/changelog
vendored
@@ -1,3 +1,93 @@
|
||||
open5gs (2.1.0) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:16:21 -0500
|
||||
|
||||
open5gs (2.1.0~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:15:00 -0500
|
||||
|
||||
open5gs (2.1.0~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Fri, 11 Dec 2020 14:13:40 -0500
|
||||
|
||||
open5gs (2.0.22) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:55:27 -0500
|
||||
|
||||
open5gs (2.0.22~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:54:23 -0500
|
||||
|
||||
open5gs (2.0.22~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 19 Nov 2020 07:53:15 -0500
|
||||
|
||||
open5gs (2.0.21) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:16:54 -0500
|
||||
|
||||
open5gs (2.0.21~focal) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:12:36 -0500
|
||||
|
||||
open5gs (2.0.21~bionic) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Wed, 11 Nov 2020 14:11:17 -0500
|
||||
|
||||
open5gs (2.0.20) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:05:14 -0500
|
||||
|
||||
open5gs (2.0.20~bionic3) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:04:15 -0500
|
||||
|
||||
open5gs (2.0.20~focal3) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 23:03:11 -0500
|
||||
|
||||
open5gs (2.0.19) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:49:04 -0400
|
||||
|
||||
open5gs (2.0.19~bionic3) bionic; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:47:12 -0400
|
||||
|
||||
open5gs (2.0.19~focal3) focal; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Sun, 01 Nov 2020 01:46:05 -0400
|
||||
|
||||
open5gs (2.0.18) unstable; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
14
debian/control
vendored
14
debian/control
vendored
@@ -19,6 +19,7 @@ Build-Depends: debhelper (>= 11),
|
||||
libyaml-dev,
|
||||
libmicrohttpd-dev,
|
||||
libcurl4-gnutls-dev,
|
||||
libnghttp2-dev,
|
||||
Standards-Version: 4.3.0
|
||||
Rules-Requires-Root: no
|
||||
Homepage: https://open5gs.org
|
||||
@@ -186,6 +187,18 @@ Description: UDM (Unified Data Management)
|
||||
.
|
||||
This package provides the UDM (Unified Data Managemement)
|
||||
|
||||
Package: open5gs-pcf
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
open5gs-common (= ${binary:Version})
|
||||
Description: PCF (Policy Control 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 PCF (Policy Control Function)
|
||||
|
||||
Package: open5gs-udr
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
@@ -214,6 +227,7 @@ Depends: ${misc:Depends},
|
||||
open5gs-nrf (= ${binary:Version}),
|
||||
open5gs-ausf (= ${binary:Version}),
|
||||
open5gs-udm (= ${binary:Version}),
|
||||
open5gs-pcf (= ${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-pcf.install
vendored
Normal file
3
debian/open5gs-pcf.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/bin/open5gs-pcfd
|
||||
configs/open5gs/pcf.yaml etc/open5gs
|
||||
configs/systemd/open5gs-pcfd.service lib/systemd/system
|
||||
@@ -26,4 +26,5 @@ RUN yum -y install \
|
||||
mongo-c-driver-devel \
|
||||
libmicrohttpd-devel \
|
||||
libcurl-devel \
|
||||
libnghttp2-devel \
|
||||
iproute
|
||||
|
||||
@@ -31,6 +31,7 @@ RUN dnf -y install \
|
||||
mongo-c-driver-devel \
|
||||
libmicrohttpd-devel \
|
||||
libcurl-devel \
|
||||
libnghttp2-devel \
|
||||
iproute
|
||||
|
||||
RUN dnf -y install meson
|
||||
|
||||
@@ -3,25 +3,16 @@
|
||||
docker-compose build
|
||||
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
TAG=eoan docker-compose build
|
||||
TAG=eoan docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
TAG=bionic docker-compose build
|
||||
TAG=bionic docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=fedora docker-compose build
|
||||
DIST=fedora docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=fedora TAG=29 docker-compose build
|
||||
DIST=fedora TAG=29 docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
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=centos TAG=7 docker-compose build
|
||||
DIST=centos TAG=7 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
|
||||
|
||||
DIST=debian TAG=stretch docker-compose build
|
||||
DIST=debian TAG=stretch docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
|
||||
|
||||
@@ -27,6 +27,7 @@ RUN apt-get update && \
|
||||
libyaml-dev \
|
||||
libmicrohttpd-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libnghttp2-dev \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
stretch
|
||||
@@ -21,6 +21,7 @@ RUN dnf -y install \
|
||||
mongo-c-driver-devel \
|
||||
libmicrohttpd-devel \
|
||||
libcurl-devel \
|
||||
libnghttp2-devel \
|
||||
iproute
|
||||
|
||||
RUN dnf -y install meson
|
||||
|
||||
1
docker/ubuntu/groovy
Symbolic link
1
docker/ubuntu/groovy
Symbolic link
@@ -0,0 +1 @@
|
||||
../debian/latest
|
||||
@@ -27,6 +27,7 @@ RUN apt-get update && \
|
||||
libyaml-dev \
|
||||
libmicrohttpd-dev \
|
||||
libcurl4-gnutls-dev \
|
||||
libnghttp2-dev \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Quickstart
|
||||
---
|
||||
|
||||
**Note:** Open5GS supports installation of packages in *Debian/Ubuntu and openSUSE* environments. *CentOS, Fedora, FreeBSD, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-open5gs-from-sources)
|
||||
**Note:** Open5GS supports installation of packages in *Debian/Ubuntu and openSUSE* environments. *CentOS, Fedora, and Mac OSX* require you to [build with source code]({{ site.url }}{{ site.baseurl }}/docs/guide/02-building-open5gs-from-sources)
|
||||
{: .notice--warning}
|
||||
|
||||
### Install Open5GS with a Package Manager
|
||||
@@ -48,9 +48,23 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbunt
|
||||
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/
|
||||
```
|
||||
|
||||
Nightly package build are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs).
|
||||
#### Nightly Builds
|
||||
|
||||
Nightly bulit package are provided by [Osmocom](https://osmocom.org) on [OBS](https://build.opensuse.org/package/show/network:osmocom:nightly/open5gs). On *Ubuntu 20.04* you can install it like this:
|
||||
|
||||
```
|
||||
$ sudo apt update
|
||||
$ sudo apt install wget gnupg
|
||||
$ wget -qO - https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/Release.key | sudo apt-key add -
|
||||
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.04/ ./' > /etc/apt/sources.list.d/open5gs.list"
|
||||
$ sudo apt update
|
||||
$ sudo apt install open5gs
|
||||
```
|
||||
|
||||
Other distributions can be installed by changing the path.
|
||||
|
||||
```
|
||||
https://download.opensuse.org/repositories/network:/osmocom:/nightly/Debian_10/
|
||||
@@ -58,9 +72,10 @@ 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_18.10/
|
||||
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/
|
||||
```
|
||||
|
||||
#### openSUSE
|
||||
|
||||
@@ -6,10 +6,14 @@ head_inline: "<style> .blue { color: blue; } </style>"
|
||||
This post explains how to compile and install the source code on **Debian/Ubuntu** based Linux Distribution.
|
||||
{: .blue}
|
||||
|
||||
**Note:** Ubuntu 16.04(xenial) and earlier versions, and Debian 9(stretch) and earlier versions are not supported.
|
||||
{: .notice--danger}
|
||||
|
||||
|
||||
### Getting MongoDB
|
||||
---
|
||||
|
||||
Install MongoDB with package manager. It is used as database for the HSS and PCRF.
|
||||
Install MongoDB with package manager. It is used as database for NRF/PCF/UDR and PCRF/HSS.
|
||||
|
||||
```bash
|
||||
$ sudo apt update
|
||||
@@ -40,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 libmicrohttpd-dev libcurl4-gnutls-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 meson
|
||||
```
|
||||
|
||||
Git clone.
|
||||
@@ -74,7 +78,7 @@ $ cd build
|
||||
$ meson test -v
|
||||
```
|
||||
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
{: .notice--info}
|
||||
|
||||
You need to perform the **installation process**.
|
||||
@@ -205,33 +209,10 @@ If you modify the config files while Open5GS daemons are running, please restart
|
||||
### Running Open5GS
|
||||
---
|
||||
|
||||
Specify the absolute path to the shared library as follows.
|
||||
|
||||
```bash
|
||||
$ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./install/lib/x86_64-linux-gnu/)
|
||||
/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
|
||||
$ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
|
||||
$ ldd ./install/bin/open5gs-amfd
|
||||
...
|
||||
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
|
||||
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
|
||||
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
|
||||
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
|
||||
...
|
||||
```
|
||||
|
||||
If you want to set the shared library path permanently, you can use ldconfig.
|
||||
```bash
|
||||
$ sudo sh -c "echo /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/open5gs.conf"
|
||||
$ sudo ldconfig
|
||||
```
|
||||
|
||||
Now let's get started.
|
||||
|
||||
```bash
|
||||
$ cd install/bin/
|
||||
$ ./install/bin/open5gs-mmed
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:53:47.328: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54)
|
||||
08/21 22:53:47.328: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../src/main.c:57)
|
||||
@@ -241,7 +222,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:53:47.366: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:57)
|
||||
|
||||
$ ./install/bin/open5gs-sgwcd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:54:43.059: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54)
|
||||
08/21 22:54:43.059: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../src/main.c:57)
|
||||
@@ -251,7 +232,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:54:43.066: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:60)
|
||||
|
||||
$ ./install/bin/open5gs-smfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:54:56.000: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../src/main.c:54)
|
||||
08/21 22:54:56.000: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../src/main.c:57)
|
||||
@@ -264,7 +245,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:54:56.051: [sbi] INFO: sbi_server() [127.0.0.4]:7777 (../lib/sbi/server.c:298)
|
||||
|
||||
$ ./install/bin/open5gs-amfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:55:14.015: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../src/main.c:54)
|
||||
08/21 22:55:14.015: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../src/main.c:57)
|
||||
@@ -273,7 +254,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:55:14.040: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56)
|
||||
|
||||
$ ./install/bin/open5gs-sgwud
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:54:10.357: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../src/main.c:54)
|
||||
08/21 22:54:10.357: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../src/main.c:57)
|
||||
@@ -282,7 +263,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32)
|
||||
|
||||
$ ./install/bin/open5gs-upfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:54:21.596: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../src/main.c:54)
|
||||
08/21 22:54:21.596: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../src/main.c:57)
|
||||
@@ -292,7 +273,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:54:21.601: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:32)
|
||||
|
||||
$ ./install/bin/open5gs-hssd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:57:17.450: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../src/main.c:54)
|
||||
08/21 22:57:17.450: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../src/main.c:57)
|
||||
@@ -300,7 +281,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
|
||||
|
||||
$ ./install/bin/open5gs-pcrfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:57:45.894: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../src/main.c:54)
|
||||
08/21 22:57:45.894: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../src/main.c:57)
|
||||
@@ -308,7 +289,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:57:45.997: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
|
||||
|
||||
$ ./install/bin/open5gs-nrfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:56:35.472: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../src/main.c:54)
|
||||
08/21 22:56:35.472: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../src/main.c:57)
|
||||
@@ -317,7 +298,7 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:56:35.473: [sbi] INFO: sbi_server() [::1]:7777 (../lib/sbi/server.c:298
|
||||
|
||||
$ ./install/bin/open5gs-ausfd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:55:41.899: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../src/main.c:54)
|
||||
08/21 22:55:41.899: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../src/main.c:57)
|
||||
@@ -325,15 +306,23 @@ Open5GS daemon v1.3.0-213-gd190548+
|
||||
08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298)
|
||||
|
||||
$ ./install/bin/open5gs-udmd
|
||||
Open5GS daemon v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../src/main.c:54)
|
||||
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../src/main.c:57)
|
||||
08/21 22:56:02.155: [app] INFO: UDM initialize...done (../src/udm/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-pcfd
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../src/main.c:54)
|
||||
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../src/main.c:57)
|
||||
08/21 22:56:02.155: [app] INFO: PCF initialize...done (../src/pcf/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 v1.3.0-213-gd190548+
|
||||
Open5GS daemon v2.1.0
|
||||
|
||||
08/21 22:56:15.810: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../src/main.c:54)
|
||||
08/21 22:56:15.810: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../src/main.c:57)
|
||||
@@ -366,9 +355,9 @@ $ cp open5gs* /usr/bin/
|
||||
|
||||
For convenience, you can execute all NFs at once by using the following command.
|
||||
```bash
|
||||
$ ./build/tests/app/5gc ## 5G Core Only with ./build/config/sample.yaml
|
||||
$ ./build/tests/app/epc -c ./build/config/srslte.yaml ## EPC Only with ./build/config/srslte.yaml
|
||||
$ ./build/tests/app/app ## Both 5G Core and EPC with ./build/config/sample.yaml
|
||||
$ ./build/tests/app/5gc ## 5G Core Only with ./build/configs/sample.yaml
|
||||
$ ./build/tests/app/epc -c ./build/configs/srslte.yaml ## EPC Only with ./build/configs/srslte.yaml
|
||||
$ ./build/tests/app/app ## Both 5G Core and EPC with ./build/configs/sample.yaml
|
||||
```
|
||||
|
||||
### Building the WebUI of Open5GS
|
||||
@@ -395,10 +384,17 @@ The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||
$ npm run dev
|
||||
```
|
||||
|
||||
Server listening can be changed by setting the environment variable HOSTNAME or PORT as below.
|
||||
|
||||
```bash
|
||||
$ HOSTNAME=192.168.0.11 npm run dev
|
||||
$ PORT=7777 npm run dev
|
||||
```
|
||||
|
||||
### Register Subscriber Information
|
||||
---
|
||||
|
||||
Connect to `http://localhost:3000` and login with **admin** account.
|
||||
Connect to `http://127.0.0.1:3000` and login with **admin** account.
|
||||
|
||||
> Username : admin
|
||||
> Password : 1423
|
||||
|
||||
@@ -33,7 +33,8 @@ PCRF-frDi = 127.0.0.9 :3868 for Gx auth
|
||||
NRF-sbi = 127.0.0.10:7777 for 5G SBI
|
||||
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
||||
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
||||
UDR-sbi = 127.0.0.13:7777 for 5G SBI
|
||||
PCF-sbi = 127.0.0.12:7777 for 5G SBI
|
||||
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
||||
```
|
||||
|
||||
_Cloud Userplane Server (to host IMS etc)_
|
||||
|
||||
50
docs/_docs/hardware/01-genodebs.md
Normal file
50
docs/_docs/hardware/01-genodebs.md
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: eNodeBs / gNodeBs tested on Open5GS
|
||||
head_inline: "<style> .blue { color: blue; } .bold { font-weight: bold; } </style>"
|
||||
---
|
||||
|
||||
This page lists Radio hardware that has been tested by members of the Open5GS community,
|
||||
|
||||
Listed eNodeBs have at a minimum connected to Open5GS. This does not mean all functionality (dedicated bearers, GBRs, etc) has been tested.
|
||||
|
||||
If you have tested radio hardware from a vendor not listed with Open5GS, please add it to this page [by creating a PR on GitHub.](https://github.com/open5gs/open5gs)
|
||||
|
||||
### Commercial Macro BTS
|
||||
---
|
||||
|
||||
* Huawei BTS 3900 (S/W version V100R011C10SPC230)
|
||||
|
||||
### Small Cells
|
||||
---
|
||||
|
||||
* Baicells Neutrino
|
||||
* Baicells Nova 243
|
||||
* Baicells Nova 246
|
||||
* Baicells Nova 436Q
|
||||
* Baicells Nova 227 (EBS & CBRS)
|
||||
* Baicells Nova 233
|
||||
* Airspan AirSpeed 1030
|
||||
* Airspan AirHarmony 1000
|
||||
* AirHarmony 4000
|
||||
* AirHarmony 4200
|
||||
* AirHarmony 4400
|
||||
* Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)
|
||||
* 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
|
||||
|
||||
### OpenRAN Hardware
|
||||
---
|
||||
|
||||
|
||||
### 4G/5G Software Stacks + SDRs
|
||||
---
|
||||
|
||||
* [srsLTE / srsENB](https://github.com/srsLTE/srsLTE) + LimeSDR, USRP, BladeRF x40 (BladeRF Not stable)
|
||||
* [Amarisoft](https://www.amarisoft.com/) + LimeSDR, USRP, Amarisoft PCI Express Card
|
||||
|
||||
### Misc Radio Hardware
|
||||
---
|
||||
* [OsmoBTS](https://osmocom.org/projects/osmobts/wiki) controlled ip.access NanoBTS (Used for CSFB with Osmocom)
|
||||
* [UERANSIM](https://github.com/aligungr/UERANSIM) 5G RAN Simulator
|
||||
* [OpenAirInterface v1.0.3](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/v1.0.3) 4G RAN Simulator
|
||||
|
||||
@@ -6,10 +6,85 @@ head_inline: "<style> .blue { color: blue; } </style>"
|
||||
This guide is based on **CentOS 8** Distribution.
|
||||
{: .blue}
|
||||
|
||||
### Getting MongoDB
|
||||
## Install **CentOS 8** from Vagrant box (optional)
|
||||
---
|
||||
Vagrant provides a simple way to create and deploy Virtual Machines from
|
||||
pre-built images using VirtualBox, libvirt, or VMWare as a hypervisor engine.
|
||||
This allows the user to quickly create a virtual machine without the hassle
|
||||
of installing the operating system by hand.
|
||||
|
||||
### Install Vagrant
|
||||
---
|
||||
|
||||
Create the MongoDB repository file.
|
||||
The instructions to install Vagrant are provided at
|
||||
[vagrantup.com](https://www.vagrantup.com/).
|
||||
|
||||
|
||||
### Create a CentOS 8 Virtual Machine using Vagrant
|
||||
---
|
||||
|
||||
Use the supplied `Vagrantfile` in the `vagrant` directory to create the
|
||||
virtual machine.
|
||||
|
||||
Note that this Vagrantfile is identical to the base CentOS 8 box, with
|
||||
the exception that the amount of virtual memory has been increased to 1GB:
|
||||
|
||||
```bash
|
||||
cd vagrant/centos
|
||||
vagrant up --provider virtualbox
|
||||
```
|
||||
|
||||
### Log into the newly created CentOS VM
|
||||
---
|
||||
|
||||
Use SSH to log into the CentOS 8 VM:
|
||||
|
||||
```bash
|
||||
vagrant ssh
|
||||
```
|
||||
|
||||
Note that the Open5GS source is *not* copied into the VM. The instructions
|
||||
below provide the step by step instructions for setting up Open5GS for
|
||||
either a bare metal or virtual CentOS 8 system.
|
||||
|
||||
The rest of the commands below are performed inside the CentOS VM as the
|
||||
user 'vagrant', or on your bare metal CentOS 8 system as any normal user.
|
||||
|
||||
## Install prerequisite packages to build and run Open5GS
|
||||
---
|
||||
|
||||
### Enable CentOS 8 PowerTools repository
|
||||
---
|
||||
|
||||
```bash
|
||||
$ sudo dnf install 'dnf-command(config-manager)'
|
||||
$ sudo dnf config-manager --set-enabled PowerTools
|
||||
```
|
||||
|
||||
### Enable the Extra Packages for Enterprise Linux
|
||||
---
|
||||
|
||||
Enable the Extra Packages for Enterprise Linux repo by installing the
|
||||
``epel-release`` package:
|
||||
```bash
|
||||
$ sudo dnf install epel-release
|
||||
```
|
||||
|
||||
### Enable [ELRepo](https://elrepo.org)
|
||||
---
|
||||
|
||||
Enable the ELRepo repo (with testing enabled):
|
||||
|
||||
```bash
|
||||
$ sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
|
||||
$ sudo dnf config-manager --set-enabled elrepo-testing
|
||||
```
|
||||
|
||||
### Install MongoDB using the package manager:
|
||||
---
|
||||
|
||||
Create a repository file to install the MongoDB packages:
|
||||
|
||||
```bash
|
||||
$ sudo sh -c 'cat << EOF > /etc/yum.repos.d/mongodb-org-3.4.repo
|
||||
[mongodb-org-3.4]
|
||||
@@ -21,28 +96,128 @@ gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
|
||||
EOF'
|
||||
```
|
||||
|
||||
Install MongoDB with Package Manager.
|
||||
Install MongoDB using the package manager:
|
||||
|
||||
```bash
|
||||
sudo dnf -y install mongodb-org
|
||||
$ sudo dnf -y install mongodb-org
|
||||
```
|
||||
|
||||
Run MongoDB server.
|
||||
### Install the dependencies for building the source code.
|
||||
---
|
||||
Open5GS requires several packages which are not installed by default in
|
||||
a base CentOS 8 installation.
|
||||
|
||||
|
||||
```bash
|
||||
$ mkdir -p ./data/db
|
||||
$ mongod --dbpath ./data/db
|
||||
$ 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
|
||||
```
|
||||
|
||||
### Setting up TUN device (No persistent after rebooting)
|
||||
### Install the SCTP kernel module in kernel-modules-extra.
|
||||
---
|
||||
|
||||
Create the TUN device. Interface name will be `ogstun`.
|
||||
```bash
|
||||
$ sudo yum -y install iproute
|
||||
$ sudo dnf install kernel-modules-extra
|
||||
```
|
||||
|
||||
### Install iproute IP interface tools.
|
||||
---
|
||||
|
||||
```bash
|
||||
$ sudo dnf install iproute
|
||||
```
|
||||
|
||||
### Update all installed packages to the latest versions.
|
||||
---
|
||||
|
||||
This will update all of the installed packages to the latest versions from
|
||||
all of the repos that we enabled above.
|
||||
|
||||
```bash
|
||||
$ sudo dnf update
|
||||
```
|
||||
|
||||
Note that this may update the kernel version so you may need to reboot
|
||||
after this step to ensure that you are running this new kernel version.
|
||||
This is important when you try to load the SCTP kernel module later.
|
||||
|
||||
```bash
|
||||
[vm] $ sudo reboot
|
||||
[host] $ # ssh back into the VM after it reboots...
|
||||
[host] $ vagrant ssh
|
||||
```
|
||||
|
||||
## Build Open5GS from Source
|
||||
---
|
||||
|
||||
### Git clone the Open5GS source code.
|
||||
---
|
||||
|
||||
Clone a copy of the open5GS source code from github:
|
||||
|
||||
```bash
|
||||
$ cd ~
|
||||
$ git clone https://github.com/{{ site.github_username }}/open5gs
|
||||
```
|
||||
|
||||
### Compile the Open5GS source.
|
||||
---
|
||||
|
||||
Compile the source using `meson`. Note that this sets the installation prefix
|
||||
to `~/open5gs/install`:
|
||||
|
||||
```bash
|
||||
$ cd ~/open5gs
|
||||
$ meson build --prefix=`pwd`/install
|
||||
$ ninja -C build
|
||||
```
|
||||
|
||||
## Run and Test Open5GS
|
||||
---
|
||||
|
||||
### Start MongoDB
|
||||
---
|
||||
|
||||
After installing the MongoDB server, it will be started automatically
|
||||
when the machine is rebooted. You can check the status using `systemctl`:
|
||||
|
||||
```bash
|
||||
$ sudo systemctl status mongod.service
|
||||
● mongod.service - MongoDB Database Server
|
||||
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
|
||||
Active: active (running) since Fri 2020-11-20 09:46:40 UTC; 10h ago
|
||||
Docs: https://docs.mongodb.org/manual
|
||||
Process: 779 ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=0/SUCCESS)
|
||||
Process: 775 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Process: 770 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Process: 732 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
|
||||
Main PID: 781 (mongod)
|
||||
Memory: 99.7M
|
||||
CGroup: /system.slice/mongod.service
|
||||
└─781 /usr/bin/mongod -f /etc/mongod.conf
|
||||
```
|
||||
|
||||
If it has not started, then it can be started using `systemctl`:
|
||||
|
||||
```bash
|
||||
$ sudo systemctl enable mongod.service
|
||||
$ sudo systemctl start mongod.service
|
||||
```
|
||||
|
||||
The default database location is `/var/log/mongodb/mongod.log`. This can
|
||||
be adjusted in `/etc/mongod.conf`.
|
||||
|
||||
### Set up a TUN interface
|
||||
---
|
||||
|
||||
Create a TUN/TAP interface. The interface name will be `ogstun`.
|
||||
```bash
|
||||
$ sudo ip tuntap add name ogstun mode tun
|
||||
$ ip link show
|
||||
```
|
||||
|
||||
Then, to support IPv6-enabled UEs, you must configure your TUN device to support IPv6.
|
||||
To support IPv6-enabled UEs, you must configure the `ogstun` interface
|
||||
to support IPv6. This is done by setting the `diable_ipv6` option for
|
||||
`ogstun` to 0 (false):
|
||||
|
||||
```bash
|
||||
$ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
|
||||
@@ -54,10 +229,10 @@ $ sysctl -n net.ipv6.conf.ogstun.disable_ipv6
|
||||
0
|
||||
```
|
||||
|
||||
**Note:** If your TUN device already supports IPv6, you can skip this steps above.
|
||||
{: .notice--warning}
|
||||
**Note:** If your TUN interface already supports IPv6, you can skip this steps above.
|
||||
{: .notice--info}
|
||||
|
||||
You are now ready to set the IP address on TUN device.
|
||||
Set the IP address on the `ogstun` TUN interface.
|
||||
|
||||
```bash
|
||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
@@ -70,92 +245,102 @@ $ sudo ip link set ogstun up
|
||||
$ ip link show
|
||||
```
|
||||
|
||||
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||
**Notice:** This configuration is not persistent after rebooting. The
|
||||
script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{
|
||||
site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy
|
||||
to configure the TUN device as follows:
|
||||
`$ sudo ./misc/netconf.sh`
|
||||
{: .notice--info}
|
||||
|
||||
### Building Open5GS
|
||||
### Install the SCTP kernel module
|
||||
---
|
||||
Open5GS requires the Linux SCTP kernel module to be loaded in the kernel.
|
||||
In the CentOS 8 Vagrant box SCTP is not loaded into the kernel automatically
|
||||
so must be installed as follows:
|
||||
|
||||
```bash
|
||||
$ sudo modprobe sctp
|
||||
$ # Check that SCTP was loaded successfully:
|
||||
$ sudo dmesg | grep sctp
|
||||
[ 639.971360] sctp: Hash tables configured (bind 256/256)
|
||||
```
|
||||
|
||||
## Testing Open5GS
|
||||
---
|
||||
|
||||
Configure EPEL package.
|
||||
### Run Individual Open5GS tests.
|
||||
----
|
||||
Open5GS test applications are created in the `~/open5gs/build/tests` directory.
|
||||
|
||||
```bash
|
||||
$ sudo dnf install epel-release
|
||||
```
|
||||
$ cd ~/open5gs
|
||||
|
||||
Enable PowerTools.
|
||||
```bash
|
||||
$ sudo dnf install 'dnf-command(config-manager)'
|
||||
$ sudo dnf config-manager --set-enabled PowerTools
|
||||
$ sudo update
|
||||
```
|
||||
|
||||
Configure ELRepo(with testing) package.
|
||||
```bash
|
||||
$ sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
|
||||
$ sudo dnf config-manager --set-enabled elrepo-testing
|
||||
$ sudo dnf update
|
||||
```
|
||||
|
||||
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 iproute
|
||||
```
|
||||
|
||||
Install Meson
|
||||
```bash
|
||||
$ sudo dnf install meson
|
||||
```
|
||||
|
||||
Git clone.
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/{{ site.github_username }}/open5gs
|
||||
```
|
||||
|
||||
To compile with meson:
|
||||
|
||||
```bash
|
||||
$ cd open5gs
|
||||
$ meson build --prefix=`pwd`/install
|
||||
$ ninja -C build
|
||||
```
|
||||
|
||||
Check whether the compilation is correct.
|
||||
```bash
|
||||
$ ./build/tests/attach/attach ## EPC Only
|
||||
s1setup-test : SUCCESS
|
||||
guti-test : SUCCESS
|
||||
auth-test : SUCCESS
|
||||
idle-test : SUCCESS
|
||||
emm-status-test : SUCCESS
|
||||
ue-context-test : SUCCESS
|
||||
reset-test : SUCCESS
|
||||
All tests passed.
|
||||
|
||||
$ ./build/tests/registration/registration ## 5G Core Only
|
||||
guti-test : SUCCESS
|
||||
auth-test : SUCCESS
|
||||
idle-test : SUCCESS
|
||||
dereg-test : SUCCESS
|
||||
identity-test : SUCCESS
|
||||
gmm-status-test : SUCCESS
|
||||
ue-context-test : SUCCESS
|
||||
All tests passed.
|
||||
|
||||
```
|
||||
|
||||
Run all test programs as below.
|
||||
### Run all Open5GS tests.
|
||||
----
|
||||
|
||||
Run all Open5GS test programs:
|
||||
```bash
|
||||
$ cd ~/open5gs
|
||||
$ cd build
|
||||
$ meson test -v
|
||||
```
|
||||
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
**Tip:** You can also check the result of `meson test -v` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
{: .notice--info}
|
||||
|
||||
You need to perform the **installation process**.
|
||||
|
||||
### Installing Open5GS.
|
||||
----
|
||||
|
||||
Open5GS can be installed using meson as well. This will install the
|
||||
product to `$(HOME)/open5gs/install` if the `prefix` was set as shown above.
|
||||
|
||||
```bash
|
||||
$ cd ~/open5gs
|
||||
$ cd build
|
||||
$ ninja install
|
||||
$ 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
|
||||
```
|
||||
|
||||
### Building WebUI of Open5GS
|
||||
## Building WebUI of Open5GS
|
||||
---
|
||||
|
||||
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
|
||||
|
||||
Install Node.js:
|
||||
```bash
|
||||
$ curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
|
||||
$ sudo yum -y install nodejs
|
||||
$ sudo dnf install nodejs
|
||||
```
|
||||
|
||||
Install the dependencies to run WebUI
|
||||
|
||||
```bash
|
||||
$ cd ~/open5gs
|
||||
$ cd webui
|
||||
$ npm install
|
||||
```
|
||||
|
||||
@@ -3,9 +3,12 @@ title: Fedora
|
||||
head_inline: "<style> .blue { color: blue; } </style>"
|
||||
---
|
||||
|
||||
This guide is based on **Fedora 31** Distribution.
|
||||
This guide is based on **Fedora 33** Distribution.
|
||||
{: .blue}
|
||||
|
||||
**Note:** Fedora 33 is not working
|
||||
{: .notice--danger}
|
||||
|
||||
### Getting MongoDB
|
||||
---
|
||||
|
||||
@@ -67,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 iproute
|
||||
$ 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
|
||||
```
|
||||
|
||||
Install Meson
|
||||
@@ -101,7 +104,7 @@ $ cd build
|
||||
$ meson test -v
|
||||
```
|
||||
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
{: .notice--info}
|
||||
|
||||
You need to perform the **installation process**.
|
||||
|
||||
@@ -97,7 +97,7 @@ $ cd build
|
||||
$ sudo meson test -v
|
||||
```
|
||||
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
{: .notice--info}
|
||||
|
||||
You need to perform the **installation process**.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Mac OS X
|
||||
head_inline: "<style> .blue { color: blue; } </style>"
|
||||
---
|
||||
|
||||
This guide is based on **macOS Catalina 10.15**.
|
||||
This guide is based on **macOS Big Sur 11.0.1**.
|
||||
{: .blue}
|
||||
|
||||
### Installing Homebrew
|
||||
@@ -72,7 +72,13 @@ $ 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 curl pkg-config
|
||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config
|
||||
```
|
||||
|
||||
Install Bison and Create soft link.
|
||||
```bash
|
||||
$ brew install bison
|
||||
$ export PATH="/usr/local/opt/bison/bin:$PATH"
|
||||
```
|
||||
|
||||
Install Meson using Homebrew.
|
||||
@@ -114,7 +120,7 @@ $ cd build
|
||||
$ sudo meson test -v
|
||||
```
|
||||
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
**Tip:** You can also check the result of `ninja -C build test` with a tool that captures packets. If you are running `wireshark`, select the `loopback` interface and set FILTER to `s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers`. You can see the virtually created packets. [testattach.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testattach.pcapng)/[testregistration.pcapng]({{ site.url }}{{ site.baseurl }}/assets/pcapng/testregistration.pcapng)
|
||||
{: .notice--info}
|
||||
|
||||
You need to perform the **installation process**.
|
||||
|
||||
@@ -23,10 +23,11 @@ open5gs 27366 0.0 0.0 2890772 14380 ? Ssl 12:13 0:00 /usr/bin/open5g
|
||||
open5gs 27485 0.0 0.0 243816 15064 ? Ssl 12:13 0:00 /usr/bin/open5gs-nrfd -c /etc/open5gs/nrf.yaml
|
||||
open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5gs-ausfd -c /etc/open5gs/ausf.yaml
|
||||
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 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 & 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 & UDR are all running.
|
||||
|
||||
If your instance doesn't show this make sure you're started each service:
|
||||
```bash
|
||||
@@ -41,6 +42,7 @@ $ systemctl start open5gs-pcrfd.service
|
||||
$ systemctl start open5gs-nrfd.service
|
||||
$ systemctl start open5gs-ausfd.service
|
||||
$ systemctl start open5gs-udmd.service
|
||||
$ systemctl start open5gs-pcfd.service
|
||||
$ systemctl start open5gs-udrd.service
|
||||
```
|
||||
|
||||
|
||||
@@ -3,6 +3,115 @@ title: Now in the Github Issue
|
||||
head_inline: "<style> .blue { color: blue; } </style>"
|
||||
---
|
||||
|
||||
#### Cannot open shared object file when running daemon
|
||||
|
||||
An error occurred when running as follows.
|
||||
|
||||
```
|
||||
$ ./install/bin/open5gs-nrfd
|
||||
./install/bin/open5gs-nrfd: error while loading shared libraries: libogscrypt.so.2: cannot open shared object file: No such file or directory
|
||||
```
|
||||
|
||||
You need to specify the absolute path to the shared library as follows.
|
||||
|
||||
```bash
|
||||
$ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./install/lib/x86_64-linux-gnu/)
|
||||
/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
|
||||
$ export LD_LIBRARY_PATH=/home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu
|
||||
$ ldd ./install/bin/open5gs-amfd
|
||||
...
|
||||
libogsapp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogsapp.so.1 (0x00007f161ab51000)
|
||||
libogscore.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogscore.so.1 (0x00007f161a922000)
|
||||
libogssctp.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogssctp.so.1 (0x00007f161a71d000)
|
||||
libogss1ap.so.1 => /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu/libogss1ap.so.1 (0x00007f161a519000)
|
||||
...
|
||||
```
|
||||
|
||||
If you want to set the shared library path permanently, you can use ldconfig.
|
||||
```bash
|
||||
$ sudo sh -c "echo /home/acetcom/Documents/git/open5gs/install/lib/x86_64-linux-gnu > /etc/ld.so.conf.d/open5gs.conf"
|
||||
$ sudo ldconfig
|
||||
```
|
||||
|
||||
#### Can I disable specific services if 5G functionally is not needed?
|
||||
|
||||
|
||||
From v2.0.x, SGW was divided into SGW-C and SGW-U, and PGW function was seperated into SMF and UPF.
|
||||
|
||||
In order to use 4G only, you need to run the process below.
|
||||
```bash
|
||||
$ open5gs-mmed
|
||||
$ open5gs-sgwcd
|
||||
$ open5gs-smfd
|
||||
$ open5gs-sgwud
|
||||
$ open5gs-upfd
|
||||
$ open5gs-hssd
|
||||
$ open5gs-pcrfd
|
||||
```
|
||||
|
||||
And the process below is only used in 5G, so there is no need to run it.
|
||||
|
||||
```bash
|
||||
$ open5gs-nrfd
|
||||
$ open5gs-amfd
|
||||
$ open5gs-ausfd
|
||||
$ open5gs-udmd
|
||||
$ open5gs-pcfd
|
||||
$ open5gs-udrd
|
||||
```
|
||||
|
||||
However, among these, SMF and UPF are used by both 4G EPC and 5G Core. And SMF has a protocol stack to interact with 5G NRF. Therefore, if you run SMF without running 5G NRF, the following WARNING occurs in SMF.
|
||||
|
||||
```
|
||||
10/08 14:44:03.045: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:450)
|
||||
10/08 14:44:03.045: [smf] INFO: PFCP associated (../src/smf/pfcp-sm.c:174)
|
||||
10/08 14:44:03.046: [diam] INFO: CONNECTED TO 'pcrf.localdomain' (SCTP,soc#16): (../lib/diameter/common/logger.c:108)
|
||||
10/08 14:44:06.046: [smf] WARNING: [3c85dd06-0996-41eb-a985-476fa905aefc] Retry to registration with NRF (../src/smf/nf-sm.c:161)
|
||||
10/08 14:44:06.047: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:450)
|
||||
```
|
||||
|
||||
To prevent SMF from attempting to access the 5G NRF, you need to modify the SMF configuration file as below.
|
||||
|
||||
```diff
|
||||
$ diff -u ./install/etc/open5gs/smf.yaml.old ./install/etc/open5gs/smf.yaml
|
||||
--- ./install/etc/open5gs/smf.yaml.old 2020-10-08 14:43:20.599734045 -0400
|
||||
+++ ./install/etc/open5gs/smf.yaml 2020-10-08 14:44:21.864952687 -0400
|
||||
@@ -168,9 +168,9 @@
|
||||
# - ::1
|
||||
#
|
||||
smf:
|
||||
- sbi:
|
||||
- - addr: 127.0.0.4
|
||||
- port: 7777
|
||||
+# sbi:
|
||||
+# - addr: 127.0.0.4
|
||||
+# port: 7777
|
||||
gtpc:
|
||||
- addr: 127.0.0.4
|
||||
- addr: ::1
|
||||
@@ -214,12 +214,12 @@
|
||||
# - 127.0.0.10
|
||||
# - fe80::1%lo
|
||||
#
|
||||
-nrf:
|
||||
- sbi:
|
||||
- - addr:
|
||||
- - 127.0.0.10
|
||||
- - ::1
|
||||
- port: 7777
|
||||
+#nrf:
|
||||
+# sbi:
|
||||
+# - addr:
|
||||
+# - 127.0.0.10
|
||||
+# - ::1
|
||||
+# port: 7777
|
||||
|
||||
#
|
||||
# upf:
|
||||
```
|
||||
|
||||
If you set as above and run SMF, you do not need to run NRF. Seven daemons operate in 4G only state.
|
||||
|
||||
#### How to change UE IP Pool
|
||||
|
||||
The Open5GS package contains a systemd-networkd configuration file for `ogstun`. Therefore, you must first modify the configuration file as follows.
|
||||
@@ -146,6 +255,7 @@ $ sudo pkill -9 open5gs-pcrfd
|
||||
$ sudo pkill -9 open5gs-nrfd
|
||||
$ sudo pkill -9 open5gs-ausfd
|
||||
$ sudo pkill -9 open5gs-udmd
|
||||
$ sudo pkill -9 open5gs-pcfd
|
||||
$ sudo pkill -9 open5gs-udrd
|
||||
```
|
||||
|
||||
@@ -352,9 +462,9 @@ $ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
#### How to use a different APN for each SMF
|
||||
#### How to use a different DNN/APN for each SMF
|
||||
|
||||
By default, MME selects the SMF as the first SMF node. To use a different APN for each SMF, specify gtpc.apn as the APN name. If the HSS uses WebUI to set the SMF IP for each UE, you can use a specific SMF node for each UE.
|
||||
By default, MME selects the SMF as the first SMF node. To use a different DNN/APN for each SMF, specify gtpc.dnn as the DNN/APN name. If the HSS uses WebUI to set the SMF IP for each UE, you can use a specific SMF node for each UE.
|
||||
|
||||
See the following example.
|
||||
|
||||
@@ -366,40 +476,41 @@ See the following example.
|
||||
# <GTP-C Client>
|
||||
#
|
||||
# o By default, the SMF uses the first SMF node.
|
||||
# - To use a different APN for each SMF, specify gtpc.apn as the APN name.
|
||||
# - To use a different DNN/APN for each SMF, specify gtpc.dnn
|
||||
# as the DNN/APN name.
|
||||
# - If the HSS uses WebUI to set the SMF IP for each UE,
|
||||
# you can use a specific SMF node for each UE.
|
||||
#
|
||||
# o Two SMF are defined. 127.0.0.4:2123 is used.
|
||||
# [fe80::3%@loopback_devname@]:2123 is ignored.
|
||||
# [fe80::3%lo]:2123 is ignored.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.4
|
||||
# - addr: fe80::3%@loopback_devname@
|
||||
# - addr: fe80::3%lo
|
||||
#
|
||||
# o One SMF is defined. if prefer_ipv4 is not true,
|
||||
# [fe80::3%@loopback_devname@] is selected.
|
||||
# [fe80::3%lo] is selected.
|
||||
# gtpc:
|
||||
# - addr:
|
||||
# - 127.0.0.4
|
||||
# - fe80::3%@loopback_devname@
|
||||
# - fe80::3%lo
|
||||
#
|
||||
# o Two SMF are defined with a different APN.
|
||||
# o Two SMF are defined with a different DNN/APN.
|
||||
# - Note that if SMF IP for UE is configured in HSS,
|
||||
# the following configurion for this UE is ignored.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.4
|
||||
# apn: internet
|
||||
# dnn: internet
|
||||
# - addr: 127.0.0.5
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
#
|
||||
# o If APN is omitted, the default APN uses the first SMF node.
|
||||
# o If DNN/APN is omitted, the default DNN/APN uses the first SMF node.
|
||||
# gtpc:
|
||||
# - addr: 127.0.0.4
|
||||
# - addr: 127.0.0.5
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
```
|
||||
|
||||
The IP address of the UE can also use a different UE pool depending on the APN.
|
||||
The IP address of the UE can also use a different UE pool depending on the DNN/APN.
|
||||
|
||||
```
|
||||
### For reference, see `smf.yaml`
|
||||
@@ -420,8 +531,8 @@ The IP address of the UE can also use a different UE pool depending on the APN.
|
||||
# - addr: cafe:1::1/64
|
||||
#
|
||||
#
|
||||
# o Specific APN(e.g 'volte') uses 10.46.0.1/16, cafe:2::1/64
|
||||
# All other APNs use 10.45.0.1/16, cafe:1::1/64
|
||||
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, cafe:2::1/64
|
||||
# All other DNNs/APNs use 10.45.0.1/16, cafe:1::1/64
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
||||
@@ -431,9 +542,9 @@ The IP address of the UE can also use a different UE pool depending on the APN.
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: cafe:1::1/64
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
#
|
||||
# o Multiple Devices (default: ogstun)
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
@@ -446,10 +557,10 @@ The IP address of the UE can also use a different UE pool depending on the APN.
|
||||
# - addr: cafe:1::1/64
|
||||
# dev: ogstun2
|
||||
# - addr: 10.46.0.1/16
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
# dev: ogstun3
|
||||
# - addr: cafe:2::1/64
|
||||
# apn: volte
|
||||
# dnn: volte
|
||||
# dev: ogstun3
|
||||
#
|
||||
# o Pool Range Sample
|
||||
@@ -612,7 +723,8 @@ Currently, the number of UE is limited to `128*128`.
|
||||
* NRF : 127.0.0.10
|
||||
* AUSF : 127.0.0.11
|
||||
* UDM : 127.0.0.12
|
||||
* UDR : 127.0.0.13
|
||||
* PCF : 127.0.0.13
|
||||
* UDR : 127.0.0.20
|
||||
```
|
||||
|
||||
- AMF_ID, TAC and S_NSSAI
|
||||
|
||||
@@ -12,8 +12,14 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
|
||||
- Tutorials
|
||||
- [Your First LTE](tutorial/01-your-first-lte)
|
||||
- [EPC Advanced Example with OpenAirInterface UE/RAN](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
|
||||
- [VoLTE Setup with Kamailio IMS and Open5GS](tutorial/02-VoLTE-setup)
|
||||
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
|
||||
- [My first 5G Core : Open5GS and UERANSIM](http://nickvsnetworking.com/my-first-5g-core-open5gs-and-ueransim/)
|
||||
- [5GC Advanced Example with UERANSIM](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
|
||||
- [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/)
|
||||
- [Kubernetes Open5GS Deployment](https://dev.to/infinitydon/virtual-4g-simulation-using-kubernetes-and-gns3-3b7k?fbclid=IwAR1p99h13a-mCfejanbBQe0H0-jp5grXkn5mWf1WrTHf47UtegB2-UHGGZQ)
|
||||
|
||||
- Troubleshooting
|
||||
@@ -24,5 +30,8 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
- [Debian/Ubuntu](platform/01-debian-ubuntu)
|
||||
- [CentOS](platform/02-centos)
|
||||
- [Fedora](platform/03-fedora)
|
||||
- [FreeBSD](platform/04-freebsd)
|
||||
- [MacOSX](platform/05-macosx)
|
||||
|
||||
- Hardware Specific Notes
|
||||
- [Tested e/gNodeBs](hardware/01-genodebs)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "v2.0.17 - 100+ UEs tested"
|
||||
date: 2020-10-08 23:12:00 -0400
|
||||
title: "v2.0.18 - 250+ UEs tested"
|
||||
date: 2020-10-09 07:53:00 -0400
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
@@ -28,5 +28,5 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
- Fix PDN connectivity request in PDN DISCONNECT ESM-state([#486](https://github.com/open5gs/open5gs/issues/486)) -- [yc541](https://github.com/yc541)
|
||||
- Fix SEMANTIC ERROR in PACKET FILTER ([#338](https://github.com/open5gs/open5gs/issues/338)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
|
||||
Download -- [v2.0.17.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.17.tar.gz)
|
||||
Download -- [v2.0.18.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.18.tar.gz)
|
||||
{: .notice--info}
|
||||
40
docs/_posts/2020-11-19-release-v2.0.22.md
Normal file
40
docs/_posts/2020-11-19-release-v2.0.22.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: "v2.0.22 - 4G EPC More Stabilization"
|
||||
date: 2020-11-19 09:35:00 -0500
|
||||
categories:
|
||||
- Release
|
||||
tags:
|
||||
- News
|
||||
- Release
|
||||
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||
---
|
||||
|
||||
#### Enhancement
|
||||
- Add information of the used APN in the SMF log file ([#674](https://github.com/open5gs/open5gs/pull/674)) -- [medeiros405](https://github.com/medeiros405)
|
||||
- Use buffering method when sending packet through stream socket ([6f11a780](https://github.com/open5gs/open5gs/commit/6f11a780792ff0d695d9f735c84e5bff3ee1804b))
|
||||
- Support VoLTE service in IDLE state ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||
- F-TEID Allocation and Release by the UP function ([a470131](https://github.com/open5gs/open5gs/commit/a470131489231bff384d54561f66b937328d2e2d))
|
||||
- Network Restorations from GTP-U Error Indication ([1bed0d5](https://github.com/open5gs/open5gs/commit/1bed0d587275ad105c5fe6f0d9ca4ef1508a74e0))
|
||||
- Work around SCTP_EVENTS broken - copy blindly from Osmocom's libosmo-netif ([f137d194](https://github.com/open5gs/open5gs/commit/f137d1947f0afaaf0a3ec37b35ff1ce99c757ded))
|
||||
|
||||
#### Re-adding feature
|
||||
- Support OAI UE/RAN ([#651](https://github.com/open5gs/open5gs/issues/651), [#584](https://github.com/open5gs/open5gs/issues/584)) -- [asoltanian1979](https://github.com/asoltanian1979), [s5uishida](https://github.com/s5uishida)
|
||||
- Provide SGW GTP(S1) address to be advertised inside S1AP messages ([#367](https://github.com/open5gs/open5gs/pull/367)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||
|
||||
#### Bug Fixes
|
||||
- Resolves an issues with DL data traffic not working in v2.0.20 and v2.0.21 ([#672](https://github.com/open5gs/open5gs/issues/672)) -- [CarlosYLee](https://github.com/CarlosYLee)
|
||||
- Fix the select/kqueue bug in Win32/MacOSX [23e8e657](https://github.com/open5gs/open5gs/commit/23e8e6577c3bc4f785e797084b66fef707bfa450)
|
||||
- Fix the possible vulnerabilities [830587a2](https://github.com/open5gs/open5gs/commit/830587a250fb22f01327a14812d778d2a51bc5b9)
|
||||
- Fix MME crash if SGs interface is DOWN ([#448](https://github.com/open5gs/open5gs/issues/448), [#628](https://github.com/open5gs/open5gs/issues/628)) -- [nickvsnetworking](https://github.com/nickvsnetworking), [kbarlee](https://github.com/kbarlee)
|
||||
- Add `rpath` to required shared library ([#535](https://github.com/open5gs/open5gs/issues/535), [#595](https://github.com/open5gs/open5gs/issues/595)) -- [kuanghanqian](https://github.com/kuanghanqian), [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||
- Change not to remove UE context when receiving Extended Service Request without MSC/VLC ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||
- Case-insensitive APN/DNN check ([#617](https://github.com/open5gs/open5gs/issues/617)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||
- Fix the bug for Update-Type in Tracking area update accept ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [cecrevier](https://github.com/cecrevier)
|
||||
- Only Send PDN connectivity reject if APN is mismatch ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [cecrevier](https://github.com/cecrevier)
|
||||
- Fix the bug for S1-reset or eNB restart ([#627](https://github.com/open5gs/open5gs/issues/627)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||
- Fix MME crash when VoLTE is enabled ([#619](https://github.com/open5gs/open5gs/issues/619)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||
- Fix the DIAMETER_MISSING_AVP on Rx ([#610](https://github.com/open5gs/open5gs/issues/610)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||
- Make WebUI listen on 0.0.0.0:3000 ([#587](https://github.com/open5gs/open5gs/pull/587)) -- [bjoern-r](https://github.com/bjoern-r)
|
||||
|
||||
Download -- [v2.0.22.tar.gz](https://github.com/open5gs/open5gs/archive/v2.0.22.tar.gz)
|
||||
{: .notice--info}
|
||||
@@ -75,6 +75,9 @@ void udm_terminate(void);
|
||||
int ausf_initialize(void);
|
||||
void ausf_terminate(void);
|
||||
|
||||
int pcf_initialize(void);
|
||||
void pcf_terminate(void);
|
||||
|
||||
int upf_initialize(void);
|
||||
void upf_terminate(void);
|
||||
|
||||
|
||||
@@ -193,8 +193,15 @@ static void app_context_prepare(void)
|
||||
/* 86400 seconds = 1 day */
|
||||
self.time.subscription.validity_duration = 86400;
|
||||
|
||||
/* Message Wait Duration : 2 seconds */
|
||||
self.time.message.duration = ogs_time_from_sec(2);
|
||||
/*
|
||||
* Message Wait Duration : 10 seconds (Default)
|
||||
*
|
||||
* The paging retry timer is 2 seconds and the retry count is 3.
|
||||
*
|
||||
* It is recomended to set at least 9 seconds to reflect
|
||||
* the paging failure result to GTPv2-C or HTTP2(SBI).
|
||||
*/
|
||||
self.time.message.duration = ogs_time_from_sec(10);
|
||||
|
||||
regenerate_all_timer_duration();
|
||||
}
|
||||
@@ -296,6 +303,9 @@ int ogs_app_context_parse_config(void)
|
||||
} else if (!strcmp(parameter_key, "no_udm")) {
|
||||
self.parameter.no_udm =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else if (!strcmp(parameter_key, "no_pcf")) {
|
||||
self.parameter.no_pcf =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else if (!strcmp(parameter_key, "no_udr")) {
|
||||
self.parameter.no_udr =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
@@ -314,6 +324,9 @@ int ogs_app_context_parse_config(void)
|
||||
} else if (!strcmp(parameter_key, "no_slaac")) {
|
||||
self.parameter.no_slaac =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else if (!strcmp(parameter_key, "use_openair")) {
|
||||
self.parameter.use_openair =
|
||||
ogs_yaml_iter_bool(¶meter_iter);
|
||||
} else
|
||||
ogs_warn("unknown key `%s`", parameter_key);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ogs_app_context_s {
|
||||
const char *version;
|
||||
|
||||
const char *file;
|
||||
void *document;
|
||||
|
||||
@@ -60,6 +62,7 @@ typedef struct ogs_app_context_s {
|
||||
int no_upf;
|
||||
int no_ausf;
|
||||
int no_udm;
|
||||
int no_pcf;
|
||||
int no_udr;
|
||||
int no_nrf;
|
||||
|
||||
@@ -69,6 +72,8 @@ typedef struct ogs_app_context_s {
|
||||
int prefer_ipv4;
|
||||
int multicast;
|
||||
int no_slaac;
|
||||
|
||||
int use_openair;
|
||||
} parameter;
|
||||
|
||||
ogs_sockopt_t sockopt;
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
|
||||
int __ogs_app_domain;
|
||||
|
||||
int ogs_app_initialize(const char *default_config, const char *const argv[])
|
||||
int ogs_app_initialize(
|
||||
const char *version, const char *default_config,
|
||||
const char *const argv[])
|
||||
{
|
||||
int rv, opt;
|
||||
ogs_getopt_t options;
|
||||
@@ -39,6 +41,7 @@ int ogs_app_initialize(const char *default_config, const char *const argv[])
|
||||
ogs_app_setup_log();
|
||||
|
||||
ogs_app_context_init();
|
||||
ogs_app()->version = version;
|
||||
|
||||
/**************************************************************************
|
||||
* Stage 1 : Command Line Options
|
||||
@@ -117,7 +120,27 @@ int ogs_app_initialize(const char *default_config, const char *const argv[])
|
||||
ogs_app()->db_uri = ogs_env_get("DB_URI");
|
||||
|
||||
/**************************************************************************
|
||||
* Stage 6 : Queue, Timer and Poll
|
||||
* Stage 6 : Print Banner
|
||||
*/
|
||||
if (ogs_app()->version) {
|
||||
ogs_log_print(OGS_LOG_INFO,
|
||||
"Open5GS daemon %s\n\n", ogs_app()->version);
|
||||
|
||||
ogs_info("Configuration: '%s'", ogs_app()->file);
|
||||
|
||||
if (ogs_app()->logger.file) {
|
||||
ogs_info("File Logging: '%s'", ogs_app()->logger.file);
|
||||
|
||||
if (ogs_app()->logger.level)
|
||||
ogs_info("LOG-LEVEL: '%s'", ogs_app()->logger.level);
|
||||
|
||||
if (ogs_app()->logger.domain)
|
||||
ogs_info("LOG-DOMAIN: '%s'", ogs_app()->logger.domain);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Stage 7 : Queue, Timer and Poll
|
||||
*/
|
||||
ogs_app()->queue = ogs_queue_create(ogs_app()->pool.event);
|
||||
ogs_assert(ogs_app()->queue);
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
int ogs_app_initialize(const char *default_config, const char *const argv[]);
|
||||
int ogs_app_initialize(
|
||||
const char *version, const char *default_config,
|
||||
const char *const argv[]);
|
||||
void ogs_app_terminate(void);
|
||||
|
||||
int ogs_app_config_read(void);
|
||||
|
||||
@@ -57,7 +57,8 @@ extern "C" {
|
||||
|
||||
#define OGS_MAX_NUM_OF_CELL_ID 16
|
||||
#define OGS_MAX_NUM_OF_ENB_ID 16
|
||||
#define OGS_MAX_NUM_OF_APN 16
|
||||
#define OGS_MAX_NUM_OF_DNN 16
|
||||
#define OGS_MAX_NUM_OF_APN OGS_MAX_NUM_OF_DNN
|
||||
#define OGS_MAX_NUM_OF_HOSTNAME 16
|
||||
#define OGS_MAX_DNN_LEN 100
|
||||
#define OGS_MAX_APN_LEN OGS_MAX_DNN_LEN
|
||||
|
||||
@@ -36,6 +36,7 @@ typedef DWORD ogs_err_t;
|
||||
#define OGS_EACCES ERROR_ACCESS_DENIED
|
||||
#define OGS_EEXIST ERROR_ALREADY_EXISTS
|
||||
#define OGS_EEXIST_FILE ERROR_FILE_EXISTS
|
||||
#define OGS_ECONNRESET WSAECONNRESET
|
||||
#define OGS_ETIMEDOUT WSAETIMEDOUT
|
||||
#define OGS_ECONNREFUSED WSAECONNREFUSED
|
||||
#define OGS_EBADF WSAEBADF
|
||||
@@ -54,6 +55,7 @@ typedef int ogs_err_t;
|
||||
#define OGS_EACCES EACCES
|
||||
#define OGS_EEXIST EEXIST
|
||||
#define OGS_EEXIST_FILE EEXIST
|
||||
#define OGS_ECONNRESET ECONNRESET
|
||||
#define OGS_ETIMEDOUT ETIMEDOUT
|
||||
#define OGS_ECONNREFUSED ECONNREFUSED
|
||||
#define OGS_EBADF EBADF
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
* The code is stolen from optparse
|
||||
* https://github.com/skeeto/optparse
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
* distribute this software, either in source code form or as a compiled
|
||||
* binary, for any purpose, commercial or non-commercial, and by any
|
||||
* means.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* In jurisdictions that recognize copyright laws, the author or authors
|
||||
* of this software dedicate any and all copyright interest in the
|
||||
* software to the public domain. We make this dedication for the benefit
|
||||
* of the public at large and to the detriment of our heirs and
|
||||
* successors. We intend this dedication to be an overt act of
|
||||
* relinquishment in perpetuity of all present and future rights to this
|
||||
* software under copyright law.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* For more information, please refer to <http://unlicense.org/>
|
||||
*/
|
||||
|
||||
#include "ogs-getopt.h"
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
* The code is stolen from optparse
|
||||
* https://github.com/skeeto/optparse
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
* distribute this software, either in source code form or as a compiled
|
||||
* binary, for any purpose, commercial or non-commercial, and by any
|
||||
* means.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* In jurisdictions that recognize copyright laws, the author or authors
|
||||
* of this software dedicate any and all copyright interest in the
|
||||
* software to the public domain. We make this dedication for the benefit
|
||||
* of the public at large and to the detriment of our heirs and
|
||||
* successors. We intend this dedication to be an overt act of
|
||||
* relinquishment in perpetuity of all present and future rights to this
|
||||
* software under copyright law.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* For more information, please refer to <http://unlicense.org/>
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
@@ -24,11 +37,6 @@
|
||||
#ifndef OGS_GETOPT_H
|
||||
#define OGS_GETOPT_H
|
||||
|
||||
/*
|
||||
* The following code is stolen from optparse
|
||||
* https://github.com/skeeto/optparse
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -137,6 +137,7 @@ static int kqueue_add(ogs_poll_t *poll)
|
||||
return kqueue_set(poll, filter, EV_ADD|EV_ENABLE);
|
||||
}
|
||||
|
||||
#if 0 /* ogs_pollset_remove() is not working, SHOULD remove the below code */
|
||||
static int kqueue_remove(ogs_poll_t *poll)
|
||||
{
|
||||
ogs_pollset_t *pollset = NULL;
|
||||
@@ -165,6 +166,22 @@ static int kqueue_remove(ogs_poll_t *poll)
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
#else /* New approach : ogs_pollset_remove() is properly working. */
|
||||
|
||||
static int kqueue_remove(ogs_poll_t *poll)
|
||||
{
|
||||
int filter = 0;
|
||||
|
||||
if (poll->when & OGS_POLLIN) {
|
||||
filter = EVFILT_READ;
|
||||
}
|
||||
if (poll->when & OGS_POLLOUT) {
|
||||
filter = EVFILT_WRITE;
|
||||
}
|
||||
|
||||
return kqueue_set(poll, filter, EV_DELETE);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int kqueue_process(ogs_pollset_t *pollset, ogs_time_t timeout)
|
||||
{
|
||||
@@ -187,6 +204,9 @@ static int kqueue_process(ogs_pollset_t *pollset, ogs_time_t timeout)
|
||||
n = kevent(context->kqueue,
|
||||
context->change_list, context->nchanges,
|
||||
context->event_list, context->nevents, tp);
|
||||
|
||||
context->nchanges = 0;
|
||||
|
||||
if (n < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "kqueue failed");
|
||||
return OGS_ERROR;
|
||||
@@ -199,7 +219,70 @@ static int kqueue_process(ogs_pollset_t *pollset, ogs_time_t timeout)
|
||||
short when = 0;
|
||||
|
||||
if (context->event_list[i].flags & EV_ERROR) {
|
||||
ogs_warn("kevent() error = 0x%x", context->event_list[i].flags);
|
||||
switch (context->event_list[i].data) {
|
||||
|
||||
/* Can occur on delete if we are not currently
|
||||
* watching any events on this fd. That can
|
||||
* happen when the fd was closed and another
|
||||
* file was opened with that fd. */
|
||||
case ENOENT:
|
||||
/* Can occur for reasons not fully understood
|
||||
* on FreeBSD. */
|
||||
case EINVAL:
|
||||
continue;
|
||||
#if defined(__FreeBSD__)
|
||||
/*
|
||||
* This currently occurs if an FD is closed
|
||||
* before the EV_DELETE makes it out via kevent().
|
||||
* The FreeBSD capabilities code sees the blank
|
||||
* capability set and rejects the request to
|
||||
* modify an event.
|
||||
*
|
||||
* To be strictly correct - when an FD is closed,
|
||||
* all the registered events are also removed.
|
||||
* Queuing EV_DELETE to a closed FD is wrong.
|
||||
* The event(s) should just be deleted from
|
||||
* the pending changelist.
|
||||
*/
|
||||
case ENOTCAPABLE:
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* Can occur on a delete if the fd is closed. */
|
||||
case EBADF:
|
||||
/* XXXX On NetBSD, we can also get EBADF if we
|
||||
* try to add the write side of a pipe, but
|
||||
* the read side has already been closed.
|
||||
* Other BSDs call this situation 'EPIPE'. It
|
||||
* would be good if we had a way to report
|
||||
* this situation. */
|
||||
continue;
|
||||
/* These two can occur on an add if the fd was one side
|
||||
* of a pipe, and the other side was closed. */
|
||||
case EPERM:
|
||||
case EPIPE:
|
||||
/* Report read events, if we're listening for
|
||||
* them, so that the user can learn about any
|
||||
* add errors. (If the operation was a
|
||||
* delete, then udata should be cleared.) */
|
||||
if (context->event_list[i].udata) {
|
||||
/* The operation was an add:
|
||||
* report the error as a read. */
|
||||
when |= OGS_POLLIN;
|
||||
break;
|
||||
} else {
|
||||
/* The operation was a del:
|
||||
* report nothing. */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Other errors shouldn't occur. */
|
||||
default:
|
||||
ogs_error("kevent() error : flags = 0x%x, errno = %d",
|
||||
context->event_list[i].flags,
|
||||
(int)context->event_list[i].data);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
} else if (context->event_list[i].filter == EVFILT_READ) {
|
||||
when |= OGS_POLLIN;
|
||||
} else if (context->event_list[i].filter == EVFILT_WRITE) {
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -339,13 +339,16 @@ static void cluster_free(ogs_pkbuf_pool_t *pool, ogs_cluster_t *cluster)
|
||||
ogs_pool_free(&pool->cluster_512, (ogs_cluster_512_t*)cluster->buffer);
|
||||
break;
|
||||
case OGS_CLUSTER_1024_SIZE:
|
||||
ogs_pool_free(&pool->cluster_1024, (ogs_cluster_1024_t*)cluster->buffer);
|
||||
ogs_pool_free(
|
||||
&pool->cluster_1024, (ogs_cluster_1024_t*)cluster->buffer);
|
||||
break;
|
||||
case OGS_CLUSTER_2048_SIZE:
|
||||
ogs_pool_free(&pool->cluster_2048, (ogs_cluster_2048_t*)cluster->buffer);
|
||||
ogs_pool_free(
|
||||
&pool->cluster_2048, (ogs_cluster_2048_t*)cluster->buffer);
|
||||
break;
|
||||
case OGS_CLUSTER_8192_SIZE:
|
||||
ogs_pool_free(&pool->cluster_8192, (ogs_cluster_8192_t*)cluster->buffer);
|
||||
ogs_pool_free(
|
||||
&pool->cluster_8192, (ogs_cluster_8192_t*)cluster->buffer);
|
||||
break;
|
||||
case OGS_CLUSTER_BIG_SIZE:
|
||||
ogs_pool_free(&pool->cluster_big, (ogs_cluster_big_t*)cluster->buffer);
|
||||
@@ -356,4 +359,3 @@ static void cluster_free(ogs_pkbuf_pool_t *pool, ogs_cluster_t *cluster)
|
||||
|
||||
ogs_pool_free(&pool->cluster, cluster);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,11 @@ typedef struct ogs_cluster_s {
|
||||
|
||||
typedef struct ogs_pkbuf_pool_s ogs_pkbuf_pool_t;
|
||||
typedef struct ogs_pkbuf_s {
|
||||
ogs_lnode_t lnode;
|
||||
|
||||
/* Currently it is used in SCTP stream number and PPID. */
|
||||
uint64_t param[2];
|
||||
|
||||
ogs_cluster_t *cluster;
|
||||
|
||||
unsigned int len;
|
||||
@@ -110,6 +115,20 @@ static ogs_inline void ogs_pkbuf_put_u8(ogs_pkbuf_t *pkbuf, uint8_t val)
|
||||
*(uint8_t *)ogs_pkbuf_put(pkbuf, 1) = val;
|
||||
}
|
||||
|
||||
static ogs_inline void ogs_pkbuf_put_u16(ogs_pkbuf_t *pkbuf, uint16_t val)
|
||||
{
|
||||
uint8_t *p = ogs_pkbuf_put(pkbuf, 2);
|
||||
uint16_t tmp = htobe16(val);
|
||||
memcpy(p, &tmp, 2);
|
||||
}
|
||||
|
||||
static ogs_inline void ogs_pkbuf_put_u32(ogs_pkbuf_t *pkbuf, uint32_t val)
|
||||
{
|
||||
uint8_t *p = ogs_pkbuf_put(pkbuf, 4);
|
||||
uint32_t tmp = htobe32(val);
|
||||
memcpy(p, &tmp, 4);
|
||||
}
|
||||
|
||||
static ogs_inline void *ogs_pkbuf_push(ogs_pkbuf_t *pkbuf, unsigned int len)
|
||||
{
|
||||
pkbuf->data -= len;
|
||||
|
||||
@@ -27,6 +27,8 @@ extern const ogs_pollset_actions_t ogs_kqueue_actions;
|
||||
extern const ogs_pollset_actions_t ogs_epoll_actions;
|
||||
extern const ogs_pollset_actions_t ogs_select_actions;
|
||||
|
||||
static void *self_handler_data = NULL;
|
||||
|
||||
ogs_pollset_actions_t ogs_pollset_actions;
|
||||
bool ogs_pollset_actions_initialized = false;
|
||||
|
||||
@@ -41,9 +43,9 @@ ogs_pollset_t *ogs_pollset_create(unsigned int capacity)
|
||||
|
||||
if (ogs_pollset_actions_initialized == false) {
|
||||
#if defined(HAVE_KQUEUE)
|
||||
ogs_pollset_actions = ogs_kqueue_actions;;
|
||||
ogs_pollset_actions = ogs_kqueue_actions;
|
||||
#elif defined(HAVE_EPOLL)
|
||||
ogs_pollset_actions = ogs_epoll_actions;;
|
||||
ogs_pollset_actions = ogs_epoll_actions;
|
||||
#else
|
||||
ogs_pollset_actions = ogs_select_actions;
|
||||
#endif
|
||||
@@ -87,7 +89,11 @@ ogs_poll_t *ogs_pollset_add(ogs_pollset_t *pollset, short when,
|
||||
poll->when = when;
|
||||
poll->fd = fd;
|
||||
poll->handler = handler;
|
||||
poll->data = data;
|
||||
|
||||
if (data == &self_handler_data)
|
||||
poll->data = poll;
|
||||
else
|
||||
poll->data = data;
|
||||
|
||||
poll->pollset = pollset;
|
||||
|
||||
@@ -117,3 +123,14 @@ void ogs_pollset_remove(ogs_poll_t *poll)
|
||||
|
||||
ogs_pool_free(&pollset->pool, poll);
|
||||
}
|
||||
|
||||
ogs_poll_t *ogs_pollset_cycle(ogs_pollset_t *pollset, ogs_poll_t *poll)
|
||||
{
|
||||
ogs_assert(pollset);
|
||||
return ogs_pool_cycle(&pollset->pool, poll);
|
||||
}
|
||||
|
||||
void *ogs_pollset_self_handler_data(void)
|
||||
{
|
||||
return &self_handler_data;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,9 @@ ogs_poll_t *ogs_pollset_add(ogs_pollset_t *pollset, short when,
|
||||
ogs_socket_t fd, ogs_poll_handler_f handler, void *data);
|
||||
void ogs_pollset_remove(ogs_poll_t *poll);
|
||||
|
||||
ogs_poll_t *ogs_pollset_cycle(ogs_pollset_t *pollset, ogs_poll_t *poll);
|
||||
void *ogs_pollset_self_handler_data(void);
|
||||
|
||||
typedef struct ogs_pollset_actions_s {
|
||||
void (*init)(ogs_pollset_t *pollset);
|
||||
void (*cleanup)(ogs_pollset_t *pollset);
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
* The code is stolen from process.h
|
||||
* https://github.com/sheredom/process.h
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
* distribute this software, either in source code form or as a compiled
|
||||
* binary, for any purpose, commercial or non-commercial, and by any
|
||||
* means.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* In jurisdictions that recognize copyright laws, the author or authors
|
||||
* of this software dedicate any and all copyright interest in the
|
||||
* software to the public domain. We make this dedication for the benefit
|
||||
* of the public at large and to the detriment of our heirs and
|
||||
* successors. We intend this dedication to be an overt act of
|
||||
* relinquishment in perpetuity of all present and future rights to this
|
||||
* software under copyright law.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* For more information, please refer to <http://unlicense.org/>
|
||||
*/
|
||||
|
||||
#include "core-config-private.h"
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
* The code is stolen from process.h
|
||||
* https://github.com/sheredom/process.h
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* This is free and unencumbered software released into the public domain.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
* distribute this software, either in source code form or as a compiled
|
||||
* binary, for any purpose, commercial or non-commercial, and by any
|
||||
* means.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* In jurisdictions that recognize copyright laws, the author or authors
|
||||
* of this software dedicate any and all copyright interest in the
|
||||
* software to the public domain. We make this dedication for the benefit
|
||||
* of the public at large and to the detriment of our heirs and
|
||||
* successors. We intend this dedication to be an overt act of
|
||||
* relinquishment in perpetuity of all present and future rights to this
|
||||
* software under copyright law.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* For more information, please refer to <http://unlicense.org/>
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
@@ -28,11 +41,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following code is stolen from process.h
|
||||
* https://github.com/sheredom/process.h
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef struct _PROCESS_INFORMATION *LPPROCESS_INFORMATION;
|
||||
typedef struct _SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -139,7 +139,7 @@ static int select_remove(ogs_poll_t *poll)
|
||||
static int select_process(ogs_pollset_t *pollset, ogs_time_t timeout)
|
||||
{
|
||||
struct select_context_s *context = NULL;
|
||||
ogs_poll_t *poll = NULL;
|
||||
ogs_poll_t *poll = NULL, *next_poll = NULL;
|
||||
int rc;
|
||||
struct timeval tv, *tp;
|
||||
|
||||
@@ -181,13 +181,15 @@ static int select_process(ogs_pollset_t *pollset, ogs_time_t timeout)
|
||||
return OGS_TIMEUP;
|
||||
}
|
||||
|
||||
ogs_list_for_each(&context->list, poll) {
|
||||
ogs_list_for_each_safe(&context->list, next_poll, poll) {
|
||||
short when = 0;
|
||||
if (FD_ISSET(poll->fd, &context->work_read_fd_set)) {
|
||||
if ((poll->when & OGS_POLLIN) &&
|
||||
FD_ISSET(poll->fd, &context->work_read_fd_set)) {
|
||||
when |= OGS_POLLIN;
|
||||
}
|
||||
|
||||
if (FD_ISSET(poll->fd, &context->work_write_fd_set)) {
|
||||
if ((poll->when & OGS_POLLOUT) &&
|
||||
FD_ISSET(poll->fd, &context->work_write_fd_set)) {
|
||||
when |= OGS_POLLOUT;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core-config-private.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core-config-private.h"
|
||||
@@ -300,7 +315,7 @@ const char *ogs_inet_ntop(void *sa, char *buf, int buflen)
|
||||
ogs_assert(buflen >= OGS_ADDRSTRLEN);
|
||||
|
||||
family = sockaddr->ogs_sa_family;
|
||||
switch(family) {
|
||||
switch (family) {
|
||||
case AF_INET:
|
||||
return inet_ntop(family, &sockaddr->sin.sin_addr, buf,
|
||||
INET_ADDRSTRLEN);
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -173,7 +173,6 @@ ogs_sock_t *ogs_sock_accept(ogs_sock_t *sock)
|
||||
|
||||
new_fd = accept(sock->fd, &addr.sa, &addrlen);
|
||||
if (new_fd < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "accept failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -185,37 +184,21 @@ ogs_sock_t *ogs_sock_accept(ogs_sock_t *sock)
|
||||
|
||||
memcpy(&new_sock->remote_addr, &addr, sizeof(new_sock->remote_addr));
|
||||
|
||||
return new_sock;;
|
||||
return new_sock;
|
||||
}
|
||||
|
||||
ssize_t ogs_write(ogs_socket_t fd, const void *buf, size_t len)
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
|
||||
size = write(fd, buf, len);
|
||||
if (size < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
|
||||
"ogs_write(len:%d) failed", (int)size);
|
||||
}
|
||||
|
||||
return size;
|
||||
return write(fd, buf, len);
|
||||
}
|
||||
|
||||
ssize_t ogs_read(ogs_socket_t fd, void *buf, size_t len)
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
|
||||
size = read(fd, buf, len);
|
||||
if (size < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
|
||||
"ogs_read(len:%d) failed", (int)size);
|
||||
}
|
||||
|
||||
return size;
|
||||
return read(fd, buf, len);
|
||||
}
|
||||
|
||||
ssize_t ogs_send(ogs_socket_t fd, const void *buf, size_t len, int flags)
|
||||
@@ -241,36 +224,20 @@ ssize_t ogs_sendto(ogs_socket_t fd,
|
||||
|
||||
ssize_t ogs_recv(ogs_socket_t fd, void *buf, size_t len, int flags)
|
||||
{
|
||||
ssize_t size;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
|
||||
size = recv(fd, buf, len, flags);
|
||||
if (size < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
|
||||
"recv(len:%d) failed", (int)len);
|
||||
}
|
||||
|
||||
return size;
|
||||
return recv(fd, buf, len, flags);
|
||||
}
|
||||
|
||||
ssize_t ogs_recvfrom(ogs_socket_t fd,
|
||||
void *buf, size_t len, int flags, ogs_sockaddr_t *from)
|
||||
{
|
||||
ssize_t size;
|
||||
socklen_t addrlen = sizeof(struct sockaddr_storage);
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
ogs_assert(from);
|
||||
|
||||
memset(from, 0, sizeof *from);
|
||||
size = recvfrom(fd, buf, len, flags, &from->sa, &addrlen);
|
||||
if (size < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno,
|
||||
"recvfrom(len:%d) failed", (int)len);
|
||||
}
|
||||
|
||||
return size;
|
||||
return recvfrom(fd, buf, len, flags, &from->sa, &addrlen);
|
||||
}
|
||||
|
||||
int ogs_closesocket(ogs_socket_t fd)
|
||||
@@ -330,15 +297,15 @@ int ogs_closeonexec(ogs_socket_t fd)
|
||||
int flags;
|
||||
|
||||
ogs_assert(fd != INVALID_SOCKET);
|
||||
flags = fcntl(fd, F_GETFL, NULL);
|
||||
flags = fcntl(fd, F_GETFD, NULL);
|
||||
if (flags < 0) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFL failed");
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_GETFD failed");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
if (!(flags & FD_CLOEXEC)) {
|
||||
rc = fcntl(fd, F_SETFL, (flags | FD_CLOEXEC));
|
||||
rc = fcntl(fd, F_SETFD, (flags | FD_CLOEXEC));
|
||||
if (rc != OGS_OK) {
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFL failed");
|
||||
ogs_log_message(OGS_LOG_ERROR, ogs_socket_errno, "F_SETFD failed");
|
||||
return OGS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,36 @@
|
||||
/**
|
||||
*
|
||||
* Orcania library
|
||||
*
|
||||
* Different functions for different purposes but that can be shared between
|
||||
* other projects
|
||||
*
|
||||
* orcania.c: main functions definitions
|
||||
*
|
||||
* Copyright 2015-2020 Nicolas Mora <mail@babelouest.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation;
|
||||
* version 2.1 of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
|
||||
@@ -1,10 +1,36 @@
|
||||
/**
|
||||
*
|
||||
* Orcania library
|
||||
*
|
||||
* Different functions for different purposes but that can be shared between
|
||||
* other projects
|
||||
*
|
||||
* orcania.c: main functions definitions
|
||||
*
|
||||
* Copyright 2015-2020 Nicolas Mora <mail@babelouest.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation;
|
||||
* version 2.1 of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU GENERAL PUBLIC LICENSE for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
@@ -55,6 +81,16 @@ void *ogs_memdup(const void *m, size_t n);
|
||||
|
||||
char *ogs_cpystrn(char *dst, const char *src, size_t dst_size);
|
||||
|
||||
/*
|
||||
* char *ogs_msprintf(const char *message, ...)
|
||||
* char *mstrcatf(char *source, const char *message, ...)
|
||||
*
|
||||
* Orcania library
|
||||
* Copyright 2015-2018 Nicolas Mora <mail@babelouest.org>
|
||||
* License: LGPL-2.1
|
||||
*
|
||||
* https://github.com/babelouest/orcania.git
|
||||
*/
|
||||
char *ogs_msprintf(const char *message, ...)
|
||||
OGS_GNUC_PRINTF(1, 2);
|
||||
char *ogs_mstrcatf(char *source, const char *message, ...)
|
||||
|
||||
@@ -1,20 +1,59 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2013 MongoDB, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright Beman Dawes 2008
|
||||
* Copyright 2009-2010 Vicente J. Botet Escriba
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
@@ -1,20 +1,59 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2013 MongoDB, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright Beman Dawes 2008
|
||||
* Copyright 2009-2010 Vicente J. Botet Escriba
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* See http://www.boost.org/LICENSE_1_0.txt
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "core-config-private.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CORE_INSIDE) && !defined(OGS_CORE_COMPILATION)
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-crypt.h"
|
||||
|
||||
#if (OGS_AES_BLOCK_SIZE != 16)
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-crypt.h"
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ogs-crypt.h"
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
/* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* HMAC-SHA-224/256/384/512 implementation
|
||||
* Last update: 06/15/2005
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* sha1.c
|
||||
*
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*-
|
||||
* HMAC-SHA-224/256/384/512 implementation
|
||||
* Last update: 06/15/2005
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* FIPS 180-2 SHA-224/256/384/512 implementation
|
||||
* Last update: 02/02/2007
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019-2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
|
||||
@@ -56,3 +56,56 @@ ogs_pkbuf_t *ogs_gtp_build_echo_response(
|
||||
gtp_message.h.type = type;
|
||||
return ogs_gtp_build_msg(>p_message);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ogs_gtp_build_error_indication(
|
||||
uint32_t teid, ogs_sockaddr_t *addr)
|
||||
{
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
unsigned char *p = NULL;
|
||||
int family;
|
||||
|
||||
ogs_assert(addr);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(
|
||||
NULL, 100 /* enough for Error Indiciation; use smaller buffer */);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_pkbuf_reserve(pkbuf, OGS_GTPV1U_5GC_HEADER_LEN);
|
||||
|
||||
/*
|
||||
* 8.3 Tunnel Endpoint Identifier Data I
|
||||
*
|
||||
* Octet 1 : Type = 16 (Decimal)
|
||||
* Octet 2-5 : Tunnel Endpoint Identitifer Data I
|
||||
*/
|
||||
ogs_pkbuf_put_u8(pkbuf, 16);
|
||||
ogs_pkbuf_put_u32(pkbuf, teid);
|
||||
|
||||
/*
|
||||
* 8.4 GTP-U Peer Address
|
||||
*
|
||||
* Octet 1 : Type = 133 (Decimal)
|
||||
* Octet 2-3 : Length
|
||||
* Octet 4-n : IPv4 or IPv6 Address
|
||||
*/
|
||||
ogs_pkbuf_put_u8(pkbuf, 133);
|
||||
|
||||
family = addr->ogs_sa_family;
|
||||
switch(family) {
|
||||
case AF_INET:
|
||||
ogs_pkbuf_put_u16(pkbuf, OGS_IPV4_LEN);
|
||||
p = ogs_pkbuf_put(pkbuf, OGS_IPV4_LEN);
|
||||
memcpy(p, &addr->sin.sin_addr, OGS_IPV4_LEN);
|
||||
break;
|
||||
case AF_INET6:
|
||||
ogs_pkbuf_put_u16(pkbuf, OGS_IPV6_LEN);
|
||||
p = ogs_pkbuf_put(pkbuf, OGS_IPV6_LEN);
|
||||
memcpy(p, &addr->sin6.sin6_addr, OGS_IPV6_LEN);
|
||||
break;
|
||||
default:
|
||||
ogs_fatal("Unknown family(%d)", family);
|
||||
ogs_abort();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pkbuf;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ ogs_pkbuf_t *ogs_gtp_build_echo_request(
|
||||
ogs_pkbuf_t *ogs_gtp_build_echo_response(
|
||||
uint8_t type, uint8_t recovery, uint8_t features);
|
||||
|
||||
ogs_pkbuf_t *ogs_gtp_build_error_indication(
|
||||
uint32_t teid, ogs_sockaddr_t *addr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/*******************************************************************************
|
||||
* This file had been created by gtp-tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2020-08-11 20:17:53.518172 by acetcom
|
||||
* Created on: 2020-10-14 13:48:14.476575 by acetcom
|
||||
* from 29274-g30.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/*******************************************************************************
|
||||
* This file had been created by gtp-tlv.py script v0.1.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2020-08-11 20:17:53.511069 by acetcom
|
||||
* Created on: 2020-10-14 13:48:14.468022 by acetcom
|
||||
* from 29274-g30.docx
|
||||
******************************************************************************/
|
||||
|
||||
@@ -50,9 +50,11 @@ typedef struct ogs_gtp_header_s {
|
||||
uint8_t spare1:3;)
|
||||
};
|
||||
/* GTU-U flags */
|
||||
#define OGS_GTPU_FLAGS_PN 0x1
|
||||
#define OGS_GTPU_FLAGS_S 0x2
|
||||
#define OGS_GTPU_FLAGS_E 0x4
|
||||
#define OGS_GTPU_FLAGS_V 0x20
|
||||
#define OGS_GTPU_FLAGS_PT 0x10
|
||||
#define OGS_GTPU_FLAGS_E 0x04
|
||||
#define OGS_GTPU_FLAGS_S 0x02
|
||||
#define OGS_GTPU_FLAGS_PN 0x01
|
||||
uint8_t flags;
|
||||
};
|
||||
/* GTP-U message type, defined in 3GPP TS 29.281 Release 11 */
|
||||
|
||||
107
lib/gtp/path.c
107
lib/gtp/path.c
@@ -123,6 +123,113 @@ int ogs_gtp_sendto(ogs_gtp_node_t *gnode, ogs_pkbuf_t *pkbuf)
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_gtp_send_user_plane(
|
||||
ogs_gtp_node_t *gnode,
|
||||
ogs_gtp_header_t *gtp_hdesc, ogs_gtp_extension_header_t *ext_hdesc,
|
||||
ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
int rv;
|
||||
|
||||
ogs_gtp_header_t *gtp_h = NULL;
|
||||
ogs_gtp_extension_header_t *ext_h = NULL;
|
||||
uint8_t flags;
|
||||
uint8_t gtp_hlen = 0;
|
||||
|
||||
ogs_assert(gnode);
|
||||
ogs_assert(gtp_hdesc);
|
||||
ogs_assert(ext_hdesc);
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
/* Processing GTP Flags */
|
||||
flags = gtp_hdesc->flags;
|
||||
flags |= OGS_GTPU_FLAGS_V | OGS_GTPU_FLAGS_PT;
|
||||
if (ext_hdesc->qos_flow_identifier) flags |= OGS_GTPU_FLAGS_E;
|
||||
|
||||
/* Define GTP Header Size */
|
||||
if (flags & OGS_GTPU_FLAGS_E)
|
||||
gtp_hlen = OGS_GTPV1U_HEADER_LEN+8;
|
||||
else if (flags & (OGS_GTPU_FLAGS_S|OGS_GTPU_FLAGS_PN))
|
||||
gtp_hlen = OGS_GTPV1U_HEADER_LEN+4;
|
||||
else
|
||||
gtp_hlen = OGS_GTPV1U_HEADER_LEN;
|
||||
|
||||
ogs_pkbuf_push(pkbuf, gtp_hlen);
|
||||
|
||||
/* Fill GTP Header */
|
||||
gtp_h = (ogs_gtp_header_t *)pkbuf->data;
|
||||
ogs_assert(gtp_h);
|
||||
memset(gtp_h, 0, gtp_hlen);
|
||||
|
||||
gtp_h->flags = flags;
|
||||
gtp_h->type = gtp_hdesc->type;
|
||||
|
||||
if (gtp_h->type == OGS_GTPU_MSGTYPE_ECHO_REQ ||
|
||||
gtp_h->type == OGS_GTPU_MSGTYPE_ECHO_RSP ||
|
||||
gtp_h->type == OGS_GTPU_MSGTYPE_ERR_IND) {
|
||||
/*
|
||||
* TS29.281 5.1 General format in GTP-U header
|
||||
*
|
||||
* - The Echo Request/Response and Supported Extension Headers
|
||||
* notification messages, where the Tunnel Endpoint Identifier
|
||||
* shall be set to all zeroes.
|
||||
* - The Error Indication message where the Tunnel Endpoint Identifier
|
||||
* shall be set to all zeros.
|
||||
*/
|
||||
ogs_assert(gtp_hdesc->teid == 0);
|
||||
}
|
||||
|
||||
gtp_h->teid = htobe32(gtp_hdesc->teid);
|
||||
|
||||
/*
|
||||
* TS29.281 5.1 General format in GTP-U header
|
||||
*
|
||||
* Length: This field indicates the length in octets of the payload,
|
||||
* i.e. the rest of the packet following the mandatory part of
|
||||
* the GTP header (that is the first 8 octets). The Sequence Number,
|
||||
* the N-PDU Number or any Extension headers shall be considered
|
||||
* to be part of the payload, i.e. included in the length count.
|
||||
*/
|
||||
gtp_h->length = htobe16(pkbuf->len - OGS_GTPV1U_HEADER_LEN);
|
||||
|
||||
/* Fill Extention Header */
|
||||
if (gtp_h->flags & OGS_GTPU_FLAGS_E) {
|
||||
ext_h = (ogs_gtp_extension_header_t *)
|
||||
(pkbuf->data + OGS_GTPV1U_HEADER_LEN);
|
||||
ogs_assert(ext_h);
|
||||
|
||||
if (ext_hdesc->qos_flow_identifier) {
|
||||
/* 5G Core */
|
||||
ext_h->type = OGS_GTP_EXTENSION_HEADER_TYPE_PDU_SESSION_CONTAINER;
|
||||
ext_h->len = 1;
|
||||
ext_h->pdu_type = ext_hdesc->pdu_type;
|
||||
ext_h->qos_flow_identifier = ext_hdesc->qos_flow_identifier;
|
||||
ext_h->next_type =
|
||||
OGS_GTP_EXTENSION_HEADER_TYPE_NO_MORE_EXTENSION_HEADERS;
|
||||
} else {
|
||||
/* EPC */
|
||||
ext_h->type = ext_hdesc->type;
|
||||
ext_h->len = 1;
|
||||
ext_h->next_type =
|
||||
OGS_GTP_EXTENSION_HEADER_TYPE_NO_MORE_EXTENSION_HEADERS;
|
||||
}
|
||||
}
|
||||
|
||||
ogs_debug("SEND GTP-U[%d] to Peer[%s] : TEID[0x%x]",
|
||||
gtp_hdesc->type, OGS_ADDR(&gnode->addr, buf), gtp_hdesc->teid);
|
||||
rv = ogs_gtp_sendto(gnode, pkbuf);
|
||||
if (rv != OGS_OK) {
|
||||
if (ogs_socket_errno != OGS_EAGAIN) {
|
||||
ogs_error("SEND GTP-U[%d] to Peer[%s] : TEID[0x%x]",
|
||||
gtp_hdesc->type, OGS_ADDR(&gnode->addr, buf), gtp_hdesc->teid);
|
||||
}
|
||||
}
|
||||
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ogs_gtp_handle_echo_req(ogs_pkbuf_t *pkb)
|
||||
{
|
||||
ogs_gtp_header_t *gtph = NULL;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user