mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-04 14:03:21 +00:00
Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f59cf3eacb | ||
|
|
8f1e591be5 | ||
|
|
905fc76faf | ||
|
|
745ea41096 | ||
|
|
8710cae0fd | ||
|
|
27cee12a7b | ||
|
|
44de4673bf | ||
|
|
2df8a1836f | ||
|
|
3c9541992f | ||
|
|
90f60cad0e | ||
|
|
26066bb0ca | ||
|
|
d3eaaff430 | ||
|
|
d40348c00c | ||
|
|
613e21c4ff | ||
|
|
41c6bb4681 | ||
|
|
23c1fee516 | ||
|
|
a74050a032 | ||
|
|
bb38c01229 | ||
|
|
ec0752cb95 | ||
|
|
b6ba02f6de | ||
|
|
5f9785af52 | ||
|
|
c0396171ff | ||
|
|
0b3ca447c9 | ||
|
|
68724c6ec1 | ||
|
|
cc30aa2a9a | ||
|
|
3a2a227b48 | ||
|
|
a76a2503c2 | ||
|
|
1e2a16fc5b | ||
|
|
829123dad0 | ||
|
|
457230a2f6 | ||
|
|
6ab5c41af5 | ||
|
|
b22023afb8 | ||
|
|
b21dc65741 | ||
|
|
5d2fea994b | ||
|
|
ebb48ede53 | ||
|
|
b07d12d3be | ||
|
|
54f1ccbb6b | ||
|
|
52cd51ca6a | ||
|
|
c848919af4 | ||
|
|
6df2906f42 | ||
|
|
ebf1c5b0d9 | ||
|
|
072fb68882 | ||
|
|
182a680d51 | ||
|
|
09780e3fed | ||
|
|
79df32638c | ||
|
|
d0eec31f5c | ||
|
|
dc474329e2 | ||
|
|
22b09443ce | ||
|
|
7ba77e6cc1 | ||
|
|
37e0a714f9 | ||
|
|
0270c0e340 | ||
|
|
a6e42a4932 | ||
|
|
0a94e1ece4 | ||
|
|
569f98f92c | ||
|
|
7848b6c966 | ||
|
|
60b75b5f5e | ||
|
|
82261bc8e4 | ||
|
|
9e8700f1a2 | ||
|
|
fc5c9b2af0 | ||
|
|
56c0987ad2 | ||
|
|
08751e1b4a | ||
|
|
de72ccaf91 | ||
|
|
9af4268bab | ||
|
|
c6bfbed922 | ||
|
|
0790674c14 | ||
|
|
2f2178595d | ||
|
|
515b5d2b17 | ||
|
|
31977bf30a | ||
|
|
d1400897e0 | ||
|
|
b6bcbac3e3 | ||
|
|
9b5cc4a568 | ||
|
|
094d40b073 | ||
|
|
852756f902 | ||
|
|
fea48f5a44 | ||
|
|
b19b3e9dd1 | ||
|
|
7901a1164f | ||
|
|
950c4c0a12 | ||
|
|
5e839e25fe | ||
|
|
d3fa7619bf | ||
|
|
6cd755ac97 | ||
|
|
f597c9e899 | ||
|
|
9e8303762c | ||
|
|
e7c261d0d3 | ||
|
|
e7cb25ac9b | ||
|
|
f47f65a51c | ||
|
|
0311d2255c | ||
|
|
d9417be9a6 | ||
|
|
373ba1452f | ||
|
|
848b7ffc29 | ||
|
|
ff5236f3e0 | ||
|
|
388e64213f | ||
|
|
49a9e58efe | ||
|
|
0fc5190a09 | ||
|
|
19014a3a25 | ||
|
|
ada01fca8f | ||
|
|
61778f9142 | ||
|
|
776d323a16 | ||
|
|
9eac90252e | ||
|
|
708784e222 | ||
|
|
50db1aaeb1 | ||
|
|
8e29eb2417 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
# This directory is fetched during first build and is present in this directory
|
# This directory is fetched during first build and is present in this directory
|
||||||
subprojects/freeDiameter
|
subprojects/freeDiameter
|
||||||
subprojects/usrsctp
|
subprojects/usrsctp
|
||||||
|
|
||||||
|
webui/.next
|
||||||
@@ -11,6 +11,7 @@ If you find Open5GS useful for work, please consider supporting this Open Source
|
|||||||
<img width="260px" src="https://open5gs.org/assets/img/nextepc_logo.jpg">
|
<img width="260px" src="https://open5gs.org/assets/img/nextepc_logo.jpg">
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td width="20px"></td>
|
||||||
<td align="center" valign="middle">
|
<td align="center" valign="middle">
|
||||||
<a href="https://sdr.eee.strath.ac.uk/" target="_blank">
|
<a href="https://sdr.eee.strath.ac.uk/" target="_blank">
|
||||||
<img width="260px" src="https://open5gs.org/assets/img/strath.png">
|
<img width="260px" src="https://open5gs.org/assets/img/strath.png">
|
||||||
@@ -40,6 +41,13 @@ If you find Open5GS useful for work, please consider supporting this Open Source
|
|||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center" valign="middle">
|
||||||
|
<a href="https://skylarkwireless.com/" target="_blank">
|
||||||
|
<img width="222px" src="https://open5gs.org/assets/img/SkylarkWireless-420x78-Web2-R.png">
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
port: 7777
|
port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -129,19 +133,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -200,6 +204,16 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -101,14 +102,17 @@ smf:
|
|||||||
# sbi:
|
# sbi:
|
||||||
# - addr: 127.0.0.4
|
# - addr: 127.0.0.4
|
||||||
# port: 7777
|
# port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -163,19 +167,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -234,6 +238,16 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ example_conf = '''
|
|||||||
csfb.yaml
|
csfb.yaml
|
||||||
volte.yaml
|
volte.yaml
|
||||||
vonr.yaml
|
vonr.yaml
|
||||||
minimal.yaml
|
slice.yaml
|
||||||
srslte.yaml
|
srslte.yaml
|
||||||
sample.yaml
|
sample.yaml
|
||||||
'''.split()
|
'''.split()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: amf.key
|
# key: amf.key
|
||||||
# pem: amf.pem
|
# pem: amf.pem
|
||||||
#
|
#
|
||||||
@@ -51,7 +51,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://amf.open5gs.org:80)
|
# o SBI Server(http://amf.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: amf.open5gs.org
|
# - name: amf.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.5:7777)
|
# o SBI Server(http://127.0.0.5:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -60,7 +60,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-amf.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
# <NGAP Server>>
|
# <NGAP Server>>
|
||||||
#
|
#
|
||||||
@@ -143,7 +154,7 @@ logger:
|
|||||||
# mnc: 70
|
# mnc: 70
|
||||||
# s_nssai:
|
# s_nssai:
|
||||||
# - sst: 1
|
# - sst: 1
|
||||||
# - sd: 010000
|
# sd: 010000
|
||||||
# - plmn_id:
|
# - plmn_id:
|
||||||
# mcc: 901
|
# mcc: 901
|
||||||
# mnc: 70
|
# mnc: 70
|
||||||
@@ -160,6 +171,10 @@ logger:
|
|||||||
#
|
#
|
||||||
# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc901.3gppnetwork.org
|
# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc901.3gppnetwork.org
|
||||||
#
|
#
|
||||||
|
# <Relative Capacity> - Default(255)
|
||||||
|
#
|
||||||
|
# relative_capacity: 100
|
||||||
|
#
|
||||||
amf:
|
amf:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.5
|
- addr: 127.0.0.5
|
||||||
@@ -227,9 +242,6 @@ nrf:
|
|||||||
#
|
#
|
||||||
# parameter:
|
# parameter:
|
||||||
#
|
#
|
||||||
# o Number of output streams per SCTP associations.
|
|
||||||
# sctp_streams: 30
|
|
||||||
#
|
|
||||||
# o Disable use of IPv4 addresses (only IPv6)
|
# o Disable use of IPv4 addresses (only IPv6)
|
||||||
# no_ipv4: true
|
# no_ipv4: true
|
||||||
#
|
#
|
||||||
@@ -239,12 +251,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -264,7 +270,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -272,7 +278,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
@@ -281,6 +287,27 @@ max:
|
|||||||
#
|
#
|
||||||
pool:
|
pool:
|
||||||
|
|
||||||
|
#
|
||||||
|
# sockopt:
|
||||||
|
# no_delay : true
|
||||||
|
#
|
||||||
|
sockopt:
|
||||||
|
|
||||||
|
#
|
||||||
|
# sctp:
|
||||||
|
# heartbit_interval : 5000 (5secs)
|
||||||
|
# sack_delay : 200 (200ms)
|
||||||
|
# rto_initial : 3000 (3secs)
|
||||||
|
# rto_min : 1000 (1sec)
|
||||||
|
# rto_max : 5000 (5secs)
|
||||||
|
# max_num_of_ostreams : 30
|
||||||
|
# max_num_of_istreams : 65535
|
||||||
|
# max_attempts : 4
|
||||||
|
# max_initial_timeout : 8000(8secs)
|
||||||
|
# usrsctp_udp_port : 9899
|
||||||
|
#
|
||||||
|
sctp:
|
||||||
|
|
||||||
#
|
#
|
||||||
# time:
|
# time:
|
||||||
#
|
#
|
||||||
@@ -300,4 +327,12 @@ pool:
|
|||||||
# o Message Wait Duration (3000 ms)
|
# o Message Wait Duration (3000 ms)
|
||||||
# message:
|
# message:
|
||||||
# duration: 3000
|
# duration: 3000
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (Default : 300 ms)
|
||||||
|
# Time to wait for AMF to send UEContextReleaseCommand
|
||||||
|
# to the source gNB after receiving HandoverNotify
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (500ms)
|
||||||
|
# handover:
|
||||||
|
# duration: 500
|
||||||
time:
|
time:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: ausf.key
|
# key: ausf.key
|
||||||
# pem: ausf.pem
|
# pem: ausf.pem
|
||||||
#
|
#
|
||||||
@@ -51,7 +51,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://ausf.open5gs.org:80)
|
# o SBI Server(http://ausf.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: ausf.open5gs.org
|
# - name: ausf.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.11:7777)
|
# o SBI Server(http://127.0.0.11:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -60,7 +60,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-ausf.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
ausf:
|
ausf:
|
||||||
sbi:
|
sbi:
|
||||||
@@ -115,12 +126,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -140,7 +145,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -148,7 +153,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -41,12 +41,6 @@ hss:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -66,7 +60,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -74,7 +68,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ open5gs_conf = '''
|
|||||||
udm.yaml
|
udm.yaml
|
||||||
udr.yaml
|
udr.yaml
|
||||||
pcf.yaml
|
pcf.yaml
|
||||||
|
nssf.yaml
|
||||||
'''.split()
|
'''.split()
|
||||||
|
|
||||||
foreach file : open5gs_conf
|
foreach file : open5gs_conf
|
||||||
|
|||||||
@@ -201,6 +201,10 @@ logger:
|
|||||||
#
|
#
|
||||||
# mme_name: open5gs-mme0
|
# mme_name: open5gs-mme0
|
||||||
#
|
#
|
||||||
|
# <Relative Capacity> - Default(255)
|
||||||
|
#
|
||||||
|
# relative_capacity: 100
|
||||||
|
#
|
||||||
mme:
|
mme:
|
||||||
freeDiameter: @sysconfdir@/freeDiameter/mme.conf
|
freeDiameter: @sysconfdir@/freeDiameter/mme.conf
|
||||||
s1ap:
|
s1ap:
|
||||||
@@ -331,9 +335,6 @@ smf:
|
|||||||
#
|
#
|
||||||
# parameter:
|
# parameter:
|
||||||
#
|
#
|
||||||
# o Number of output streams per SCTP associations.
|
|
||||||
# sctp_streams: 30
|
|
||||||
#
|
|
||||||
# o Disable use of IPv4 addresses (only IPv6)
|
# o Disable use of IPv4 addresses (only IPv6)
|
||||||
# no_ipv4: true
|
# no_ipv4: true
|
||||||
#
|
#
|
||||||
@@ -343,12 +344,6 @@ smf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
# o Use OAI UE
|
# o Use OAI UE
|
||||||
# - Remove HashMME in Security-mode command message
|
# - Remove HashMME in Security-mode command message
|
||||||
# - Use the length 1 of EPS network feature support in Attach accept message
|
# - Use the length 1 of EPS network feature support in Attach accept message
|
||||||
@@ -373,7 +368,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -381,7 +376,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
@@ -391,17 +386,23 @@ max:
|
|||||||
pool:
|
pool:
|
||||||
|
|
||||||
#
|
#
|
||||||
# sctp:
|
# sockopt:
|
||||||
|
# no_delay : true
|
||||||
#
|
#
|
||||||
# o heartbit_interval : 5000 (5secs)
|
sockopt:
|
||||||
# o rto_initial : 3000 (3secs)
|
|
||||||
# o rto_min : 1000 (1sec)
|
#
|
||||||
# o rto_max : 5000 (5secs)
|
# sctp:
|
||||||
# o max_num_of_ostreams : 30
|
# heartbit_interval : 5000 (5secs)
|
||||||
# o max_num_of_istreams : 65535
|
# sack_delay : 200 (200ms)
|
||||||
# o max_attempts : 4
|
# rto_initial : 3000 (3secs)
|
||||||
# o max_initial_timeout : 8000(8secs)
|
# rto_min : 1000 (1sec)
|
||||||
# o usrsctp_udp_port : 9899
|
# rto_max : 5000 (5secs)
|
||||||
|
# max_num_of_ostreams : 30
|
||||||
|
# max_num_of_istreams : 65535
|
||||||
|
# max_attempts : 4
|
||||||
|
# max_initial_timeout : 8000(8secs)
|
||||||
|
# usrsctp_udp_port : 9899
|
||||||
#
|
#
|
||||||
sctp:
|
sctp:
|
||||||
|
|
||||||
@@ -413,4 +414,12 @@ sctp:
|
|||||||
# o Message Wait Duration (3000 ms)
|
# o Message Wait Duration (3000 ms)
|
||||||
# message:
|
# message:
|
||||||
# duration: 3000
|
# duration: 3000
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (Default : 300 ms)
|
||||||
|
# Time to wait for MME to send UEContextReleaseCommand
|
||||||
|
# to the source eNB after receiving HandoverNotify
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (500ms)
|
||||||
|
# handover:
|
||||||
|
# duration: 500
|
||||||
time:
|
time:
|
||||||
|
|||||||
@@ -87,12 +87,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -112,7 +106,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -120,7 +114,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
234
configs/open5gs/nssf.yaml.in
Normal file
234
configs/open5gs/nssf.yaml.in
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
#
|
||||||
|
# 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,nssf,event,tlv,mem,sock
|
||||||
|
#
|
||||||
|
logger:
|
||||||
|
file: @localstatedir@/log/open5gs/nssf.log
|
||||||
|
#
|
||||||
|
# nssf:
|
||||||
|
#
|
||||||
|
# <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: nssf.key
|
||||||
|
# pem: nssf.pem
|
||||||
|
#
|
||||||
|
# o SBI Server(https://127.0.0.14:443, http://[::1]:80)
|
||||||
|
# sbi:
|
||||||
|
# - addr: 127.0.0.14
|
||||||
|
# tls:
|
||||||
|
# key: nssf.key
|
||||||
|
# pem: nssf.pem
|
||||||
|
# - addr: ::1
|
||||||
|
#
|
||||||
|
# o SBI Server(http://nssf.open5gs.org:80)
|
||||||
|
# sbi:
|
||||||
|
# - name: nssf.open5gs.org
|
||||||
|
#
|
||||||
|
# o SBI Server(http://127.0.0.14:7777)
|
||||||
|
# sbi:
|
||||||
|
# - addr: 127.0.0.14
|
||||||
|
# port: 7777
|
||||||
|
#
|
||||||
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-nssf.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
|
#
|
||||||
|
# <List of avaiable Network Slice Instance(NSI)>
|
||||||
|
#
|
||||||
|
# o One NSI
|
||||||
|
# - NRF[http://::1:7777/nnrf-nfm/v1/nf-instances]
|
||||||
|
# NSSAI[SST:1]
|
||||||
|
#
|
||||||
|
# nsi:
|
||||||
|
# - addr: ::1
|
||||||
|
# port: 7777
|
||||||
|
# s_nssai:
|
||||||
|
# sst: 1
|
||||||
|
#
|
||||||
|
# o Three NSI
|
||||||
|
# 1. NRF[http://::1:7777/nnrf-nfm/v1/nf-instances]
|
||||||
|
# S-NSSAI[SST:1]
|
||||||
|
#
|
||||||
|
# 2. NRF[http://127.0.0.19:7777/nnrf-nfm/v1/nf-instances]
|
||||||
|
# NSSAI[SST:1, SD:000080]
|
||||||
|
#
|
||||||
|
# 2. NRF[http://127.0.0.10:7777/nnrf-nfm/v1/nf-instances]
|
||||||
|
# NSSAI[SST:1, SD:009000]
|
||||||
|
#
|
||||||
|
# nsi:
|
||||||
|
# - addr: ::1
|
||||||
|
# port: 7777
|
||||||
|
# s_nssai:
|
||||||
|
# sst: 1
|
||||||
|
# - addr: 127.0.0.19
|
||||||
|
# port: 7777
|
||||||
|
# s_nssai:
|
||||||
|
# sst: 1
|
||||||
|
# sd: 000080
|
||||||
|
# - addr: 127.0.0.10
|
||||||
|
# port: 7777
|
||||||
|
# s_nssai:
|
||||||
|
# sst: 1
|
||||||
|
# sd: 009000
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# nrf:
|
||||||
|
#
|
||||||
|
# <SBI Client>>
|
||||||
|
#
|
||||||
|
# o SBI Client(http://127.0.0.10:7777)
|
||||||
|
# sbi:
|
||||||
|
# addr: 127.0.0.10
|
||||||
|
# port: 7777
|
||||||
|
#
|
||||||
|
# o SBI Client(https://127.0.0.10:443, http://nrf.open5gs.org:80)
|
||||||
|
# sbi:
|
||||||
|
# - addr: 127.0.0.10
|
||||||
|
# tls:
|
||||||
|
# key: nrf.key
|
||||||
|
# pem: nrf.pem
|
||||||
|
# - name: nrf.open5gs.org
|
||||||
|
#
|
||||||
|
# o SBI Client(http://[fe80::1%@loopback_devname@]:80)
|
||||||
|
# If prefer_ipv4 is true, http://127.0.0.10:80 is selected.
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# addr:
|
||||||
|
# - 127.0.0.10
|
||||||
|
# - fe80::1%@loopback_devname@
|
||||||
|
#
|
||||||
|
nrf:
|
||||||
|
sbi:
|
||||||
|
- addr:
|
||||||
|
- 127.0.0.10
|
||||||
|
- ::1
|
||||||
|
port: 7777
|
||||||
|
|
||||||
|
#
|
||||||
|
# parameter:
|
||||||
|
#
|
||||||
|
# o Number of output streams per SCTP associations.
|
||||||
|
# sctp_streams: 30
|
||||||
|
#
|
||||||
|
# o Disable use of IPv4 addresses (only IPv6)
|
||||||
|
# no_ipv4: true
|
||||||
|
#
|
||||||
|
# o Disable use of IPv6 addresses (only IPv4)
|
||||||
|
# no_ipv6: true
|
||||||
|
#
|
||||||
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
|
# prefer_ipv4: true
|
||||||
|
#
|
||||||
|
parameter:
|
||||||
|
|
||||||
|
#
|
||||||
|
# max:
|
||||||
|
#
|
||||||
|
# o Maximum Number of UE per AMF/MME
|
||||||
|
# ue: 1024
|
||||||
|
# o Maximum Number of gNB/eNB per AMF/MME
|
||||||
|
# gnb: 32
|
||||||
|
#
|
||||||
|
max:
|
||||||
|
|
||||||
|
#
|
||||||
|
# pool:
|
||||||
|
#
|
||||||
|
# o The default memory pool size was set assuming 1024 UEs.
|
||||||
|
# To connect more UEs, you need to increase the size further.
|
||||||
|
#
|
||||||
|
# - Pool-size 128 => 65536 Number
|
||||||
|
# - Pool-size 256 => 16384 Number
|
||||||
|
# - Pool-size 512 => 4096 Number
|
||||||
|
# - Pool-size 1024 => 1024 Number
|
||||||
|
# - Pool-size 2048 => 512 Number
|
||||||
|
# - Pool-size 8192 => 128 Number
|
||||||
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
|
#
|
||||||
|
# 128: 65536
|
||||||
|
# 256: 16384
|
||||||
|
# 512: 4096
|
||||||
|
# 1024: 1024
|
||||||
|
# 2048: 512
|
||||||
|
# 8192: 128
|
||||||
|
# big: 8
|
||||||
|
#
|
||||||
|
pool:
|
||||||
|
|
||||||
|
#
|
||||||
|
# time:
|
||||||
|
#
|
||||||
|
# o NF Instance Heartbeat (Default : 0)
|
||||||
|
# NFs will not send heart-beat timer in NFProfile
|
||||||
|
# NRF will send heart-beat timer in NFProfile
|
||||||
|
#
|
||||||
|
# o NF Instance Heartbeat (20 seconds)
|
||||||
|
# NFs will send heart-beat timer (20 seconds) in NFProfile
|
||||||
|
# NRF can change heart-beat timer in NFProfile
|
||||||
|
#
|
||||||
|
# nf_instance:
|
||||||
|
# heartbeat: 20
|
||||||
|
#
|
||||||
|
# o 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:
|
||||||
@@ -39,7 +39,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: pcf.key
|
# key: pcf.key
|
||||||
# pem: pcf.pem
|
# pem: pcf.pem
|
||||||
#
|
#
|
||||||
@@ -53,7 +53,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://pcf.open5gs.org:80)
|
# o SBI Server(http://pcf.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: pcf.open5gs.org
|
# - name: pcf.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.13:7777)
|
# o SBI Server(http://127.0.0.13:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -62,7 +62,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-pcf.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
pcf:
|
pcf:
|
||||||
sbi:
|
sbi:
|
||||||
@@ -117,12 +128,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -142,7 +147,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -150,7 +155,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -40,12 +40,6 @@ pcrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
# o Legacy support for pre-release LTE 11 devices to do calling
|
# o Legacy support for pre-release LTE 11 devices to do calling
|
||||||
# - Replace IPv4/v6 local addr field in AAR Media-Subcomponent AVP by any
|
# - Replace IPv4/v6 local addr field in AAR Media-Subcomponent AVP by any
|
||||||
# no_ipv4v6_local_addr_in_packet_filter: true
|
# no_ipv4v6_local_addr_in_packet_filter: true
|
||||||
@@ -69,7 +63,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -77,7 +71,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ logger:
|
|||||||
# - addr: 127.0.0.3
|
# - addr: 127.0.0.3
|
||||||
# - addr: ::1
|
# - addr: ::1
|
||||||
#
|
#
|
||||||
|
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
|
# pfcp:
|
||||||
|
# name: localhost
|
||||||
|
#
|
||||||
sgwc:
|
sgwc:
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.3
|
- addr: 127.0.0.3
|
||||||
@@ -122,12 +126,6 @@ sgwu:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -147,7 +145,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -155,7 +153,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -24,16 +24,23 @@ logger:
|
|||||||
#
|
#
|
||||||
# sgwu:
|
# sgwu:
|
||||||
#
|
#
|
||||||
# <GTP-U Server>
|
# <PFCP Server>
|
||||||
#
|
#
|
||||||
# o GTP-U Server(all address available)
|
# o PFCP Server(127.0.0.6:8805, ::1:8805)
|
||||||
# gtpu:
|
# pfcp:
|
||||||
|
# - addr: 127.0.0.6
|
||||||
|
# - addr: ::1
|
||||||
|
#
|
||||||
|
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
|
# pfcp:
|
||||||
|
# - name: localhost
|
||||||
|
#
|
||||||
|
# <GTP-U Server>
|
||||||
#
|
#
|
||||||
# o GTP-U Server(127.0.0.6:2152, [::1]:2152)
|
# o GTP-U Server(127.0.0.6:2152, [::1]:2152)
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr:
|
# - addr: 127.0.0.6
|
||||||
# - 127.0.0.6
|
# - addr: ::1
|
||||||
# - ::1
|
|
||||||
#
|
#
|
||||||
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
# gtpu:
|
# gtpu:
|
||||||
@@ -57,34 +64,27 @@ logger:
|
|||||||
# o Provide custom SGW-U GTP-U address to be advertised inside S1AP messages
|
# o Provide custom SGW-U GTP-U address to be advertised inside S1AP messages
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_addr: 172.24.15.30
|
# advertise: 172.24.15.30
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_addr:
|
# advertise:
|
||||||
# - 127.0.0.1
|
# - 127.0.0.1
|
||||||
# - ::1
|
# - ::1
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - dev: ens3
|
# - dev: ens3
|
||||||
# advertise_name: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
# advertise: sgw1.epc.mnc001.mcc001.3gppnetwork.org
|
||||||
#
|
|
||||||
# <PFCP Server>
|
|
||||||
#
|
|
||||||
# o PFCP Server(127.0.0.6:8805, ::1:8805)
|
|
||||||
# pfcp:
|
|
||||||
# - addr: 127.0.0.6
|
|
||||||
# - addr: ::1
|
|
||||||
#
|
#
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
#
|
#
|
||||||
# sgwc:
|
# sgwc:
|
||||||
@@ -113,12 +113,6 @@ sgwc:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -138,7 +132,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -146,7 +140,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: smf.key
|
# key: smf.key
|
||||||
# pem: smf.pem
|
# pem: smf.pem
|
||||||
#
|
#
|
||||||
@@ -51,7 +51,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://smf.open5gs.org:80)
|
# o SBI Server(http://smf.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: smf.open5gs.org
|
# - name: smf.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.4:7777)
|
# o SBI Server(http://127.0.0.4:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -60,7 +60,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-smf.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
# <PFCP Server>
|
# <PFCP Server>
|
||||||
#
|
#
|
||||||
@@ -69,6 +80,10 @@ logger:
|
|||||||
# - addr: 127.0.0.4
|
# - addr: 127.0.0.4
|
||||||
# - addr: ::1
|
# - addr: ::1
|
||||||
#
|
#
|
||||||
|
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
|
# pfcp:
|
||||||
|
# name: localhost
|
||||||
|
#
|
||||||
# <GTP-C Server>
|
# <GTP-C Server>
|
||||||
#
|
#
|
||||||
# o GTP-C Server(127.0.0.4:2123, [fe80::3%@loopback_devname@]:2123)
|
# o GTP-C Server(127.0.0.4:2123, [fe80::3%@loopback_devname@]:2123)
|
||||||
@@ -83,74 +98,78 @@ logger:
|
|||||||
# - addr: 127.0.0.4
|
# - addr: 127.0.0.4
|
||||||
# - addr: fe80::3%@loopback_devname@
|
# - addr: fe80::3%@loopback_devname@
|
||||||
#
|
#
|
||||||
# <PDN Configuration with UE Pool>
|
# <GTP-U Server>>
|
||||||
|
#
|
||||||
|
# o GTP-U Server(127.0.0.4:2152, [::1]:2152)
|
||||||
|
# gtpu:
|
||||||
|
# - addr: 127.0.0.4
|
||||||
|
# - addr: ::1
|
||||||
|
#
|
||||||
|
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
|
# gtpu:
|
||||||
|
# name: localhost
|
||||||
|
#
|
||||||
|
# <Subnet for UE Pool>
|
||||||
#
|
#
|
||||||
# o IPv4 Pool
|
# o IPv4 Pool
|
||||||
# pdn:
|
# subnet:
|
||||||
# addr: 10.45.0.1/16
|
# addr: 10.45.0.1/16
|
||||||
#
|
#
|
||||||
# o IPv4/IPv6 Pool
|
# o IPv4/IPv6 Pool
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, cafe:2::1/64
|
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||||
# pdn:
|
#
|
||||||
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# - addr: 10.46.0.1/16
|
# - addr: 10.46.0.1/16
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
# - addr: cafe:2::1/64
|
# - addr: 2001:230:babe::1/48
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
#
|
#
|
||||||
# o Multiple Devices (default: ogstun)
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/16
|
|
||||||
# dnn: internet
|
|
||||||
# - addr: cafe:1::1/64
|
|
||||||
# dnn: internet
|
|
||||||
# dev: ogstun2
|
|
||||||
# - addr: 10.46.0.1/16
|
|
||||||
# dnn: ims
|
|
||||||
# dev: ogstun3
|
|
||||||
# - addr: cafe:2::1/64
|
|
||||||
# dnn: ims
|
|
||||||
# dev: ogstun3
|
|
||||||
#
|
|
||||||
# o Pool Range Sample
|
# o Pool Range Sample
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range: 10.45.0.100-10.45.0.200
|
# range: 10.45.0.100-10.45.0.200
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range:
|
# range:
|
||||||
# - 10.45.0.5-10.45.0.50
|
# - 10.45.0.5-10.45.0.50
|
||||||
# - 10.45.0.100-
|
# - 10.45.0.100-
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range:
|
# range:
|
||||||
# - -10.45.0.200
|
# - -10.45.0.200
|
||||||
# - 10.45.0.210-10.45.0.220
|
# - 10.45.0.210-10.45.0.220
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# range:
|
# range:
|
||||||
# - 10.45.0.100-10.45.0.200
|
# - 10.45.0.100-10.45.0.200
|
||||||
# - 10.45.1.100-10.45.1.200
|
# - 10.45.1.100-10.45.1.200
|
||||||
# - addr: cafe::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# range:
|
# range:
|
||||||
# - cafe::a0-cafe:b0
|
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
|
||||||
# - cafe::c0-cafe:d0
|
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
|
||||||
#
|
#
|
||||||
# <Domain Name Server>
|
# <Domain Name Server>
|
||||||
#
|
#
|
||||||
# o Primary/Secondary can be configured. Others are ignored.
|
# o Primary/Secondary can be configured. Others are ignored.
|
||||||
#
|
#
|
||||||
|
# dns:
|
||||||
|
# - 8.8.8.8
|
||||||
|
# - 8.8.4.4
|
||||||
|
# - 2001:4860:4860::8888
|
||||||
|
# - 2001:4860:4860::8844
|
||||||
|
#
|
||||||
# <MTU Size>
|
# <MTU Size>
|
||||||
#
|
#
|
||||||
# o Provisioning a limit on the size of the packets sent by the MS
|
# o Provisioning a limit on the size of the packets sent by the MS
|
||||||
@@ -167,19 +186,152 @@ logger:
|
|||||||
# - 127.0.0.1
|
# - 127.0.0.1
|
||||||
# - ::1
|
# - ::1
|
||||||
#
|
#
|
||||||
|
# <SMF Selection - 5G Core only>
|
||||||
|
# 1. SMF sends SmfInfo(S-NSSAI, DNN, TAI) to the NRF
|
||||||
|
# 2. NRF responds to AMF with SmfInfo during NF-Discovery.
|
||||||
|
# 3. AMF selects SMF based on S-NSSAI, DNN and TAI in SmfInfo.
|
||||||
|
#
|
||||||
|
# Note that if there is no SmfInfo, any AMF can select this SMF.
|
||||||
|
#
|
||||||
|
# o S-NSSAI[SST:1] and DNN[internet] - At least 1 DNN is required in S-NSSAI
|
||||||
|
# info:
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 1
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
#
|
||||||
|
# o S-NSSAI[SST:1 SD:009000] and DNN[internet or ims]
|
||||||
|
# info:
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 1
|
||||||
|
# sd: 009000
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# - ims
|
||||||
|
#
|
||||||
|
# o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:90170 TAC:1]
|
||||||
|
# info:
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 1
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# tai:
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# tac: 1
|
||||||
|
#
|
||||||
|
# o If any of conditions below are met:
|
||||||
|
# - S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:90170 TAC:1-9]
|
||||||
|
# - S-NSSAI[SST:2 SD:000080] and DNN[internet or ims]
|
||||||
|
# - S-NSSAI[SST:4] and DNN[internet] and TAI[PLMN-ID:90170 TAC:10-20,30-40]
|
||||||
|
#
|
||||||
|
# info:
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 1
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# tai:
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# range:
|
||||||
|
# - 1-9
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 2
|
||||||
|
# sd: 000080
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# - ims
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 4
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# tai:
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# range:
|
||||||
|
# - 10-20
|
||||||
|
# - 30-40
|
||||||
|
#
|
||||||
|
# o Complex Example
|
||||||
|
# info:
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 1
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# - sst: 1
|
||||||
|
# sd: 000080
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# - ims
|
||||||
|
# - sst: 1
|
||||||
|
# sd: 009000
|
||||||
|
# dnn:
|
||||||
|
# [internet, ims]
|
||||||
|
# - sst: 2
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# - sst: 3
|
||||||
|
# sd: 123456
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# tai:
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# tac: [1, 2, 3]
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# tac: 4
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# tac:
|
||||||
|
# - 5
|
||||||
|
# - 6
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# range:
|
||||||
|
# - 100-200
|
||||||
|
# - 300-400
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# range:
|
||||||
|
# - 500-600
|
||||||
|
# - 700-800
|
||||||
|
# - 900-1000
|
||||||
|
# - s_nssai:
|
||||||
|
# - sst: 4
|
||||||
|
# dnn:
|
||||||
|
# - internet
|
||||||
|
# tai:
|
||||||
|
# - plmn_id:
|
||||||
|
# mcc: 901
|
||||||
|
# mnc: 70
|
||||||
|
# tac: 99
|
||||||
|
#
|
||||||
|
|
||||||
smf:
|
smf:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
port: 7777
|
port: 7777
|
||||||
gtpc:
|
|
||||||
- addr: 127.0.0.4
|
|
||||||
- addr: ::1
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pdn:
|
gtpc:
|
||||||
|
- addr: 127.0.0.4
|
||||||
|
- addr: ::1
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.4
|
||||||
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -231,10 +383,10 @@ nrf:
|
|||||||
# pfcp:
|
# pfcp:
|
||||||
# addr: 127.0.0.7
|
# addr: 127.0.0.7
|
||||||
#
|
#
|
||||||
# <UPF_SELECTION_MODE - EPC only>
|
# <UPF Selection>
|
||||||
#
|
#
|
||||||
# o Round-Robin
|
# o Round-Robin
|
||||||
# (note that round robin can be disabled for a particular node
|
# (note that round robin can be disabled for a particular node
|
||||||
# by setting flag 'rr' to 0)
|
# by setting flag 'rr' to 0)
|
||||||
#
|
#
|
||||||
# upf:
|
# upf:
|
||||||
@@ -244,8 +396,8 @@ nrf:
|
|||||||
# rr: 0
|
# rr: 0
|
||||||
# - addr: 127.0.0.19
|
# - addr: 127.0.0.19
|
||||||
#
|
#
|
||||||
# o UPF selection by eNodeB TAC
|
# o UPF selection by eNodeB TAC
|
||||||
# (either single TAC or multiple TACs, DECIMAL representation)
|
# (either single TAC or multiple TACs, DECIMAL representation)
|
||||||
#
|
#
|
||||||
# upf:
|
# upf:
|
||||||
# pfcp:
|
# pfcp:
|
||||||
@@ -254,7 +406,7 @@ nrf:
|
|||||||
# - addr: 127.0.0.12
|
# - addr: 127.0.0.12
|
||||||
# tac: [3,5,8]
|
# tac: [3,5,8]
|
||||||
#
|
#
|
||||||
# o UPF selection by UE's DNN/APN (either single DNN/APN or multiple DNNs/APNs)
|
# o UPF selection by UE's DNN/APN (either single DNN/APN or multiple DNNs/APNs)
|
||||||
#
|
#
|
||||||
# upf:
|
# upf:
|
||||||
# pfcp:
|
# pfcp:
|
||||||
@@ -263,8 +415,8 @@ nrf:
|
|||||||
# - addr: 127.0.0.12
|
# - addr: 127.0.0.12
|
||||||
# dnn: [internet, web]
|
# dnn: [internet, web]
|
||||||
#
|
#
|
||||||
# o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit)
|
# o UPF selection by CellID(e_cell_id: 28bit, nr_cell_id: 36bit)
|
||||||
# (either single enb_id or multiple enb_ids, HEX representation)
|
# (either single enb_id or multiple enb_ids, HEX representation)
|
||||||
#
|
#
|
||||||
# upf:
|
# upf:
|
||||||
# pfcp:
|
# pfcp:
|
||||||
@@ -292,12 +444,6 @@ upf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -317,7 +463,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -325,7 +471,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
@@ -353,4 +499,13 @@ pool:
|
|||||||
# o Message Wait Duration (3000 ms)
|
# o Message Wait Duration (3000 ms)
|
||||||
# message:
|
# message:
|
||||||
# duration: 3000
|
# duration: 3000
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (Default : 300 ms)
|
||||||
|
# Time to wait for SMF to send
|
||||||
|
# PFCP Session Modification Request(Remove Indirect Tunnel) to the UPF
|
||||||
|
# after sending Nsmf_PDUSession_UpdateSMContext Response(hoState:COMPLETED)
|
||||||
|
#
|
||||||
|
# o Handover Wait Duration (500ms)
|
||||||
|
# handover:
|
||||||
|
# duration: 500
|
||||||
time:
|
time:
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: udm.key
|
# key: udm.key
|
||||||
# pem: udm.pem
|
# pem: udm.pem
|
||||||
#
|
#
|
||||||
@@ -51,7 +51,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://udm.open5gs.org:80)
|
# o SBI Server(http://udm.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: udm.open5gs.org
|
# - name: udm.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.12:7777)
|
# o SBI Server(http://127.0.0.12:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -60,7 +60,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-udm.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
udm:
|
udm:
|
||||||
sbi:
|
sbi:
|
||||||
@@ -115,12 +126,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -140,7 +145,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -148,7 +153,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(https://<all address avaiable>:443)
|
# o SBI Server(https://<all address avaiable>:443)
|
||||||
# sbi:
|
# sbi:
|
||||||
# tls:
|
# - tls:
|
||||||
# key: udr.key
|
# key: udr.key
|
||||||
# pem: udr.pem
|
# pem: udr.pem
|
||||||
#
|
#
|
||||||
@@ -53,7 +53,7 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://udr.open5gs.org:80)
|
# o SBI Server(http://udr.open5gs.org:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# name: udr.open5gs.org
|
# - name: udr.open5gs.org
|
||||||
#
|
#
|
||||||
# o SBI Server(http://127.0.0.20:7777)
|
# o SBI Server(http://127.0.0.20:7777)
|
||||||
# sbi:
|
# sbi:
|
||||||
@@ -62,7 +62,18 @@ logger:
|
|||||||
#
|
#
|
||||||
# o SBI Server(http://<eth0 IP address>:80)
|
# o SBI Server(http://<eth0 IP address>:80)
|
||||||
# sbi:
|
# sbi:
|
||||||
# dev: eth0
|
# - dev: eth0
|
||||||
|
#
|
||||||
|
# o Provide custom SBI address to be advertised to NRF
|
||||||
|
# sbi:
|
||||||
|
# - dev: eth0
|
||||||
|
# advertise: open5gs-udr.svc.local
|
||||||
|
#
|
||||||
|
# sbi:
|
||||||
|
# - addr: localhost
|
||||||
|
# advertise:
|
||||||
|
# - 127.0.0.99
|
||||||
|
# - ::1
|
||||||
#
|
#
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
@@ -117,12 +128,6 @@ nrf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -142,7 +147,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -150,7 +155,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -31,16 +31,16 @@ logger:
|
|||||||
# - addr: 127.0.0.7
|
# - addr: 127.0.0.7
|
||||||
# - addr: ::1
|
# - addr: ::1
|
||||||
#
|
#
|
||||||
# <GTP-U Server>>
|
# o PFCP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
|
# pfcp:
|
||||||
|
# name: localhost
|
||||||
#
|
#
|
||||||
# o GTP-U Server(all address available)
|
# <GTP-U Server>>
|
||||||
# gtpu:
|
|
||||||
#
|
#
|
||||||
# o GTP-U Server(127.0.0.7:2152, [::1]:2152)
|
# o GTP-U Server(127.0.0.7:2152, [::1]:2152)
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr:
|
# - addr: 127.0.0.7
|
||||||
# - 127.0.0.7
|
# - addr: ::1
|
||||||
# - ::1
|
|
||||||
#
|
#
|
||||||
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
# o GTP-U Server(127.0.0.1:2152, [::1]:2152)
|
||||||
# gtpu:
|
# gtpu:
|
||||||
@@ -64,111 +64,86 @@ logger:
|
|||||||
# o Provide custom UPF GTP-U address to be advertised inside NGAP messages
|
# o Provide custom UPF GTP-U address to be advertised inside NGAP messages
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_addr: 172.24.15.30
|
# advertise: 172.24.15.30
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_addr:
|
# advertise:
|
||||||
# - 127.0.0.1
|
# - 127.0.0.1
|
||||||
# - ::1
|
# - ::1
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - addr: 10.4.128.21
|
# - addr: 10.4.128.21
|
||||||
# advertise_name: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
||||||
#
|
#
|
||||||
# gtpu:
|
# gtpu:
|
||||||
# - dev: ens3
|
# - dev: ens3
|
||||||
# advertise_name: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
# advertise: upf1.5gc.mnc001.mcc001.3gppnetwork.org
|
||||||
#
|
#
|
||||||
|
# <Subnet for UE network>
|
||||||
#
|
#
|
||||||
# <PDN Configuration with UE Pool>
|
# Note that you need to setup your UE network using TUN device.
|
||||||
|
# (ogstun, ogstun2, ogstunX, ..)
|
||||||
#
|
#
|
||||||
# o IPv4 Pool
|
# o IPv4 Pool
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# addr: 10.45.0.1/16
|
# addr: 10.45.0.1/16
|
||||||
#
|
#
|
||||||
# o IPv4/IPv6 Pool
|
# o IPv4/IPv6 Pool
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, cafe:2::1/64
|
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||||
# All other APNs use 10.45.0.1/16, cafe:1::1/64
|
# All other APNs use 10.45.0.1/16, 2001:230:cafe::1/48
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ 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 10.46.0.1/16 dev ogstun
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# - addr: 10.46.0.1/16
|
# - addr: 10.46.0.1/16
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
# - addr: cafe:2::1/64
|
# - addr: 2001:230:babe::1/48
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
#
|
#
|
||||||
# o Multiple Devices (default: ogstun)
|
# o Multiple Devices (default: ogstun)
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun2
|
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun2
|
||||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
|
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
|
||||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun3
|
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun3
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# dnn: internet
|
# dnn: internet
|
||||||
# dev: ogstun2
|
# dev: ogstun2
|
||||||
# - addr: 10.46.0.1/16
|
# - addr: 10.46.0.1/16
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
# dev: ogstun3
|
# dev: ogstun3
|
||||||
# - addr: cafe:2::1/64
|
# - addr: 2001:230:babe::1/48
|
||||||
# dnn: ims
|
# dnn: ims
|
||||||
# dev: ogstun3
|
# dev: ogstun3
|
||||||
#
|
#
|
||||||
# o Pool Range Sample
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/24
|
|
||||||
# range: 10.45.0.100-10.45.0.200
|
|
||||||
#
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/24
|
|
||||||
# range:
|
|
||||||
# - 10.45.0.5-10.45.0.50
|
|
||||||
# - 10.45.0.100-
|
|
||||||
#
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/24
|
|
||||||
# range:
|
|
||||||
# - -10.45.0.200
|
|
||||||
# - 10.45.0.210-10.45.0.220
|
|
||||||
#
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/16
|
|
||||||
# range:
|
|
||||||
# - 10.45.0.100-10.45.0.200
|
|
||||||
# - 10.45.1.100-10.45.1.200
|
|
||||||
# - addr: cafe::1/64
|
|
||||||
# range:
|
|
||||||
# - cafe::a0-cafe:b0
|
|
||||||
# - cafe::c0-cafe:d0
|
|
||||||
#
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
#
|
#
|
||||||
# smf:
|
# smf:
|
||||||
@@ -197,13 +172,6 @@ smf:
|
|||||||
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
# o Prefer IPv4 instead of IPv6 for estabishing new GTP connections.
|
||||||
# prefer_ipv4: true
|
# prefer_ipv4: true
|
||||||
#
|
#
|
||||||
# o Enable Multicast traffic to the UE
|
|
||||||
# multicast: true
|
|
||||||
#
|
|
||||||
# o Disable Stateless Address Autoconfiguration for IPv6
|
|
||||||
# no_slaac: true
|
|
||||||
#
|
|
||||||
#
|
|
||||||
parameter:
|
parameter:
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -223,7 +191,7 @@ max:
|
|||||||
# To connect more UEs, you need to increase the size further.
|
# To connect more UEs, you need to increase the size further.
|
||||||
#
|
#
|
||||||
# - Pool-size 128 => 65536 Number
|
# - Pool-size 128 => 65536 Number
|
||||||
# - Pool-size 256 => 8192 Number
|
# - Pool-size 256 => 16384 Number
|
||||||
# - Pool-size 512 => 4096 Number
|
# - Pool-size 512 => 4096 Number
|
||||||
# - Pool-size 1024 => 1024 Number
|
# - Pool-size 1024 => 1024 Number
|
||||||
# - Pool-size 2048 => 512 Number
|
# - Pool-size 2048 => 512 Number
|
||||||
@@ -231,7 +199,7 @@ max:
|
|||||||
# - Pool-size 1024*1024 => 8 Number
|
# - Pool-size 1024*1024 => 8 Number
|
||||||
#
|
#
|
||||||
# 128: 65536
|
# 128: 65536
|
||||||
# 256: 8192
|
# 256: 16384
|
||||||
# 512: 4096
|
# 512: 4096
|
||||||
# 1024: 1024
|
# 1024: 1024
|
||||||
# 2048: 512
|
# 2048: 512
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
port: 7777
|
port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -129,19 +133,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -200,6 +204,15 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
port: 7777
|
port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -105,25 +109,26 @@ amf:
|
|||||||
- addr: 127.0.0.5
|
- addr: 127.0.0.5
|
||||||
guami:
|
guami:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
mcc: 208
|
mcc: 901
|
||||||
mnc: 93
|
mnc: 70
|
||||||
amf_id:
|
amf_id:
|
||||||
region: 202
|
region: 202
|
||||||
set: 1016
|
set: 1016
|
||||||
tai:
|
tai:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
mcc: 208
|
mcc: 901
|
||||||
mnc: 93
|
mnc: 70
|
||||||
tac: 1
|
tac: 1
|
||||||
plmn_support:
|
plmn_support:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
mcc: 208
|
mcc: 901
|
||||||
mnc: 93
|
mnc: 70
|
||||||
s_nssai:
|
s_nssai:
|
||||||
- sst: 1
|
- sst: 1
|
||||||
sd: 010203
|
|
||||||
- sst: 1
|
- sst: 1
|
||||||
sd: 112233
|
sd: 000080
|
||||||
|
- sst: 1
|
||||||
|
sd: 009000
|
||||||
security:
|
security:
|
||||||
integrity_order : [ NIA2, NIA1 ]
|
integrity_order : [ NIA2, NIA1 ]
|
||||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||||
@@ -132,19 +137,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -203,6 +208,26 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
- addr: 127.0.0.19
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
sd: 000080
|
||||||
|
- addr: 127.0.0.10
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
sd: 009000
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
# sbi:
|
# sbi:
|
||||||
# - addr: 127.0.0.4
|
# - addr: 127.0.0.4
|
||||||
# port: 7777
|
# port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -129,19 +133,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -200,6 +204,16 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ Name=ogstun
|
|||||||
|
|
||||||
[Network]
|
[Network]
|
||||||
Address=10.45.0.1/16
|
Address=10.45.0.1/16
|
||||||
Address=cafe::1/64
|
Address=2001:230:cafe::1/48
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ systemd_conf_in = '''
|
|||||||
open5gs-ausfd.service
|
open5gs-ausfd.service
|
||||||
open5gs-udmd.service
|
open5gs-udmd.service
|
||||||
open5gs-pcfd.service
|
open5gs-pcfd.service
|
||||||
|
open5gs-nssfd.service
|
||||||
open5gs-udrd.service
|
open5gs-udrd.service
|
||||||
'''.split()
|
'''.split()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Open5GS NRF Daemon
|
Description=Open5GS NRF Daemon
|
||||||
After=networking.service
|
Wants=mongodb.service mongod.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
18
configs/systemd/open5gs-nssfd.service.in
Normal file
18
configs/systemd/open5gs-nssfd.service.in
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Open5GS NSSF Daemon
|
||||||
|
After=networking.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
User=open5gs
|
||||||
|
Group=open5gs
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
ExecStart=@bindir@/open5gs-nssfd -c @sysconfdir@/open5gs/nssf.yaml
|
||||||
|
RestartSec=2
|
||||||
|
RestartPreventExitStatus=1
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Open5GS PCF Daemon
|
Description=Open5GS PCF Daemon
|
||||||
After=networking.service
|
Wants=mongodb.service mongod.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Open5GS UDR Daemon
|
Description=Open5GS UDR Daemon
|
||||||
After=networking.service
|
Wants=mongodb.service mongod.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
# sbi:
|
# sbi:
|
||||||
# - addr: 127.0.0.4
|
# - addr: 127.0.0.4
|
||||||
# port: 7777
|
# port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -132,19 +136,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -163,6 +167,8 @@ hss:
|
|||||||
connect:
|
connect:
|
||||||
- identity: mme.localdomain
|
- identity: mme.localdomain
|
||||||
addr: 127.0.0.2
|
addr: 127.0.0.2
|
||||||
|
- identity: ims.localdomain
|
||||||
|
addr: 127.0.0.1
|
||||||
pcrf:
|
pcrf:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
identity: pcrf.localdomain
|
identity: pcrf.localdomain
|
||||||
@@ -180,7 +186,7 @@ pcrf:
|
|||||||
connect:
|
connect:
|
||||||
- identity: smf.localdomain
|
- identity: smf.localdomain
|
||||||
addr: 127.0.0.4
|
addr: 127.0.0.4
|
||||||
- identity: pcscf.localdomain
|
- identity: ims.localdomain
|
||||||
addr: 127.0.0.1
|
addr: 127.0.0.1
|
||||||
|
|
||||||
#nrf:
|
#nrf:
|
||||||
@@ -205,6 +211,16 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ parameter:
|
|||||||
# no_ausf: true
|
# no_ausf: true
|
||||||
# no_udm: true
|
# no_udm: true
|
||||||
# no_pcf: true
|
# no_pcf: true
|
||||||
|
# no_nssf: true
|
||||||
# no_udr: true
|
# no_udr: true
|
||||||
# no_mme: true
|
# no_mme: true
|
||||||
# no_sgwc: true
|
# no_sgwc: true
|
||||||
@@ -67,14 +68,17 @@ smf:
|
|||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
port: 7777
|
port: 7777
|
||||||
|
pfcp:
|
||||||
|
- addr: 127.0.0.4
|
||||||
gtpc:
|
gtpc:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pfcp:
|
gtpu:
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
pdn:
|
- addr: ::1
|
||||||
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
@@ -132,19 +136,19 @@ amf:
|
|||||||
amf_name: open5gs-amf0
|
amf_name: open5gs-amf0
|
||||||
|
|
||||||
sgwu:
|
sgwu:
|
||||||
gtpu:
|
|
||||||
- addr: 127.0.0.6
|
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.6
|
- addr: 127.0.0.6
|
||||||
|
gtpu:
|
||||||
|
- addr: 127.0.0.6
|
||||||
|
|
||||||
upf:
|
upf:
|
||||||
pfcp:
|
pfcp:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
hss:
|
hss:
|
||||||
freeDiameter:
|
freeDiameter:
|
||||||
@@ -205,6 +209,16 @@ pcf:
|
|||||||
- addr: 127.0.0.13
|
- addr: 127.0.0.13
|
||||||
port: 7777
|
port: 7777
|
||||||
|
|
||||||
|
nssf:
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.14
|
||||||
|
port: 7777
|
||||||
|
nsi:
|
||||||
|
- addr: ::1
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
|
||||||
udr:
|
udr:
|
||||||
sbi:
|
sbi:
|
||||||
- addr: 127.0.0.20
|
- addr: 127.0.0.20
|
||||||
|
|||||||
180
debian/changelog
vendored
180
debian/changelog
vendored
@@ -1,3 +1,183 @@
|
|||||||
|
open5gs (2.2.6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* HSS Cx Added
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Apr 2021 21:10:43 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.6~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* HSS Cx Added
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Apr 2021 21:09:14 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.6~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* HSS Cx Added
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Apr 2021 21:07:19 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.5) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Sat, 03 Apr 2021 14:16:23 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.5~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Sat, 03 Apr 2021 14:14:53 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.5~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Sat, 03 Apr 2021 14:13:33 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.4) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 01 Apr 2021 16:45:22 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.4~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 01 Apr 2021 16:43:54 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.4~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 01 Apr 2021 16:42:31 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.3) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 29 Mar 2021 22:44:54 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.3~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 29 Mar 2021 22:43:54 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.3~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 29 Mar 2021 22:42:53 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Mar 2021 21:48:13 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.2~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Mar 2021 21:47:12 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.2~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Fri, 19 Mar 2021 21:45:47 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* UE IPv6 Support
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:06:16 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.1~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* UE IPv6 Support
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:05:00 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.1~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* UE IPv6 Support
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 15 Mar 2021 10:03:39 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* DB Schame Changes
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:31:35 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.0~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* DB Schame Changes
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:30:31 +0900
|
||||||
|
|
||||||
|
open5gs (2.2.0~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* DB Schame Changes
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Mar 2021 21:29:03 +0900
|
||||||
|
|
||||||
|
open5gs (2.1.7) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:27:23 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.7~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:26:08 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.7~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Mon, 08 Feb 2021 22:23:55 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:18:13 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.6~bionic1) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:17:04 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.6~focal1) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Thu, 04 Feb 2021 09:14:17 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.5) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:47:59 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.5~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:46:57 -0500
|
||||||
|
|
||||||
|
open5gs (2.1.5~focal) focal; urgency=medium
|
||||||
|
|
||||||
|
* Bug Fixed
|
||||||
|
|
||||||
|
-- Sukchan Lee <acetcom@gmail.com> Tue, 02 Feb 2021 14:45:48 -0500
|
||||||
|
|
||||||
open5gs (2.1.4) unstable; urgency=medium
|
open5gs (2.1.4) unstable; urgency=medium
|
||||||
|
|
||||||
* Paging was added
|
* Paging was added
|
||||||
|
|||||||
13
debian/control
vendored
13
debian/control
vendored
@@ -199,6 +199,18 @@ Description: PCF (Policy Control Function)
|
|||||||
.
|
.
|
||||||
This package provides the PCF (Policy Control Function)
|
This package provides the PCF (Policy Control Function)
|
||||||
|
|
||||||
|
Package: open5gs-nssf
|
||||||
|
Architecture: any
|
||||||
|
Multi-Arch: same
|
||||||
|
Depends: ${shlibs:Depends},
|
||||||
|
${misc:Depends},
|
||||||
|
open5gs-common (= ${binary:Version})
|
||||||
|
Description: NSSF (Network Slice Selection 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 NSSF (Network Slice Selection Function)
|
||||||
|
|
||||||
Package: open5gs-udr
|
Package: open5gs-udr
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Multi-Arch: same
|
Multi-Arch: same
|
||||||
@@ -228,6 +240,7 @@ Depends: ${misc:Depends},
|
|||||||
open5gs-ausf (= ${binary:Version}),
|
open5gs-ausf (= ${binary:Version}),
|
||||||
open5gs-udm (= ${binary:Version}),
|
open5gs-udm (= ${binary:Version}),
|
||||||
open5gs-pcf (= ${binary:Version}),
|
open5gs-pcf (= ${binary:Version}),
|
||||||
|
open5gs-nssf (= ${binary:Version}),
|
||||||
open5gs-udr (= ${binary:Version})
|
open5gs-udr (= ${binary:Version})
|
||||||
Description: 5G Core and EPC (metapackage)
|
Description: 5G Core and EPC (metapackage)
|
||||||
Open5GS is a C-language implementation of 5G Core and EPC
|
Open5GS is a C-language implementation of 5G Core and EPC
|
||||||
|
|||||||
2
debian/open5gs-common.install
vendored
2
debian/open5gs-common.install
vendored
@@ -3,4 +3,4 @@ usr/lib/*/libfd*.so*
|
|||||||
usr/lib/*/freeDiameter/*.fdx
|
usr/lib/*/freeDiameter/*.fdx
|
||||||
configs/freeDiameter/cacert.pem /etc/freeDiameter
|
configs/freeDiameter/cacert.pem /etc/freeDiameter
|
||||||
configs/logrotate/open5gs /etc/logrotate.d
|
configs/logrotate/open5gs /etc/logrotate.d
|
||||||
misc/db/open5gs-dbctl /usr/bin
|
#misc/db/open5gs-dbctl /usr/bin
|
||||||
|
|||||||
3
debian/open5gs-nssf.install
vendored
Normal file
3
debian/open5gs-nssf.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
usr/bin/open5gs-nssfd
|
||||||
|
configs/open5gs/nssf.yaml etc/open5gs
|
||||||
|
configs/systemd/open5gs-nssfd.service lib/systemd/system
|
||||||
@@ -10,7 +10,7 @@ COPY setup.sh /root
|
|||||||
|
|
||||||
ARG USER=open5gs
|
ARG USER=open5gs
|
||||||
ARG REPO=open5gs
|
ARG REPO=open5gs
|
||||||
ARG BRANCH=master
|
ARG BRANCH=main
|
||||||
RUN git clone https://github.com/$USER/$REPO
|
RUN git clone https://github.com/$USER/$REPO
|
||||||
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/open5gs-ver.json
|
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/open5gs-ver.json
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||||
ip addr add 10.45.0.1/16 dev ogstun
|
ip addr add 10.45.0.1/16 dev ogstun
|
||||||
ip addr del cafe::1/64 dev ogstun 2> /dev/null
|
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||||
ip addr add cafe::1/64 dev ogstun
|
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||||
ip addr add 10.45.0.1/16 dev ogstun
|
ip addr add 10.45.0.1/16 dev ogstun
|
||||||
ip addr del cafe::1/64 dev ogstun 2> /dev/null
|
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||||
ip addr add cafe::1/64 dev ogstun
|
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||||
ip addr add 10.45.0.1/16 dev ogstun
|
ip addr add 10.45.0.1/16 dev ogstun
|
||||||
ip addr del cafe::1/64 dev ogstun 2> /dev/null
|
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||||
ip addr add cafe::1/64 dev ogstun
|
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||||
ip addr add 10.45.0.1/16 dev ogstun
|
ip addr add 10.45.0.1/16 dev ogstun
|
||||||
ip addr del cafe::1/64 dev ogstun 2> /dev/null
|
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||||
ip addr add cafe::1/64 dev ogstun
|
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||||||
fi
|
fi
|
||||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||||
ip addr add 10.45.0.1/16 dev ogstun
|
ip addr add 10.45.0.1/16 dev ogstun
|
||||||
ip addr del cafe::1/64 dev ogstun 2> /dev/null
|
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||||
ip addr add cafe::1/64 dev ogstun
|
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ source "https://rubygems.org"
|
|||||||
# This will help ensure the proper Jekyll version is running.
|
# This will help ensure the proper Jekyll version is running.
|
||||||
# Happy Jekylling!
|
# Happy Jekylling!
|
||||||
|
|
||||||
gem "jekyll", "~> 3.8.5"
|
gem "jekyll", "~> 4.2.0"
|
||||||
|
gem "webrick", "~> 1.7.0"
|
||||||
gem "minima", "~> 2.0"
|
gem "minima", "~> 2.0"
|
||||||
gem 'jekyll-seo-tag'
|
gem 'jekyll-seo-tag'
|
||||||
|
|
||||||
|
|||||||
@@ -1,77 +1,83 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
addressable (2.6.0)
|
addressable (2.7.0)
|
||||||
public_suffix (>= 2.0.2, < 4.0)
|
public_suffix (>= 2.0.2, < 5.0)
|
||||||
colorator (1.1.0)
|
colorator (1.1.0)
|
||||||
concurrent-ruby (1.1.5)
|
concurrent-ruby (1.1.8)
|
||||||
em-websocket (0.5.1)
|
em-websocket (0.5.2)
|
||||||
eventmachine (>= 0.12.9)
|
eventmachine (>= 0.12.9)
|
||||||
http_parser.rb (~> 0.6.0)
|
http_parser.rb (~> 0.6.0)
|
||||||
eventmachine (1.2.7)
|
eventmachine (1.2.7)
|
||||||
ffi (1.10.0)
|
ffi (1.15.0)
|
||||||
forwardable-extended (2.6.0)
|
forwardable-extended (2.6.0)
|
||||||
http_parser.rb (0.6.0)
|
http_parser.rb (0.6.0)
|
||||||
i18n (0.9.5)
|
i18n (1.8.9)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jekyll (3.8.5)
|
jekyll (4.2.0)
|
||||||
addressable (~> 2.4)
|
addressable (~> 2.4)
|
||||||
colorator (~> 1.0)
|
colorator (~> 1.0)
|
||||||
em-websocket (~> 0.5)
|
em-websocket (~> 0.5)
|
||||||
i18n (~> 0.7)
|
i18n (~> 1.0)
|
||||||
jekyll-sass-converter (~> 1.0)
|
jekyll-sass-converter (~> 2.0)
|
||||||
jekyll-watch (~> 2.0)
|
jekyll-watch (~> 2.0)
|
||||||
kramdown (~> 1.14)
|
kramdown (~> 2.3)
|
||||||
|
kramdown-parser-gfm (~> 1.0)
|
||||||
liquid (~> 4.0)
|
liquid (~> 4.0)
|
||||||
mercenary (~> 0.3.3)
|
mercenary (~> 0.4.0)
|
||||||
pathutil (~> 0.9)
|
pathutil (~> 0.9)
|
||||||
rouge (>= 1.7, < 4)
|
rouge (~> 3.0)
|
||||||
safe_yaml (~> 1.0)
|
safe_yaml (~> 1.0)
|
||||||
jekyll-feed (0.12.1)
|
terminal-table (~> 2.0)
|
||||||
|
jekyll-feed (0.15.1)
|
||||||
jekyll (>= 3.7, < 5.0)
|
jekyll (>= 3.7, < 5.0)
|
||||||
jekyll-redirect-from (0.15.0)
|
jekyll-redirect-from (0.16.0)
|
||||||
jekyll (>= 3.3, < 5.0)
|
jekyll (>= 3.3, < 5.0)
|
||||||
jekyll-sass-converter (1.5.2)
|
jekyll-sass-converter (2.1.0)
|
||||||
sass (~> 3.4)
|
sassc (> 2.0.1, < 3.0)
|
||||||
jekyll-seo-tag (2.6.0)
|
jekyll-seo-tag (2.7.1)
|
||||||
jekyll (~> 3.3)
|
jekyll (>= 3.8, < 5.0)
|
||||||
jekyll-watch (2.2.1)
|
jekyll-watch (2.2.1)
|
||||||
listen (~> 3.0)
|
listen (~> 3.0)
|
||||||
kramdown (1.17.0)
|
kramdown (2.3.1)
|
||||||
|
rexml
|
||||||
|
kramdown-parser-gfm (1.1.0)
|
||||||
|
kramdown (~> 2.0)
|
||||||
liquid (4.0.3)
|
liquid (4.0.3)
|
||||||
listen (3.1.5)
|
listen (3.5.0)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
ruby_dep (~> 1.2)
|
mercenary (0.4.0)
|
||||||
mercenary (0.3.6)
|
minima (2.5.1)
|
||||||
minima (2.5.0)
|
jekyll (>= 3.5, < 5.0)
|
||||||
jekyll (~> 3.5)
|
|
||||||
jekyll-feed (~> 0.9)
|
jekyll-feed (~> 0.9)
|
||||||
jekyll-seo-tag (~> 2.1)
|
jekyll-seo-tag (~> 2.1)
|
||||||
pathutil (0.16.2)
|
pathutil (0.16.2)
|
||||||
forwardable-extended (~> 2.6)
|
forwardable-extended (~> 2.6)
|
||||||
public_suffix (3.0.3)
|
public_suffix (4.0.6)
|
||||||
rb-fsevent (0.10.3)
|
rb-fsevent (0.10.4)
|
||||||
rb-inotify (0.10.0)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
rouge (3.3.0)
|
rexml (3.2.4)
|
||||||
ruby_dep (1.5.0)
|
rouge (3.26.0)
|
||||||
safe_yaml (1.0.5)
|
safe_yaml (1.0.5)
|
||||||
sass (3.7.4)
|
sassc (2.4.0)
|
||||||
sass-listen (~> 4.0.0)
|
ffi (~> 1.9)
|
||||||
sass-listen (4.0.0)
|
terminal-table (2.0.0)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
unicode-display_width (1.7.0)
|
||||||
|
webrick (1.7.0)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
jekyll (~> 3.8.5)
|
jekyll (~> 4.2.0)
|
||||||
jekyll-feed (~> 0.6)
|
jekyll-feed (~> 0.6)
|
||||||
jekyll-redirect-from
|
jekyll-redirect-from
|
||||||
jekyll-seo-tag
|
jekyll-seo-tag
|
||||||
minima (~> 2.0)
|
minima (~> 2.0)
|
||||||
|
webrick (~> 1.7.0)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.1
|
2.2.15
|
||||||
|
|||||||
@@ -52,8 +52,9 @@ The Open5GS 5G SA Core contains the following functions:
|
|||||||
* UDM - Unified Data Management
|
* UDM - Unified Data Management
|
||||||
* UDR - Unified Data Repository
|
* UDR - Unified Data Repository
|
||||||
* PCF - Policy and Charging Function
|
* PCF - Policy and Charging Function
|
||||||
|
* NSSF - Network Slice Selection Function
|
||||||
|
|
||||||
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). Finally there is the PCF, used for charging and enforcing subscriber policies.
|
The 5G SA core works in a different way to the 4G core - it uses a **Service Based Architecture** (SBI). **Control plane** functions are configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations) connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/ PGWC). The NSSF provides a way to select the network slice. Finally there is the PCF, used for charging and enforcing subscriber policies.
|
||||||
|
|
||||||
The 5G SA core **user plane** is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and the external WAN. It connects back to the SMF too.
|
The 5G SA core **user plane** is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and the external WAN. It connects back to the SMF too.
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.
|
|||||||
## 3. Install the WebUI of Open5GS
|
## 3. Install the WebUI of Open5GS
|
||||||
---
|
---
|
||||||
|
|
||||||
The WebUI allows you to interactively edit subscriber data. While it is not essential to use this, it makes things easier when you are just starting out on your Open5GS adventure. (A [command line tool](https://github.com/{{ site.github_username }}/open5gs/blob/master/misc/db/open5gs-dbctl) is available for advanced users).
|
The WebUI allows you to interactively edit subscriber data. While it is not essential to use this, it makes things easier when you are just starting out on your Open5GS adventure. (A [command line tool](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/db/open5gs-dbctl) is available for advanced users).
|
||||||
|
|
||||||
|
|
||||||
[Node.js](https://nodejs.org/) is required to install the WebUI of Open5GS
|
[Node.js](https://nodejs.org/) is required to install the WebUI of Open5GS
|
||||||
@@ -218,6 +219,7 @@ NRF-sbi = 127.0.0.10:7777 for 5G SBI
|
|||||||
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
||||||
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
||||||
PCF-sbi = 127.0.0.13:7777 for 5G SBI
|
PCF-sbi = 127.0.0.13:7777 for 5G SBI
|
||||||
|
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
|
||||||
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -228,7 +230,7 @@ You will need to modify your 4G MME config to support your PLMN and TAC. The int
|
|||||||
If you are aiming to connect an external eNB to your core, you will also need to change the S1AP bind address of the MME **and** the GTP-U bind address of the SGWU. If you are running an eNB stack locally, you will not need to make these changes.
|
If you are aiming to connect an external eNB to your core, you will also need to change the S1AP bind address of the MME **and** the GTP-U bind address of the SGWU. If you are running an eNB stack locally, you will not need to make these changes.
|
||||||
|
|
||||||
|
|
||||||
Modify [/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
Modify [/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
||||||
@@ -260,7 +262,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
Modify [/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
||||||
|
|
||||||
@@ -287,7 +289,7 @@ You will need to modify your 5G AMF config to support your PLMN and TAC. The int
|
|||||||
If you are aiming to connect an external gNB to your core, you will also need to change the NGAP bind address of the AMF **and** the GTPU bind address of the UPF. If you are running an gNB stack locally, you will not need to make these changes.
|
If you are aiming to connect an external gNB to your core, you will also need to change the NGAP bind address of the AMF **and** the GTPU bind address of the UPF. If you are running an gNB stack locally, you will not need to make these changes.
|
||||||
|
|
||||||
|
|
||||||
Modify [/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
Modify [/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
||||||
@@ -316,7 +318,7 @@ amf:
|
|||||||
+ mcc: 001 # set your PLMN-MCC
|
+ mcc: 001 # set your PLMN-MCC
|
||||||
+ mnc: 01 # set your PLMN-MNC
|
+ mnc: 01 # set your PLMN-MNC
|
||||||
+ tac: 2 # should match the TAC used by your gNB
|
+ tac: 2 # should match the TAC used by your gNB
|
||||||
plmn:
|
plmn_support:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
- mcc: 901
|
- mcc: 901
|
||||||
- mnc: 70
|
- mnc: 70
|
||||||
@@ -328,7 +330,7 @@ amf:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U address.
|
Modify [/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
||||||
|
|
||||||
@@ -338,9 +340,9 @@ upf:
|
|||||||
gtpu:
|
gtpu:
|
||||||
- - addr: 127.0.0.7
|
- - addr: 127.0.0.7
|
||||||
+ - addr: 10.11.0.7 # for external gNB - a local address that can be reached by the gNB
|
+ - addr: 10.11.0.7 # for external gNB - a local address that can be reached by the gNB
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -414,11 +416,13 @@ target prot opt source destination
|
|||||||
|
|
||||||
To enable forwarding and add the NAT rule, enter
|
To enable forwarding and add the NAT rule, enter
|
||||||
```bash
|
```bash
|
||||||
### Enable IPv4 Forwarding
|
### Enable IPv4/IPv6 Forwarding
|
||||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
$ sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
### Add NAT Rule
|
### Add NAT Rule
|
||||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||||
|
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -461,6 +465,7 @@ $ sudo systemctl stop open5gs-nrfd
|
|||||||
$ sudo systemctl stop open5gs-ausfd
|
$ sudo systemctl stop open5gs-ausfd
|
||||||
$ sudo systemctl stop open5gs-udmd
|
$ sudo systemctl stop open5gs-udmd
|
||||||
$ sudo systemctl stop open5gs-pcfd
|
$ sudo systemctl stop open5gs-pcfd
|
||||||
|
$ sudo systemctl stop open5gs-nssfd
|
||||||
$ sudo systemctl stop open5gs-udrd
|
$ sudo systemctl stop open5gs-udrd
|
||||||
$ sudo systemctl stop open5gs-webui
|
$ sudo systemctl stop open5gs-webui
|
||||||
```
|
```
|
||||||
@@ -478,6 +483,7 @@ $ sudo systemctl restart open5gs-nrfd
|
|||||||
$ sudo systemctl restart open5gs-ausfd
|
$ sudo systemctl restart open5gs-ausfd
|
||||||
$ sudo systemctl restart open5gs-udmd
|
$ sudo systemctl restart open5gs-udmd
|
||||||
$ sudo systemctl restart open5gs-pcfd
|
$ sudo systemctl restart open5gs-pcfd
|
||||||
|
$ sudo systemctl restart open5gs-nssfd
|
||||||
$ sudo systemctl restart open5gs-udrd
|
$ sudo systemctl restart open5gs-udrd
|
||||||
$ sudo systemctl restart open5gs-webui
|
$ sudo systemctl restart open5gs-webui
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ Create the TUN device with the interface name `ogstun`.
|
|||||||
```bash
|
```bash
|
||||||
$ sudo ip tuntap add name ogstun mode tun
|
$ sudo ip tuntap add name ogstun mode tun
|
||||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
$ sudo ip addr add cafe::1/64 dev ogstun
|
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
$ sudo ip link set ogstun up
|
$ sudo ip link set ogstun up
|
||||||
```
|
```
|
||||||
|
|
||||||
**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:
|
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||||
`$ sudo ./misc/netconf.sh`
|
`$ sudo ./misc/netconf.sh`
|
||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ $ cd ../
|
|||||||
|
|
||||||
##### 5G Core
|
##### 5G Core
|
||||||
|
|
||||||
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
||||||
@@ -122,7 +122,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
|||||||
+ mcc: 001
|
+ mcc: 001
|
||||||
+ mnc: 01
|
+ mnc: 01
|
||||||
+ tac: 2
|
+ tac: 2
|
||||||
plmn:
|
plmn_support:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
- mcc: 901
|
- mcc: 901
|
||||||
- mnc: 70
|
- mnc: 70
|
||||||
@@ -133,7 +133,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
|||||||
security:
|
security:
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
|
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
||||||
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
|
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
|
||||||
@@ -146,13 +146,13 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
|||||||
- - 127.0.0.7
|
- - 127.0.0.7
|
||||||
- - ::1
|
- - ::1
|
||||||
+ - addr: 10.11.0.7
|
+ - addr: 10.11.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
```
|
```
|
||||||
##### 4G EPC
|
##### 4G EPC
|
||||||
|
|
||||||
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
||||||
@@ -187,7 +187,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
|||||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
||||||
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
|
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
|
||||||
@@ -211,7 +211,7 @@ If you modify the config files while Open5GS daemons are running, please restart
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd install/bin/
|
$ cd install/bin/
|
||||||
$ ./install/bin/open5gs-mmed
|
$ ./install/bin/open5gs-mmed
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../src/main.c:54)
|
||||||
@@ -221,7 +221,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:53:47.365: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:59)
|
08/21 22:53:47.365: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:59)
|
||||||
08/21 22:53:47.366: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:57)
|
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
|
$ ./install/bin/open5gs-sgwcd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../src/main.c:54)
|
||||||
@@ -253,7 +253,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:55:14.040: [sbi] INFO: sbi_server() [127.0.0.5]:7777 (../lib/sbi/server.c:298)
|
08/21 22:55:14.040: [sbi] INFO: sbi_server() [127.0.0.5]:7777 (../lib/sbi/server.c:298)
|
||||||
08/21 22:55:14.040: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56)
|
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
|
$ ./install/bin/open5gs-sgwud
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../src/main.c:54)
|
||||||
@@ -262,7 +262,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:54:10.360: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)
|
08/21 22:54:10.360: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)
|
||||||
08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32)
|
08/21 22:54:10.361: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:32)
|
||||||
|
|
||||||
$ ./install/bin/open5gs-upfd
|
$ ./install/bin/open5gs-upfd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../src/main.c:54)
|
||||||
@@ -280,7 +280,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:57:17.451: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
|
08/21 22:57:17.451: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:99)
|
||||||
08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
|
08/21 22:57:17.519: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
|
||||||
|
|
||||||
$ ./install/bin/open5gs-pcrfd
|
$ ./install/bin/open5gs-pcrfd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../src/main.c:54)
|
||||||
@@ -305,7 +305,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:55:41.900: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)
|
08/21 22:55:41.900: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)
|
||||||
08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298)
|
08/21 22:55:41.900: [sbi] INFO: sbi_server() [127.0.0.11]:7777 (../lib/sbi/server.c:298)
|
||||||
|
|
||||||
$ ./install/bin/open5gs-udmd
|
$ ./install/bin/open5gs-udmd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../src/main.c:54)
|
||||||
@@ -313,7 +313,7 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:56:02.155: [app] INFO: UDM initialize...done (../src/udm/app.c:31)
|
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)
|
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
|
||||||
|
|
||||||
$ ./install/bin/open5gs-pcfd
|
$ ./install/bin/open5gs-pcfd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../src/main.c:54)
|
||||||
@@ -321,7 +321,15 @@ Open5GS daemon v2.1.0
|
|||||||
08/21 22:56:02.155: [app] INFO: PCF initialize...done (../src/pcf/app.c:31)
|
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)
|
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
|
||||||
|
|
||||||
$ ./install/bin/open5gs-udrd
|
$ ./install/bin/open5gs-nssfd
|
||||||
|
Open5GS daemon v2.1.0
|
||||||
|
|
||||||
|
08/21 22:56:02.154: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssfd.yaml' (../src/main.c:54)
|
||||||
|
08/21 22:56:02.154: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssfd.log' (../src/main.c:57)
|
||||||
|
08/21 22:56:02.155: [app] INFO: NSSF initialize...done (../src/nssfd/app.c:31)
|
||||||
|
08/21 22:56:02.155: [sbi] INFO: sbi_server() [127.0.0.12]:7777 (../lib/sbi/server.c:298)
|
||||||
|
|
||||||
|
$ ./install/bin/open5gs-udrd
|
||||||
Open5GS daemon v2.1.0
|
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: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../src/main.c:54)
|
||||||
@@ -375,7 +383,7 @@ Install the dependencies to run WebUI
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd webui
|
$ cd webui
|
||||||
$ npm install
|
$ npm ci --no-optional
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
@@ -444,11 +452,13 @@ target prot opt source destination
|
|||||||
Chain POSTROUTING (policy ACCEPT)
|
Chain POSTROUTING (policy ACCEPT)
|
||||||
target prot opt source destination
|
target prot opt source destination
|
||||||
|
|
||||||
### Enable IPv4 Forwarding
|
### Enable IPv4/IPv6 Forwarding
|
||||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
$ sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
### Add NAT Rule
|
### Add NAT Rule
|
||||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||||
|
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** The above assumes you do not have any existing rules in the filter and nat tables. If a program such as docker has already set up rules, you may need to add the Open5GS related rules differently.
|
**Note:** The above assumes you do not have any existing rules in the filter and nat tables. If a program such as docker has already set up rules, you may need to add the Open5GS related rules differently.
|
||||||
@@ -460,6 +470,42 @@ $ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
|||||||
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
|
- You can see actual traffic through wireshark -- [[srsenb.pcapng]]({{ site.url }}{{ site.baseurl }}/assets/pcapng/srsenb.pcapng).
|
||||||
- You can view the log at `$INSTALL_PREFIX/var/log/open5gs/*.log`.
|
- You can view the log at `$INSTALL_PREFIX/var/log/open5gs/*.log`.
|
||||||
|
|
||||||
|
### Re-install with updated source code
|
||||||
|
|
||||||
|
You need to update the Open5GS source and all subprojects.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd open5gs
|
||||||
|
$ git pull ## Update the Open5GS source
|
||||||
|
$ meson subprojects update ## Update all subprojects
|
||||||
|
```
|
||||||
|
|
||||||
|
To compile with meson:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ninja -C build
|
||||||
|
```
|
||||||
|
|
||||||
|
Check whether the compilation is correct.
|
||||||
|
```bash
|
||||||
|
$ cd build
|
||||||
|
$ meson test -v
|
||||||
|
```
|
||||||
|
|
||||||
|
Install Open5GS without making any configuration file changes.
|
||||||
|
```bash
|
||||||
|
$ ninja install
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** The configuration files in the installation directory are not changed. If you want to initialize the configuration files as well, you need to delete the existing installation directory and install it.
|
||||||
|
{: .notice--danger}
|
||||||
|
|
||||||
|
Install Open5GS and initialize configuration files.
|
||||||
|
```bash
|
||||||
|
$ rm -Rf ../install
|
||||||
|
$ ninja install
|
||||||
|
```
|
||||||
|
|
||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ PCRF-frDi = 127.0.0.9 :3868 for Gx auth
|
|||||||
NRF-sbi = 127.0.0.10:7777 for 5G SBI
|
NRF-sbi = 127.0.0.10:7777 for 5G SBI
|
||||||
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
AUSF-sbi = 127.0.0.11:7777 for 5G SBI
|
||||||
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
UDM-sbi = 127.0.0.12:7777 for 5G SBI
|
||||||
PCF-sbi = 127.0.0.12:7777 for 5G SBI
|
PCF-sbi = 127.0.0.13:7777 for 5G SBI
|
||||||
|
NSSF-sbi = 127.0.0.14:7777 for 5G SBI
|
||||||
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
UDR-sbi = 127.0.0.20:7777 for 5G SBI
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ You can refer to the network settings at
|
|||||||
[{{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf]({{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf) provided by [@kbarlee](https://github.com/kbarlee) in issue [#528](https://github.com/{{ site.github_username }}/open5gs/issues/528)
|
[{{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf]({{ site.url }}{{ site.baseurl }}/assets/Open5GS-Diagram.pdf) provided by [@kbarlee](https://github.com/kbarlee) in issue [#528](https://github.com/{{ site.github_username }}/open5gs/issues/528)
|
||||||
{: .notice--danger}
|
{: .notice--danger}
|
||||||
|
|
||||||
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
||||||
@@ -85,7 +86,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
|||||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address.
|
Modify [install/etc/open5gs/sgwc.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwc.yaml.in) to set the PFCP IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
|
$ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
|
||||||
@@ -49,7 +49,7 @@
|
@@ -49,7 +49,7 @@
|
||||||
@@ -108,7 +109,7 @@ $ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
|
|||||||
# parameter:
|
# parameter:
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
|
Modify [install/etc/open5gs/smf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/smf.yaml.in) to set the PFCP IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
|
$ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
|
||||||
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
|
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
|
||||||
@@ -120,9 +121,9 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
|
|||||||
- - addr: 127.0.0.4
|
- - addr: 127.0.0.4
|
||||||
- - addr: ::1
|
- - addr: ::1
|
||||||
+ - addr: 10.10.0.4
|
+ - addr: 10.10.0.4
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
@@ -282,7 +281,7 @@
|
@@ -282,7 +281,7 @@
|
||||||
#
|
#
|
||||||
upf:
|
upf:
|
||||||
@@ -135,7 +136,7 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/amf.yaml.in) to set the NGAP IP address, PLMN ID, TAC and NSSAI.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
||||||
@@ -164,7 +165,7 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
|||||||
+ mcc: 901
|
+ mcc: 901
|
||||||
+ mnc: 70
|
+ mnc: 70
|
||||||
+ tac: 1
|
+ tac: 1
|
||||||
plmn:
|
plmn_support:
|
||||||
- plmn_id:
|
- plmn_id:
|
||||||
- mcc: 001
|
- mcc: 001
|
||||||
- mnc: 01
|
- mnc: 01
|
||||||
@@ -178,7 +179,7 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
|
|||||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
|
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U and PFCP IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
||||||
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
|
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
|
||||||
@@ -197,7 +198,7 @@ $ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
|||||||
# sgwc:
|
# sgwc:
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
|
Modify [install/etc/open5gs/upf.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/upf.yaml.in) to set the GTP-U and PFCP IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
$ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
||||||
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
|
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
|
||||||
@@ -213,9 +214,9 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
|||||||
- - 127.0.0.7
|
- - 127.0.0.7
|
||||||
- - ::1
|
- - ::1
|
||||||
+ - addr: 10.11.0.7
|
+ - addr: 10.11.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
```
|
```
|
||||||
|
|
||||||
After changing conf files, please restart Open5GS daemons.
|
After changing conf files, please restart Open5GS daemons.
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
|
|||||||
* Gemtek WLTGFC-101 (S/W version 2.1.1746.1116)
|
* 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 FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
|
||||||
* NOKIA FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
|
* NOKIA FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
|
||||||
|
* Accelleran E1010 (LTE TDD B42)
|
||||||
|
|
||||||
### OpenRAN Hardware
|
### OpenRAN Hardware
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ $ sudo sh -c "cat << EOF > /etc/systemd/network/99-open5gs.network
|
|||||||
Name=ogstun
|
Name=ogstun
|
||||||
[Network]
|
[Network]
|
||||||
Address=10.45.0.1/16
|
Address=10.45.0.1/16
|
||||||
Address=cafe::1/64
|
Address=2001:230:cafe::1/48
|
||||||
EOF"
|
EOF"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ Make sure it is set up properly.
|
|||||||
$ ifconfig ogstun
|
$ ifconfig ogstun
|
||||||
ogstun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
ogstun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||||
inet 10.45.0.1 netmask 255.255.0.0 destination 10.45.0.1
|
inet 10.45.0.1 netmask 255.255.0.0 destination 10.45.0.1
|
||||||
inet6 cafe::1 prefixlen 64 scopeid 0x0<global>
|
inet6 2001:230:cafe::1 prefixlen 64 scopeid 0x0<global>
|
||||||
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20<link>
|
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20<link>
|
||||||
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
||||||
RX packets 0 bytes 0 (0.0 B)
|
RX packets 0 bytes 0 (0.0 B)
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ Set the IP address on the `ogstun` TUN interface.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
$ sudo ip addr add cafe::1/64 dev ogstun
|
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure it is set up properly.
|
Make sure it is set up properly.
|
||||||
@@ -247,7 +247,7 @@ $ ip link show
|
|||||||
|
|
||||||
**Notice:** This configuration is not persistent after rebooting. The
|
**Notice:** This configuration is not persistent after rebooting. The
|
||||||
script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{
|
script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{
|
||||||
site.github_username }}/open5gs/blob/master/misc/netconf.sh) makes it easy
|
site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy
|
||||||
to configure the TUN device as follows:
|
to configure the TUN device as follows:
|
||||||
`$ sudo ./misc/netconf.sh`
|
`$ sudo ./misc/netconf.sh`
|
||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
@@ -325,7 +325,7 @@ $ cd ../
|
|||||||
$ ls install/bin
|
$ ls install/bin
|
||||||
open5gs-amfd open5gs-hssd open5gs-nrfd open5gs-sgwcd open5gs-smfd open5gs-udrd
|
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-ausfd open5gs-mmed open5gs-pcrfd open5gs-sgwud open5gs-udmd open5gs-pcfd
|
||||||
open5gs-upfd
|
open5gs-upfd open5gs-nssfd
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building WebUI of Open5GS
|
## Building WebUI of Open5GS
|
||||||
@@ -342,7 +342,7 @@ Install the dependencies to run WebUI
|
|||||||
```bash
|
```bash
|
||||||
$ cd ~/open5gs
|
$ cd ~/open5gs
|
||||||
$ cd webui
|
$ cd webui
|
||||||
$ npm install
|
$ npm ci --no-optional
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ You are now ready to set the IP address on TUN device.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
$ sudo ip addr add cafe::1/64 dev ogstun
|
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure it is set up properly.
|
Make sure it is set up properly.
|
||||||
@@ -61,7 +61,7 @@ $ sudo ip link set ogstun up
|
|||||||
$ ip link show
|
$ 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:
|
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||||
`$ sudo ./misc/netconf.sh`
|
`$ sudo ./misc/netconf.sh`
|
||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ Install the dependencies to run WebUI
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd webui
|
$ cd webui
|
||||||
$ npm install
|
$ npm ci --no-optional
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
|
|||||||
@@ -1,29 +1,53 @@
|
|||||||
---
|
---
|
||||||
title: FreeBSD
|
title: Mac OS X
|
||||||
head_inline: "<style> .blue { color: blue; } </style>"
|
head_inline: "<style> .blue { color: blue; } </style>"
|
||||||
---
|
---
|
||||||
|
|
||||||
This guide is based on **FreeBSD Relase 11.1**.
|
This guide is based on macOS Big Sur 11.2 on a Macbook Air(Apple M1 Chips) computer.
|
||||||
{: .blue}
|
{: .blue}
|
||||||
|
|
||||||
|
### Install Xcode Command-Line Tools
|
||||||
|
---
|
||||||
|
|
||||||
|
Homebrew requires the Xcode command-line tools from Apple's Xcode.
|
||||||
|
```bash
|
||||||
|
$ xcode-select --install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Installing Homebrew
|
||||||
|
---
|
||||||
|
|
||||||
|
Install brew using the official Homebrew installation instructions.
|
||||||
|
```bash
|
||||||
|
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
|
```
|
||||||
|
|
||||||
### Getting MongoDB
|
### Getting MongoDB
|
||||||
---
|
---
|
||||||
|
|
||||||
Install MongoDB with package manager.
|
Install MongoDB with Package Manager.
|
||||||
```bash
|
```bash
|
||||||
$ sudo pkg install mongodb
|
$ brew tap mongodb/brew
|
||||||
|
$ brew install mongodb-community
|
||||||
```
|
```
|
||||||
|
|
||||||
Run MongoDB server.
|
Run MongoDB server.
|
||||||
```bash
|
```bash
|
||||||
$ mkdir -p ./data/db
|
$ mongod --config /usr/local/etc/mongod.conf
|
||||||
$ mongod --dbpath ./data/db
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up TUN device (No persistent after rebooting)
|
**Tip:** MongoDB is persistent after rebooting with the following commands:
|
||||||
|
`$ brew services start mongodb-community`
|
||||||
|
{: .notice--info}
|
||||||
|
|
||||||
|
|
||||||
|
### Setting up network (No persistent after rebooting)
|
||||||
---
|
---
|
||||||
|
|
||||||
Configure the TUN device.
|
Note that Open5GS uses built-in "utun" device driver. So, You don't have to install external TUN/TAP driver.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
Configure the loopback interface.
|
||||||
```bash
|
```bash
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||||
@@ -38,15 +62,26 @@ $ sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
|
|||||||
$ sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
|
||||||
```
|
```
|
||||||
|
|
||||||
Enable IP forwarding
|
Enable IP forwarding & Masquerading
|
||||||
```bash
|
```bash
|
||||||
$ sudo sysctl -w net.inet.ip.forwarding=1
|
$ sudo sysctl -w net.inet.ip.forwarding=1
|
||||||
|
$ sudo sysctl -w net.inet6.ip6.forwarding=1
|
||||||
|
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||||
|
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||||
|
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||||
```
|
```
|
||||||
|
|
||||||
**Tip:** The script provided in [$GIT_REPO/support/network/restart.sh](https://github.com/{{ site.github_username }}/open5gs/blob/master/support/network/restart.sh) makes it easy to configure the TUN device as follows:
|
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||||
`$ sudo ./support/network/restart.sh`
|
`$ sudo ./misc/netconf.sh`
|
||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
|
|
||||||
### Building Open5GS
|
### Building Open5GS
|
||||||
@@ -54,13 +89,19 @@ $ sudo sysctl -w net.inet.ip.forwarding=1
|
|||||||
|
|
||||||
Install the depedencies for building the source code.
|
Install the depedencies for building the source code.
|
||||||
```bash
|
```bash
|
||||||
$ sudo pkg install py36-pip ninja gcc bison gsed pkgconf git mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd curl
|
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config bison libusrsctp
|
||||||
```
|
```
|
||||||
|
|
||||||
Install Meson using Python.
|
Configure Homebrew PATH
|
||||||
```bash
|
```bash
|
||||||
$ sudo pip install --upgrade pip
|
$ export PATH="/opt/homebrew/opt/bison/bin:/opt/homebrew/bin:$PATH"
|
||||||
$ sudo pip install meson
|
$ export LIBRARY_PATH=/opt/homebrew/lib
|
||||||
|
$ export C_INCLUDE_PATH=/opt/homebrew/include
|
||||||
|
```
|
||||||
|
|
||||||
|
Install Meson using Homebrew.
|
||||||
|
```bash
|
||||||
|
$ brew install meson
|
||||||
```
|
```
|
||||||
|
|
||||||
Git clone.
|
Git clone.
|
||||||
@@ -107,20 +148,21 @@ $ ninja install
|
|||||||
$ cd ../
|
$ cd ../
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Building WebUI of Open5GS
|
### Building WebUI of Open5GS
|
||||||
---
|
---
|
||||||
|
|
||||||
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
|
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo pkg install node
|
$ brew install node
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the dependencies to run WebUI
|
Install the dependencies to run WebUI
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd webui
|
$ cd webui
|
||||||
$ npm install
|
$ npm ci --no-optional
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
@@ -128,4 +170,3 @@ The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
|||||||
```bash
|
```bash
|
||||||
$ npm run dev
|
$ npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -3,14 +3,23 @@ title: Mac OS X
|
|||||||
head_inline: "<style> .blue { color: blue; } </style>"
|
head_inline: "<style> .blue { color: blue; } </style>"
|
||||||
---
|
---
|
||||||
|
|
||||||
This guide is based on **macOS Big Sur 11.0.1**.
|
This guide is based on macOS Big Sur 11.2 on a Macbook Pro(Intel Chips) computer.
|
||||||
{: .blue}
|
{: .blue}
|
||||||
|
|
||||||
|
### Install Xcode Command-Line Tools
|
||||||
|
---
|
||||||
|
|
||||||
|
Homebrew requires the Xcode command-line tools from Apple's Xcode.
|
||||||
|
```bash
|
||||||
|
$ xcode-select --install
|
||||||
|
```
|
||||||
|
|
||||||
### Installing Homebrew
|
### Installing Homebrew
|
||||||
---
|
---
|
||||||
|
|
||||||
|
Install brew using the official Homebrew installation instructions.
|
||||||
```bash
|
```bash
|
||||||
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Getting MongoDB
|
### Getting MongoDB
|
||||||
@@ -32,14 +41,13 @@ $ mongod --config /usr/local/etc/mongod.conf
|
|||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
|
|
||||||
|
|
||||||
### Setting up TUN device (No persistent after rebooting)
|
### Setting up network (No persistent after rebooting)
|
||||||
---
|
---
|
||||||
|
|
||||||
Install TUN/TAP driver
|
Note that Open5GS uses built-in "utun" device driver. So, You don't have to install external TUN/TAP driver.
|
||||||
- You can download it from [http://tuntaposx.sourceforge.net/](http://tuntaposx.sourceforge.net/)
|
{: .blue}
|
||||||
- And then, run tuntap_20150118.pkg to install TUN/TAP driver.
|
|
||||||
|
|
||||||
Configure the TUN device.
|
Configure the loopback interface.
|
||||||
```bash
|
```bash
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||||
@@ -54,16 +62,25 @@ $ sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
|
|||||||
$ sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
||||||
$ sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
$ sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
|
||||||
```
|
```
|
||||||
|
|
||||||
Enable IP forwarding & Masquerading
|
Enable IP forwarding & Masquerading
|
||||||
```bash
|
```bash
|
||||||
$ sudo sysctl -w net.inet.ip.forwarding=1
|
$ sudo sysctl -w net.inet.ip.forwarding=1
|
||||||
|
$ sudo sysctl -w net.inet6.ip6.forwarding=1
|
||||||
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||||
|
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||||
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||||
```
|
```
|
||||||
|
|
||||||
**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:
|
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||||
`$ sudo ./misc/netconf.sh`
|
`$ sudo ./misc/netconf.sh`
|
||||||
{: .notice--info}
|
{: .notice--info}
|
||||||
|
|
||||||
@@ -72,7 +89,7 @@ $ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
|||||||
|
|
||||||
Install the depedencies for building the source code.
|
Install the depedencies for building the source code.
|
||||||
```bash
|
```bash
|
||||||
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config
|
$ brew install mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2 pkg-config libusrsctp
|
||||||
```
|
```
|
||||||
|
|
||||||
Install Bison and Create soft link.
|
Install Bison and Create soft link.
|
||||||
@@ -96,7 +113,7 @@ To compile with meson:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd open5gs
|
$ cd open5gs
|
||||||
$ meson build --prefix=`pwd`/install -D c_std=c99
|
$ meson build --prefix=`pwd`/install
|
||||||
$ ninja -C build
|
$ ninja -C build
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -144,7 +161,7 @@ Install the dependencies to run WebUI
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cd webui
|
$ cd webui
|
||||||
$ npm install
|
$ npm ci --no-optional
|
||||||
```
|
```
|
||||||
|
|
||||||
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
@@ -152,4 +169,3 @@ The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
|||||||
```bash
|
```bash
|
||||||
$ npm run dev
|
$ npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
216
docs/_docs/platform/07-freebsd.md
Normal file
216
docs/_docs/platform/07-freebsd.md
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
---
|
||||||
|
title: FreeBSD
|
||||||
|
head_inline: "<style> .blue { color: blue; } </style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
This guide is based on **FreeBSD-11.4-STABLE**.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
## Install **FreeBSD-11.4-STABLE** 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
|
||||||
|
---
|
||||||
|
|
||||||
|
The instructions to install Vagrant are provided at
|
||||||
|
[vagrantup.com](https://www.vagrantup.com/).
|
||||||
|
|
||||||
|
|
||||||
|
### Create a FreeBSD-11.4-STABLE 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 FreeBSD 11 box, with
|
||||||
|
the exception that the amount of virtual memory has been increased to 1GB:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd vagrant/freebsd
|
||||||
|
vagrant up --provider virtualbox
|
||||||
|
```
|
||||||
|
|
||||||
|
### Log into the newly created FreeBSD VM
|
||||||
|
---
|
||||||
|
|
||||||
|
Use SSH to log into the FreeBSD 11 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 FreeBSD 11 system.
|
||||||
|
|
||||||
|
The rest of the commands below are performed inside the FreeBSD VM as the
|
||||||
|
user 'vagrant', or on your bare metal FreeBSD 11 system as any normal user.
|
||||||
|
|
||||||
|
### Getting MongoDB
|
||||||
|
---
|
||||||
|
|
||||||
|
Install MongoDB with package manager.
|
||||||
|
```bash
|
||||||
|
$ sudo pkg install mongodb44
|
||||||
|
```
|
||||||
|
|
||||||
|
Run MongoDB server.
|
||||||
|
```bash
|
||||||
|
$ mkdir -p ./data/db
|
||||||
|
$ mongod --dbpath ./data/db
|
||||||
|
```
|
||||||
|
|
||||||
|
### Setting up network (No persistent after rebooting)
|
||||||
|
---
|
||||||
|
|
||||||
|
Configure the loopback interface.
|
||||||
|
```bash
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
|
||||||
|
$ sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable IP forwarding
|
||||||
|
```bash
|
||||||
|
$ sudo sysctl -w net.inet.ip.forwarding=1
|
||||||
|
$ sudo sysctl -w net.inet6.ip6.forwarding=1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tip:** The script provided in [$GIT_REPO/misc/netconf.sh](https://github.com/{{ site.github_username }}/open5gs/blob/main/misc/netconf.sh) makes it easy to configure the TUN device as follows:
|
||||||
|
`$ sudo ./misc/netconf.sh`
|
||||||
|
{: .notice--info}
|
||||||
|
|
||||||
|
### Building Open5GS
|
||||||
|
---
|
||||||
|
|
||||||
|
Install the depedencies for building the source code.
|
||||||
|
```bash
|
||||||
|
$ sudo pkg install meson ninja gcc bison gsed pkgconf git mongo-c-driver gnutls libgcrypt libidn libyaml libmicrohttpd nghttp2
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure gcc PATH
|
||||||
|
```bash
|
||||||
|
$ setenv LIBRARY_PATH /usr/local/lib
|
||||||
|
$ setenv C_INCLUDE_PATH /usr/local/include
|
||||||
|
```
|
||||||
|
|
||||||
|
If you are using BASH instead of default CSH,
|
||||||
|
```bash
|
||||||
|
$ export LIBRARY_PATH=/usr/local/lib
|
||||||
|
$ export C_INCLUDE_PATH=/usr/local/include
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** No source code changes are required for FreeBSD 11.x version. However, in FreeBSD 12.x version, we'll getting a crash with segmentation fault when calling basename(3). To avoid this, you need to change the freeDiameter source code as below.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
```diff
|
||||||
|
$ cd open5gs/subprojects/freeDiameter
|
||||||
|
|
||||||
|
$ diff --git a/include/freeDiameter/libfdproto.h b/include/freeDiameter/libfdproto.h
|
||||||
|
index 52c11ef..cd7f383 100644
|
||||||
|
--- a/include/freeDiameter/libfdproto.h
|
||||||
|
+++ b/include/freeDiameter/libfdproto.h
|
||||||
|
@@ -293,7 +293,7 @@ extern int fd_g_debug_lvl;
|
||||||
|
|
||||||
|
/* A version of __FILE__ without the full path. This is specific to each C file being compiled */
|
||||||
|
static char * file_bname = NULL;
|
||||||
|
-static char * file_bname_init(char * full) { file_bname = basename(full); return file_bname; }
|
||||||
|
+static char * file_bname_init(char * full) { file_bname = __old_basename(full); return file_bname; }
|
||||||
|
#define __STRIPPED_FILE__ (file_bname ?: file_bname_init((char *)__FILE__))
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, compile again:
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd open5gs
|
||||||
|
$ ninja -C build
|
||||||
|
```
|
||||||
|
|
||||||
|
Check whether the compilation is correct.
|
||||||
|
|
||||||
|
**Note:** This should require *sudo* due to access `/dev/tun0`.
|
||||||
|
{: .notice--danger}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sudo ./build/tests/attach/attach ## EPC Only
|
||||||
|
$ sudo ./build/tests/registration/registration ## 5G Core Only
|
||||||
|
```
|
||||||
|
|
||||||
|
Run all test programs as below.
|
||||||
|
|
||||||
|
**Note:** This should require *sudo* due to access `/dev/tun0`.
|
||||||
|
{: .notice--danger}
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ 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 || 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**.
|
||||||
|
```bash
|
||||||
|
$ cd build
|
||||||
|
$ ninja install
|
||||||
|
$ cd ../
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building WebUI of Open5GS
|
||||||
|
---
|
||||||
|
|
||||||
|
[Node.js](https://nodejs.org/) is required to build WebUI of Open5GS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ sudo pkg install node
|
||||||
|
```
|
||||||
|
|
||||||
|
Install the dependencies to run WebUI
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd webui
|
||||||
|
$ npm ci --no-optional
|
||||||
|
```
|
||||||
|
|
||||||
|
The WebUI runs as an [npm](https://www.npmjs.com/) script.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run dev
|
||||||
|
```
|
||||||
@@ -24,10 +24,11 @@ open5gs 27485 0.0 0.0 243816 15064 ? Ssl 12:13 0:00 /usr/bin/open5g
|
|||||||
open5gs 27543 0.0 0.0 222416 9672 ? Ssl 12:13 0:00 /usr/bin/open5gs-ausfd -c /etc/open5gs/ausf.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 222328 9668 ? Ssl 12:13 0:00 /usr/bin/open5gs-udmd -c /etc/open5gs/udm.yaml
|
||||||
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
|
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-pcfd -c /etc/open5gs/pcf.yaml
|
||||||
|
open5gs 27600 0.0 0.0 222329 9669 ? Ssl 12:13 0:00 /usr/bin/open5gs-nssfd -c /etc/open5gs/nssf.yaml
|
||||||
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
|
open5gs 27697 0.0 0.0 243976 13716 ? Ssl 12:13 0:00 /usr/bin/open5gs-udrd -c /etc/open5gs/udr.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF & UDR are all running.
|
You should see each of the above services, MME, SGW-C, SMF, AMF, SGW-U, UPF, HSS, PCRF, NRF, AUSF, UDM, PCF, NSSF & UDR are all running.
|
||||||
|
|
||||||
If your instance doesn't show this make sure you're started each service:
|
If your instance doesn't show this make sure you're started each service:
|
||||||
```bash
|
```bash
|
||||||
@@ -43,6 +44,7 @@ $ systemctl start open5gs-nrfd.service
|
|||||||
$ systemctl start open5gs-ausfd.service
|
$ systemctl start open5gs-ausfd.service
|
||||||
$ systemctl start open5gs-udmd.service
|
$ systemctl start open5gs-udmd.service
|
||||||
$ systemctl start open5gs-pcfd.service
|
$ systemctl start open5gs-pcfd.service
|
||||||
|
$ systemctl start open5gs-nssfd.service
|
||||||
$ systemctl start open5gs-udrd.service
|
$ systemctl start open5gs-udrd.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -10,35 +10,93 @@ head_inline: "<style> .blue { color: blue; } </style>"
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
#### Cannot open shared object file when running daemon
|
#### How to use a different Slice for each SMF
|
||||||
|
|
||||||
An error occurred when running as follows.
|
To add a slice with SST of 1 and SD of 000080, you need to update the configuration file as shown below.
|
||||||
|
|
||||||
```
|
```diff
|
||||||
$ ./install/bin/open5gs-nrfd
|
### amf.yaml
|
||||||
./install/bin/open5gs-nrfd: error while loading shared libraries: libogscrypt.so.2: cannot open shared object file: No such file or directory
|
|
||||||
|
$ diff --git a/configs/open5gs/amf.yaml.in b/configs/open5gs/amf.yaml.in
|
||||||
|
index 7e939e81..dfe4456d 100644
|
||||||
|
--- a/configs/open5gs/amf.yaml.in
|
||||||
|
+++ b/configs/open5gs/amf.yaml.in
|
||||||
|
@@ -199,6 +199,12 @@ amf:
|
||||||
|
mnc: 70
|
||||||
|
s_nssai:
|
||||||
|
- sst: 1
|
||||||
|
+ - plmn_id:
|
||||||
|
+ mcc: 901
|
||||||
|
+ mnc: 70
|
||||||
|
+ s_nssai:
|
||||||
|
+ - sst: 1
|
||||||
|
+ sd: 000080
|
||||||
|
security:
|
||||||
|
integrity_order : [ NIA2, NIA1, NIA0 ]
|
||||||
|
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||||
|
|
||||||
|
### FIRST smf.yaml
|
||||||
|
|
||||||
|
$ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in
|
||||||
|
index d45aa60f..701ee533 100644
|
||||||
|
--- a/configs/open5gs/smf.yaml.in
|
||||||
|
+++ b/configs/open5gs/smf.yaml.in
|
||||||
|
@@ -317,6 +317,11 @@ logger:
|
||||||
|
#
|
||||||
|
|
||||||
|
smf:
|
||||||
|
+ info:
|
||||||
|
+ - s_nssai:
|
||||||
|
+ - sst: 1
|
||||||
|
+ dnn:
|
||||||
|
+ - internet
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.4
|
||||||
|
port: 7777
|
||||||
|
|
||||||
|
### SECOND smf.yaml
|
||||||
|
|
||||||
|
$ diff --git a/configs/open5gs/smf.yaml.in b/configs/open5gs/smf.yaml.in
|
||||||
|
index d45aa60f..949da220 100644
|
||||||
|
--- a/configs/open5gs/smf.yaml.in
|
||||||
|
+++ b/configs/open5gs/smf.yaml.in
|
||||||
|
@@ -317,6 +317,12 @@ logger:
|
||||||
|
#
|
||||||
|
|
||||||
|
smf:
|
||||||
|
+ info:
|
||||||
|
+ - s_nssai:
|
||||||
|
+ - sst: 1
|
||||||
|
+ sd: 000080
|
||||||
|
+ dnn:
|
||||||
|
+ - internet
|
||||||
|
sbi:
|
||||||
|
- addr: 127.0.0.4
|
||||||
|
port: 7777
|
||||||
|
|
||||||
|
### nssf.yaml
|
||||||
|
$ diff --git a/configs/open5gs/nssf.yaml.in b/configs/open5gs/nssf.yaml.in
|
||||||
|
index ecd4f7e2..04d9c4ba 100644
|
||||||
|
--- a/configs/open5gs/nssf.yaml.in
|
||||||
|
+++ b/configs/open5gs/nssf.yaml.in
|
||||||
|
@@ -119,6 +119,11 @@ nssf:
|
||||||
|
port: 7777
|
||||||
|
s_nssai:
|
||||||
|
sst: 1
|
||||||
|
+ - addr: 127.0.0.10
|
||||||
|
+ port: 7777
|
||||||
|
+ s_nssai:
|
||||||
|
+ sst: 1
|
||||||
|
+ sd: 000080
|
||||||
|
|
||||||
|
#
|
||||||
|
# nrf:
|
||||||
```
|
```
|
||||||
|
|
||||||
You need to specify the absolute path to the shared library as follows.
|
Then add a slice to MongoDB's subscriber info.
|
||||||
|
|
||||||
```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?
|
#### Can I disable specific services if 5G functionally is not needed?
|
||||||
|
|
||||||
@@ -64,6 +122,7 @@ $ open5gs-amfd
|
|||||||
$ open5gs-ausfd
|
$ open5gs-ausfd
|
||||||
$ open5gs-udmd
|
$ open5gs-udmd
|
||||||
$ open5gs-pcfd
|
$ open5gs-pcfd
|
||||||
|
$ open5gs-nssfd
|
||||||
$ open5gs-udrd
|
$ open5gs-udrd
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -133,7 +192,7 @@ $ diff -u /etc/systemd/network/99-open5gs.network /etc/systemd/network/99-open5g
|
|||||||
[Network]
|
[Network]
|
||||||
-Address=10.45.0.1/16
|
-Address=10.45.0.1/16
|
||||||
+Address=10.46.0.1/16
|
+Address=10.46.0.1/16
|
||||||
Address=cafe::1/64
|
Address=2001:230:cafe::1/48
|
||||||
```
|
```
|
||||||
|
|
||||||
Restart systemd-networkd
|
Restart systemd-networkd
|
||||||
@@ -141,6 +200,11 @@ Restart systemd-networkd
|
|||||||
$ sudo systemctl restart systemd-networkd
|
$ sudo systemctl restart systemd-networkd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
And then, you need to chanage NAT table as below.
|
||||||
|
```
|
||||||
|
$ sudo iptables -t nat -A POSTROUTING -s 10.46.0.0/16 ! -o ogstun -j MASQUERADE
|
||||||
|
```
|
||||||
|
|
||||||
Now, you need to modify the configuration file of Open5GS to adjust the UE IP Pool. UE IP Pool can be allocated by SMF or UPF, but in this tutorial, we will modify both configuration files.
|
Now, you need to modify the configuration file of Open5GS to adjust the UE IP Pool. UE IP Pool can be allocated by SMF or UPF, but in this tutorial, we will modify both configuration files.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
@@ -150,10 +214,10 @@ $ diff -u smf.yaml smf.yaml.new
|
|||||||
@@ -190,7 +190,7 @@
|
@@ -190,7 +190,7 @@
|
||||||
- addr: 127.0.0.4
|
- addr: 127.0.0.4
|
||||||
- addr: ::1
|
- addr: ::1
|
||||||
pdn:
|
subnet:
|
||||||
- - addr: 10.45.0.1/16
|
- - addr: 10.45.0.1/16
|
||||||
+ - addr: 10.46.0.1/16
|
+ - addr: 10.46.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
```
|
```
|
||||||
@@ -165,10 +229,10 @@ $ diff -u upf.yaml upf.yaml.new
|
|||||||
@@ -139,7 +139,7 @@
|
@@ -139,7 +139,7 @@
|
||||||
gtpu:
|
gtpu:
|
||||||
- addr: 127.0.0.7
|
- addr: 127.0.0.7
|
||||||
pdn:
|
subnet:
|
||||||
- - addr: 10.45.0.1/16
|
- - addr: 10.45.0.1/16
|
||||||
+ - addr: 10.46.0.1/16
|
+ - addr: 10.46.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
|
|
||||||
#
|
#
|
||||||
```
|
```
|
||||||
@@ -263,6 +327,7 @@ $ sudo pkill -9 open5gs-nrfd
|
|||||||
$ sudo pkill -9 open5gs-ausfd
|
$ sudo pkill -9 open5gs-ausfd
|
||||||
$ sudo pkill -9 open5gs-udmd
|
$ sudo pkill -9 open5gs-udmd
|
||||||
$ sudo pkill -9 open5gs-pcfd
|
$ sudo pkill -9 open5gs-pcfd
|
||||||
|
$ sudo pkill -9 open5gs-nssfd
|
||||||
$ sudo pkill -9 open5gs-udrd
|
$ sudo pkill -9 open5gs-udrd
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -357,9 +422,10 @@ Timeout: 0
|
|||||||
|
|
||||||
#### Is it possible to setup IP/NAT table along with Docker?
|
#### Is it possible to setup IP/NAT table along with Docker?
|
||||||
|
|
||||||
Enable IP Forward.
|
Enable IPv4/IPv6 Forward.
|
||||||
```
|
```
|
||||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
$ sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
```
|
```
|
||||||
|
|
||||||
The following is the default docker IP/NAT table.
|
The following is the default docker IP/NAT table.
|
||||||
@@ -435,6 +501,11 @@ And then, apply **newtables** as below.
|
|||||||
$ sudo iptables-restore < newtables
|
$ sudo iptables-restore < newtables
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Docker doesn't have IPv6 NAT rules. In this case, you just add the NAT rule as below.
|
||||||
|
```
|
||||||
|
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||||
|
```
|
||||||
|
|
||||||
The above operation is the same as described in the following manuals.
|
The above operation is the same as described in the following manuals.
|
||||||
```
|
```
|
||||||
### Check IP Tables
|
### Check IP Tables
|
||||||
@@ -462,11 +533,13 @@ target prot opt source destination
|
|||||||
Chain POSTROUTING (policy ACCEPT)
|
Chain POSTROUTING (policy ACCEPT)
|
||||||
target prot opt source destination
|
target prot opt source destination
|
||||||
|
|
||||||
### Enable IPv4 Forwarding
|
### Enable IPv4/IPv6 Forwarding
|
||||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
$ sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
### Add NAT Rule
|
### Add NAT Rule
|
||||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||||
|
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How to use a different DNN/APN for each SMF
|
#### How to use a different DNN/APN for each SMF
|
||||||
@@ -521,81 +594,64 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A
|
|||||||
|
|
||||||
```
|
```
|
||||||
### For reference, see `smf.yaml`
|
### For reference, see `smf.yaml`
|
||||||
# <PDN Configuration with UE Pool>
|
# <Subnet for UE Pool>
|
||||||
#
|
#
|
||||||
# o IPv4 Pool
|
# o IPv4 Pool
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# addr: 10.45.0.1/16
|
# addr: 10.45.0.1/16
|
||||||
#
|
#
|
||||||
# o IPv4/IPv6 Pool
|
# o IPv4/IPv6 Pool
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, cafe:2::1/64
|
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||||
# All other DNNs/APNs use 10.45.0.1/16, cafe:1::1/64
|
# All other DNNs/APNs use 10.45.0.1/16, 2001:230:cafe::1/48
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
# $ 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 10.46.0.1/16 dev ogstun
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun
|
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# - addr: cafe:1::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# - addr: 10.46.0.1/16
|
# - addr: 10.46.0.1/16
|
||||||
# dnn: volte
|
# dnn: volte
|
||||||
# - addr: cafe:2::1/64
|
# - addr: 2001:230:babe::1/48
|
||||||
# dnn: volte
|
# dnn: volte
|
||||||
#
|
#
|
||||||
# o Multiple Devices (default: ogstun)
|
|
||||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
|
||||||
# $ sudo ip addr add cafe:1::1/64 dev ogstun2
|
|
||||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
|
|
||||||
# $ sudo ip addr add cafe:2::1/64 dev ogstun3
|
|
||||||
#
|
|
||||||
# pdn:
|
|
||||||
# - addr: 10.45.0.1/16
|
|
||||||
# - addr: cafe:1::1/64
|
|
||||||
# dev: ogstun2
|
|
||||||
# - addr: 10.46.0.1/16
|
|
||||||
# dnn: volte
|
|
||||||
# dev: ogstun3
|
|
||||||
# - addr: cafe:2::1/64
|
|
||||||
# dnn: volte
|
|
||||||
# dev: ogstun3
|
|
||||||
#
|
|
||||||
# o Pool Range Sample
|
# o Pool Range Sample
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range: 10.45.0.100-10.45.0.200
|
# range: 10.45.0.100-10.45.0.200
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range:
|
# range:
|
||||||
# - 10.45.0.5-10.45.0.50
|
# - 10.45.0.5-10.45.0.50
|
||||||
# - 10.45.0.100-
|
# - 10.45.0.100-
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/24
|
# - addr: 10.45.0.1/24
|
||||||
# range:
|
# range:
|
||||||
# - -10.45.0.200
|
# - -10.45.0.200
|
||||||
# - 10.45.0.210-10.45.0.220
|
# - 10.45.0.210-10.45.0.220
|
||||||
#
|
#
|
||||||
# pdn:
|
# subnet:
|
||||||
# - addr: 10.45.0.1/16
|
# - addr: 10.45.0.1/16
|
||||||
# range:
|
# range:
|
||||||
# - 10.45.0.100-10.45.0.200
|
# - 10.45.0.100-10.45.0.200
|
||||||
# - 10.45.1.100-10.45.1.200
|
# - 10.45.1.100-10.45.1.200
|
||||||
# - addr: cafe::1/64
|
# - addr: 2001:230:cafe::1/48
|
||||||
# range:
|
# range:
|
||||||
# - cafe::a0-cafe:b0
|
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
|
||||||
# - cafe::c0-cafe:d0
|
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
|
||||||
#
|
#
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -693,7 +749,7 @@ You should configure the domain name on your computer. Otherwise, freeDiameter r
|
|||||||
|
|
||||||
#### How many of UEs can Open5GS support?
|
#### How many of UEs can Open5GS support?
|
||||||
|
|
||||||
See the [lib/core/ogs-3gpp-types.h](https://github.com/{{ site.github_username }}/open5gs/blob/master/lib/core/ogs-3gpp-types.h).
|
See the [lib/core/ogs-3gpp-types.h](https://github.com/{{ site.github_username }}/open5gs/blob/main/lib/core/ogs-3gpp-types.h).
|
||||||
|
|
||||||
```
|
```
|
||||||
#define MAX_NUM_OF_ENB 128
|
#define MAX_NUM_OF_ENB 128
|
||||||
@@ -731,6 +787,7 @@ Currently, the number of UE is limited to `128*128`.
|
|||||||
* AUSF : 127.0.0.11
|
* AUSF : 127.0.0.11
|
||||||
* UDM : 127.0.0.12
|
* UDM : 127.0.0.12
|
||||||
* PCF : 127.0.0.13
|
* PCF : 127.0.0.13
|
||||||
|
* NSSF : 127.0.0.14
|
||||||
* UDR : 127.0.0.20
|
* UDR : 127.0.0.20
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -774,7 +831,7 @@ Currently, the number of UE is limited to `128*128`.
|
|||||||
|
|
||||||
```
|
```
|
||||||
* IPv4 : 10.45.0.1/16
|
* IPv4 : 10.45.0.1/16
|
||||||
* IPv6 : cafe::1/64
|
* IPv6 : 2001:230:cafe::1/48
|
||||||
```
|
```
|
||||||
|
|
||||||
- DNS
|
- DNS
|
||||||
@@ -904,3 +961,33 @@ getsockopt level=132 optname=0 not yet supported
|
|||||||
|
|
||||||
The SCTP module is not included in the QEMU kernel. I believe that if the Linux kernel installed on your target platform contains an SCTP module, it will work normally.
|
The SCTP module is not included in the QEMU kernel. I believe that if the Linux kernel installed on your target platform contains an SCTP module, it will work normally.
|
||||||
{: .notice--warning}
|
{: .notice--warning}
|
||||||
|
|
||||||
|
#### 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
|
||||||
|
```
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ Then proceed as follows:
|
|||||||
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
|
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
|
||||||
4. Click `SAVE` Button
|
4. Click `SAVE` Button
|
||||||
|
|
||||||
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/mme.yaml.in) to set the S1AP IP address, PLMN ID, and TAC.
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
||||||
@@ -257,7 +257,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
|
|||||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||||
```
|
```
|
||||||
|
|
||||||
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/master/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
Modify [install/etc/open5gs/sgwu.yaml](https://github.com/{{ site.github_username }}/open5gs/blob/main/configs/open5gs/sgwu.yaml.in) to set the GTP-U IP address.
|
||||||
```diff
|
```diff
|
||||||
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
$ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
|
||||||
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
|
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
|
||||||
@@ -308,11 +308,13 @@ target prot opt source destination
|
|||||||
Chain POSTROUTING (policy ACCEPT)
|
Chain POSTROUTING (policy ACCEPT)
|
||||||
target prot opt source destination
|
target prot opt source destination
|
||||||
|
|
||||||
### Enable IPv4 Forwarding
|
### Enable IPv4/IPv6 Forwarding
|
||||||
$ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
$ sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
|
$ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
### Add NAT Rule
|
### Add NAT Rule
|
||||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||||
|
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
||||||
|
|||||||
@@ -754,22 +754,22 @@ Below startup script can be used for setting up interfaces:
|
|||||||
```
|
```
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
|
sudo sysctl -w net.ipv4.ip_forward=1
|
||||||
sh -c "echo 1 > /proc/sys/net/ipv6/ip_forward"
|
sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
||||||
|
|
||||||
ip tuntap add name ogstun mode tun
|
ip tuntap add name ogstun mode tun
|
||||||
ip addr add 192.168.100.1/24 dev ogstun
|
ip addr add 192.168.100.1/24 dev ogstun
|
||||||
ip addr add fd84:6aea:c36e:2b69::/64 dev ogstun
|
ip addr add fd84:6aea:c36e:2b69::/48 dev ogstun
|
||||||
ip link set ogstun mtu 1400
|
ip link set ogstun mtu 1400
|
||||||
ip link set ogstun up
|
ip link set ogstun up
|
||||||
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 ! -o ogstun -j MASQUERADE
|
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 ! -o ogstun -j MASQUERADE
|
||||||
ip6tables -t nat -A POSTROUTING -s fd84:6aea:c36e:2b69::/64 ! -o ogstun -j MASQUERADE
|
ip6tables -t nat -A POSTROUTING -s fd84:6aea:c36e:2b69::/48 ! -o ogstun -j MASQUERADE
|
||||||
iptables -I INPUT -i ogstun -j ACCEPT
|
iptables -I INPUT -i ogstun -j ACCEPT
|
||||||
ip6tables -I INPUT -i ogstun -j ACCEPT
|
ip6tables -I INPUT -i ogstun -j ACCEPT
|
||||||
|
|
||||||
ip tuntap add name ogstun2 mode tun
|
ip tuntap add name ogstun2 mode tun
|
||||||
ip addr add 192.168.101.1/24 dev ogstun2
|
ip addr add 192.168.101.1/24 dev ogstun2
|
||||||
ip addr add fd1f:76f3:da9b:0101::/64 dev ogstun2
|
ip addr add fd1f:76f3:da9b:0101::/48 dev ogstun2
|
||||||
ip link set ogstun2 mtu 1400
|
ip link set ogstun2 mtu 1400
|
||||||
ip link set ogstun2 up
|
ip link set ogstun2 up
|
||||||
iptables -I INPUT -i ogstun2 -j ACCEPT
|
iptables -I INPUT -i ogstun2 -j ACCEPT
|
||||||
|
|||||||
@@ -14,15 +14,17 @@ Open5GS is a C-language Open Source implementation of 5GC and EPC, i.e. the core
|
|||||||
- Support of USIM cards using Milenage
|
- Support of USIM cards using Milenage
|
||||||
- IPv6 support
|
- IPv6 support
|
||||||
- Multiple PDU session
|
- Multiple PDU session
|
||||||
- S1/X2 and Xn Handover
|
- Handover(5GC Xn/N2 and EPC S1/X2)
|
||||||
- CSFB(Circuit Switched Fall Back) and SMSoS(SMS Over SGs)
|
- CSFB(Circuit Switched Fall Back) and SMSoS(SMS Over SGs)
|
||||||
- VoLTE(Voice over LTE)
|
- VoLTE(Voice over LTE)
|
||||||
|
|
||||||
#### Known Limitations
|
#### Known Limitations
|
||||||
---
|
---
|
||||||
|
|
||||||
- No OCS/OFCS
|
- No VoNR(Voice over NR)
|
||||||
|
- No Interworking with EPC
|
||||||
- No NB-IoT
|
- No NB-IoT
|
||||||
|
- No OCS/OFCS
|
||||||
- No eMBMS
|
- No eMBMS
|
||||||
- No SRVCC
|
- No SRVCC
|
||||||
- No Roaming
|
- No Roaming
|
||||||
|
|||||||
@@ -8,19 +8,11 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
|||||||
- User's Guide
|
- User's Guide
|
||||||
- [Quickstart](guide/01-quickstart)
|
- [Quickstart](guide/01-quickstart)
|
||||||
- [Building Open5GS from Sources](guide/02-building-open5gs-from-sources)
|
- [Building Open5GS from Sources](guide/02-building-open5gs-from-sources)
|
||||||
- [Splitting Network Functions](guide/03-splitting-network-functions)
|
|
||||||
|
|
||||||
- Tutorials
|
- Tutorials
|
||||||
- [Your First LTE](tutorial/01-your-first-lte)
|
- [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)
|
- [VoLTE Setup with Kamailio IMS and Open5GS](tutorial/02-VoLTE-setup)
|
||||||
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
|
- [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
|
- Troubleshooting
|
||||||
- [Simple Issues](troubleshoot/01-simple-issues)
|
- [Simple Issues](troubleshoot/01-simple-issues)
|
||||||
@@ -30,8 +22,23 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
|||||||
- [Debian/Ubuntu](platform/01-debian-ubuntu)
|
- [Debian/Ubuntu](platform/01-debian-ubuntu)
|
||||||
- [CentOS](platform/02-centos)
|
- [CentOS](platform/02-centos)
|
||||||
- [Fedora](platform/03-fedora)
|
- [Fedora](platform/03-fedora)
|
||||||
- [MacOSX](platform/05-macosx)
|
- [MacOSX(Apple Silicon)](platform/05-macosx-apple-silicon)
|
||||||
|
- [MacOSX(Intel)](platform/06-macosx-intel)
|
||||||
|
- [FreeBSD](platform/07-freebsd)
|
||||||
|
|
||||||
- Hardware Specific Notes
|
- Hardware Specific Notes
|
||||||
- [Tested e/gNodeBs](hardware/01-genodebs)
|
- [Tested e/gNodeBs](hardware/01-genodebs)
|
||||||
|
|
||||||
|
- @infinitydon
|
||||||
|
- [Kubernetes Open5GS Deployment](https://dev.to/infinitydon/virtual-4g-simulation-using-kubernetes-and-gns3-3b7k?fbclid=IwAR1p99h13a-mCfejanbBQe0H0-jp5grXkn5mWf1WrTHf47UtegB2-UHGGZQ)
|
||||||
|
|
||||||
|
- @nickvsnetworking
|
||||||
|
- [My first 5G Core : Open5GS and UERANSIM](http://nickvsnetworking.com/my-first-5g-core-open5gs-and-ueransim/)
|
||||||
|
- [Sending SMS in Open5GS LTE Networks using the SGs Interface and OsmoMSC](https://nickvsnetworking.com/sending-sms-in-open5gs-lte-networks-using-the-sgs-interface-and-osmomsc-with-smsos/)
|
||||||
|
- [OsmoMSC and Open5GS MME – SGs Interface for CSCF / InterRAT Handover](https://nickvsnetworking.com/osmomsc-and-open5gs-mme-sgs-interface-for-cscf-interran-handover/)
|
||||||
|
- [Static IPs for UEs](http://nickvsnetworking.com/open5gs-epc-static-ip-addresses-for-ues-apns-subscribers/)
|
||||||
|
|
||||||
|
- @s5uishida
|
||||||
|
- [EPC Advanced Example with OpenAirInterface UE/RAN](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
|
||||||
|
- [5GC Advanced Example with UERANSIM](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ pgw:
|
|||||||
- addr: ::1
|
- addr: ::1
|
||||||
ue_pool:
|
ue_pool:
|
||||||
- addr: 10.45.0.1/16
|
- addr: 10.45.0.1/16
|
||||||
- addr: cafe::1/64
|
- addr: 2001:230:cafe::1/48
|
||||||
dns:
|
dns:
|
||||||
- 8.8.8.8
|
- 8.8.8.8
|
||||||
- 8.8.4.4
|
- 8.8.4.4
|
||||||
|
|||||||
23
docs/_posts/2021-01-18-release-v2.1.4.md
Normal file
23
docs/_posts/2021-01-18-release-v2.1.4.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
title: "v2.1.4 - Paging was added"
|
||||||
|
date: 2021-01-18 21:23:00 -0500
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### New feature
|
||||||
|
- [5GC] Paging ([c9363b1](https://github.com/open5gs/open5gs/commit/c9363b132093581b6fd2ce794aa63cd597bf83a6))
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- [PFCP] Legacy support for pre-release LTE11 devices while performing VoLTE call([#757](https://github.com/open5gs/open5gs/pull/757)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [EPC] Use ESM cause(43:Invalid EPS bearer identity) if SGW-C sends GTP cause(Context Not Found) ([#755](https://github.com/open5gs/open5gs/issues/755)) -- [herlesupreeth](https://github.com/herlesupreeth)
|
||||||
|
- [MME] fix a bug where SCTP stream number was not set while sending S1-Paging message. ([c9363b1](https://github.com/open5gs/open5gs/commit/c9363b132093581b6fd2ce794aa63cd597bf83a6))
|
||||||
|
|
||||||
|
Download -- [v2.1.4.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.4.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
29
docs/_posts/2021-02-02-release-v2.1.5.md
Normal file
29
docs/_posts/2021-02-02-release-v2.1.5.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
---
|
||||||
|
title: "v2.1.5 - 5G Core N2 based handover"
|
||||||
|
date: 2021-02-02 14:52:00 -0500
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### New feature
|
||||||
|
- [5GC] N2 Handver ([49a9e58](https://github.com/open5gs/open5gs/commit/49a9e58efe3f6ecd482c3b77b98cd0841688b647), [ff5236f](https://github.com/open5gs/open5gs/commit/ff5236f3e01ee6984bc78eaacc7d84e08c321266))
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- [AMF/MME] Check IMEISV length == 16 digits ([388e642](https://github.com/open5gs/open5gs/commit/388e64213fcebc257eb7bd0223105c3055c56252))
|
||||||
|
- [AMF] Add Handling Duplicated PDU Session ID ([d9417be](https://github.com/open5gs/open5gs/commit/d9417be9a62255efa91a11ee2c424ec1e739b919))
|
||||||
|
- [ASN] S1AP/NGAP update to v16.4.0(2021-01-04) ([ada01fc](https://github.com/open5gs/open5gs/commit/ada01fca8ffaea029d2ae04e6bc1bb499ab37894))
|
||||||
|
- [AMF/MME] Add UserLocation Handling in UplinkNASTransport ([#772](https://github.com/open5gs/open5gs/pull/772)) -- [zhonglin6666](https://github.com/zhonglin6666)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [UDR] Modify SmfSelectionSubscriptionData ([#785](https://github.com/open5gs/open5gs/pull/785)) -- [zhonglin6666](https://github.com/zhonglin6666)
|
||||||
|
- [MME] ENBDirectInformationTransfer decoding problem ([#783](https://github.com/open5gs/open5gs/issues/783)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
- [AMF] PartOfNG-Interface in NGReset decoding problem ([#773](https://github.com/open5gs/open5gs/issues/773)) -- [acetcom](https://github.com/acetcom)
|
||||||
|
- [AMF] Fix UE Context Request IE Handling ([#771](https://github.com/open5gs/open5gs/issues/771)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
- [5GC] Fix the AMF/SMF/UDM crash issues ([#770](https://github.com/open5gs/open5gs/issues/770), [#771](https://github.com/open5gs/open5gs/issues/771)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
|
||||||
|
Download -- [v2.1.5.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.5.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
22
docs/_posts/2021-02-08-release-v2.1.7.md
Normal file
22
docs/_posts/2021-02-08-release-v2.1.7.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: "v2.1.7 - 5G Core Hotfix"
|
||||||
|
date: 2021-02-07 22:31:00 -0500
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [5GC/EPC] Pool size adjusted to support 1,024 UEs ([#753](https://github.com/open5gs/open5gs/issues/753)) -- [zhouxiang93123](https://github.com/zhouxiang93123)
|
||||||
|
- [AMF] Crash during handling Duplicated PDU Session ID ([#793](https://github.com/open5gs/open5gs/issues/783)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
|
||||||
|
#### New Platform
|
||||||
|
- MacOSX with Apple M1 Silicon ([7901a1](https://github.com/open5gs/open5gs/commit/7901a1164fdaa04cf72a5a944f50474d569f619d))
|
||||||
|
- FreeBSD ([852756](https://github.com/open5gs/open5gs/commit/852756f90222a8e0821f6e1994baa32eafbdc47c))
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.1.7.tar.gz](https://github.com/open5gs/open5gs/archive/v2.1.7.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
30
docs/_posts/2021-03-08-release-v2.2.0.md
Normal file
30
docs/_posts/2021-03-08-release-v2.2.0.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.0 - DB Schema Changes"
|
||||||
|
date: 2021-03-08 21:35:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } </style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### DB Schema Changes
|
||||||
|
- No backward compatibility. If you are using an old subscription DB, you should change to the new DB schema.
|
||||||
|
|
||||||
|
#### New features
|
||||||
|
- NSSF(Network Slice Selection Function) is added.
|
||||||
|
- SMF selection is added.
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- [DB] Masking MongoDB credentials when logging ([#827](https://github.com/open5gs/open5gs/pull/827)) -- [cglewis](https://github.com/cglewis)
|
||||||
|
- [EPC/5GC] Branch name changes from master to main ([#811](https://github.com/open5gs/open5gs/pull/811)) -- [PawelMack](https://github.com/PawelMack)
|
||||||
|
- [AMF] Cause of UEContextRelaseCommand uses Cause of UEContextReleaseRequest ([#789](https://github.com/open5gs/open5gs/issues/789)) -- [PawelMack](https://github.com/PawelMack)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [SMF] Fix the bug for DataForwardingNotPossible ([31977bf](https://github.com/open5gs/open5gs/commit/31977bf30a396389557c8be0f82cfdfb8152d580))
|
||||||
|
- [AMF] Fix the exception handling routine when UE/gNB repeatedly sends NGAP messages ([#804](https://github.com/open5gs/open5gs/issues/804)) -- [strongcourage](https://github.com/strongcourage)
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.0.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.0.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
31
docs/_posts/2021-03-15-release-v2.2.1.md
Normal file
31
docs/_posts/2021-03-15-release-v2.2.1.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.1 - UE IPv6 Support"
|
||||||
|
date: 2021-03-15 09:38:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### IMPORTANT
|
||||||
|
|
||||||
|
To use the new WebUI v2.2.1, you have to log out and log back in to reset your browser token information.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
#### UE IPv6 Support
|
||||||
|
- If the SMF receives Router Solicitation Message through UPF, it sends Router Advertisement Message to the UE through UPF.
|
||||||
|
- If the UPF matches the IPv6 Prefix instead of Full IPv6 address, it forwards the packet to the UE. ([#808](https://github.com/open5gs/open5gs/issues/808)) -- [kbarlee](https://github.com/kbarlee), [byteburner](https://github.com/byteburner)
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- Adding API tokens to WebUI to improve security vulnerabilities ([#838](https://github.com/open5gs/open5gs/pull/838)) -- [rashley-iqt](https://github.com/rashley-iqt)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [AMF] Fixed a problem that occurs when the UE does not send S-NSSAI in UL NAS Transport message ([#845](https://github.com/open5gs/open5gs/issues/845)) -- [mcatalancid](https://github.com/mcatalancid)
|
||||||
|
- [AMF] Fixed a problem that occurs when the UE does not send Request-NSSAI in Registration request([#844](https://github.com/open5gs/open5gs/issues/844)) -- [ggardikis](https://github.com/ggardikis)
|
||||||
|
- [MME] Fixed the infinit loop related to Delete-Session-Request ([#568](https://github.com/open5gs/open5gs/issues/568)) -- [domgth](https://github.com/domgth)
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.1.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.1.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
55
docs/_posts/2021-03-19-release-v2.2.2.md
Normal file
55
docs/_posts/2021-03-19-release-v2.2.2.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.2 - It will be deleted soon"
|
||||||
|
date: 2021-03-19 21:54:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### IMPORTANT Using v2.2.x
|
||||||
|
|
||||||
|
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ mongo
|
||||||
|
> use open5gs
|
||||||
|
switched to db open5gs
|
||||||
|
> db.subscribers.drop()
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ git checkout v2.1.7
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You should log out
|
||||||
|
|
||||||
|
$ git checkout main
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You can log back in
|
||||||
|
```
|
||||||
|
|
||||||
|
#### New Features
|
||||||
|
- [EPC] Added E-RABModificationIndication/E-RABModificationConfirm ([#834](https://github.com/open5gs/open5gs/issues/834)) -- [alf-askey](https://github.com/alf-askey)
|
||||||
|
- [ALL] Advertising address for all SBI and GTP-U interfaces ([#825](https://github.com/open5gs/open5gs/issues/825)) -- [infinitydon](https://github.com/infinitydon)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [5GC] When PDR is created without deleting session, there is a bug to create new PDR. ([#860](https://github.com/open5gs/open5gs/issues/860)) -- [kbarlee](https://github.com/kbarlee)
|
||||||
|
- [NSSF] Add default NSI configuration for NSSF ([#859](https://github.com/open5gs/open5gs/issues/859)) -- [AniketTiw](https://github.com/AniketTiw)
|
||||||
|
- [MME] Fixed the MME crash during HandoverCancel without Target eNB ([#855](https://github.com/open5gs/open5gs/issues/855)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.2.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.2.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
74
docs/_posts/2021-03-29-release-v2.2.3.md
Normal file
74
docs/_posts/2021-03-29-release-v2.2.3.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.3 - It will be deleted soon"
|
||||||
|
date: 2021-03-29 23:08:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [MME] Fix an issue where Modify Bearer Request was not sent ([#885](https://github.com/open5gs/open5gs/issues/885)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||||
|
- [PFCP/GTP] Fix to be able to ignore unknown TLV type ([#871](https://github.com/open5gs/open5gs/issues/871)) -- [infinitydon](https://github.com/infinitydon)
|
||||||
|
- [IMS] Fix the problem with managingg multiple calls ([#869](https://github.com/open5gs/open5gs/issues/869)) -- [ngvoice](https://github.com/ngvoice)
|
||||||
|
- [AMF] Fix creating allowed-NSSAI ([#859](https://github.com/open5gs/open5gs/issues/859)) -- [AniketTiw](https://github.com/AniketTiw)
|
||||||
|
|
||||||
|
#### freeDiameter 1.5.0
|
||||||
|
|
||||||
|
freeDiameter version has changed from 1.3.2 to 1.5.0. If you want to compile the source code, you need to update meson subprojects as shown below.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd open5gs
|
||||||
|
$ git pull
|
||||||
|
$ meson subprojects update
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
Or just use a clean github repository.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ rm -Rf open5gs
|
||||||
|
$ git clone https://github.com/open5gs/open5gs
|
||||||
|
$ cd open5gs
|
||||||
|
$ meson build --prefix=`pwd`/install
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
#### IMPORTANT Using v2.2.x
|
||||||
|
|
||||||
|
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ mongo
|
||||||
|
> use open5gs
|
||||||
|
switched to db open5gs
|
||||||
|
> db.subscribers.drop()
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ git checkout v2.1.7
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You should log out
|
||||||
|
|
||||||
|
$ git checkout main
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You can log back in
|
||||||
|
```
|
||||||
|
|
||||||
|
Download -- [v2.2.3.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.3.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
77
docs/_posts/2021-04-01-release-v2.2.4.md
Normal file
77
docs/_posts/2021-04-01-release-v2.2.4.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.4 - It will be deleted soon"
|
||||||
|
date: 2021-04-01 23:08:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [freeDiameter] A crash has been fixed when using a version prior to v2.2.3 ([#898](https://github.com/open5gs/open5gs/issues/898)) -- [Nour963](https://github.com/Nour963), [kbarlee](https://github.com/kbarlee)
|
||||||
|
- [AMF] Fixed a crash when a lot of number simultaneous connections occur. ([#886](https://github.com/open5gs/open5gs/issues/886)) -- [dongzx666](https://github.com/dongzx666)
|
||||||
|
- [MME/AMF] Fixed a bug when S-TMSI does not exist in InitialUEMessage ([#890](https://github.com/open5gs/open5gs/issues/890)) -- [chliny2016](https://github.com/chliny2016)
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- [MME/AMF] Added SACK_DELAY_TIME in the AMF/MME configuration files ([#895](https://github.com/open5gs/open5gs/issues/895)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||||
|
- [DB] Updated Python Lib docs and script to migrate DB data to new format ([#889](https://github.com/open5gs/open5gs/pull/889)) -- [nickvsnetworking](https://github.com/nickvsnetworking)
|
||||||
|
|
||||||
|
#### IMPORTANT Using v2.2.x
|
||||||
|
|
||||||
|
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ mongo
|
||||||
|
> use open5gs
|
||||||
|
switched to db open5gs
|
||||||
|
> db.subscribers.drop()
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ git checkout v2.1.7
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You should log out
|
||||||
|
|
||||||
|
$ git checkout main
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You can log back in
|
||||||
|
```
|
||||||
|
|
||||||
|
- freeDiameter version has changed from 1.3.2 to 1.5.0. If you want to compile the source code, you need to update meson subprojects as shown below.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd open5gs
|
||||||
|
$ git pull
|
||||||
|
$ meson subprojects update
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
Or just use a clean github repository.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ rm -Rf open5gs
|
||||||
|
$ git clone https://github.com/open5gs/open5gs
|
||||||
|
$ cd open5gs
|
||||||
|
$ meson build --prefix=`pwd`/install
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.4.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.4.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
70
docs/_posts/2021-04-03-release-v2.2.5.md
Normal file
70
docs/_posts/2021-04-03-release-v2.2.5.md
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.5 - It will be deleted soon"
|
||||||
|
date: 2021-04-03 14:20:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [AMF] Always Include Allow NSSAI in Registration accept ([#910](https://github.com/open5gs/open5gs/issues/910)) -- [chliny2016](https://github.com/chliny2016)
|
||||||
|
#### IMPORTANT Using v2.2.x
|
||||||
|
|
||||||
|
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ mongo
|
||||||
|
> use open5gs
|
||||||
|
switched to db open5gs
|
||||||
|
> db.subscribers.drop()
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ git checkout v2.1.7
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You should log out
|
||||||
|
|
||||||
|
$ git checkout main
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You can log back in
|
||||||
|
```
|
||||||
|
|
||||||
|
- freeDiameter version has changed from 1.3.2 to 1.5.0. If you want to compile the source code, you need to update meson subprojects as shown below.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd open5gs
|
||||||
|
$ git pull
|
||||||
|
$ meson subprojects update
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
Or just use a clean github repository.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ rm -Rf open5gs
|
||||||
|
$ git clone https://github.com/open5gs/open5gs
|
||||||
|
$ cd open5gs
|
||||||
|
$ meson build --prefix=`pwd`/install
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.5.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.5.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
93
docs/_posts/2021-04-09-release-v2.2.6.md
Normal file
93
docs/_posts/2021-04-09-release-v2.2.6.md
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
---
|
||||||
|
title: "v2.2.6 - HSS Cx Added"
|
||||||
|
date: 2021-04-09 21:15:00 +0900
|
||||||
|
categories:
|
||||||
|
- Release
|
||||||
|
tags:
|
||||||
|
- News
|
||||||
|
- Release
|
||||||
|
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
|
||||||
|
---
|
||||||
|
|
||||||
|
#### New Features
|
||||||
|
- [HSS] Cx Interface Added
|
||||||
|
- [EPC] Added E-RABModificationIndication/E-RABModificationConfirm ([#834](https://github.com/open5gs/open5gs/issues/834)) -- [alf-askey](https://github.com/alf-askey)
|
||||||
|
- [ALL] Advertising address for all SBI and GTP-U interfaces ([#825](https://github.com/open5gs/open5gs/issues/825)) -- [infinitydon](https://github.com/infinitydon)
|
||||||
|
|
||||||
|
#### Enhancement
|
||||||
|
- [MME/AMF] Added SACK_DELAY_TIME in the AMF/MME configuration files ([#895](https://github.com/open5gs/open5gs/issues/895)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||||
|
- [DB] Updated Python Lib docs and script to migrate DB data to new format ([#889](https://github.com/open5gs/open5gs/pull/889)) -- [nickvsnetworking](https://github.com/nickvsnetworking)
|
||||||
|
|
||||||
|
#### Bug Fixes
|
||||||
|
- [AMF] Fixed a crash when gNB with 40+ connected UE's disconnect ([#925](https://github.com/open5gs/open5gs/issues/925)) -- [Spectranis](https://github.com/Spectranis)
|
||||||
|
- [WebUI] Fixed the installation script for solving the debian mongod dependency problem ([#915](https://github.com/open5gs/open5gs/issues/915)) -- [iman432](https://github.com/iman432)
|
||||||
|
- [AMF] Fixed a crash for unknown timezone offset ([#914](https://github.com/open5gs/open5gs/issues/914)) -- [iman432](https://github.com/iman432)
|
||||||
|
- [AMF] Always Include Allow NSSAI in Registration accept ([#910](https://github.com/open5gs/open5gs/issues/910)) -- [chliny2016](https://github.com/chliny2016)
|
||||||
|
- [freeDiameter] A crash has been fixed when using a version prior to v2.2.3 ([#898](https://github.com/open5gs/open5gs/issues/898)) -- [Nour963](https://github.com/Nour963), [kbarlee](https://github.com/kbarlee)
|
||||||
|
- [AMF] Fixed a crash when a lot of number simultaneous connections occur. ([#886](https://github.com/open5gs/open5gs/issues/886)) -- [dongzx666](https://github.com/dongzx666)
|
||||||
|
- [MME/AMF] Fixed a bug when S-TMSI does not exist in InitialUEMessage ([#890](https://github.com/open5gs/open5gs/issues/890)) -- [chliny2016](https://github.com/chliny2016)
|
||||||
|
- [MME] Fix an issue where Modify Bearer Request was not sent ([#885](https://github.com/open5gs/open5gs/issues/885)) -- [RafalArciszewski](https://github.com/RafalArciszewski)
|
||||||
|
- [PFCP/GTP] Fix to be able to ignore unknown TLV type ([#871](https://github.com/open5gs/open5gs/issues/871)) -- [infinitydon](https://github.com/infinitydon)
|
||||||
|
- [IMS] Fix the problem with managingg multiple calls ([#869](https://github.com/open5gs/open5gs/issues/869)) -- [ngvoice](https://github.com/ngvoice)
|
||||||
|
- [AMF] Fix creating allowed-NSSAI ([#859](https://github.com/open5gs/open5gs/issues/859)) -- [AniketTiw](https://github.com/AniketTiw)
|
||||||
|
- [5GC] When PDR is created without deleting session, there is a bug to create new PDR. ([#860](https://github.com/open5gs/open5gs/issues/860)) -- [kbarlee](https://github.com/kbarlee)
|
||||||
|
- [NSSF] Add default NSI configuration for NSSF ([#859](https://github.com/open5gs/open5gs/issues/859)) -- [AniketTiw](https://github.com/AniketTiw)
|
||||||
|
- [MME] Fixed the MME crash during HandoverCancel without Target eNB ([#855](https://github.com/open5gs/open5gs/issues/855)) -- [kuanghanqian](https://github.com/kuanghanqian)
|
||||||
|
|
||||||
|
#### IMPORTANT Using v2.2.x
|
||||||
|
|
||||||
|
- **DB Schema Changes:** If you are using an existing subscription DB, you should delete the existing DB. Then you can add a new subscription DB.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ mongo
|
||||||
|
> use open5gs
|
||||||
|
switched to db open5gs
|
||||||
|
> db.subscribers.drop()
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
- **The New WebUI:** You have to log out using the old WebUI backend/frontend. Then, you can log back in again using the new WebUI backend/frontend.
|
||||||
|
{: .blue}
|
||||||
|
```
|
||||||
|
$ git checkout v2.1.7
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You should log out
|
||||||
|
|
||||||
|
$ git checkout main
|
||||||
|
$ cd webui
|
||||||
|
$ rm -Rf ./node_modules
|
||||||
|
$ npm ci --no-optional
|
||||||
|
$ npm run dev
|
||||||
|
|
||||||
|
## You can log back in
|
||||||
|
```
|
||||||
|
|
||||||
|
- freeDiameter version has changed from 1.3.2 to 1.5.0. If you want to compile the source code, you need to update meson subprojects as shown below.
|
||||||
|
{: .blue}
|
||||||
|
|
||||||
|
```
|
||||||
|
$ cd open5gs
|
||||||
|
$ git pull
|
||||||
|
$ meson subprojects update
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
Or just use a clean github repository.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ rm -Rf open5gs
|
||||||
|
$ git clone https://github.com/open5gs/open5gs
|
||||||
|
$ cd open5gs
|
||||||
|
$ meson build --prefix=`pwd`/install
|
||||||
|
$ cd build
|
||||||
|
$ ninja
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Download -- [v2.2.6.tar.gz](https://github.com/open5gs/open5gs/archive/v2.2.6.tar.gz)
|
||||||
|
{: .notice--info}
|
||||||
BIN
docs/assets/images/subscriber_info_with_two_slice.png
Normal file
BIN
docs/assets/images/subscriber_info_with_two_slice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
@@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
PACKAGE="open5gs"
|
PACKAGE="open5gs"
|
||||||
VERSION="2.0.0"
|
VERSION="2.2.6"
|
||||||
|
|
||||||
print_status() {
|
print_status() {
|
||||||
echo
|
echo
|
||||||
@@ -228,7 +228,7 @@ if [[ $RC != 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
print_status "Build the Open5GS WebUI..."
|
print_status "Build the Open5GS WebUI..."
|
||||||
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm install && npm run build"
|
exec_cmd "cd ./${PACKAGE}-${VERSION}/webui && npm ci --no-optional && npm run build"
|
||||||
|
|
||||||
print_status "Install the Open5GS WebUI..."
|
print_status "Install the Open5GS WebUI..."
|
||||||
exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"
|
exec_cmd "mv ./${PACKAGE}-${VERSION}/webui /usr/lib/node_modules/${PACKAGE}"
|
||||||
@@ -237,8 +237,7 @@ exec_cmd_nobail "chown -R open5gs:open5gs /usr/lib/node_modules/${PACKAGE}"
|
|||||||
exec_cmd "cat << EOF > /lib/systemd/system/open5gs-webui.service
|
exec_cmd "cat << EOF > /lib/systemd/system/open5gs-webui.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Open5GS WebUI
|
Description=Open5GS WebUI
|
||||||
BindTo=mongodb.service
|
Wants=mongodb.service mongod.service
|
||||||
After=networking.service mongodb.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|||||||
@@ -78,6 +78,9 @@ void ausf_terminate(void);
|
|||||||
int pcf_initialize(void);
|
int pcf_initialize(void);
|
||||||
void pcf_terminate(void);
|
void pcf_terminate(void);
|
||||||
|
|
||||||
|
int nssf_initialize(void);
|
||||||
|
void nssf_terminate(void);
|
||||||
|
|
||||||
int upf_initialize(void);
|
int upf_initialize(void);
|
||||||
void upf_terminate(void);
|
void upf_terminate(void);
|
||||||
|
|
||||||
|
|||||||
@@ -86,17 +86,20 @@ static void recalculate_pool_size(void)
|
|||||||
self.pool.pfcp_node = self.pool.nf;
|
self.pool.pfcp_node = self.pool.nf;
|
||||||
|
|
||||||
#define MAX_NUM_OF_NF_SERVICE 16 /* Num of NF Service per NF Instance */
|
#define MAX_NUM_OF_NF_SERVICE 16 /* Num of NF Service per NF Instance */
|
||||||
#define MAX_NUM_OF_SBI_MESSAGE 8 /* Num of HTTP(s) Request/Response per NF */
|
#define MAX_NUM_OF_SBI_MESSAGE 4 /* Num of HTTP(s) Request/Response per NF */
|
||||||
#define MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */
|
#define MAX_NUM_OF_NF_SUBSCRIPTION 4 /* Num of Subscription per NF */
|
||||||
self.pool.nf_service = self.pool.nf * MAX_NUM_OF_NF_SERVICE;
|
self.pool.nf_service = self.pool.nf * MAX_NUM_OF_NF_SERVICE;
|
||||||
self.pool.sbi_message = self.pool.nf * MAX_NUM_OF_SBI_MESSAGE;
|
self.pool.sbi_message = self.pool.nf * MAX_NUM_OF_SBI_MESSAGE;
|
||||||
self.pool.nf_subscription = self.pool.nf * MAX_NUM_OF_NF_SUBSCRIPTION;
|
self.pool.nf_subscription = self.pool.nf * MAX_NUM_OF_NF_SUBSCRIPTION;
|
||||||
|
|
||||||
#define MAX_EVENT_POOL 32
|
self.pool.event = self.max.ue;
|
||||||
self.pool.event = MAX_EVENT_POOL;
|
|
||||||
|
|
||||||
#define MAX_CSMAP_POOL 128
|
#define MAX_CSMAP_POOL 128
|
||||||
self.pool.csmap = MAX_CSMAP_POOL; /* Num of TAI-LAI Mapping Table */
|
self.pool.csmap = MAX_CSMAP_POOL; /* Num of TAI-LAI Mapping Table */
|
||||||
|
|
||||||
|
#define MAX_NUM_OF_IMPU 8
|
||||||
|
self.pool.impi = self.max.ue;
|
||||||
|
self.pool.impu = self.pool.impi * MAX_NUM_OF_IMPU;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void regenerate_all_timer_duration(void)
|
static void regenerate_all_timer_duration(void)
|
||||||
@@ -173,6 +176,18 @@ static void app_context_prepare(void)
|
|||||||
#define USRSCTP_LOCAL_UDP_PORT 9899
|
#define USRSCTP_LOCAL_UDP_PORT 9899
|
||||||
self.usrsctp.udp_port = USRSCTP_LOCAL_UDP_PORT;
|
self.usrsctp.udp_port = USRSCTP_LOCAL_UDP_PORT;
|
||||||
|
|
||||||
|
self.sctp.heartbit_interval = 5000; /* 5 seconds */
|
||||||
|
self.sctp.sack_delay = 200; /* 200 ms */
|
||||||
|
self.sctp.rto_initial = 3000; /* 3 seconds */
|
||||||
|
self.sctp.rto_min = 1000; /* 1 seconds */
|
||||||
|
self.sctp.rto_max = 5000; /* 5 seconds */
|
||||||
|
self.sctp.max_num_of_ostreams = OGS_DEFAULT_SCTP_MAX_NUM_OF_OSTREAMS;
|
||||||
|
self.sctp.max_num_of_istreams = 65535;
|
||||||
|
self.sctp.max_attempts = 4;
|
||||||
|
self.sctp.max_initial_timeout = 8000; /* 8 seconds */
|
||||||
|
|
||||||
|
self.sockopt.no_delay = true;
|
||||||
|
|
||||||
#define MAX_NUM_OF_UE 1024 /* Num of UE per AMF/MME */
|
#define MAX_NUM_OF_UE 1024 /* Num of UE per AMF/MME */
|
||||||
#define MAX_NUM_OF_GNB 32 /* Num of gNB per AMF/MME */
|
#define MAX_NUM_OF_GNB 32 /* Num of gNB per AMF/MME */
|
||||||
|
|
||||||
@@ -203,6 +218,14 @@ static void app_context_prepare(void)
|
|||||||
*/
|
*/
|
||||||
self.time.message.duration = ogs_time_from_sec(10);
|
self.time.message.duration = ogs_time_from_sec(10);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Handover Wait Duration : 300 ms (Default)
|
||||||
|
*
|
||||||
|
* Time to wait for AMF/MME to send UEContextReleaseCommand
|
||||||
|
* to the source gNB/eNB after receiving HandoverNotify
|
||||||
|
*/
|
||||||
|
self.time.handover.duration = ogs_time_from_msec(300);
|
||||||
|
|
||||||
regenerate_all_timer_duration();
|
regenerate_all_timer_duration();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +329,9 @@ int ogs_app_context_parse_config(void)
|
|||||||
} else if (!strcmp(parameter_key, "no_pcf")) {
|
} else if (!strcmp(parameter_key, "no_pcf")) {
|
||||||
self.parameter.no_pcf =
|
self.parameter.no_pcf =
|
||||||
ogs_yaml_iter_bool(¶meter_iter);
|
ogs_yaml_iter_bool(¶meter_iter);
|
||||||
|
} else if (!strcmp(parameter_key, "no_nssf")) {
|
||||||
|
self.parameter.no_nssf =
|
||||||
|
ogs_yaml_iter_bool(¶meter_iter);
|
||||||
} else if (!strcmp(parameter_key, "no_udr")) {
|
} else if (!strcmp(parameter_key, "no_udr")) {
|
||||||
self.parameter.no_udr =
|
self.parameter.no_udr =
|
||||||
ogs_yaml_iter_bool(¶meter_iter);
|
ogs_yaml_iter_bool(¶meter_iter);
|
||||||
@@ -321,9 +347,6 @@ int ogs_app_context_parse_config(void)
|
|||||||
} else if (!strcmp(parameter_key, "multicast")) {
|
} else if (!strcmp(parameter_key, "multicast")) {
|
||||||
self.parameter.multicast =
|
self.parameter.multicast =
|
||||||
ogs_yaml_iter_bool(¶meter_iter);
|
ogs_yaml_iter_bool(¶meter_iter);
|
||||||
} else if (!strcmp(parameter_key, "no_slaac")) {
|
|
||||||
self.parameter.no_slaac =
|
|
||||||
ogs_yaml_iter_bool(¶meter_iter);
|
|
||||||
} else if (!strcmp(parameter_key, "use_openair")) {
|
} else if (!strcmp(parameter_key, "use_openair")) {
|
||||||
self.parameter.use_openair =
|
self.parameter.use_openair =
|
||||||
ogs_yaml_iter_bool(¶meter_iter);
|
ogs_yaml_iter_bool(¶meter_iter);
|
||||||
@@ -334,6 +357,22 @@ int ogs_app_context_parse_config(void)
|
|||||||
} else
|
} else
|
||||||
ogs_warn("unknown key `%s`", parameter_key);
|
ogs_warn("unknown key `%s`", parameter_key);
|
||||||
}
|
}
|
||||||
|
} else if (!strcmp(root_key, "sockopt")) {
|
||||||
|
ogs_yaml_iter_t sockopt_iter;
|
||||||
|
ogs_yaml_iter_recurse(&root_iter, &sockopt_iter);
|
||||||
|
while (ogs_yaml_iter_next(&sockopt_iter)) {
|
||||||
|
const char *sockopt_key = ogs_yaml_iter_key(&sockopt_iter);
|
||||||
|
ogs_assert(sockopt_key);
|
||||||
|
if (!strcmp(sockopt_key, "no_delay")) {
|
||||||
|
self.sockopt.no_delay =
|
||||||
|
ogs_yaml_iter_bool(&sockopt_iter);
|
||||||
|
} else if (!strcmp(sockopt_key, "linger")) {
|
||||||
|
const char *v = ogs_yaml_iter_value(&sockopt_iter);
|
||||||
|
if (v) self.sockopt.l_linger = atoi(v);
|
||||||
|
self.sockopt.l_onoff = true;
|
||||||
|
} else
|
||||||
|
ogs_warn("unknown key `%s`", sockopt_key);
|
||||||
|
}
|
||||||
} else if (!strcmp(root_key, "sctp")) {
|
} else if (!strcmp(root_key, "sctp")) {
|
||||||
ogs_yaml_iter_t sctp_iter;
|
ogs_yaml_iter_t sctp_iter;
|
||||||
ogs_yaml_iter_recurse(&root_iter, &sctp_iter);
|
ogs_yaml_iter_recurse(&root_iter, &sctp_iter);
|
||||||
@@ -342,31 +381,34 @@ int ogs_app_context_parse_config(void)
|
|||||||
ogs_assert(sctp_key);
|
ogs_assert(sctp_key);
|
||||||
if (!strcmp(sctp_key, "heartbit_interval")) {
|
if (!strcmp(sctp_key, "heartbit_interval")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.sockopt.sctp.heartbit_interval = atoi(v);
|
if (v) self.sctp.heartbit_interval = atoi(v);
|
||||||
|
} else if (!strcmp(sctp_key, "sack_delay")) {
|
||||||
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
|
if (v) self.sctp.sack_delay = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "rto_initial")) {
|
} else if (!strcmp(sctp_key, "rto_initial")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.sockopt.sctp.rto_initial = atoi(v);
|
if (v) self.sctp.rto_initial = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "rto_min")) {
|
} else if (!strcmp(sctp_key, "rto_min")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.sockopt.sctp.rto_min = atoi(v);
|
if (v) self.sctp.rto_min = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "rto_max")) {
|
} else if (!strcmp(sctp_key, "rto_max")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.sockopt.sctp.rto_max = atoi(v);
|
if (v) self.sctp.rto_max = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "max_num_of_ostreams")) {
|
} else if (!strcmp(sctp_key, "max_num_of_ostreams")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v)
|
if (v)
|
||||||
self.sockopt.sctp.max_num_of_ostreams = atoi(v);
|
self.sctp.max_num_of_ostreams = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "max_num_of_istreams")) {
|
} else if (!strcmp(sctp_key, "max_num_of_istreams")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v)
|
if (v)
|
||||||
self.sockopt.sctp.max_num_of_istreams = atoi(v);
|
self.sctp.max_num_of_istreams = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "max_attempts")) {
|
} else if (!strcmp(sctp_key, "max_attempts")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.sockopt.sctp.max_attempts = atoi(v);
|
if (v) self.sctp.max_attempts = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "max_initial_timeout")) {
|
} else if (!strcmp(sctp_key, "max_initial_timeout")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v)
|
if (v)
|
||||||
self.sockopt.sctp.max_initial_timeout = atoi(v);
|
self.sctp.max_initial_timeout = atoi(v);
|
||||||
} else if (!strcmp(sctp_key, "usrsctp_udp_port")) {
|
} else if (!strcmp(sctp_key, "usrsctp_udp_port")) {
|
||||||
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
const char *v = ogs_yaml_iter_value(&sctp_iter);
|
||||||
if (v) self.usrsctp.udp_port = atoi(v);
|
if (v) self.usrsctp.udp_port = atoi(v);
|
||||||
@@ -482,13 +524,31 @@ int ogs_app_context_parse_config(void)
|
|||||||
if (!strcmp(msg_key, "duration")) {
|
if (!strcmp(msg_key, "duration")) {
|
||||||
const char *v = ogs_yaml_iter_value(&msg_iter);
|
const char *v = ogs_yaml_iter_value(&msg_iter);
|
||||||
if (v) {
|
if (v) {
|
||||||
self.time.message.duration =
|
self.time.message.duration =
|
||||||
ogs_time_from_msec(atoll(v));
|
ogs_time_from_msec(atoll(v));
|
||||||
regenerate_all_timer_duration();
|
regenerate_all_timer_duration();
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ogs_warn("unknown key `%s`", msg_key);
|
ogs_warn("unknown key `%s`", msg_key);
|
||||||
}
|
}
|
||||||
|
} else if (!strcmp(time_key, "handover")) {
|
||||||
|
ogs_yaml_iter_t msg_iter;
|
||||||
|
ogs_yaml_iter_recurse(&time_iter, &msg_iter);
|
||||||
|
|
||||||
|
while (ogs_yaml_iter_next(&msg_iter)) {
|
||||||
|
const char *msg_key =
|
||||||
|
ogs_yaml_iter_key(&msg_iter);
|
||||||
|
ogs_assert(msg_key);
|
||||||
|
|
||||||
|
if (!strcmp(msg_key, "duration")) {
|
||||||
|
const char *v = ogs_yaml_iter_value(&msg_iter);
|
||||||
|
if (v) {
|
||||||
|
self.time.handover.duration =
|
||||||
|
ogs_time_from_msec(atoll(v));
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
ogs_warn("unknown key `%s`", msg_key);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
ogs_warn("unknown key `%s`", time_key);
|
ogs_warn("unknown key `%s`", time_key);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ typedef struct ogs_app_context_s {
|
|||||||
int no_ausf;
|
int no_ausf;
|
||||||
int no_udm;
|
int no_udm;
|
||||||
int no_pcf;
|
int no_pcf;
|
||||||
|
int no_nssf;
|
||||||
int no_udr;
|
int no_udr;
|
||||||
int no_nrf;
|
int no_nrf;
|
||||||
|
|
||||||
@@ -71,13 +72,29 @@ typedef struct ogs_app_context_s {
|
|||||||
int no_ipv6;
|
int no_ipv6;
|
||||||
int prefer_ipv4;
|
int prefer_ipv4;
|
||||||
int multicast;
|
int multicast;
|
||||||
int no_slaac;
|
|
||||||
|
|
||||||
int use_openair;
|
int use_openair;
|
||||||
int no_ipv4v6_local_addr_in_packet_filter;
|
int no_ipv4v6_local_addr_in_packet_filter;
|
||||||
} parameter;
|
} parameter;
|
||||||
|
|
||||||
ogs_sockopt_t sockopt;
|
struct {
|
||||||
|
int no_delay;
|
||||||
|
int l_onoff;
|
||||||
|
int l_linger;
|
||||||
|
} sockopt;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int heartbit_interval;
|
||||||
|
int sack_delay;
|
||||||
|
int rto_initial;
|
||||||
|
int rto_min;
|
||||||
|
int rto_max;
|
||||||
|
int max_num_of_ostreams;
|
||||||
|
int max_num_of_istreams;
|
||||||
|
int max_attempts;
|
||||||
|
int max_initial_timeout;
|
||||||
|
} sctp;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int udp_port;
|
int udp_port;
|
||||||
} usrsctp;
|
} usrsctp;
|
||||||
@@ -109,6 +126,9 @@ typedef struct ogs_app_context_s {
|
|||||||
uint64_t gtp_node;
|
uint64_t gtp_node;
|
||||||
uint64_t pfcp_xact;
|
uint64_t pfcp_xact;
|
||||||
uint64_t pfcp_node;
|
uint64_t pfcp_node;
|
||||||
|
|
||||||
|
uint64_t impi;
|
||||||
|
uint64_t impu;
|
||||||
} pool;
|
} pool;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@@ -146,6 +166,12 @@ typedef struct ogs_app_context_s {
|
|||||||
ogs_time_t no_heartbeat_duration;
|
ogs_time_t no_heartbeat_duration;
|
||||||
} pfcp;
|
} pfcp;
|
||||||
} message;
|
} message;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
ogs_time_t duration;
|
||||||
|
ogs_time_t complete_delay;
|
||||||
|
} handover;
|
||||||
|
|
||||||
} time;
|
} time;
|
||||||
} ogs_app_context_t;
|
} ogs_app_context_t;
|
||||||
|
|
||||||
|
|||||||
@@ -4,447 +4,72 @@
|
|||||||
*/
|
*/
|
||||||
#include <asn_internal.h>
|
#include <asn_internal.h>
|
||||||
#include <ANY.h>
|
#include <ANY.h>
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
|
asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs = {
|
||||||
sizeof(ANY_t),
|
sizeof(ANY_t),
|
||||||
offsetof(ANY_t, _asn_ctx),
|
offsetof(ANY_t, _asn_ctx),
|
||||||
ASN_OSUBV_ANY
|
ASN_OSUBV_ANY
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_ANY = {
|
asn_TYPE_operation_t asn_OP_ANY = {
|
||||||
OCTET_STRING_free,
|
OCTET_STRING_free,
|
||||||
OCTET_STRING_print,
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
OCTET_STRING_compare,
|
OCTET_STRING_print,
|
||||||
OCTET_STRING_decode_ber,
|
|
||||||
OCTET_STRING_encode_der,
|
|
||||||
OCTET_STRING_decode_xer_hex,
|
|
||||||
ANY_encode_xer,
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
0,
|
0,
|
||||||
0,
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
OCTET_STRING_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0, 0, 0, 0,
|
OCTET_STRING_decode_ber,
|
||||||
|
OCTET_STRING_encode_der,
|
||||||
#else
|
#else
|
||||||
ANY_decode_uper,
|
0,
|
||||||
ANY_encode_uper,
|
0,
|
||||||
ANY_decode_aper,
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
ANY_encode_aper,
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
OCTET_STRING_decode_xer_hex,
|
||||||
0, /* Random fill is not defined for ANY type */
|
ANY_encode_xer,
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
ANY_decode_uper,
|
||||||
|
ANY_encode_uper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
ANY_decode_aper,
|
||||||
|
ANY_encode_aper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
0, /* Random fill is not defined for ANY type */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_ANY = {
|
asn_TYPE_descriptor_t asn_DEF_ANY = {
|
||||||
"ANY",
|
"ANY",
|
||||||
"ANY",
|
"ANY",
|
||||||
&asn_OP_ANY,
|
&asn_OP_ANY,
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
{ 0, 0, asn_generic_no_constraint }, /* No constraints */
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
&asn_SPC_ANY_specs,
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
asn_generic_no_constraint
|
||||||
|
}, /* No constraints */
|
||||||
|
0, 0, /* No members */
|
||||||
|
&asn_SPC_ANY_specs,
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef RETURN
|
|
||||||
#define RETURN(_code) \
|
|
||||||
do { \
|
|
||||||
asn_dec_rval_t tmprval; \
|
|
||||||
tmprval.code = _code; \
|
|
||||||
tmprval.consumed = consumed_myself; \
|
|
||||||
return tmprval; \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
ANY_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
|
||||||
enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
|
|
||||||
void *app_key) {
|
|
||||||
if(flags & XER_F_CANONICAL) {
|
|
||||||
/*
|
|
||||||
* Canonical XER-encoding of ANY type is not supported.
|
|
||||||
*/
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dump as binary */
|
|
||||||
return OCTET_STRING_encode_xer(td, sptr, ilevel, flags, cb, app_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct _callback_arg {
|
|
||||||
uint8_t *buffer;
|
|
||||||
size_t offset;
|
|
||||||
size_t size;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int ANY__consume_bytes(const void *buffer, size_t size, void *key);
|
|
||||||
|
|
||||||
int
|
|
||||||
ANY_fromType(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
|
|
||||||
struct _callback_arg arg;
|
|
||||||
asn_enc_rval_t erval = {0,0,0};
|
|
||||||
|
|
||||||
if(!st || !td) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!sptr) {
|
|
||||||
if(st->buf) FREEMEM(st->buf);
|
|
||||||
st->size = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
arg.offset = arg.size = 0;
|
|
||||||
arg.buffer = 0;
|
|
||||||
|
|
||||||
erval = der_encode(td, sptr, ANY__consume_bytes, &arg);
|
|
||||||
if(erval.encoded == -1) {
|
|
||||||
if(arg.buffer) FREEMEM(arg.buffer);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
assert((size_t)erval.encoded == arg.offset);
|
|
||||||
|
|
||||||
if(st->buf) FREEMEM(st->buf);
|
|
||||||
st->buf = arg.buffer;
|
|
||||||
st->size = arg.offset;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
|
|
||||||
uint8_t *buffer = NULL;
|
|
||||||
ssize_t erval;
|
|
||||||
|
|
||||||
if(!st || !td) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!sptr) {
|
|
||||||
if(st->buf) FREEMEM(st->buf);
|
|
||||||
st->size = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
|
|
||||||
|
|
||||||
if(erval == -1) {
|
|
||||||
if(buffer) FREEMEM(buffer);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
assert((size_t)erval > 0);
|
|
||||||
|
|
||||||
if(st->buf) FREEMEM(st->buf);
|
|
||||||
st->buf = buffer;
|
|
||||||
st->size = erval;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ANY_t *
|
|
||||||
ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
|
|
||||||
ANY_t tmp;
|
|
||||||
ANY_t *st;
|
|
||||||
|
|
||||||
if(!td || !sptr) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&tmp, 0, sizeof(tmp));
|
|
||||||
|
|
||||||
if(ANY_fromType(&tmp, td, sptr)) return 0;
|
|
||||||
|
|
||||||
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
|
|
||||||
if(st) {
|
|
||||||
*st = tmp;
|
|
||||||
return st;
|
|
||||||
} else {
|
|
||||||
FREEMEM(tmp.buf);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ANY_t *
|
|
||||||
ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
|
|
||||||
ANY_t tmp;
|
|
||||||
ANY_t *st;
|
|
||||||
|
|
||||||
if(!td || !sptr) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&tmp, 0, sizeof(tmp));
|
|
||||||
|
|
||||||
if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
|
|
||||||
|
|
||||||
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
|
|
||||||
if(st) {
|
|
||||||
*st = tmp;
|
|
||||||
return st;
|
|
||||||
} else {
|
|
||||||
FREEMEM(tmp.buf);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
void *newst = 0;
|
|
||||||
|
|
||||||
if(!st || !td || !struct_ptr) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(st->buf == 0) {
|
|
||||||
/* Nothing to convert, make it empty. */
|
|
||||||
*struct_ptr = (void *)0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rval = ber_decode(0, td, (void **)&newst, st->buf, st->size);
|
|
||||||
if(rval.code == RC_OK) {
|
|
||||||
*struct_ptr = newst;
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
/* Remove possibly partially decoded data. */
|
|
||||||
ASN_STRUCT_FREE(*td, newst);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
void *newst = 0;
|
|
||||||
|
|
||||||
if(!st || !td || !struct_ptr) {
|
|
||||||
errno = EINVAL;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(st->buf == 0) {
|
|
||||||
/* Nothing to convert, make it empty. */
|
|
||||||
*struct_ptr = (void *)0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
|
|
||||||
if(rval.code == RC_OK) {
|
|
||||||
*struct_ptr = newst;
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
/* Remove possibly partially decoded data. */
|
|
||||||
ASN_STRUCT_FREE(*td, newst);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
|
|
||||||
struct _callback_arg *arg = (struct _callback_arg *)key;
|
|
||||||
|
|
||||||
if((arg->offset + size) >= arg->size) {
|
|
||||||
size_t nsize = (arg->size ? arg->size << 2 : 16) + size;
|
|
||||||
void *p = REALLOC(arg->buffer, nsize);
|
|
||||||
if(!p) return -1;
|
|
||||||
arg->buffer = (uint8_t *)p;
|
|
||||||
arg->size = nsize;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(arg->buffer + arg->offset, buffer, size);
|
|
||||||
arg->offset += size;
|
|
||||||
assert(arg->offset < arg->size);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef ASN_DISABLE_PER_SUPPORT
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
ANY_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr,
|
|
||||||
asn_per_data_t *pd) {
|
|
||||||
const asn_OCTET_STRING_specifics_t *specs =
|
|
||||||
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
|
||||||
: &asn_SPC_ANY_specs;
|
|
||||||
size_t consumed_myself = 0;
|
|
||||||
int repeat;
|
|
||||||
ANY_t *st = (ANY_t *)*sptr;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
(void)constraints;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocate the structure.
|
|
||||||
*/
|
|
||||||
if(!st) {
|
|
||||||
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
|
|
||||||
if(!st) RETURN(RC_FAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("UPER Decoding ANY type");
|
|
||||||
|
|
||||||
st->size = 0;
|
|
||||||
do {
|
|
||||||
ssize_t raw_len;
|
|
||||||
ssize_t len_bytes;
|
|
||||||
ssize_t len_bits;
|
|
||||||
void *p;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Get the PER length */
|
|
||||||
raw_len = uper_get_length(pd, -1, 0, &repeat);
|
|
||||||
if(raw_len < 0) RETURN(RC_WMORE);
|
|
||||||
if(raw_len == 0 && st->buf) break;
|
|
||||||
|
|
||||||
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
|
|
||||||
repeat ? "repeat" : "once", td->name);
|
|
||||||
len_bytes = raw_len;
|
|
||||||
len_bits = len_bytes * 8;
|
|
||||||
|
|
||||||
p = REALLOC(st->buf, st->size + len_bytes + 1);
|
|
||||||
if(!p) RETURN(RC_FAIL);
|
|
||||||
st->buf = (uint8_t *)p;
|
|
||||||
|
|
||||||
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
|
|
||||||
if(ret < 0) RETURN(RC_WMORE);
|
|
||||||
consumed_myself += len_bits;
|
|
||||||
st->size += len_bytes;
|
|
||||||
} while(repeat);
|
|
||||||
st->buf[st->size] = 0; /* nul-terminate */
|
|
||||||
|
|
||||||
RETURN(RC_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
ANY_encode_uper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, const void *sptr,
|
|
||||||
asn_per_outp_t *po) {
|
|
||||||
const ANY_t *st = (const ANY_t *)sptr;
|
|
||||||
asn_enc_rval_t er = {0, 0, 0};
|
|
||||||
const uint8_t *buf;
|
|
||||||
size_t size;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
(void)constraints;
|
|
||||||
|
|
||||||
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
buf = st->buf;
|
|
||||||
size = st->size;
|
|
||||||
do {
|
|
||||||
int need_eom = 0;
|
|
||||||
ssize_t may_save = uper_put_length(po, size, &need_eom);
|
|
||||||
if(may_save < 0) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ret = per_put_many_bits(po, buf, may_save * 8);
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
buf += may_save;
|
|
||||||
size -= may_save;
|
|
||||||
assert(!(may_save & 0x07) || !size);
|
|
||||||
if(need_eom && uper_put_length(po, 0, 0))
|
|
||||||
ASN__ENCODE_FAILED; /* End of Message length */
|
|
||||||
} while(size);
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr,
|
|
||||||
asn_per_data_t *pd) {
|
|
||||||
const asn_OCTET_STRING_specifics_t *specs =
|
|
||||||
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
|
||||||
: &asn_SPC_ANY_specs;
|
|
||||||
size_t consumed_myself = 0;
|
|
||||||
int repeat;
|
|
||||||
ANY_t *st = (ANY_t *)*sptr;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
(void)constraints;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocate the structure.
|
|
||||||
*/
|
|
||||||
if(!st) {
|
|
||||||
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
|
|
||||||
if(!st) RETURN(RC_FAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("APER Decoding ANY type");
|
|
||||||
|
|
||||||
st->size = 0;
|
|
||||||
do {
|
|
||||||
ssize_t raw_len;
|
|
||||||
ssize_t len_bytes;
|
|
||||||
ssize_t len_bits;
|
|
||||||
void *p;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Get the PER length */
|
|
||||||
raw_len = aper_get_length(pd, -1, 0, &repeat);
|
|
||||||
if(raw_len < 0) RETURN(RC_WMORE);
|
|
||||||
if(raw_len == 0 && st->buf) break;
|
|
||||||
|
|
||||||
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
|
|
||||||
repeat ? "repeat" : "once", td->name);
|
|
||||||
len_bytes = raw_len;
|
|
||||||
len_bits = len_bytes * 8;
|
|
||||||
|
|
||||||
p = REALLOC(st->buf, st->size + len_bytes + 1);
|
|
||||||
if(!p) RETURN(RC_FAIL);
|
|
||||||
st->buf = (uint8_t *)p;
|
|
||||||
|
|
||||||
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
|
|
||||||
if(ret < 0) RETURN(RC_WMORE);
|
|
||||||
consumed_myself += len_bits;
|
|
||||||
st->size += len_bytes;
|
|
||||||
} while(repeat);
|
|
||||||
st->buf[st->size] = 0; /* nul-terminate */
|
|
||||||
|
|
||||||
RETURN(RC_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
ANY_encode_aper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, const void *sptr,
|
|
||||||
asn_per_outp_t *po) {
|
|
||||||
const ANY_t *st = (const ANY_t *)sptr;
|
|
||||||
asn_enc_rval_t er = {0, 0, 0};
|
|
||||||
const uint8_t *buf;
|
|
||||||
size_t size;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
(void)constraints;
|
|
||||||
|
|
||||||
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
buf = st->buf;
|
|
||||||
size = st->size;
|
|
||||||
do {
|
|
||||||
int need_eom = 0;
|
|
||||||
ssize_t may_save = uper_put_length(po, size, &need_eom);
|
|
||||||
if(may_save < 0) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ret = per_put_many_bits(po, buf, may_save * 8);
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
buf += may_save;
|
|
||||||
size -= may_save;
|
|
||||||
assert(!(may_save & 0x07) || !size);
|
|
||||||
if(need_eom && uper_put_length(po, 0, 0))
|
|
||||||
ASN__ENCODE_FAILED; /* End of Message length */
|
|
||||||
} while(size);
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,23 +22,34 @@ extern asn_TYPE_descriptor_t asn_DEF_ANY;
|
|||||||
extern asn_TYPE_operation_t asn_OP_ANY;
|
extern asn_TYPE_operation_t asn_OP_ANY;
|
||||||
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
|
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
|
||||||
|
|
||||||
asn_struct_free_f ANY_free;
|
#define ANY_free OCTET_STRING_free
|
||||||
asn_struct_print_f ANY_print;
|
|
||||||
ber_type_decoder_f ANY_decode_ber;
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
der_type_encoder_f ANY_encode_der;
|
#define ANY_print OCTET_STRING_print
|
||||||
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
|
|
||||||
|
#define ANY_compare OCTET_STRING_compare
|
||||||
|
|
||||||
|
#define ANY_constraint asn_generic_no_constraint
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
|
#define ANY_decode_ber OCTET_STRING_decode_ber
|
||||||
|
#define ANY_encode_der OCTET_STRING_encode_der
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
|
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
|
||||||
xer_type_encoder_f ANY_encode_xer;
|
xer_type_encoder_f ANY_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
per_type_decoder_f ANY_decode_uper;
|
per_type_decoder_f ANY_decode_uper;
|
||||||
per_type_encoder_f ANY_encode_uper;
|
per_type_encoder_f ANY_encode_uper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
per_type_decoder_f ANY_decode_aper;
|
per_type_decoder_f ANY_decode_aper;
|
||||||
per_type_encoder_f ANY_encode_aper;
|
per_type_encoder_f ANY_encode_aper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
#define ANY_free OCTET_STRING_free
|
|
||||||
#define ANY_print OCTET_STRING_print
|
|
||||||
#define ANY_compare OCTET_STRING_compare
|
|
||||||
#define ANY_constraint asn_generic_no_constraint
|
|
||||||
#define ANY_decode_ber OCTET_STRING_decode_ber
|
|
||||||
#define ANY_encode_der OCTET_STRING_encode_der
|
|
||||||
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
|
|
||||||
|
|
||||||
/******************************
|
/******************************
|
||||||
* Handy conversion routines. *
|
* Handy conversion routines. *
|
||||||
@@ -46,13 +57,17 @@ per_type_encoder_f ANY_encode_aper;
|
|||||||
|
|
||||||
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
|
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
|
||||||
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
|
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
|
||||||
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
|
|
||||||
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
|
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
|
||||||
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
|
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
/* Convert the contents of the ANY type into the specified type. */
|
/* Convert the contents of the ANY type into the specified type. */
|
||||||
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
|
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
|
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
|
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
|
||||||
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
|
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
|
||||||
|
|||||||
190
lib/asn1c/common/ANY_aper.c
Normal file
190
lib/asn1c/common/ANY_aper.c
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <ANY.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#undef RETURN
|
||||||
|
#define RETURN(_code) \
|
||||||
|
do { \
|
||||||
|
asn_dec_rval_t tmprval; \
|
||||||
|
tmprval.code = _code; \
|
||||||
|
tmprval.consumed = consumed_myself; \
|
||||||
|
return tmprval; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
int
|
||||||
|
ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
|
||||||
|
uint8_t *buffer = NULL;
|
||||||
|
ssize_t erval;
|
||||||
|
|
||||||
|
if(!st || !td) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!sptr) {
|
||||||
|
if(st->buf) FREEMEM(st->buf);
|
||||||
|
st->size = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
erval = aper_encode_to_new_buffer(td, td->encoding_constraints.per_constraints, sptr, (void**)&buffer);
|
||||||
|
|
||||||
|
if(erval == -1) {
|
||||||
|
if(buffer) FREEMEM(buffer);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
assert((size_t)erval > 0);
|
||||||
|
|
||||||
|
if(st->buf) FREEMEM(st->buf);
|
||||||
|
st->buf = buffer;
|
||||||
|
st->size = erval;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ANY_t *
|
||||||
|
ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
|
||||||
|
ANY_t tmp;
|
||||||
|
ANY_t *st;
|
||||||
|
|
||||||
|
if(!td || !sptr) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&tmp, 0, sizeof(tmp));
|
||||||
|
|
||||||
|
if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
|
||||||
|
|
||||||
|
st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
|
||||||
|
if(st) {
|
||||||
|
*st = tmp;
|
||||||
|
return st;
|
||||||
|
} else {
|
||||||
|
FREEMEM(tmp.buf);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
|
||||||
|
asn_dec_rval_t rval;
|
||||||
|
void *newst = 0;
|
||||||
|
|
||||||
|
if(!st || !td || !struct_ptr) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(st->buf == 0) {
|
||||||
|
/* Nothing to convert, make it empty. */
|
||||||
|
*struct_ptr = (void *)0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
|
||||||
|
if(rval.code == RC_OK) {
|
||||||
|
*struct_ptr = newst;
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
/* Remove possibly partially decoded data. */
|
||||||
|
ASN_STRUCT_FREE(*td, newst);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
asn_dec_rval_t
|
||||||
|
ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
||||||
|
const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints, void **sptr,
|
||||||
|
asn_per_data_t *pd) {
|
||||||
|
const asn_OCTET_STRING_specifics_t *specs =
|
||||||
|
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
||||||
|
: &asn_SPC_ANY_specs;
|
||||||
|
size_t consumed_myself = 0;
|
||||||
|
int repeat;
|
||||||
|
ANY_t *st = (ANY_t *)*sptr;
|
||||||
|
|
||||||
|
(void)opt_codec_ctx;
|
||||||
|
(void)constraints;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocate the structure.
|
||||||
|
*/
|
||||||
|
if(!st) {
|
||||||
|
st = (ANY_t *)(*sptr = CALLOC(1, specs->struct_size));
|
||||||
|
if(!st) RETURN(RC_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
ASN_DEBUG("APER Decoding ANY type");
|
||||||
|
|
||||||
|
st->size = 0;
|
||||||
|
do {
|
||||||
|
ssize_t raw_len;
|
||||||
|
ssize_t len_bytes;
|
||||||
|
ssize_t len_bits;
|
||||||
|
void *p;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* Get the PER length */
|
||||||
|
raw_len = aper_get_length(pd, -1, 0, &repeat);
|
||||||
|
if(raw_len < 0) RETURN(RC_WMORE);
|
||||||
|
if(raw_len == 0 && st->buf) break;
|
||||||
|
|
||||||
|
ASN_DEBUG("Got PER length len %" ASN_PRI_SIZE ", %s (%s)", raw_len,
|
||||||
|
repeat ? "repeat" : "once", td->name);
|
||||||
|
len_bytes = raw_len;
|
||||||
|
len_bits = len_bytes * 8;
|
||||||
|
|
||||||
|
p = REALLOC(st->buf, st->size + len_bytes + 1);
|
||||||
|
if(!p) RETURN(RC_FAIL);
|
||||||
|
st->buf = (uint8_t *)p;
|
||||||
|
|
||||||
|
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
|
||||||
|
if(ret < 0) RETURN(RC_WMORE);
|
||||||
|
consumed_myself += len_bits;
|
||||||
|
st->size += len_bytes;
|
||||||
|
} while(repeat);
|
||||||
|
st->buf[st->size] = 0; /* nul-terminate */
|
||||||
|
|
||||||
|
RETURN(RC_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
asn_enc_rval_t
|
||||||
|
ANY_encode_aper(const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints, const void *sptr,
|
||||||
|
asn_per_outp_t *po) {
|
||||||
|
const ANY_t *st = (const ANY_t *)sptr;
|
||||||
|
asn_enc_rval_t er = {0, 0, 0};
|
||||||
|
const uint8_t *buf;
|
||||||
|
size_t size;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
(void)constraints;
|
||||||
|
|
||||||
|
if(!st || (!st->buf && st->size)) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
buf = st->buf;
|
||||||
|
size = st->size;
|
||||||
|
do {
|
||||||
|
int need_eom = 0;
|
||||||
|
ssize_t may_save = aper_put_length(po, -1, size, &need_eom);
|
||||||
|
if(may_save < 0) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
ret = per_put_many_bits(po, buf, may_save * 8);
|
||||||
|
if(ret) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
buf += may_save;
|
||||||
|
size -= may_save;
|
||||||
|
assert(!(may_save & 0x07) || !size);
|
||||||
|
if(need_eom && aper_put_length(po, -1, 0, 0))
|
||||||
|
ASN__ENCODE_FAILED; /* End of Message length */
|
||||||
|
} while(size);
|
||||||
|
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
@@ -4,61 +4,89 @@
|
|||||||
*/
|
*/
|
||||||
#include <asn_internal.h>
|
#include <asn_internal.h>
|
||||||
#include <BIT_STRING.h>
|
#include <BIT_STRING.h>
|
||||||
#include <asn_internal.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BIT STRING basic type description.
|
* BIT STRING basic type description.
|
||||||
*/
|
*/
|
||||||
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
|
static const ber_tlv_tag_t asn_DEF_BIT_STRING_tags[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
|
||||||
};
|
};
|
||||||
asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
|
asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs = {
|
||||||
sizeof(BIT_STRING_t),
|
sizeof(BIT_STRING_t),
|
||||||
offsetof(BIT_STRING_t, _asn_ctx),
|
offsetof(BIT_STRING_t, _asn_ctx),
|
||||||
ASN_OSUBV_BIT
|
ASN_OSUBV_BIT
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_BIT_STRING = {
|
asn_TYPE_operation_t asn_OP_BIT_STRING = {
|
||||||
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
|
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
|
||||||
BIT_STRING_print,
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
BIT_STRING_compare,
|
BIT_STRING_print,
|
||||||
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
|
|
||||||
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
|
|
||||||
OCTET_STRING_decode_xer_binary,
|
|
||||||
BIT_STRING_encode_xer,
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
BIT_STRING_decode_oer,
|
0,
|
||||||
BIT_STRING_encode_oer,
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
BIT_STRING_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0,
|
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
|
||||||
0,
|
OCTET_STRING_encode_der, /* Implemented in terms of OCTET STRING */
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
BIT_STRING_decode_uper, /* Unaligned PER decoder */
|
0,
|
||||||
BIT_STRING_encode_uper, /* Unaligned PER encoder */
|
0,
|
||||||
OCTET_STRING_decode_aper, /* Aligned PER decoder */
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
OCTET_STRING_encode_aper, /* Aligned PER encoder */
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
OCTET_STRING_decode_xer_binary,
|
||||||
BIT_STRING_random_fill,
|
BIT_STRING_encode_xer,
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
BIT_STRING_decode_oer,
|
||||||
|
BIT_STRING_encode_oer,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
BIT_STRING_decode_uper, /* Unaligned PER decoder */
|
||||||
|
BIT_STRING_encode_uper, /* Unaligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
OCTET_STRING_decode_aper, /* Aligned PER decoder */
|
||||||
|
OCTET_STRING_encode_aper, /* Aligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
BIT_STRING_random_fill,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
|
asn_TYPE_descriptor_t asn_DEF_BIT_STRING = {
|
||||||
"BIT STRING",
|
"BIT STRING",
|
||||||
"BIT_STRING",
|
"BIT_STRING",
|
||||||
&asn_OP_BIT_STRING,
|
&asn_OP_BIT_STRING,
|
||||||
asn_DEF_BIT_STRING_tags,
|
asn_DEF_BIT_STRING_tags,
|
||||||
sizeof(asn_DEF_BIT_STRING_tags)
|
sizeof(asn_DEF_BIT_STRING_tags)
|
||||||
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
|
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
|
||||||
asn_DEF_BIT_STRING_tags, /* Same as above */
|
asn_DEF_BIT_STRING_tags, /* Same as above */
|
||||||
sizeof(asn_DEF_BIT_STRING_tags)
|
sizeof(asn_DEF_BIT_STRING_tags)
|
||||||
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
|
/ sizeof(asn_DEF_BIT_STRING_tags[0]),
|
||||||
{ 0, 0, BIT_STRING_constraint },
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
&asn_SPC_BIT_STRING_specs
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
BIT_STRING_constraint
|
||||||
|
},
|
||||||
|
0, 0, /* No members */
|
||||||
|
&asn_SPC_BIT_STRING_specs
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -87,136 +115,10 @@ BIT_STRING_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *_bit_pattern[16] = {
|
|
||||||
"0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111",
|
|
||||||
"1000", "1001", "1010", "1011", "1100", "1101", "1110", "1111"
|
|
||||||
};
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
BIT_STRING_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
|
|
||||||
int ilevel, enum xer_encoder_flags_e flags,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
asn_enc_rval_t er = {0, 0, 0};
|
|
||||||
char scratch[128];
|
|
||||||
char *p = scratch;
|
|
||||||
char *scend = scratch + (sizeof(scratch) - 10);
|
|
||||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
|
||||||
int xcan = (flags & XER_F_CANONICAL);
|
|
||||||
uint8_t *buf;
|
|
||||||
uint8_t *end;
|
|
||||||
|
|
||||||
if(!st || !st->buf)
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
er.encoded = 0;
|
|
||||||
|
|
||||||
buf = st->buf;
|
|
||||||
end = buf + st->size - 1; /* Last byte is special */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Binary dump
|
|
||||||
*/
|
|
||||||
for(; buf < end; buf++) {
|
|
||||||
int v = *buf;
|
|
||||||
int nline = xcan?0:(((buf - st->buf) % 8) == 0);
|
|
||||||
if(p >= scend || nline) {
|
|
||||||
ASN__CALLBACK(scratch, p - scratch);
|
|
||||||
p = scratch;
|
|
||||||
if(nline) ASN__TEXT_INDENT(1, ilevel);
|
|
||||||
}
|
|
||||||
memcpy(p + 0, _bit_pattern[v >> 4], 4);
|
|
||||||
memcpy(p + 4, _bit_pattern[v & 0x0f], 4);
|
|
||||||
p += 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!xcan && ((buf - st->buf) % 8) == 0)
|
|
||||||
ASN__TEXT_INDENT(1, ilevel);
|
|
||||||
ASN__CALLBACK(scratch, p - scratch);
|
|
||||||
p = scratch;
|
|
||||||
|
|
||||||
if(buf == end) {
|
|
||||||
int v = *buf;
|
|
||||||
int ubits = st->bits_unused;
|
|
||||||
int i;
|
|
||||||
for(i = 7; i >= ubits; i--)
|
|
||||||
*p++ = (v & (1 << i)) ? 0x31 : 0x30;
|
|
||||||
ASN__CALLBACK(scratch, p - scratch);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!xcan) ASN__TEXT_INDENT(1, ilevel - 1);
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
cb_failed:
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* BIT STRING specific contents printer.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
const char * const h2c = "0123456789ABCDEF";
|
|
||||||
char scratch[64];
|
|
||||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
|
||||||
uint8_t *buf;
|
|
||||||
uint8_t *end;
|
|
||||||
char *p = scratch;
|
|
||||||
|
|
||||||
(void)td; /* Unused argument */
|
|
||||||
|
|
||||||
if(!st || !st->buf)
|
|
||||||
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
|
||||||
|
|
||||||
ilevel++;
|
|
||||||
buf = st->buf;
|
|
||||||
end = buf + st->size;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Hexadecimal dump.
|
|
||||||
*/
|
|
||||||
for(; buf < end; buf++) {
|
|
||||||
if((buf - st->buf) % 16 == 0 && (st->size > 16)
|
|
||||||
&& buf != st->buf) {
|
|
||||||
_i_INDENT(1);
|
|
||||||
/* Dump the string */
|
|
||||||
if(cb(scratch, p - scratch, app_key) < 0) return -1;
|
|
||||||
p = scratch;
|
|
||||||
}
|
|
||||||
*p++ = h2c[*buf >> 4];
|
|
||||||
*p++ = h2c[*buf & 0x0F];
|
|
||||||
*p++ = 0x20;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(p > scratch) {
|
|
||||||
p--; /* Eat the tailing space */
|
|
||||||
|
|
||||||
if((st->size > 16)) {
|
|
||||||
_i_INDENT(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dump the incomplete 16-bytes row */
|
|
||||||
if(cb(scratch, p - scratch, app_key) < 0)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(st->bits_unused) {
|
|
||||||
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
|
|
||||||
st->bits_unused, st->bits_unused == 1 ? "" : "s");
|
|
||||||
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
|
|
||||||
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
|
|
||||||
&& cb(scratch, ret, app_key) < 0)
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Non-destructively remove the trailing 0-bits from the given bit string.
|
* Non-destructively remove the trailing 0-bits from the given bit string.
|
||||||
*/
|
*/
|
||||||
static const BIT_STRING_t *
|
const BIT_STRING_t *
|
||||||
BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
|
BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp) {
|
||||||
const uint8_t *b;
|
const uint8_t *b;
|
||||||
union {
|
union {
|
||||||
@@ -271,6 +173,7 @@ BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
|
|||||||
const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
|
const BIT_STRING_t *b = BIT_STRING__compactify(bptr, &compact_b);
|
||||||
const asn_OCTET_STRING_specifics_t *specs = td->specifics;
|
const asn_OCTET_STRING_specifics_t *specs = td->specifics;
|
||||||
|
|
||||||
|
(void)specs;
|
||||||
assert(specs && specs->subvariant == ASN_OSUBV_BIT);
|
assert(specs && specs->subvariant == ASN_OSUBV_BIT);
|
||||||
|
|
||||||
if(a && b) {
|
if(a && b) {
|
||||||
@@ -303,354 +206,3 @@ BIT_STRING_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ASN_DISABLE_PER_SUPPORT
|
|
||||||
|
|
||||||
#undef RETURN
|
|
||||||
#define RETURN(_code) \
|
|
||||||
do { \
|
|
||||||
asn_dec_rval_t tmprval; \
|
|
||||||
tmprval.code = _code; \
|
|
||||||
tmprval.consumed = consumed_myself; \
|
|
||||||
return tmprval; \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
static asn_per_constraint_t asn_DEF_BIT_STRING_constraint_size = {
|
|
||||||
APC_SEMI_CONSTRAINED, -1, -1, 0, 0};
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
BIT_STRING_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr,
|
|
||||||
asn_per_data_t *pd) {
|
|
||||||
const asn_OCTET_STRING_specifics_t *specs = td->specifics
|
|
||||||
? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
|
||||||
: &asn_SPC_BIT_STRING_specs;
|
|
||||||
const asn_per_constraints_t *pc =
|
|
||||||
constraints ? constraints : td->encoding_constraints.per_constraints;
|
|
||||||
const asn_per_constraint_t *csiz;
|
|
||||||
asn_dec_rval_t rval = { RC_OK, 0 };
|
|
||||||
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
|
|
||||||
ssize_t consumed_myself = 0;
|
|
||||||
int repeat;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
|
|
||||||
if(pc) {
|
|
||||||
csiz = &pc->size;
|
|
||||||
} else {
|
|
||||||
csiz = &asn_DEF_BIT_STRING_constraint_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(specs->subvariant != ASN_OSUBV_BIT) {
|
|
||||||
ASN_DEBUG("Subvariant %d is not BIT OSUBV_BIT", specs->subvariant);
|
|
||||||
RETURN(RC_FAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Allocate the string.
|
|
||||||
*/
|
|
||||||
if(!st) {
|
|
||||||
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
|
|
||||||
if(!st) RETURN(RC_FAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
|
|
||||||
csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
|
|
||||||
csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
|
|
||||||
|
|
||||||
if(csiz->flags & APC_EXTENSIBLE) {
|
|
||||||
int inext = per_get_few_bits(pd, 1);
|
|
||||||
if(inext < 0) RETURN(RC_WMORE);
|
|
||||||
if(inext) {
|
|
||||||
csiz = &asn_DEF_BIT_STRING_constraint_size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csiz->effective_bits >= 0) {
|
|
||||||
FREEMEM(st->buf);
|
|
||||||
st->size = (csiz->upper_bound + 7) >> 3;
|
|
||||||
st->buf = (uint8_t *)MALLOC(st->size + 1);
|
|
||||||
if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* X.691, #16.5: zero-length encoding */
|
|
||||||
/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
|
|
||||||
/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
|
|
||||||
if(csiz->effective_bits == 0) {
|
|
||||||
int ret;
|
|
||||||
ASN_DEBUG("Encoding BIT STRING size %ld", csiz->upper_bound);
|
|
||||||
ret = per_get_many_bits(pd, st->buf, 0, csiz->upper_bound);
|
|
||||||
if(ret < 0) RETURN(RC_WMORE);
|
|
||||||
consumed_myself += csiz->upper_bound;
|
|
||||||
st->buf[st->size] = 0;
|
|
||||||
st->bits_unused = (8 - (csiz->upper_bound & 0x7)) & 0x7;
|
|
||||||
RETURN(RC_OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
st->size = 0;
|
|
||||||
do {
|
|
||||||
ssize_t raw_len;
|
|
||||||
ssize_t len_bytes;
|
|
||||||
ssize_t len_bits;
|
|
||||||
void *p;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Get the PER length */
|
|
||||||
raw_len = uper_get_length(pd, csiz->effective_bits, csiz->lower_bound,
|
|
||||||
&repeat);
|
|
||||||
if(raw_len < 0) RETURN(RC_WMORE);
|
|
||||||
if(raw_len == 0 && st->buf) break;
|
|
||||||
|
|
||||||
ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
|
|
||||||
(long)csiz->effective_bits, (long)raw_len,
|
|
||||||
repeat ? "repeat" : "once", td->name);
|
|
||||||
len_bits = raw_len;
|
|
||||||
len_bytes = (len_bits + 7) >> 3;
|
|
||||||
if(len_bits & 0x7) st->bits_unused = 8 - (len_bits & 0x7);
|
|
||||||
/* len_bits be multiple of 16K if repeat is set */
|
|
||||||
p = REALLOC(st->buf, st->size + len_bytes + 1);
|
|
||||||
if(!p) RETURN(RC_FAIL);
|
|
||||||
st->buf = (uint8_t *)p;
|
|
||||||
|
|
||||||
ret = per_get_many_bits(pd, &st->buf[st->size], 0, len_bits);
|
|
||||||
if(ret < 0) RETURN(RC_WMORE);
|
|
||||||
st->size += len_bytes;
|
|
||||||
} while(repeat);
|
|
||||||
st->buf[st->size] = 0; /* nul-terminate */
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
BIT_STRING_encode_uper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
const asn_OCTET_STRING_specifics_t *specs =
|
|
||||||
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
|
||||||
: &asn_SPC_BIT_STRING_specs;
|
|
||||||
const asn_per_constraints_t *pc =
|
|
||||||
constraints ? constraints : td->encoding_constraints.per_constraints;
|
|
||||||
const asn_per_constraint_t *csiz;
|
|
||||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
|
||||||
BIT_STRING_t compact_bstr; /* Do not modify this directly! */
|
|
||||||
asn_enc_rval_t er = { 0, 0, 0 };
|
|
||||||
int inext = 0; /* Lies not within extension root */
|
|
||||||
size_t size_in_bits;
|
|
||||||
const uint8_t *buf;
|
|
||||||
int ret;
|
|
||||||
int ct_extensible;
|
|
||||||
|
|
||||||
if(!st || (!st->buf && st->size))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
if(specs->subvariant == ASN_OSUBV_BIT) {
|
|
||||||
if((st->size == 0 && st->bits_unused) || (st->bits_unused & ~7))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
} else {
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(pc) {
|
|
||||||
csiz = &pc->size;
|
|
||||||
} else {
|
|
||||||
csiz = &asn_DEF_BIT_STRING_constraint_size;
|
|
||||||
}
|
|
||||||
ct_extensible = csiz->flags & APC_EXTENSIBLE;
|
|
||||||
|
|
||||||
/* Figure out the size without the trailing bits */
|
|
||||||
st = BIT_STRING__compactify(st, &compact_bstr);
|
|
||||||
size_in_bits = 8 * st->size - st->bits_unused;
|
|
||||||
|
|
||||||
ASN_DEBUG(
|
|
||||||
"Encoding %s into %" ASN_PRI_SIZE " bits"
|
|
||||||
" (%ld..%ld, effective %d)%s",
|
|
||||||
td->name, size_in_bits, csiz->lower_bound, csiz->upper_bound,
|
|
||||||
csiz->effective_bits, ct_extensible ? " EXT" : "");
|
|
||||||
|
|
||||||
/* Figure out whether size lies within PER visible constraint */
|
|
||||||
|
|
||||||
if(csiz->effective_bits >= 0) {
|
|
||||||
if((ssize_t)size_in_bits > csiz->upper_bound) {
|
|
||||||
if(ct_extensible) {
|
|
||||||
csiz = &asn_DEF_BIT_STRING_constraint_size;
|
|
||||||
inext = 1;
|
|
||||||
} else {
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
inext = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ct_extensible) {
|
|
||||||
/* Declare whether length is [not] within extension root */
|
|
||||||
if(per_put_few_bits(po, inext, 1))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(csiz->effective_bits >= 0 && !inext) {
|
|
||||||
int add_trailer = (ssize_t)size_in_bits < csiz->lower_bound;
|
|
||||||
ASN_DEBUG(
|
|
||||||
"Encoding %" ASN_PRI_SIZE " bytes (%ld), length (in %d bits) trailer %d; actual "
|
|
||||||
"value %" ASN_PRI_SSIZE "",
|
|
||||||
st->size, size_in_bits - csiz->lower_bound, csiz->effective_bits,
|
|
||||||
add_trailer,
|
|
||||||
add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound);
|
|
||||||
ret = per_put_few_bits(
|
|
||||||
po, add_trailer ? 0 : (ssize_t)size_in_bits - csiz->lower_bound,
|
|
||||||
csiz->effective_bits);
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
ret = per_put_many_bits(po, st->buf, size_in_bits);
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
if(add_trailer) {
|
|
||||||
static const uint8_t zeros[16];
|
|
||||||
size_t trailing_zero_bits = csiz->lower_bound - size_in_bits;
|
|
||||||
while(trailing_zero_bits > 0) {
|
|
||||||
if(trailing_zero_bits > 8 * sizeof(zeros)) {
|
|
||||||
ret = per_put_many_bits(po, zeros, 8 * sizeof(zeros));
|
|
||||||
trailing_zero_bits -= 8 * sizeof(zeros);
|
|
||||||
} else {
|
|
||||||
ret = per_put_many_bits(po, zeros, trailing_zero_bits);
|
|
||||||
trailing_zero_bits = 0;
|
|
||||||
}
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding %" ASN_PRI_SIZE " bytes", st->size);
|
|
||||||
|
|
||||||
buf = st->buf;
|
|
||||||
do {
|
|
||||||
int need_eom = 0;
|
|
||||||
ssize_t maySave = uper_put_length(po, size_in_bits, &need_eom);
|
|
||||||
if(maySave < 0) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding %" ASN_PRI_SSIZE " of %" ASN_PRI_SIZE "", maySave, size_in_bits);
|
|
||||||
|
|
||||||
ret = per_put_many_bits(po, buf, maySave);
|
|
||||||
if(ret) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
buf += maySave >> 3;
|
|
||||||
size_in_bits -= maySave;
|
|
||||||
assert(!(maySave & 0x07) || !size_in_bits);
|
|
||||||
if(need_eom && uper_put_length(po, 0, 0))
|
|
||||||
ASN__ENCODE_FAILED; /* End of Message length */
|
|
||||||
} while(size_in_bits);
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
|
||||||
|
|
||||||
asn_random_fill_result_t
|
|
||||||
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
|
||||||
const asn_encoding_constraints_t *constraints,
|
|
||||||
size_t max_length) {
|
|
||||||
const asn_OCTET_STRING_specifics_t *specs =
|
|
||||||
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
|
||||||
: &asn_SPC_BIT_STRING_specs;
|
|
||||||
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
|
||||||
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
|
||||||
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
|
||||||
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
|
|
||||||
126, 127, 128, 16383, 16384, 16385,
|
|
||||||
65534, 65535, 65536, 65537};
|
|
||||||
uint8_t *buf;
|
|
||||||
uint8_t *bend;
|
|
||||||
uint8_t *b;
|
|
||||||
size_t rnd_bits, rnd_len;
|
|
||||||
BIT_STRING_t *st;
|
|
||||||
|
|
||||||
if(max_length == 0) return result_skipped;
|
|
||||||
|
|
||||||
switch(specs->subvariant) {
|
|
||||||
case ASN_OSUBV_ANY:
|
|
||||||
return result_failed;
|
|
||||||
case ASN_OSUBV_BIT:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Figure out how far we should go */
|
|
||||||
rnd_bits = lengths[asn_random_between(
|
|
||||||
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
|
|
||||||
if(!constraints || !constraints->per_constraints)
|
|
||||||
constraints = &td->encoding_constraints;
|
|
||||||
if(constraints->per_constraints) {
|
|
||||||
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
|
|
||||||
if(pc->flags & APC_CONSTRAINED) {
|
|
||||||
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
|
|
||||||
? pc->upper_bound
|
|
||||||
: (ssize_t)max_length;
|
|
||||||
if(max_length < (size_t)pc->lower_bound) {
|
|
||||||
return result_skipped;
|
|
||||||
}
|
|
||||||
if(pc->flags & APC_EXTENSIBLE) {
|
|
||||||
switch(asn_random_between(0, 5)) {
|
|
||||||
case 0:
|
|
||||||
if(pc->lower_bound > 0) {
|
|
||||||
rnd_bits = pc->lower_bound - 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/* Fall through */
|
|
||||||
case 1:
|
|
||||||
rnd_bits = pc->upper_bound + 1;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
/* Keep rnd_bits from the table */
|
|
||||||
if(rnd_bits < max_length) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/* Fall through */
|
|
||||||
default:
|
|
||||||
rnd_bits = asn_random_between(pc->lower_bound,
|
|
||||||
suggested_upper_bound);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rnd_bits =
|
|
||||||
asn_random_between(pc->lower_bound, suggested_upper_bound);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
rnd_bits = asn_random_between(0, max_length - 1);
|
|
||||||
}
|
|
||||||
} else if(rnd_bits >= max_length) {
|
|
||||||
rnd_bits = asn_random_between(0, max_length - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
rnd_len = (rnd_bits + 7) / 8;
|
|
||||||
buf = CALLOC(1, rnd_len + 1);
|
|
||||||
if(!buf) return result_failed;
|
|
||||||
|
|
||||||
bend = &buf[rnd_len];
|
|
||||||
|
|
||||||
for(b = buf; b < bend; b++) {
|
|
||||||
*(uint8_t *)b = asn_random_between(0, 255);
|
|
||||||
}
|
|
||||||
*b = 0; /* Zero-terminate just in case. */
|
|
||||||
|
|
||||||
if(*sptr) {
|
|
||||||
st = *sptr;
|
|
||||||
FREEMEM(st->buf);
|
|
||||||
} else {
|
|
||||||
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
|
|
||||||
if(!st) {
|
|
||||||
FREEMEM(buf);
|
|
||||||
return result_failed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
st->buf = buf;
|
|
||||||
st->size = rnd_len;
|
|
||||||
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
|
|
||||||
if(st->bits_unused) {
|
|
||||||
assert(st->size > 0);
|
|
||||||
st->buf[st->size-1] &= 0xff << st->bits_unused;
|
|
||||||
}
|
|
||||||
|
|
||||||
result_ok.length = st->size;
|
|
||||||
return result_ok;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -24,22 +24,45 @@ extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
|
|||||||
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
|
extern asn_TYPE_operation_t asn_OP_BIT_STRING;
|
||||||
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
|
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
|
||||||
|
|
||||||
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
|
#define BIT_STRING_free OCTET_STRING_free
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
|
asn_struct_print_f BIT_STRING_print; /* Human-readable output */
|
||||||
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
|
|
||||||
asn_struct_compare_f BIT_STRING_compare;
|
asn_struct_compare_f BIT_STRING_compare;
|
||||||
|
|
||||||
asn_constr_check_f BIT_STRING_constraint;
|
asn_constr_check_f BIT_STRING_constraint;
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
|
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
|
||||||
|
#define BIT_STRING_encode_der OCTET_STRING_encode_der
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
|
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
|
||||||
xer_type_encoder_f BIT_STRING_encode_xer;
|
xer_type_encoder_f BIT_STRING_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
oer_type_decoder_f BIT_STRING_decode_oer;
|
oer_type_decoder_f BIT_STRING_decode_oer;
|
||||||
oer_type_encoder_f BIT_STRING_encode_oer;
|
oer_type_encoder_f BIT_STRING_encode_oer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
per_type_decoder_f BIT_STRING_decode_uper;
|
per_type_decoder_f BIT_STRING_decode_uper;
|
||||||
per_type_encoder_f BIT_STRING_encode_uper;
|
per_type_encoder_f BIT_STRING_encode_uper;
|
||||||
asn_random_fill_f BIT_STRING_random_fill;
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
|
||||||
|
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#define BIT_STRING_free OCTET_STRING_free
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber
|
asn_random_fill_f BIT_STRING_random_fill;
|
||||||
#define BIT_STRING_encode_der OCTET_STRING_encode_der
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
|
|
||||||
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper
|
const BIT_STRING_t *BIT_STRING__compactify(const BIT_STRING_t *st, BIT_STRING_t *tmp);
|
||||||
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
69
lib/asn1c/common/BIT_STRING_print.c
Normal file
69
lib/asn1c/common/BIT_STRING_print.c
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <BIT_STRING.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BIT STRING specific contents printer.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
BIT_STRING_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
||||||
|
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||||
|
const char * const h2c = "0123456789ABCDEF";
|
||||||
|
char scratch[64];
|
||||||
|
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
||||||
|
uint8_t *buf;
|
||||||
|
uint8_t *end;
|
||||||
|
char *p = scratch;
|
||||||
|
|
||||||
|
(void)td; /* Unused argument */
|
||||||
|
|
||||||
|
if(!st || !st->buf)
|
||||||
|
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
||||||
|
|
||||||
|
ilevel++;
|
||||||
|
buf = st->buf;
|
||||||
|
end = buf + st->size;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hexadecimal dump.
|
||||||
|
*/
|
||||||
|
for(; buf < end; buf++) {
|
||||||
|
if((buf - st->buf) % 16 == 0 && (st->size > 16)
|
||||||
|
&& buf != st->buf) {
|
||||||
|
_i_INDENT(1);
|
||||||
|
/* Dump the string */
|
||||||
|
if(cb(scratch, p - scratch, app_key) < 0) return -1;
|
||||||
|
p = scratch;
|
||||||
|
}
|
||||||
|
*p++ = h2c[*buf >> 4];
|
||||||
|
*p++ = h2c[*buf & 0x0F];
|
||||||
|
*p++ = 0x20;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(p > scratch) {
|
||||||
|
p--; /* Eat the tailing space */
|
||||||
|
|
||||||
|
if((st->size > 16)) {
|
||||||
|
_i_INDENT(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dump the incomplete 16-bytes row */
|
||||||
|
if(cb(scratch, p - scratch, app_key) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(st->bits_unused) {
|
||||||
|
int ret = snprintf(scratch, sizeof(scratch), " (%d bit%s unused)",
|
||||||
|
st->bits_unused, st->bits_unused == 1 ? "" : "s");
|
||||||
|
assert(ret > 0 && ret < (ssize_t)sizeof(scratch));
|
||||||
|
if(ret > 0 && ret < (ssize_t)sizeof(scratch)
|
||||||
|
&& cb(scratch, ret, app_key) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
124
lib/asn1c/common/BIT_STRING_rfill.c
Normal file
124
lib/asn1c/common/BIT_STRING_rfill.c
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <BIT_STRING.h>
|
||||||
|
|
||||||
|
asn_random_fill_result_t
|
||||||
|
BIT_STRING_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
||||||
|
const asn_encoding_constraints_t *constraints,
|
||||||
|
size_t max_length) {
|
||||||
|
const asn_OCTET_STRING_specifics_t *specs =
|
||||||
|
td->specifics ? (const asn_OCTET_STRING_specifics_t *)td->specifics
|
||||||
|
: &asn_SPC_BIT_STRING_specs;
|
||||||
|
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
||||||
|
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
||||||
|
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
||||||
|
static unsigned lengths[] = {0, 1, 2, 3, 4, 8,
|
||||||
|
126, 127, 128, 16383, 16384, 16385,
|
||||||
|
65534, 65535, 65536, 65537};
|
||||||
|
uint8_t *buf;
|
||||||
|
uint8_t *bend;
|
||||||
|
uint8_t *b;
|
||||||
|
size_t rnd_bits, rnd_len;
|
||||||
|
BIT_STRING_t *st;
|
||||||
|
|
||||||
|
if(max_length == 0) return result_skipped;
|
||||||
|
|
||||||
|
switch(specs->subvariant) {
|
||||||
|
case ASN_OSUBV_ANY:
|
||||||
|
return result_failed;
|
||||||
|
case ASN_OSUBV_BIT:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Figure out how far we should go */
|
||||||
|
rnd_bits = lengths[asn_random_between(
|
||||||
|
0, sizeof(lengths) / sizeof(lengths[0]) - 1)];
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
if(!constraints || !constraints->per_constraints)
|
||||||
|
constraints = &td->encoding_constraints;
|
||||||
|
if(constraints->per_constraints) {
|
||||||
|
const asn_per_constraint_t *pc = &constraints->per_constraints->size;
|
||||||
|
if(pc->flags & APC_CONSTRAINED) {
|
||||||
|
long suggested_upper_bound = pc->upper_bound < (ssize_t)max_length
|
||||||
|
? pc->upper_bound
|
||||||
|
: (ssize_t)max_length;
|
||||||
|
if(max_length < (size_t)pc->lower_bound) {
|
||||||
|
return result_skipped;
|
||||||
|
}
|
||||||
|
if(pc->flags & APC_EXTENSIBLE) {
|
||||||
|
switch(asn_random_between(0, 5)) {
|
||||||
|
case 0:
|
||||||
|
if(pc->lower_bound > 0) {
|
||||||
|
rnd_bits = pc->lower_bound - 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Fall through */
|
||||||
|
case 1:
|
||||||
|
rnd_bits = pc->upper_bound + 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
/* Keep rnd_bits from the table */
|
||||||
|
if(rnd_bits < max_length) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Fall through */
|
||||||
|
default:
|
||||||
|
rnd_bits = asn_random_between(pc->lower_bound,
|
||||||
|
suggested_upper_bound);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rnd_bits =
|
||||||
|
asn_random_between(pc->lower_bound, suggested_upper_bound);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rnd_bits = asn_random_between(0, max_length - 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
#else
|
||||||
|
if(!constraints) constraints = &td->encoding_constraints;
|
||||||
|
{
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
if(rnd_bits >= max_length) {
|
||||||
|
rnd_bits = asn_random_between(0, max_length - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rnd_len = (rnd_bits + 7) / 8;
|
||||||
|
buf = CALLOC(1, rnd_len + 1);
|
||||||
|
if(!buf) return result_failed;
|
||||||
|
|
||||||
|
bend = &buf[rnd_len];
|
||||||
|
|
||||||
|
for(b = buf; b < bend; b++) {
|
||||||
|
*(uint8_t *)b = asn_random_between(0, 255);
|
||||||
|
}
|
||||||
|
*b = 0; /* Zero-terminate just in case. */
|
||||||
|
|
||||||
|
if(*sptr) {
|
||||||
|
st = *sptr;
|
||||||
|
FREEMEM(st->buf);
|
||||||
|
} else {
|
||||||
|
st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
|
||||||
|
if(!st) {
|
||||||
|
FREEMEM(buf);
|
||||||
|
return result_failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
st->buf = buf;
|
||||||
|
st->size = rnd_len;
|
||||||
|
st->bits_unused = (8 - (rnd_bits & 0x7)) & 0x7;
|
||||||
|
if(st->bits_unused) {
|
||||||
|
assert(st->size > 0);
|
||||||
|
st->buf[st->size-1] &= 0xff << st->bits_unused;
|
||||||
|
}
|
||||||
|
|
||||||
|
result_ok.length = st->size;
|
||||||
|
return result_ok;
|
||||||
|
}
|
||||||
@@ -9,50 +9,78 @@
|
|||||||
* GraphicString basic type description.
|
* GraphicString basic type description.
|
||||||
*/
|
*/
|
||||||
static const ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
|
static const ber_tlv_tag_t asn_DEF_GraphicString_tags[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
|
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
|
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_GraphicString = {
|
asn_TYPE_operation_t asn_OP_GraphicString = {
|
||||||
OCTET_STRING_free,
|
OCTET_STRING_free,
|
||||||
OCTET_STRING_print, /* non-ascii string */
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
OCTET_STRING_compare,
|
OCTET_STRING_print, /* non-ascii string */
|
||||||
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
|
|
||||||
OCTET_STRING_encode_der,
|
|
||||||
OCTET_STRING_decode_xer_hex,
|
|
||||||
OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
OCTET_STRING_decode_oer,
|
0,
|
||||||
OCTET_STRING_encode_oer,
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
OCTET_STRING_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0,
|
OCTET_STRING_decode_ber, /* Implemented in terms of OCTET STRING */
|
||||||
0,
|
OCTET_STRING_encode_der,
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
|
0,
|
||||||
OCTET_STRING_encode_uper,
|
0,
|
||||||
OCTET_STRING_decode_aper, /* Implemented in terms of OCTET STRING */
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
OCTET_STRING_encode_aper,
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
OCTET_STRING_decode_xer_hex,
|
||||||
OCTET_STRING_random_fill,
|
OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
OCTET_STRING_decode_oer,
|
||||||
|
OCTET_STRING_encode_oer,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
|
||||||
|
OCTET_STRING_encode_uper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
OCTET_STRING_decode_aper, /* Implemented in terms of OCTET STRING */
|
||||||
|
OCTET_STRING_encode_aper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
OCTET_STRING_random_fill,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_GraphicString = {
|
asn_TYPE_descriptor_t asn_DEF_GraphicString = {
|
||||||
"GraphicString",
|
"GraphicString",
|
||||||
"GraphicString",
|
"GraphicString",
|
||||||
&asn_OP_GraphicString,
|
&asn_OP_GraphicString,
|
||||||
asn_DEF_GraphicString_tags,
|
asn_DEF_GraphicString_tags,
|
||||||
sizeof(asn_DEF_GraphicString_tags)
|
sizeof(asn_DEF_GraphicString_tags)
|
||||||
/ sizeof(asn_DEF_GraphicString_tags[0]) - 1,
|
/ sizeof(asn_DEF_GraphicString_tags[0]) - 1,
|
||||||
asn_DEF_GraphicString_tags,
|
asn_DEF_GraphicString_tags,
|
||||||
sizeof(asn_DEF_GraphicString_tags)
|
sizeof(asn_DEF_GraphicString_tags)
|
||||||
/ sizeof(asn_DEF_GraphicString_tags[0]),
|
/ sizeof(asn_DEF_GraphicString_tags[0]),
|
||||||
{ 0, 0, asn_generic_unknown_constraint },
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
0 /* No specifics */
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
asn_generic_unknown_constraint
|
||||||
|
},
|
||||||
|
0, 0, /* No members */
|
||||||
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -16,18 +16,34 @@ typedef OCTET_STRING_t GraphicString_t; /* Implemented via OCTET STRING */
|
|||||||
extern asn_TYPE_descriptor_t asn_DEF_GraphicString;
|
extern asn_TYPE_descriptor_t asn_DEF_GraphicString;
|
||||||
extern asn_TYPE_operation_t asn_OP_GraphicString;
|
extern asn_TYPE_operation_t asn_OP_GraphicString;
|
||||||
|
|
||||||
#define GraphicString_free OCTET_STRING_free
|
#define GraphicString_free OCTET_STRING_free
|
||||||
#define GraphicString_print OCTET_STRING_print
|
|
||||||
#define GraphicString_compare OCTET_STRING_compare
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
#define GraphicString_constraint asn_generic_unknown_constraint
|
#define GraphicString_print OCTET_STRING_print
|
||||||
#define GraphicString_decode_ber OCTET_STRING_decode_ber
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#define GraphicString_encode_der OCTET_STRING_encode_der
|
|
||||||
#define GraphicString_decode_xer OCTET_STRING_decode_xer_hex
|
#define GraphicString_compare OCTET_STRING_compare
|
||||||
#define GraphicString_encode_xer OCTET_STRING_encode_xer
|
|
||||||
#define GraphicString_decode_uper OCTET_STRING_decode_uper
|
#define GraphicString_constraint asn_generic_unknown_constraint
|
||||||
#define GraphicString_encode_uper OCTET_STRING_encode_uper
|
|
||||||
#define GraphicString_decode_aper OCTET_STRING_decode_aper
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
#define GraphicString_encode_aper OCTET_STRING_encode_aper
|
#define GraphicString_decode_ber OCTET_STRING_decode_ber
|
||||||
|
#define GraphicString_encode_der OCTET_STRING_encode_der
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
|
#define GraphicString_decode_xer OCTET_STRING_decode_xer_hex
|
||||||
|
#define GraphicString_encode_xer OCTET_STRING_encode_xer
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
#define GraphicString_decode_uper OCTET_STRING_decode_uper
|
||||||
|
#define GraphicString_encode_uper OCTET_STRING_encode_uper
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
#define GraphicString_decode_aper OCTET_STRING_decode_aper
|
||||||
|
#define GraphicString_encode_aper OCTET_STRING_encode_aper
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -35,21 +35,48 @@ typedef struct asn_INTEGER_specifics_s {
|
|||||||
int field_unsigned; /* Signed=0, unsigned=1 */
|
int field_unsigned; /* Signed=0, unsigned=1 */
|
||||||
} asn_INTEGER_specifics_t;
|
} asn_INTEGER_specifics_t;
|
||||||
|
|
||||||
#define INTEGER_free ASN__PRIMITIVE_TYPE_free
|
ssize_t INTEGER__dump(const asn_TYPE_descriptor_t *td,
|
||||||
#define INTEGER_decode_ber ber_decode_primitive
|
const INTEGER_t *st,
|
||||||
#define INTEGER_constraint asn_generic_no_constraint
|
asn_app_consume_bytes_f *cb,
|
||||||
|
void *app_key, int plainOrXER);
|
||||||
|
|
||||||
|
#define INTEGER_free ASN__PRIMITIVE_TYPE_free
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
asn_struct_print_f INTEGER_print;
|
asn_struct_print_f INTEGER_print;
|
||||||
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
|
|
||||||
asn_struct_compare_f INTEGER_compare;
|
asn_struct_compare_f INTEGER_compare;
|
||||||
|
|
||||||
|
#define INTEGER_constraint asn_generic_no_constraint
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
|
#define INTEGER_decode_ber ber_decode_primitive
|
||||||
der_type_encoder_f INTEGER_encode_der;
|
der_type_encoder_f INTEGER_encode_der;
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
xer_type_decoder_f INTEGER_decode_xer;
|
xer_type_decoder_f INTEGER_decode_xer;
|
||||||
xer_type_encoder_f INTEGER_encode_xer;
|
xer_type_encoder_f INTEGER_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
oer_type_decoder_f INTEGER_decode_oer;
|
oer_type_decoder_f INTEGER_decode_oer;
|
||||||
oer_type_encoder_f INTEGER_encode_oer;
|
oer_type_encoder_f INTEGER_encode_oer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
per_type_decoder_f INTEGER_decode_uper;
|
per_type_decoder_f INTEGER_decode_uper;
|
||||||
per_type_encoder_f INTEGER_encode_uper;
|
per_type_encoder_f INTEGER_encode_uper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
per_type_decoder_f INTEGER_decode_aper;
|
per_type_decoder_f INTEGER_decode_aper;
|
||||||
per_type_encoder_f INTEGER_encode_aper;
|
per_type_encoder_f INTEGER_encode_aper;
|
||||||
asn_random_fill_f INTEGER_random_fill;
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
asn_random_fill_f INTEGER_random_fill;
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
|
||||||
/***********************************
|
/***********************************
|
||||||
* Some handy conversion routines. *
|
* Some handy conversion routines. *
|
||||||
|
|||||||
304
lib/asn1c/common/INTEGER_aper.c
Normal file
304
lib/asn1c/common/INTEGER_aper.c
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <INTEGER.h>
|
||||||
|
|
||||||
|
asn_dec_rval_t
|
||||||
|
INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
||||||
|
const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_dec_rval_t rval = { RC_OK, 0 };
|
||||||
|
INTEGER_t *st = (INTEGER_t *)*sptr;
|
||||||
|
const asn_per_constraint_t *ct;
|
||||||
|
int repeat;
|
||||||
|
|
||||||
|
(void)opt_codec_ctx;
|
||||||
|
|
||||||
|
if(!st) {
|
||||||
|
st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
|
||||||
|
if(!st) ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!constraints) constraints = td->encoding_constraints.per_constraints;
|
||||||
|
ct = constraints ? &constraints->value : 0;
|
||||||
|
|
||||||
|
if(ct && ct->flags & APC_EXTENSIBLE) {
|
||||||
|
int inext = per_get_few_bits(pd, 1);
|
||||||
|
if(inext < 0) ASN__DECODE_STARVED;
|
||||||
|
if(inext) ct = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
FREEMEM(st->buf);
|
||||||
|
st->buf = 0;
|
||||||
|
st->size = 0;
|
||||||
|
if(ct) {
|
||||||
|
if(ct->flags & APC_SEMI_CONSTRAINED) {
|
||||||
|
st->buf = (uint8_t *)CALLOC(1, 2);
|
||||||
|
if(!st->buf) ASN__DECODE_FAILED;
|
||||||
|
st->size = 1;
|
||||||
|
} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
|
||||||
|
size_t size = (ct->range_bits + 7) >> 3;
|
||||||
|
st->buf = (uint8_t *)MALLOC(1 + size + 1);
|
||||||
|
if(!st->buf) ASN__DECODE_FAILED;
|
||||||
|
st->size = size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* X.691, #12.2.2 */
|
||||||
|
if(ct && ct->flags != APC_UNCONSTRAINED) {
|
||||||
|
/* #10.5.6 */
|
||||||
|
ASN_DEBUG("Integer with range %d bits", ct->range_bits);
|
||||||
|
if(ct->range_bits >= 0) {
|
||||||
|
if (ct->range_bits > 16) {
|
||||||
|
int max_range_bytes = (ct->range_bits >> 3) +
|
||||||
|
(((ct->range_bits % 8) > 0) ? 1 : 0);
|
||||||
|
int length = 0, i;
|
||||||
|
long value = 0;
|
||||||
|
|
||||||
|
for (i = 1; ; i++) {
|
||||||
|
int upper = 1 << i;
|
||||||
|
if (upper >= max_range_bytes)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
|
||||||
|
max_range_bytes, i);
|
||||||
|
|
||||||
|
if ((length = per_get_few_bits(pd, i)) < 0)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
|
||||||
|
/* X.691 #12.2.6 length determinant + lb (1) */
|
||||||
|
length += 1;
|
||||||
|
ASN_DEBUG("Got length %d", length);
|
||||||
|
if (aper_get_align(pd) != 0)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
while (length--) {
|
||||||
|
int buf = per_get_few_bits(pd, 8);
|
||||||
|
if (buf < 0)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
value += (((long)buf) << (8 * length));
|
||||||
|
}
|
||||||
|
|
||||||
|
value += ct->lower_bound;
|
||||||
|
if((specs && specs->field_unsigned)
|
||||||
|
? asn_uint642INTEGER(st, (unsigned long)value)
|
||||||
|
: asn_int642INTEGER(st, value))
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
ASN_DEBUG("Got value %ld + low %ld",
|
||||||
|
value, ct->lower_bound);
|
||||||
|
} else {
|
||||||
|
long value = 0;
|
||||||
|
if (ct->range_bits < 8) {
|
||||||
|
value = per_get_few_bits(pd, ct->range_bits);
|
||||||
|
if(value < 0) ASN__DECODE_STARVED;
|
||||||
|
} else if (ct->range_bits == 8) {
|
||||||
|
if (aper_get_align(pd) < 0)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
value = per_get_few_bits(pd, ct->range_bits);
|
||||||
|
if(value < 0) ASN__DECODE_STARVED;
|
||||||
|
} else {
|
||||||
|
/* Align */
|
||||||
|
if (aper_get_align(pd) < 0)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
value = per_get_few_bits(pd, 16);
|
||||||
|
if(value < 0) ASN__DECODE_STARVED;
|
||||||
|
}
|
||||||
|
value += ct->lower_bound;
|
||||||
|
if((specs && specs->field_unsigned)
|
||||||
|
? asn_ulong2INTEGER(st, value)
|
||||||
|
: asn_long2INTEGER(st, value))
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
ASN_DEBUG("Got value %ld + low %ld",
|
||||||
|
value, ct->lower_bound);
|
||||||
|
}
|
||||||
|
return rval;
|
||||||
|
} else {
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ASN_DEBUG("Decoding unconstrained integer %s", td->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* X.691, #12.2.3, #12.2.4 */
|
||||||
|
do {
|
||||||
|
ssize_t len;
|
||||||
|
void *p;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* Get the PER length */
|
||||||
|
len = aper_get_length(pd, -1, -1, &repeat);
|
||||||
|
if(len < 0) ASN__DECODE_STARVED;
|
||||||
|
|
||||||
|
p = REALLOC(st->buf, st->size + len + 1);
|
||||||
|
if(!p) ASN__DECODE_FAILED;
|
||||||
|
st->buf = (uint8_t *)p;
|
||||||
|
|
||||||
|
ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
|
||||||
|
if(ret < 0) ASN__DECODE_STARVED;
|
||||||
|
st->size += len;
|
||||||
|
} while(repeat);
|
||||||
|
st->buf[st->size] = 0; /* JIC */
|
||||||
|
|
||||||
|
/* #12.2.3 */
|
||||||
|
if(ct && ct->lower_bound) {
|
||||||
|
/*
|
||||||
|
* TODO: replace by in-place arithmetics.
|
||||||
|
*/
|
||||||
|
long value;
|
||||||
|
if(asn_INTEGER2long(st, &value))
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
if(asn_long2INTEGER(st, value + ct->lower_bound))
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
|
asn_enc_rval_t
|
||||||
|
INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints,
|
||||||
|
const void *sptr, asn_per_outp_t *po) {
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_enc_rval_t er = {0,0,0};
|
||||||
|
const INTEGER_t *st = (const INTEGER_t *)sptr;
|
||||||
|
const uint8_t *buf;
|
||||||
|
const uint8_t *end;
|
||||||
|
const asn_per_constraint_t *ct;
|
||||||
|
long value = 0;
|
||||||
|
|
||||||
|
if(!st || st->size == 0) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
if(!constraints) constraints = td->encoding_constraints.per_constraints;
|
||||||
|
ct = constraints ? &constraints->value : 0;
|
||||||
|
|
||||||
|
er.encoded = 0;
|
||||||
|
|
||||||
|
if(ct) {
|
||||||
|
int inext = 0;
|
||||||
|
if(specs && specs->field_unsigned) {
|
||||||
|
unsigned long uval;
|
||||||
|
if(asn_INTEGER2ulong(st, &uval))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
/* Check proper range */
|
||||||
|
if(ct->flags & APC_SEMI_CONSTRAINED) {
|
||||||
|
if(uval < (unsigned long)ct->lower_bound)
|
||||||
|
inext = 1;
|
||||||
|
} else if(ct->range_bits >= 0) {
|
||||||
|
if(uval < (unsigned long)ct->lower_bound
|
||||||
|
|| uval > (unsigned long)ct->upper_bound)
|
||||||
|
inext = 1;
|
||||||
|
}
|
||||||
|
ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
|
||||||
|
uval, st->buf[0], st->size,
|
||||||
|
ct->lower_bound, ct->upper_bound,
|
||||||
|
inext ? "ext" : "fix");
|
||||||
|
value = uval;
|
||||||
|
} else {
|
||||||
|
if(asn_INTEGER2long(st, &value)) ASN__ENCODE_FAILED;
|
||||||
|
/* Check proper range */
|
||||||
|
if(ct->flags & APC_SEMI_CONSTRAINED) {
|
||||||
|
if(value < ct->lower_bound)
|
||||||
|
inext = 1;
|
||||||
|
} else if(ct->range_bits >= 0) {
|
||||||
|
if(value < ct->lower_bound
|
||||||
|
|| value > ct->upper_bound)
|
||||||
|
inext = 1;
|
||||||
|
}
|
||||||
|
ASN_DEBUG("Value %lu (%02x/%lu) lb %ld ub %ld %s",
|
||||||
|
value, st->buf[0], st->size,
|
||||||
|
ct->lower_bound, ct->upper_bound,
|
||||||
|
inext ? "ext" : "fix");
|
||||||
|
}
|
||||||
|
if(ct->flags & APC_EXTENSIBLE) {
|
||||||
|
if(per_put_few_bits(po, inext, 1))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
if(inext) ct = 0;
|
||||||
|
} else if(inext) {
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* X.691, #12.2.2 */
|
||||||
|
if(ct && ct->range_bits >= 0) {
|
||||||
|
unsigned long v;
|
||||||
|
|
||||||
|
/* #10.5.6 */
|
||||||
|
ASN_DEBUG("Encoding integer %ld (%lu) with range %d bits",
|
||||||
|
value, value - ct->lower_bound, ct->range_bits);
|
||||||
|
|
||||||
|
v = value - ct->lower_bound;
|
||||||
|
|
||||||
|
/* #12 <= 8 -> alignment ? */
|
||||||
|
int range = ct->upper_bound - ct->lower_bound + 1;
|
||||||
|
if (ct->range_bits < 8 || (ct->range_bits == 8 && range < 256)) {
|
||||||
|
if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
} else if (ct->range_bits == 8) {
|
||||||
|
if(aper_put_align(po) < 0)
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
if(per_put_few_bits(po, 0x00 | v, ct->range_bits))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
} else if (ct->range_bits <= 16) {
|
||||||
|
/* Consume the bytes to align on octet */
|
||||||
|
if(aper_put_align(po) < 0)
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
if(per_put_few_bits(po, 0x0000 | v, 16))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
} else {
|
||||||
|
/* TODO: extend to >64 bits */
|
||||||
|
int64_t v64 = v;
|
||||||
|
int i, j;
|
||||||
|
int max_range_bytes = (ct->range_bits >> 3) +
|
||||||
|
(((ct->range_bits % 8) > 0) ? 1 : 0);
|
||||||
|
|
||||||
|
for (i = 1; ; i++) {
|
||||||
|
int upper = 1 << i;
|
||||||
|
if (upper >= max_range_bytes)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j = sizeof(int64_t) -1; j != 0; j--) {
|
||||||
|
int64_t val;
|
||||||
|
val = v64 >> (j * 8);
|
||||||
|
if (val != 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Putting length in the minimum number of bits ex: 5 = 3bits */
|
||||||
|
if (per_put_few_bits(po, j, i))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
/* Consume the bits to align on octet */
|
||||||
|
if (aper_put_align(po) < 0)
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
/* Put the value */
|
||||||
|
for (i = 0; i <= j; i++) {
|
||||||
|
if(per_put_few_bits(po, (v64 >> (8 * (j - i))) & 0xff, 8))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ct && ct->lower_bound) {
|
||||||
|
ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
|
||||||
|
/* TODO: adjust lower bound */
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(buf = st->buf, end = st->buf + st->size; buf < end;) {
|
||||||
|
int need_eom = 0;
|
||||||
|
ssize_t mayEncode = aper_put_length(po, -1, end - buf, &need_eom);
|
||||||
|
if(mayEncode < 0)
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
if(per_put_many_bits(po, buf, 8 * mayEncode))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
buf += mayEncode;
|
||||||
|
if(need_eom && aper_put_length(po, -1, 0, 0)) ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
26
lib/asn1c/common/INTEGER_print.c
Normal file
26
lib/asn1c/common/INTEGER_print.c
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <INTEGER.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* INTEGER specific human-readable output.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
INTEGER_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
||||||
|
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||||
|
const INTEGER_t *st = (const INTEGER_t *)sptr;
|
||||||
|
ssize_t ret;
|
||||||
|
|
||||||
|
(void)ilevel;
|
||||||
|
|
||||||
|
if(!st || !st->buf)
|
||||||
|
ret = cb("<absent>", 8, app_key);
|
||||||
|
else
|
||||||
|
ret = INTEGER__dump(td, st, cb, app_key, 0);
|
||||||
|
|
||||||
|
return (ret < 0) ? -1 : 0;
|
||||||
|
}
|
||||||
92
lib/asn1c/common/INTEGER_rfill.c
Normal file
92
lib/asn1c/common/INTEGER_rfill.c
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <INTEGER.h>
|
||||||
|
|
||||||
|
asn_random_fill_result_t
|
||||||
|
INTEGER_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
||||||
|
const asn_encoding_constraints_t *constraints,
|
||||||
|
size_t max_length) {
|
||||||
|
const asn_INTEGER_specifics_t *specs =
|
||||||
|
(const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
||||||
|
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
||||||
|
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
||||||
|
INTEGER_t *st = *sptr;
|
||||||
|
const asn_INTEGER_enum_map_t *emap;
|
||||||
|
size_t emap_len;
|
||||||
|
intmax_t value;
|
||||||
|
int find_inside_map;
|
||||||
|
|
||||||
|
if(max_length == 0) return result_skipped;
|
||||||
|
|
||||||
|
if(st == NULL) {
|
||||||
|
st = (INTEGER_t *)CALLOC(1, sizeof(*st));
|
||||||
|
if(st == NULL) {
|
||||||
|
return result_failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(specs) {
|
||||||
|
emap = specs->value2enum;
|
||||||
|
emap_len = specs->map_count;
|
||||||
|
if(specs->strict_enumeration) {
|
||||||
|
find_inside_map = emap_len > 0;
|
||||||
|
} else {
|
||||||
|
find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
emap = 0;
|
||||||
|
emap_len = 0;
|
||||||
|
find_inside_map = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(find_inside_map) {
|
||||||
|
assert(emap_len > 0);
|
||||||
|
value = emap[asn_random_between(0, emap_len - 1)].nat_value;
|
||||||
|
} else {
|
||||||
|
static const long variants[] = {
|
||||||
|
-65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
|
||||||
|
-16383, -257, -256, -255, -254, -129, -128, -127,
|
||||||
|
-126, -1, 0, 1, 126, 127, 128, 129,
|
||||||
|
254, 255, 256, 257, 16383, 16384, 16385, 32767,
|
||||||
|
32768, 32769, 65534, 65535, 65536, 65537};
|
||||||
|
if(specs && specs->field_unsigned) {
|
||||||
|
assert(variants[18] == 0);
|
||||||
|
value = variants[asn_random_between(
|
||||||
|
18, sizeof(variants) / sizeof(variants[0]) - 1)];
|
||||||
|
} else {
|
||||||
|
value = variants[asn_random_between(
|
||||||
|
0, sizeof(variants) / sizeof(variants[0]) - 1)];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!constraints) constraints = &td->encoding_constraints;
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
const asn_per_constraints_t *ct;
|
||||||
|
|
||||||
|
ct = constraints ? constraints->per_constraints : 0;
|
||||||
|
if(ct && (ct->value.flags & APC_CONSTRAINED)) {
|
||||||
|
if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
|
||||||
|
value = asn_random_between(ct->value.lower_bound,
|
||||||
|
ct->value.upper_bound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
}
|
||||||
|
|
||||||
|
if(asn_imax2INTEGER(st, value)) {
|
||||||
|
if(st == *sptr) {
|
||||||
|
ASN_STRUCT_RESET(*td, st);
|
||||||
|
} else {
|
||||||
|
ASN_STRUCT_FREE(*td, st);
|
||||||
|
}
|
||||||
|
return result_failed;
|
||||||
|
} else {
|
||||||
|
*sptr = st;
|
||||||
|
result_ok.length = st->size;
|
||||||
|
return result_ok;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,55 +3,83 @@
|
|||||||
* Redistribution and modifications are permitted subject to BSD license.
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
*/
|
*/
|
||||||
#include <asn_internal.h>
|
#include <asn_internal.h>
|
||||||
#include <asn_codecs_prim.h>
|
|
||||||
#include <NULL.h>
|
#include <NULL.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NULL basic type description.
|
* NULL basic type description.
|
||||||
*/
|
*/
|
||||||
static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
|
static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_NULL = {
|
asn_TYPE_operation_t asn_OP_NULL = {
|
||||||
NULL_free,
|
NULL_free,
|
||||||
NULL_print,
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
NULL_compare,
|
NULL_print,
|
||||||
NULL_decode_ber,
|
|
||||||
NULL_encode_der, /* Special handling of DER encoding */
|
|
||||||
NULL_decode_xer,
|
|
||||||
NULL_encode_xer,
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NULL_decode_oer,
|
0,
|
||||||
NULL_encode_oer,
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
NULL_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0,
|
NULL_decode_ber,
|
||||||
0,
|
NULL_encode_der, /* Special handling of DER encoding */
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NULL_decode_uper, /* Unaligned PER decoder */
|
0,
|
||||||
NULL_encode_uper, /* Unaligned PER encoder */
|
0,
|
||||||
NULL_decode_aper, /* Aligned PER decoder */
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
NULL_encode_aper, /* Aligned PER encoder */
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
NULL_decode_xer,
|
||||||
NULL_random_fill,
|
NULL_encode_xer,
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
NULL_decode_oer,
|
||||||
|
NULL_encode_oer,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
NULL_decode_uper, /* Unaligned PER decoder */
|
||||||
|
NULL_encode_uper, /* Unaligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
NULL_decode_aper, /* Aligned PER decoder */
|
||||||
|
NULL_encode_aper, /* Aligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
NULL_random_fill,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_NULL = {
|
asn_TYPE_descriptor_t asn_DEF_NULL = {
|
||||||
"NULL",
|
"NULL",
|
||||||
"NULL",
|
"NULL",
|
||||||
&asn_OP_NULL,
|
&asn_OP_NULL,
|
||||||
asn_DEF_NULL_tags,
|
asn_DEF_NULL_tags,
|
||||||
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
|
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
|
||||||
asn_DEF_NULL_tags, /* Same as above */
|
asn_DEF_NULL_tags, /* Same as above */
|
||||||
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
|
sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
|
||||||
{ 0, 0, asn_generic_no_constraint },
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
0 /* No specifics */
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
asn_generic_no_constraint
|
||||||
|
},
|
||||||
|
0, 0, /* No members */
|
||||||
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -71,106 +99,6 @@ NULL_free(const asn_TYPE_descriptor_t *td, void *ptr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Decode NULL type.
|
|
||||||
*/
|
|
||||||
asn_dec_rval_t
|
|
||||||
NULL_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td, void **bool_value,
|
|
||||||
const void *buf_ptr, size_t size, int tag_mode) {
|
|
||||||
NULL_t *st = (NULL_t *)*bool_value;
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
ber_tlv_len_t length;
|
|
||||||
|
|
||||||
if(st == NULL) {
|
|
||||||
st = (NULL_t *)(*bool_value = CALLOC(1, sizeof(*st)));
|
|
||||||
if(st == NULL) {
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
rval.consumed = 0;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("Decoding %s as NULL (tm=%d)", td->name, tag_mode);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check tags.
|
|
||||||
*/
|
|
||||||
rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size, tag_mode, 0,
|
|
||||||
&length, 0);
|
|
||||||
if(rval.code != RC_OK) {
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
// X.690-201508, #8.8.2, length shall be zero.
|
|
||||||
if(length != 0) {
|
|
||||||
ASN_DEBUG("Decoding %s as NULL failed: too much data", td->name);
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
rval.consumed = 0;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NULL_encode_der(const asn_TYPE_descriptor_t *td, const void *ptr, int tag_mode,
|
|
||||||
ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
asn_enc_rval_t erval = {0,0,0};
|
|
||||||
|
|
||||||
erval.encoded = der_write_tags(td, 0, tag_mode, 0, tag, cb, app_key);
|
|
||||||
if(erval.encoded == -1) {
|
|
||||||
erval.failed_type = td;
|
|
||||||
erval.structure_ptr = ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(erval);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NULL_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
|
||||||
enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
|
|
||||||
void *app_key) {
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
|
|
||||||
(void)td;
|
|
||||||
(void)sptr;
|
|
||||||
(void)ilevel;
|
|
||||||
(void)flags;
|
|
||||||
(void)cb;
|
|
||||||
(void)app_key;
|
|
||||||
|
|
||||||
/* XMLNullValue is empty */
|
|
||||||
er.encoded = 0;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static enum xer_pbd_rval
|
|
||||||
NULL__xer_body_decode(const asn_TYPE_descriptor_t *td, void *sptr,
|
|
||||||
const void *chunk_buf, size_t chunk_size) {
|
|
||||||
(void)td;
|
|
||||||
(void)sptr;
|
|
||||||
(void)chunk_buf; /* Going to be empty according to the rules below. */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* There must be no content in self-terminating <NULL/> tag.
|
|
||||||
*/
|
|
||||||
if(chunk_size)
|
|
||||||
return XPBD_BROKEN_ENCODING;
|
|
||||||
else
|
|
||||||
return XPBD_BODY_CONSUMED;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NULL_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td, void **sptr,
|
|
||||||
const char *opt_mname, const void *buf_ptr, size_t size) {
|
|
||||||
return xer_decode_primitive(opt_codec_ctx, td,
|
|
||||||
sptr, sizeof(NULL_t), opt_mname, buf_ptr, size,
|
|
||||||
NULL__xer_body_decode);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
|
NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
|
||||||
(void)td;
|
(void)td;
|
||||||
@@ -178,180 +106,3 @@ NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
|
|||||||
(void)b;
|
(void)b;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
NULL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
(void)td; /* Unused argument */
|
|
||||||
(void)ilevel; /* Unused argument */
|
|
||||||
|
|
||||||
if(sptr) {
|
|
||||||
return (cb("<present>", 9, app_key) < 0) ? -1 : 0;
|
|
||||||
} else {
|
|
||||||
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef ASN_DISABLE_OER_SUPPORT
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NULL_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_oer_constraints_t *constraints, void **sptr,
|
|
||||||
const void *ptr, size_t size) {
|
|
||||||
asn_dec_rval_t rv = {RC_OK, 0};
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
(void)td;
|
|
||||||
(void)constraints;
|
|
||||||
(void)ptr;
|
|
||||||
(void)size;
|
|
||||||
|
|
||||||
if(!*sptr) {
|
|
||||||
*sptr = MALLOC(sizeof(NULL_t));
|
|
||||||
if(*sptr) {
|
|
||||||
*(NULL_t *)*sptr = 0;
|
|
||||||
} else {
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NULL_encode_oer(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_oer_constraints_t *constraints, const void *sptr,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
|
|
||||||
(void)td;
|
|
||||||
(void)sptr;
|
|
||||||
(void)constraints;
|
|
||||||
(void)cb;
|
|
||||||
(void)app_key;
|
|
||||||
|
|
||||||
er.encoded = 0; /* Encoding in 0 bytes. */
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
|
||||||
|
|
||||||
#ifndef ASN_DISABLE_PER_SUPPORT
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NULL_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr,
|
|
||||||
asn_per_data_t *pd) {
|
|
||||||
asn_dec_rval_t rv;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
(void)td;
|
|
||||||
(void)constraints;
|
|
||||||
(void)pd;
|
|
||||||
|
|
||||||
if(!*sptr) {
|
|
||||||
*sptr = MALLOC(sizeof(NULL_t));
|
|
||||||
if(*sptr) {
|
|
||||||
*(NULL_t *)*sptr = 0;
|
|
||||||
} else {
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NULL type does not have content octets.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rv.code = RC_OK;
|
|
||||||
rv.consumed = 0;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NULL_encode_uper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, const void *sptr,
|
|
||||||
asn_per_outp_t *po) {
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
|
|
||||||
(void)td;
|
|
||||||
(void)constraints;
|
|
||||||
(void)sptr;
|
|
||||||
(void)po;
|
|
||||||
|
|
||||||
er.encoded = 0;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NULL_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
|
||||||
asn_dec_rval_t rv = {RC_OK, 0};
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
(void)td;
|
|
||||||
(void)constraints;
|
|
||||||
(void)pd;
|
|
||||||
|
|
||||||
if(!*sptr) {
|
|
||||||
*sptr = MALLOC(sizeof(NULL_t));
|
|
||||||
if(*sptr) {
|
|
||||||
*(NULL_t *)*sptr = 0;
|
|
||||||
} else {
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NULL type does not have content octets.
|
|
||||||
*/
|
|
||||||
|
|
||||||
rv.code = RC_OK;
|
|
||||||
rv.consumed = 0;
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NULL_encode_aper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
|
|
||||||
(void)td;
|
|
||||||
(void)constraints;
|
|
||||||
(void)sptr;
|
|
||||||
(void)po;
|
|
||||||
|
|
||||||
er.encoded = 0;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
|
||||||
|
|
||||||
asn_random_fill_result_t
|
|
||||||
NULL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
|
||||||
const asn_encoding_constraints_t *constr,
|
|
||||||
size_t max_length) {
|
|
||||||
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
|
||||||
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
|
||||||
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
|
||||||
NULL_t *st = *sptr;
|
|
||||||
|
|
||||||
(void)td;
|
|
||||||
(void)constr;
|
|
||||||
|
|
||||||
if(max_length == 0) return result_skipped;
|
|
||||||
|
|
||||||
if(st == NULL) {
|
|
||||||
st = (NULL_t *)(*sptr = CALLOC(1, sizeof(*st)));
|
|
||||||
if(st == NULL) {
|
|
||||||
return result_failed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result_ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,21 +21,42 @@ extern asn_TYPE_descriptor_t asn_DEF_NULL;
|
|||||||
extern asn_TYPE_operation_t asn_OP_NULL;
|
extern asn_TYPE_operation_t asn_OP_NULL;
|
||||||
|
|
||||||
asn_struct_free_f NULL_free;
|
asn_struct_free_f NULL_free;
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
asn_struct_print_f NULL_print;
|
asn_struct_print_f NULL_print;
|
||||||
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
|
|
||||||
asn_struct_compare_f NULL_compare;
|
asn_struct_compare_f NULL_compare;
|
||||||
|
|
||||||
|
#define NULL_constraint asn_generic_no_constraint
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
ber_type_decoder_f NULL_decode_ber;
|
ber_type_decoder_f NULL_decode_ber;
|
||||||
der_type_encoder_f NULL_encode_der;
|
der_type_encoder_f NULL_encode_der;
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
xer_type_decoder_f NULL_decode_xer;
|
xer_type_decoder_f NULL_decode_xer;
|
||||||
xer_type_encoder_f NULL_encode_xer;
|
xer_type_encoder_f NULL_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
oer_type_decoder_f NULL_decode_oer;
|
oer_type_decoder_f NULL_decode_oer;
|
||||||
oer_type_encoder_f NULL_encode_oer;
|
oer_type_encoder_f NULL_encode_oer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
per_type_decoder_f NULL_decode_uper;
|
per_type_decoder_f NULL_decode_uper;
|
||||||
per_type_encoder_f NULL_encode_uper;
|
per_type_encoder_f NULL_encode_uper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
per_type_decoder_f NULL_decode_aper;
|
per_type_decoder_f NULL_decode_aper;
|
||||||
per_type_encoder_f NULL_encode_aper;
|
per_type_encoder_f NULL_encode_aper;
|
||||||
asn_random_fill_f NULL_random_fill;
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#define NULL_constraint asn_generic_no_constraint
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
asn_random_fill_f NULL_random_fill;
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
52
lib/asn1c/common/NULL_aper.c
Normal file
52
lib/asn1c/common/NULL_aper.c
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <NULL.h>
|
||||||
|
|
||||||
|
asn_dec_rval_t
|
||||||
|
NULL_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
||||||
|
const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
||||||
|
asn_dec_rval_t rv = {RC_OK, 0};
|
||||||
|
|
||||||
|
(void)opt_codec_ctx;
|
||||||
|
(void)td;
|
||||||
|
(void)constraints;
|
||||||
|
(void)pd;
|
||||||
|
|
||||||
|
if(!*sptr) {
|
||||||
|
*sptr = MALLOC(sizeof(NULL_t));
|
||||||
|
if(*sptr) {
|
||||||
|
*(NULL_t *)*sptr = 0;
|
||||||
|
} else {
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NULL type does not have content octets.
|
||||||
|
*/
|
||||||
|
|
||||||
|
rv.code = RC_OK;
|
||||||
|
rv.consumed = 0;
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
asn_enc_rval_t
|
||||||
|
NULL_encode_aper(const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints,
|
||||||
|
const void *sptr, asn_per_outp_t *po) {
|
||||||
|
asn_enc_rval_t er = {0,0,0};
|
||||||
|
|
||||||
|
(void)td;
|
||||||
|
(void)constraints;
|
||||||
|
(void)sptr;
|
||||||
|
(void)po;
|
||||||
|
|
||||||
|
er.encoded = 0;
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
20
lib/asn1c/common/NULL_print.c
Normal file
20
lib/asn1c/common/NULL_print.c
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <NULL.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
NULL_print(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
||||||
|
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||||
|
(void)td; /* Unused argument */
|
||||||
|
(void)ilevel; /* Unused argument */
|
||||||
|
|
||||||
|
if(sptr) {
|
||||||
|
return (cb("<present>", 9, app_key) < 0) ? -1 : 0;
|
||||||
|
} else {
|
||||||
|
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
31
lib/asn1c/common/NULL_rfill.c
Normal file
31
lib/asn1c/common/NULL_rfill.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <NULL.h>
|
||||||
|
|
||||||
|
asn_random_fill_result_t
|
||||||
|
NULL_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
||||||
|
const asn_encoding_constraints_t *constr,
|
||||||
|
size_t max_length) {
|
||||||
|
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
||||||
|
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
||||||
|
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
||||||
|
NULL_t *st = *sptr;
|
||||||
|
|
||||||
|
(void)td;
|
||||||
|
(void)constr;
|
||||||
|
|
||||||
|
if(max_length == 0) return result_skipped;
|
||||||
|
|
||||||
|
if(st == NULL) {
|
||||||
|
st = (NULL_t *)(*sptr = CALLOC(1, sizeof(*st)));
|
||||||
|
if(st == NULL) {
|
||||||
|
return result_failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result_ok;
|
||||||
|
}
|
||||||
@@ -16,360 +16,88 @@
|
|||||||
* NativeEnumerated basic type description.
|
* NativeEnumerated basic type description.
|
||||||
*/
|
*/
|
||||||
static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
|
static const ber_tlv_tag_t asn_DEF_NativeEnumerated_tags[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_NativeEnumerated = {
|
asn_TYPE_operation_t asn_OP_NativeEnumerated = {
|
||||||
NativeInteger_free,
|
NativeInteger_free,
|
||||||
NativeInteger_print,
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
NativeInteger_compare,
|
NativeInteger_print,
|
||||||
NativeInteger_decode_ber,
|
|
||||||
NativeInteger_encode_der,
|
|
||||||
NativeInteger_decode_xer,
|
|
||||||
NativeEnumerated_encode_xer,
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NativeEnumerated_decode_oer,
|
0,
|
||||||
NativeEnumerated_encode_oer,
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
NativeInteger_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0,
|
NativeInteger_decode_ber,
|
||||||
0,
|
NativeInteger_encode_der,
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NativeEnumerated_decode_uper,
|
0,
|
||||||
NativeEnumerated_encode_uper,
|
0,
|
||||||
NativeEnumerated_decode_aper,
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
NativeEnumerated_encode_aper,
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
NativeInteger_decode_xer,
|
||||||
NativeEnumerated_random_fill,
|
NativeEnumerated_encode_xer,
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
NativeEnumerated_decode_oer,
|
||||||
|
NativeEnumerated_encode_oer,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
NativeEnumerated_decode_uper,
|
||||||
|
NativeEnumerated_encode_uper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
NativeEnumerated_decode_aper,
|
||||||
|
NativeEnumerated_encode_aper,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
NativeEnumerated_random_fill,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
|
asn_TYPE_descriptor_t asn_DEF_NativeEnumerated = {
|
||||||
"ENUMERATED", /* The ASN.1 type is still ENUMERATED */
|
"ENUMERATED", /* The ASN.1 type is still ENUMERATED */
|
||||||
"ENUMERATED",
|
"ENUMERATED",
|
||||||
&asn_OP_NativeEnumerated,
|
&asn_OP_NativeEnumerated,
|
||||||
asn_DEF_NativeEnumerated_tags,
|
asn_DEF_NativeEnumerated_tags,
|
||||||
sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
|
sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
|
||||||
asn_DEF_NativeEnumerated_tags, /* Same as above */
|
asn_DEF_NativeEnumerated_tags, /* Same as above */
|
||||||
sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
|
sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
|
||||||
{ 0, 0, asn_generic_no_constraint },
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
0 /* No specifics */
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
asn_generic_no_constraint
|
||||||
|
},
|
||||||
|
0, 0, /* No members */
|
||||||
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
||||||
asn_enc_rval_t
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
NativeEnumerated_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
|
int
|
||||||
int ilevel, enum xer_encoder_flags_e flags,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
const long *native = (const long *)sptr;
|
|
||||||
const asn_INTEGER_enum_map_t *el;
|
|
||||||
|
|
||||||
(void)ilevel;
|
|
||||||
(void)flags;
|
|
||||||
|
|
||||||
if(!native) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
el = INTEGER_map_value2enum(specs, *native);
|
|
||||||
if(el) {
|
|
||||||
er.encoded =
|
|
||||||
asn__format_to_callback(cb, app_key, "<%s/>", el->enum_name);
|
|
||||||
if(er.encoded < 0) ASN__ENCODE_FAILED;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
} else {
|
|
||||||
ASN_DEBUG(
|
|
||||||
"ASN.1 forbids dealing with "
|
|
||||||
"unknown value of ENUMERATED type");
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeEnumerated_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
void **sptr, asn_per_data_t *pd) {
|
|
||||||
const asn_INTEGER_specifics_t *specs = td->specifics;
|
|
||||||
asn_dec_rval_t rval = { RC_OK, 0 };
|
|
||||||
long *native = (long *)*sptr;
|
|
||||||
const asn_per_constraint_t *ct;
|
|
||||||
long value;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
|
|
||||||
if(constraints) ct = &constraints->value;
|
|
||||||
else if(td->encoding_constraints.per_constraints)
|
|
||||||
ct = &td->encoding_constraints.per_constraints->value;
|
|
||||||
else ASN__DECODE_FAILED; /* Mandatory! */
|
|
||||||
if(!specs) ASN__DECODE_FAILED;
|
|
||||||
|
|
||||||
if(!native) {
|
|
||||||
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(!native) ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
|
|
||||||
|
|
||||||
if(ct->flags & APC_EXTENSIBLE) {
|
|
||||||
int inext = per_get_few_bits(pd, 1);
|
|
||||||
if(inext < 0) ASN__DECODE_STARVED;
|
|
||||||
if(inext) ct = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ct && ct->range_bits >= 0) {
|
|
||||||
value = per_get_few_bits(pd, ct->range_bits);
|
|
||||||
if(value < 0) ASN__DECODE_STARVED;
|
|
||||||
if(value >= (specs->extension
|
|
||||||
? specs->extension - 1 : specs->map_count))
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
} else {
|
|
||||||
if(!specs->extension)
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
/*
|
|
||||||
* X.691, #10.6: normally small non-negative whole number;
|
|
||||||
*/
|
|
||||||
value = uper_get_nsnnwn(pd);
|
|
||||||
if(value < 0) ASN__DECODE_STARVED;
|
|
||||||
value += specs->extension - 1;
|
|
||||||
if(value >= specs->map_count)
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
*native = specs->value2enum[value].nat_value;
|
|
||||||
ASN_DEBUG("Decoded %s = %ld", td->name, *native);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
|
NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
|
||||||
const asn_INTEGER_enum_map_t *a = ap;
|
const asn_INTEGER_enum_map_t *a = ap;
|
||||||
const asn_INTEGER_enum_map_t *b = bp;
|
const asn_INTEGER_enum_map_t *b = bp;
|
||||||
if(a->nat_value == b->nat_value)
|
if(a->nat_value == b->nat_value)
|
||||||
return 0;
|
return 0;
|
||||||
if(a->nat_value < b->nat_value)
|
if(a->nat_value < b->nat_value)
|
||||||
return -1;
|
return -1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeEnumerated_encode_uper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
long native, value;
|
|
||||||
const asn_per_constraint_t *ct;
|
|
||||||
int inext = 0;
|
|
||||||
asn_INTEGER_enum_map_t key;
|
|
||||||
const asn_INTEGER_enum_map_t *kf;
|
|
||||||
|
|
||||||
if(!sptr) ASN__ENCODE_FAILED;
|
|
||||||
if(!specs) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
if(constraints) ct = &constraints->value;
|
|
||||||
else if(td->encoding_constraints.per_constraints)
|
|
||||||
ct = &td->encoding_constraints.per_constraints->value;
|
|
||||||
else ASN__ENCODE_FAILED; /* Mandatory! */
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
|
|
||||||
|
|
||||||
er.encoded = 0;
|
|
||||||
|
|
||||||
native = *(const long *)sptr;
|
|
||||||
|
|
||||||
key.nat_value = native;
|
|
||||||
kf = bsearch(&key, specs->value2enum, specs->map_count,
|
|
||||||
sizeof(key), NativeEnumerated__compar_value2enum);
|
|
||||||
if(!kf) {
|
|
||||||
ASN_DEBUG("No element corresponds to %ld", native);
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
value = kf - specs->value2enum;
|
|
||||||
|
|
||||||
if(ct->range_bits >= 0) {
|
|
||||||
int cmpWith = specs->extension
|
|
||||||
? specs->extension - 1 : specs->map_count;
|
|
||||||
if(value >= cmpWith)
|
|
||||||
inext = 1;
|
|
||||||
}
|
|
||||||
if(ct->flags & APC_EXTENSIBLE) {
|
|
||||||
if(per_put_few_bits(po, inext, 1))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
if(inext) ct = 0;
|
|
||||||
} else if(inext) {
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ct && ct->range_bits >= 0) {
|
|
||||||
if(per_put_few_bits(po, value, ct->range_bits))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!specs->extension)
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* X.691, #10.6: normally small non-negative whole number;
|
|
||||||
*/
|
|
||||||
ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
|
|
||||||
value, specs->extension, inext,
|
|
||||||
value - (inext ? (specs->extension - 1) : 0));
|
|
||||||
if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
void **sptr, asn_per_data_t *pd) {
|
|
||||||
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_dec_rval_t rval = { RC_OK, 0 };
|
|
||||||
long *native = (long *)*sptr;
|
|
||||||
const asn_per_constraint_t *ct;
|
|
||||||
long value;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
|
|
||||||
if(constraints) ct = &constraints->value;
|
|
||||||
else if(td->encoding_constraints.per_constraints)
|
|
||||||
ct = &td->encoding_constraints.per_constraints->value;
|
|
||||||
else ASN__DECODE_FAILED; /* Mandatory! */
|
|
||||||
if(!specs) ASN__DECODE_FAILED;
|
|
||||||
|
|
||||||
if(!native) {
|
|
||||||
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(!native) ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
|
|
||||||
|
|
||||||
if(ct->flags & APC_EXTENSIBLE) {
|
|
||||||
int inext = per_get_few_bits(pd, 1);
|
|
||||||
if(inext < 0) ASN__DECODE_STARVED;
|
|
||||||
if(inext) ct = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Deal with APER padding */
|
|
||||||
if(ct && ct->upper_bound >= 255) {
|
|
||||||
int padding = 0;
|
|
||||||
padding = (8 - (pd->moved % 8)) % 8;
|
|
||||||
ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d", td->name, pd->moved, padding);
|
|
||||||
ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name, ct->upper_bound);
|
|
||||||
if(padding > 0)
|
|
||||||
per_get_few_bits(pd, padding);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ct && ct->range_bits >= 0) {
|
|
||||||
value = per_get_few_bits(pd, ct->range_bits);
|
|
||||||
if(value < 0) ASN__DECODE_STARVED;
|
|
||||||
if(value >= (specs->extension
|
|
||||||
? specs->extension - 1 : specs->map_count))
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
} else {
|
|
||||||
if(!specs->extension)
|
|
||||||
ASN__DECODE_FAILED;
|
|
||||||
/*
|
|
||||||
* X.691, #10.6: normally small non-negative whole number;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* XXX handle indefinite index length > 64k */
|
|
||||||
value = aper_get_nsnnwn(pd, 65537);
|
|
||||||
if(value < 0) ASN__DECODE_STARVED;
|
|
||||||
value += specs->extension - 1;
|
|
||||||
//if(value >= specs->map_count)
|
|
||||||
// ASN__DECODE_FAILED;
|
|
||||||
if(value >= specs->map_count) {
|
|
||||||
ASN_DEBUG("Decoded unknown index value %s = %ld", td->name, value);
|
|
||||||
/* unknown index. Workaround => set the first enumeration value */
|
|
||||||
*native = specs->value2enum[0].nat_value;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*native = specs->value2enum[value].nat_value;
|
|
||||||
ASN_DEBUG("Decoded %s = %ld", td->name, *native);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
long native, value;
|
|
||||||
const asn_per_constraint_t *ct;
|
|
||||||
int inext = 0;
|
|
||||||
asn_INTEGER_enum_map_t key;
|
|
||||||
asn_INTEGER_enum_map_t *kf;
|
|
||||||
|
|
||||||
if(!sptr) ASN__ENCODE_FAILED;
|
|
||||||
if(!specs) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
if(constraints) ct = &constraints->value;
|
|
||||||
else if(td->encoding_constraints.per_constraints)
|
|
||||||
ct = &td->encoding_constraints.per_constraints->value;
|
|
||||||
else ASN__ENCODE_FAILED; /* Mandatory! */
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
|
|
||||||
|
|
||||||
er.encoded = 0;
|
|
||||||
|
|
||||||
native = *(const long *)sptr;
|
|
||||||
if(native < 0) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
key.nat_value = native;
|
|
||||||
kf = bsearch(&key, specs->value2enum, specs->map_count,
|
|
||||||
sizeof(key), NativeEnumerated__compar_value2enum);
|
|
||||||
if(!kf) {
|
|
||||||
ASN_DEBUG("No element corresponds to %ld", native);
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
value = kf - specs->value2enum;
|
|
||||||
|
|
||||||
if(ct->range_bits >= 0) {
|
|
||||||
int cmpWith = specs->extension
|
|
||||||
? specs->extension - 1 : specs->map_count;
|
|
||||||
if(value >= cmpWith)
|
|
||||||
inext = 1;
|
|
||||||
}
|
|
||||||
if(ct->flags & APC_EXTENSIBLE) {
|
|
||||||
if(per_put_few_bits(po, inext, 1))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
if(inext) ct = 0;
|
|
||||||
} else if(inext) {
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ct && ct->range_bits >= 0) {
|
|
||||||
if(per_put_few_bits(po, value, ct->range_bits))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!specs->extension)
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* X.691, #10.6: normally small non-negative whole number;
|
|
||||||
*/
|
|
||||||
ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
|
|
||||||
value, specs->extension, inext,
|
|
||||||
value - (inext ? (specs->extension - 1) : 0));
|
|
||||||
if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
}
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|||||||
@@ -21,22 +21,49 @@ extern "C" {
|
|||||||
extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
|
extern asn_TYPE_descriptor_t asn_DEF_NativeEnumerated;
|
||||||
extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
|
extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
|
||||||
|
|
||||||
xer_type_encoder_f NativeEnumerated_encode_xer;
|
#define NativeEnumerated_free NativeInteger_free
|
||||||
oer_type_decoder_f NativeEnumerated_decode_oer;
|
|
||||||
oer_type_encoder_f NativeEnumerated_encode_oer;
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
per_type_decoder_f NativeEnumerated_decode_uper;
|
#define NativeEnumerated_print NativeInteger_print
|
||||||
per_type_encoder_f NativeEnumerated_encode_uper;
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
per_type_decoder_f NativeEnumerated_decode_aper;
|
|
||||||
per_type_encoder_f NativeEnumerated_encode_aper;
|
#define NativeEnumerated_compare NativeInteger_compare
|
||||||
|
|
||||||
#define NativeEnumerated_free NativeInteger_free
|
|
||||||
#define NativeEnumerated_print NativeInteger_print
|
|
||||||
#define NativeEnumerated_compare NativeInteger_compare
|
|
||||||
#define NativeEnumerated_random_fill NativeInteger_random_fill
|
|
||||||
#define NativeEnumerated_constraint asn_generic_no_constraint
|
#define NativeEnumerated_constraint asn_generic_no_constraint
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
#define NativeEnumerated_decode_ber NativeInteger_decode_ber
|
#define NativeEnumerated_decode_ber NativeInteger_decode_ber
|
||||||
#define NativeEnumerated_encode_der NativeInteger_encode_der
|
#define NativeEnumerated_encode_der NativeInteger_encode_der
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#define NativeEnumerated_decode_xer NativeInteger_decode_xer
|
#define NativeEnumerated_decode_xer NativeInteger_decode_xer
|
||||||
|
xer_type_encoder_f NativeEnumerated_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
oer_type_decoder_f NativeEnumerated_decode_oer;
|
||||||
|
oer_type_encoder_f NativeEnumerated_encode_oer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
per_type_decoder_f NativeEnumerated_decode_uper;
|
||||||
|
per_type_encoder_f NativeEnumerated_encode_uper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
per_type_decoder_f NativeEnumerated_decode_aper;
|
||||||
|
per_type_encoder_f NativeEnumerated_encode_aper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
#define NativeEnumerated_random_fill NativeInteger_random_fill
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
int NativeEnumerated__compar_value2enum(
|
||||||
|
const void *ap,
|
||||||
|
const void *bp);
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
155
lib/asn1c/common/NativeEnumerated_aper.c
Normal file
155
lib/asn1c/common/NativeEnumerated_aper.c
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <NativeEnumerated.h>
|
||||||
|
|
||||||
|
asn_dec_rval_t
|
||||||
|
NativeEnumerated_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
||||||
|
const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints,
|
||||||
|
void **sptr, asn_per_data_t *pd) {
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_dec_rval_t rval = { RC_OK, 0 };
|
||||||
|
long *native = (long *)*sptr;
|
||||||
|
const asn_per_constraint_t *ct;
|
||||||
|
long value;
|
||||||
|
|
||||||
|
(void)opt_codec_ctx;
|
||||||
|
|
||||||
|
if(constraints) ct = &constraints->value;
|
||||||
|
else if(td->encoding_constraints.per_constraints)
|
||||||
|
ct = &td->encoding_constraints.per_constraints->value;
|
||||||
|
else ASN__DECODE_FAILED; /* Mandatory! */
|
||||||
|
if(!specs) ASN__DECODE_FAILED;
|
||||||
|
|
||||||
|
if(!native) {
|
||||||
|
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
||||||
|
if(!native) ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
|
||||||
|
|
||||||
|
if(ct->flags & APC_EXTENSIBLE) {
|
||||||
|
int inext = per_get_few_bits(pd, 1);
|
||||||
|
if(inext < 0) ASN__DECODE_STARVED;
|
||||||
|
if(inext) ct = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deal with APER padding */
|
||||||
|
if(ct && ct->upper_bound >= 255) {
|
||||||
|
int padding = 0;
|
||||||
|
padding = (8 - (pd->moved % 8)) % 8;
|
||||||
|
ASN_DEBUG("For NativeEnumerated %s,offset= %lu Padding bits = %d", td->name, pd->moved, padding);
|
||||||
|
ASN_DEBUG("For NativeEnumerated %s, upper bound = %lu", td->name, ct->upper_bound);
|
||||||
|
if(padding > 0)
|
||||||
|
per_get_few_bits(pd, padding);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ct && ct->range_bits >= 0) {
|
||||||
|
value = per_get_few_bits(pd, ct->range_bits);
|
||||||
|
if(value < 0) ASN__DECODE_STARVED;
|
||||||
|
if(value >= (specs->extension
|
||||||
|
? specs->extension - 1 : specs->map_count))
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
} else {
|
||||||
|
if(!specs->extension)
|
||||||
|
ASN__DECODE_FAILED;
|
||||||
|
/*
|
||||||
|
* X.691, #10.6: normally small non-negative whole number;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* XXX handle indefinite index length > 64k */
|
||||||
|
value = aper_get_nsnnwn(pd, 65537);
|
||||||
|
if(value < 0) ASN__DECODE_STARVED;
|
||||||
|
value += specs->extension - 1;
|
||||||
|
//if(value >= specs->map_count)
|
||||||
|
// ASN__DECODE_FAILED;
|
||||||
|
if(value >= specs->map_count) {
|
||||||
|
ASN_DEBUG("Decoded unknown index value %s = %ld", td->name, value);
|
||||||
|
/* unknown index. Workaround => set the first enumeration value */
|
||||||
|
*native = specs->value2enum[0].nat_value;
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*native = specs->value2enum[value].nat_value;
|
||||||
|
ASN_DEBUG("Decoded %s = %ld", td->name, *native);
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
|
asn_enc_rval_t
|
||||||
|
NativeEnumerated_encode_aper(const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints,
|
||||||
|
const void *sptr, asn_per_outp_t *po) {
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_enc_rval_t er = {0,0,0};
|
||||||
|
long native, value;
|
||||||
|
const asn_per_constraint_t *ct;
|
||||||
|
int inext = 0;
|
||||||
|
asn_INTEGER_enum_map_t key;
|
||||||
|
asn_INTEGER_enum_map_t *kf;
|
||||||
|
|
||||||
|
if(!sptr) ASN__ENCODE_FAILED;
|
||||||
|
if(!specs) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
if(constraints) ct = &constraints->value;
|
||||||
|
else if(td->encoding_constraints.per_constraints)
|
||||||
|
ct = &td->encoding_constraints.per_constraints->value;
|
||||||
|
else ASN__ENCODE_FAILED; /* Mandatory! */
|
||||||
|
|
||||||
|
ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
|
||||||
|
|
||||||
|
er.encoded = 0;
|
||||||
|
|
||||||
|
native = *(const long *)sptr;
|
||||||
|
if(native < 0) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
key.nat_value = native;
|
||||||
|
kf = bsearch(&key, specs->value2enum, specs->map_count,
|
||||||
|
sizeof(key), NativeEnumerated__compar_value2enum);
|
||||||
|
if(!kf) {
|
||||||
|
ASN_DEBUG("No element corresponds to %ld", native);
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
value = kf - specs->value2enum;
|
||||||
|
|
||||||
|
if(ct->range_bits >= 0) {
|
||||||
|
int cmpWith = specs->extension
|
||||||
|
? specs->extension - 1 : specs->map_count;
|
||||||
|
if(value >= cmpWith)
|
||||||
|
inext = 1;
|
||||||
|
}
|
||||||
|
if(ct->flags & APC_EXTENSIBLE) {
|
||||||
|
if(per_put_few_bits(po, inext, 1))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
if(inext) ct = 0;
|
||||||
|
} else if(inext) {
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ct && ct->range_bits >= 0) {
|
||||||
|
if(per_put_few_bits(po, value, ct->range_bits))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!specs->extension)
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X.691, #10.6: normally small non-negative whole number;
|
||||||
|
*/
|
||||||
|
ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
|
||||||
|
value, specs->extension, inext,
|
||||||
|
value - (inext ? (specs->extension - 1) : 0));
|
||||||
|
if(aper_put_nsnnwn(po,
|
||||||
|
ct->upper_bound - ct->lower_bound + 1,
|
||||||
|
value - (inext ? (specs->extension - 1) : 0)))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
ASN__ENCODED_OK(er);
|
||||||
|
}
|
||||||
@@ -17,408 +17,79 @@
|
|||||||
* NativeInteger basic type description.
|
* NativeInteger basic type description.
|
||||||
*/
|
*/
|
||||||
static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
|
static const ber_tlv_tag_t asn_DEF_NativeInteger_tags[] = {
|
||||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
||||||
};
|
};
|
||||||
asn_TYPE_operation_t asn_OP_NativeInteger = {
|
asn_TYPE_operation_t asn_OP_NativeInteger = {
|
||||||
NativeInteger_free,
|
NativeInteger_free,
|
||||||
NativeInteger_print,
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
NativeInteger_compare,
|
NativeInteger_print,
|
||||||
NativeInteger_decode_ber,
|
|
||||||
NativeInteger_encode_der,
|
|
||||||
NativeInteger_decode_xer,
|
|
||||||
NativeInteger_encode_xer,
|
|
||||||
#ifdef ASN_DISABLE_OER_SUPPORT
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NativeInteger_decode_oer, /* OER decoder */
|
0,
|
||||||
NativeInteger_encode_oer, /* Canonical OER encoder */
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
#endif /* ASN_DISABLE_OER_SUPPORT */
|
NativeInteger_compare,
|
||||||
#ifdef ASN_DISABLE_PER_SUPPORT
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
0,
|
NativeInteger_decode_ber,
|
||||||
0,
|
NativeInteger_encode_der,
|
||||||
0,
|
|
||||||
0,
|
|
||||||
#else
|
#else
|
||||||
NativeInteger_decode_uper, /* Unaligned PER decoder */
|
0,
|
||||||
NativeInteger_encode_uper, /* Unaligned PER encoder */
|
0,
|
||||||
NativeInteger_decode_aper, /* Aligned PER decoder */
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
NativeInteger_encode_aper, /* Aligned PER encoder */
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
NativeInteger_decode_xer,
|
||||||
NativeInteger_random_fill,
|
NativeInteger_encode_xer,
|
||||||
0 /* Use generic outmost tag fetcher */
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
|
NativeInteger_decode_oer, /* OER decoder */
|
||||||
|
NativeInteger_encode_oer, /* Canonical OER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
|
NativeInteger_decode_uper, /* Unaligned PER decoder */
|
||||||
|
NativeInteger_encode_uper, /* Unaligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
NativeInteger_decode_aper, /* Aligned PER decoder */
|
||||||
|
NativeInteger_encode_aper, /* Aligned PER encoder */
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
NativeInteger_random_fill,
|
||||||
|
#else
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
0 /* Use generic outmost tag fetcher */
|
||||||
};
|
};
|
||||||
asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
|
asn_TYPE_descriptor_t asn_DEF_NativeInteger = {
|
||||||
"INTEGER", /* The ASN.1 type is still INTEGER */
|
"INTEGER", /* The ASN.1 type is still INTEGER */
|
||||||
"INTEGER",
|
"INTEGER",
|
||||||
&asn_OP_NativeInteger,
|
&asn_OP_NativeInteger,
|
||||||
asn_DEF_NativeInteger_tags,
|
asn_DEF_NativeInteger_tags,
|
||||||
sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
|
sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
|
||||||
asn_DEF_NativeInteger_tags, /* Same as above */
|
asn_DEF_NativeInteger_tags, /* Same as above */
|
||||||
sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
|
sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
|
||||||
{ 0, 0, asn_generic_no_constraint },
|
{
|
||||||
0, 0, /* No members */
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
0 /* No specifics */
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
|
0,
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
asn_generic_no_constraint
|
||||||
|
},
|
||||||
|
0, 0, /* No members */
|
||||||
|
0 /* No specifics */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Decode INTEGER type.
|
|
||||||
*/
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeInteger_decode_ber(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td, void **nint_ptr,
|
|
||||||
const void *buf_ptr, size_t size, int tag_mode) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
long *native = (long *)*nint_ptr;
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
ber_tlv_len_t length;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the structure is not there, allocate it.
|
|
||||||
*/
|
|
||||||
if(native == NULL) {
|
|
||||||
native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(native == NULL) {
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
rval.consumed = 0;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ASN_DEBUG("Decoding %s as INTEGER (tm=%d)",
|
|
||||||
td->name, tag_mode);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check tags.
|
|
||||||
*/
|
|
||||||
rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
|
|
||||||
tag_mode, 0, &length, 0);
|
|
||||||
if(rval.code != RC_OK)
|
|
||||||
return rval;
|
|
||||||
|
|
||||||
ASN_DEBUG("%s length is %d bytes", td->name, (int)length);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Make sure we have this length.
|
|
||||||
*/
|
|
||||||
buf_ptr = ((const char *)buf_ptr) + rval.consumed;
|
|
||||||
size -= rval.consumed;
|
|
||||||
if(length > (ber_tlv_len_t)size) {
|
|
||||||
rval.code = RC_WMORE;
|
|
||||||
rval.consumed = 0;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ASN.1 encoded INTEGER: buf_ptr, length
|
|
||||||
* Fill the native, at the same time checking for overflow.
|
|
||||||
* If overflow occurred, return with RC_FAIL.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
INTEGER_t tmp;
|
|
||||||
union {
|
|
||||||
const void *constbuf;
|
|
||||||
void *nonconstbuf;
|
|
||||||
} unconst_buf;
|
|
||||||
long l;
|
|
||||||
|
|
||||||
unconst_buf.constbuf = buf_ptr;
|
|
||||||
tmp.buf = (uint8_t *)unconst_buf.nonconstbuf;
|
|
||||||
tmp.size = length;
|
|
||||||
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_INTEGER2ulong(&tmp, (unsigned long *)&l) /* sic */
|
|
||||||
: asn_INTEGER2long(&tmp, &l)) {
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
rval.consumed = 0;
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
*native = l;
|
|
||||||
}
|
|
||||||
|
|
||||||
rval.code = RC_OK;
|
|
||||||
rval.consumed += length;
|
|
||||||
|
|
||||||
ASN_DEBUG("Took %ld/%ld bytes to encode %s (%ld)",
|
|
||||||
(long)rval.consumed, (long)length, td->name, (long)*native);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Encode the NativeInteger using the standard INTEGER type DER encoder.
|
|
||||||
*/
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeInteger_encode_der(const asn_TYPE_descriptor_t *sd, const void *ptr,
|
|
||||||
int tag_mode, ber_tlv_tag_t tag,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
unsigned long native = *(const unsigned long *)ptr; /* Disable sign ext. */
|
|
||||||
asn_enc_rval_t erval = {0,0,0};
|
|
||||||
INTEGER_t tmp;
|
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN /* Opportunistic optimization */
|
|
||||||
|
|
||||||
tmp.buf = (uint8_t *)&native;
|
|
||||||
tmp.size = sizeof(native);
|
|
||||||
|
|
||||||
#else /* Works even if WORDS_BIGENDIAN is not set where should've been */
|
|
||||||
uint8_t buf[sizeof(native)];
|
|
||||||
uint8_t *p;
|
|
||||||
|
|
||||||
/* Prepare a fake INTEGER */
|
|
||||||
for(p = buf + sizeof(buf) - 1; p >= buf; p--, native >>= 8)
|
|
||||||
*p = (uint8_t)native;
|
|
||||||
|
|
||||||
tmp.buf = buf;
|
|
||||||
tmp.size = sizeof(buf);
|
|
||||||
#endif /* WORDS_BIGENDIAN */
|
|
||||||
|
|
||||||
/* Encode fake INTEGER */
|
|
||||||
erval = INTEGER_encode_der(sd, &tmp, tag_mode, tag, cb, app_key);
|
|
||||||
if(erval.structure_ptr == &tmp) {
|
|
||||||
erval.structure_ptr = ptr;
|
|
||||||
}
|
|
||||||
return erval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Decode the chunk of XML text encoding INTEGER.
|
|
||||||
*/
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeInteger_decode_xer(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td, void **sptr,
|
|
||||||
const char *opt_mname, const void *buf_ptr,
|
|
||||||
size_t size) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
INTEGER_t st;
|
|
||||||
void *st_ptr = (void *)&st;
|
|
||||||
long *native = (long *)*sptr;
|
|
||||||
|
|
||||||
if(!native) {
|
|
||||||
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(!native) ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&st, 0, sizeof(st));
|
|
||||||
rval = INTEGER_decode_xer(opt_codec_ctx, td, &st_ptr,
|
|
||||||
opt_mname, buf_ptr, size);
|
|
||||||
if(rval.code == RC_OK) {
|
|
||||||
long l;
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_INTEGER2ulong(&st, (unsigned long *)&l) /* sic */
|
|
||||||
: asn_INTEGER2long(&st, &l)) {
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
rval.consumed = 0;
|
|
||||||
} else {
|
|
||||||
*native = l;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/*
|
|
||||||
* Cannot restart from the middle;
|
|
||||||
* there is no place to save state in the native type.
|
|
||||||
* Request a continuation from the very beginning.
|
|
||||||
*/
|
|
||||||
rval.consumed = 0;
|
|
||||||
}
|
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &st);
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeInteger_encode_xer(const asn_TYPE_descriptor_t *td, const void *sptr,
|
|
||||||
int ilevel, enum xer_encoder_flags_e flags,
|
|
||||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
char scratch[32]; /* Enough for 64-bit int */
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
const long *native = (const long *)sptr;
|
|
||||||
|
|
||||||
(void)ilevel;
|
|
||||||
(void)flags;
|
|
||||||
|
|
||||||
if(!native) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
er.encoded = snprintf(scratch, sizeof(scratch),
|
|
||||||
(specs && specs->field_unsigned)
|
|
||||||
? "%lu" : "%ld", *native);
|
|
||||||
if(er.encoded <= 0 || (size_t)er.encoded >= sizeof(scratch)
|
|
||||||
|| cb(scratch, er.encoded, app_key) < 0)
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
ASN__ENCODED_OK(er);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef ASN_DISABLE_PER_SUPPORT
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeInteger_decode_uper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr,
|
|
||||||
asn_per_data_t *pd) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
long *native = (long *)*sptr;
|
|
||||||
INTEGER_t tmpint;
|
|
||||||
void *tmpintptr = &tmpint;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
ASN_DEBUG("Decoding NativeInteger %s (UPER)", td->name);
|
|
||||||
|
|
||||||
if(!native) {
|
|
||||||
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(!native) ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&tmpint, 0, sizeof tmpint);
|
|
||||||
rval = INTEGER_decode_uper(opt_codec_ctx, td, constraints,
|
|
||||||
&tmpintptr, pd);
|
|
||||||
if(rval.code == RC_OK) {
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
|
|
||||||
: asn_INTEGER2long(&tmpint, native))
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
else
|
|
||||||
ASN_DEBUG("NativeInteger %s got value %ld",
|
|
||||||
td->name, *native);
|
|
||||||
}
|
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeInteger_encode_uper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
long native;
|
|
||||||
INTEGER_t tmpint;
|
|
||||||
|
|
||||||
if(!sptr) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
native = *(const long *)sptr;
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding NativeInteger %s %ld (UPER)", td->name, native);
|
|
||||||
|
|
||||||
memset(&tmpint, 0, sizeof(tmpint));
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_ulong2INTEGER(&tmpint, native)
|
|
||||||
: asn_long2INTEGER(&tmpint, native))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
er = INTEGER_encode_uper(td, constraints, &tmpint, po);
|
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
|
||||||
return er;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_dec_rval_t
|
|
||||||
NativeInteger_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
|
||||||
const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
|
||||||
|
|
||||||
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_dec_rval_t rval;
|
|
||||||
long *native = (long *)*sptr;
|
|
||||||
INTEGER_t tmpint;
|
|
||||||
void *tmpintptr = &tmpint;
|
|
||||||
|
|
||||||
(void)opt_codec_ctx;
|
|
||||||
ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
|
|
||||||
|
|
||||||
if(!native) {
|
|
||||||
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
|
||||||
if(!native) ASN__DECODE_FAILED;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&tmpint, 0, sizeof tmpint);
|
|
||||||
rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
|
|
||||||
&tmpintptr, pd);
|
|
||||||
if(rval.code == RC_OK) {
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
|
|
||||||
: asn_INTEGER2long(&tmpint, native))
|
|
||||||
rval.code = RC_FAIL;
|
|
||||||
else
|
|
||||||
ASN_DEBUG("NativeInteger %s got value %ld",
|
|
||||||
td->name, *native);
|
|
||||||
}
|
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
|
||||||
|
|
||||||
return rval;
|
|
||||||
}
|
|
||||||
|
|
||||||
asn_enc_rval_t
|
|
||||||
NativeInteger_encode_aper(const asn_TYPE_descriptor_t *td,
|
|
||||||
const asn_per_constraints_t *constraints,
|
|
||||||
const void *sptr, asn_per_outp_t *po) {
|
|
||||||
|
|
||||||
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_enc_rval_t er = {0,0,0};
|
|
||||||
long native;
|
|
||||||
INTEGER_t tmpint;
|
|
||||||
|
|
||||||
if(!sptr) ASN__ENCODE_FAILED;
|
|
||||||
|
|
||||||
native = *(const long *)sptr;
|
|
||||||
|
|
||||||
ASN_DEBUG("Encoding NativeInteger %s %ld (APER)", td->name, native);
|
|
||||||
|
|
||||||
memset(&tmpint, 0, sizeof(tmpint));
|
|
||||||
if((specs&&specs->field_unsigned)
|
|
||||||
? asn_ulong2INTEGER(&tmpint, (unsigned long)native)
|
|
||||||
: asn_long2INTEGER(&tmpint, native))
|
|
||||||
ASN__ENCODE_FAILED;
|
|
||||||
er = INTEGER_encode_aper(td, constraints, &tmpint, po);
|
|
||||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
|
||||||
return er;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ASN_DISABLE_PER_SUPPORT */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* INTEGER specific human-readable output.
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
NativeInteger_print(const asn_TYPE_descriptor_t *td, const void *sptr,
|
|
||||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
const long *native = (const long *)sptr;
|
|
||||||
char scratch[32]; /* Enough for 64-bit int */
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
(void)td; /* Unused argument */
|
|
||||||
(void)ilevel; /* Unused argument */
|
|
||||||
|
|
||||||
if(native) {
|
|
||||||
long value = *native;
|
|
||||||
ret = snprintf(scratch, sizeof(scratch),
|
|
||||||
(specs && specs->field_unsigned) ? "%lu" : "%ld", value);
|
|
||||||
assert(ret > 0 && (size_t)ret < sizeof(scratch));
|
|
||||||
if(cb(scratch, ret, app_key) < 0) return -1;
|
|
||||||
if(specs && (value >= 0 || !specs->field_unsigned)) {
|
|
||||||
const asn_INTEGER_enum_map_t *el =
|
|
||||||
INTEGER_map_value2enum(specs, value);
|
|
||||||
if(el) {
|
|
||||||
if(cb(" (", 2, app_key) < 0) return -1;
|
|
||||||
if(cb(el->enum_name, el->enum_len, app_key) < 0) return -1;
|
|
||||||
if(cb(")", 1, app_key) < 0) return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr,
|
NativeInteger_free(const asn_TYPE_descriptor_t *td, void *ptr,
|
||||||
enum asn_struct_free_method method) {
|
enum asn_struct_free_method method) {
|
||||||
@@ -474,77 +145,3 @@ NativeInteger_compare(const asn_TYPE_descriptor_t *td, const void *aptr, const v
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
asn_random_fill_result_t
|
|
||||||
NativeInteger_random_fill(const asn_TYPE_descriptor_t *td, void **sptr,
|
|
||||||
const asn_encoding_constraints_t *constraints,
|
|
||||||
size_t max_length) {
|
|
||||||
const asn_INTEGER_specifics_t *specs =
|
|
||||||
(const asn_INTEGER_specifics_t *)td->specifics;
|
|
||||||
asn_random_fill_result_t result_ok = {ARFILL_OK, 1};
|
|
||||||
asn_random_fill_result_t result_failed = {ARFILL_FAILED, 0};
|
|
||||||
asn_random_fill_result_t result_skipped = {ARFILL_SKIPPED, 0};
|
|
||||||
long *st = *sptr;
|
|
||||||
const asn_INTEGER_enum_map_t *emap;
|
|
||||||
size_t emap_len;
|
|
||||||
intmax_t value;
|
|
||||||
int find_inside_map;
|
|
||||||
|
|
||||||
if(max_length == 0) return result_skipped;
|
|
||||||
|
|
||||||
if(st == NULL) {
|
|
||||||
st = (long *)CALLOC(1, sizeof(*st));
|
|
||||||
if(st == NULL) {
|
|
||||||
return result_failed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(specs) {
|
|
||||||
emap = specs->value2enum;
|
|
||||||
emap_len = specs->map_count;
|
|
||||||
if(specs->strict_enumeration) {
|
|
||||||
find_inside_map = emap_len > 0;
|
|
||||||
} else {
|
|
||||||
find_inside_map = emap_len ? asn_random_between(0, 1) : 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
emap = 0;
|
|
||||||
emap_len = 0;
|
|
||||||
find_inside_map = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(find_inside_map) {
|
|
||||||
assert(emap_len > 0);
|
|
||||||
value = emap[asn_random_between(0, emap_len - 1)].nat_value;
|
|
||||||
} else {
|
|
||||||
const asn_per_constraints_t *ct;
|
|
||||||
|
|
||||||
static const long variants[] = {
|
|
||||||
-65536, -65535, -65534, -32769, -32768, -32767, -16385, -16384,
|
|
||||||
-16383, -257, -256, -255, -254, -129, -128, -127,
|
|
||||||
-126, -1, 0, 1, 126, 127, 128, 129,
|
|
||||||
254, 255, 256, 257, 16383, 16384, 16385, 32767,
|
|
||||||
32768, 32769, 65534, 65535, 65536, 65537};
|
|
||||||
if(specs && specs->field_unsigned) {
|
|
||||||
assert(variants[18] == 0);
|
|
||||||
value = variants[asn_random_between(
|
|
||||||
18, sizeof(variants) / sizeof(variants[0]) - 1)];
|
|
||||||
} else {
|
|
||||||
value = variants[asn_random_between(
|
|
||||||
0, sizeof(variants) / sizeof(variants[0]) - 1)];
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!constraints) constraints = &td->encoding_constraints;
|
|
||||||
ct = constraints ? constraints->per_constraints : 0;
|
|
||||||
if(ct && (ct->value.flags & APC_CONSTRAINED)) {
|
|
||||||
if(value < ct->value.lower_bound || value > ct->value.upper_bound) {
|
|
||||||
value = asn_random_between(ct->value.lower_bound,
|
|
||||||
ct->value.upper_bound);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*sptr = st;
|
|
||||||
*st = value;
|
|
||||||
return result_ok;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,22 +22,43 @@ extern "C" {
|
|||||||
extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
|
extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
|
||||||
extern asn_TYPE_operation_t asn_OP_NativeInteger;
|
extern asn_TYPE_operation_t asn_OP_NativeInteger;
|
||||||
|
|
||||||
asn_struct_free_f NativeInteger_free;
|
asn_struct_free_f NativeInteger_free;
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_PRINT_SUPPORT)
|
||||||
asn_struct_print_f NativeInteger_print;
|
asn_struct_print_f NativeInteger_print;
|
||||||
|
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
|
||||||
|
|
||||||
asn_struct_compare_f NativeInteger_compare;
|
asn_struct_compare_f NativeInteger_compare;
|
||||||
|
|
||||||
|
#define NativeInteger_constraint asn_generic_no_constraint
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_BER_SUPPORT)
|
||||||
ber_type_decoder_f NativeInteger_decode_ber;
|
ber_type_decoder_f NativeInteger_decode_ber;
|
||||||
der_type_encoder_f NativeInteger_encode_der;
|
der_type_encoder_f NativeInteger_encode_der;
|
||||||
|
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_XER_SUPPORT)
|
||||||
xer_type_decoder_f NativeInteger_decode_xer;
|
xer_type_decoder_f NativeInteger_decode_xer;
|
||||||
xer_type_encoder_f NativeInteger_encode_xer;
|
xer_type_encoder_f NativeInteger_encode_xer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_OER_SUPPORT)
|
||||||
oer_type_decoder_f NativeInteger_decode_oer;
|
oer_type_decoder_f NativeInteger_decode_oer;
|
||||||
oer_type_encoder_f NativeInteger_encode_oer;
|
oer_type_encoder_f NativeInteger_encode_oer;
|
||||||
|
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
|
||||||
|
|
||||||
|
#if !defined(ASN_DISABLE_UPER_SUPPORT)
|
||||||
per_type_decoder_f NativeInteger_decode_uper;
|
per_type_decoder_f NativeInteger_decode_uper;
|
||||||
per_type_encoder_f NativeInteger_encode_uper;
|
per_type_encoder_f NativeInteger_encode_uper;
|
||||||
|
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
|
||||||
|
#if !defined(ASN_DISABLE_APER_SUPPORT)
|
||||||
per_type_decoder_f NativeInteger_decode_aper;
|
per_type_decoder_f NativeInteger_decode_aper;
|
||||||
per_type_encoder_f NativeInteger_encode_aper;
|
per_type_encoder_f NativeInteger_encode_aper;
|
||||||
asn_random_fill_f NativeInteger_random_fill;
|
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
|
||||||
|
|
||||||
#define NativeInteger_constraint asn_generic_no_constraint
|
#if !defined(ASN_DISABLE_RFILL_SUPPORT)
|
||||||
|
asn_random_fill_f NativeInteger_random_fill;
|
||||||
|
#endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
69
lib/asn1c/common/NativeInteger_aper.c
Normal file
69
lib/asn1c/common/NativeInteger_aper.c
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2017 Lev Walkin <vlm@lionet.info>.
|
||||||
|
* All rights reserved.
|
||||||
|
* Redistribution and modifications are permitted subject to BSD license.
|
||||||
|
*/
|
||||||
|
#include <asn_internal.h>
|
||||||
|
#include <NativeInteger.h>
|
||||||
|
|
||||||
|
asn_dec_rval_t
|
||||||
|
NativeInteger_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
|
||||||
|
const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
||||||
|
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_dec_rval_t rval;
|
||||||
|
long *native = (long *)*sptr;
|
||||||
|
INTEGER_t tmpint;
|
||||||
|
void *tmpintptr = &tmpint;
|
||||||
|
|
||||||
|
(void)opt_codec_ctx;
|
||||||
|
ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
|
||||||
|
|
||||||
|
if(!native) {
|
||||||
|
native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
|
||||||
|
if(!native) ASN__DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&tmpint, 0, sizeof tmpint);
|
||||||
|
rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
|
||||||
|
&tmpintptr, pd);
|
||||||
|
if(rval.code == RC_OK) {
|
||||||
|
if((specs&&specs->field_unsigned)
|
||||||
|
? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
|
||||||
|
: asn_INTEGER2long(&tmpint, native))
|
||||||
|
rval.code = RC_FAIL;
|
||||||
|
else
|
||||||
|
ASN_DEBUG("NativeInteger %s got value %ld",
|
||||||
|
td->name, *native);
|
||||||
|
}
|
||||||
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
|
asn_enc_rval_t
|
||||||
|
NativeInteger_encode_aper(const asn_TYPE_descriptor_t *td,
|
||||||
|
const asn_per_constraints_t *constraints,
|
||||||
|
const void *sptr, asn_per_outp_t *po) {
|
||||||
|
|
||||||
|
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t *)td->specifics;
|
||||||
|
asn_enc_rval_t er = {0,0,0};
|
||||||
|
long native;
|
||||||
|
INTEGER_t tmpint;
|
||||||
|
|
||||||
|
if(!sptr) ASN__ENCODE_FAILED;
|
||||||
|
|
||||||
|
native = *(const long *)sptr;
|
||||||
|
|
||||||
|
ASN_DEBUG("Encoding NativeInteger %s %ld (APER)", td->name, native);
|
||||||
|
|
||||||
|
memset(&tmpint, 0, sizeof(tmpint));
|
||||||
|
if((specs&&specs->field_unsigned)
|
||||||
|
? asn_ulong2INTEGER(&tmpint, (unsigned long)native)
|
||||||
|
: asn_long2INTEGER(&tmpint, native))
|
||||||
|
ASN__ENCODE_FAILED;
|
||||||
|
er = INTEGER_encode_aper(td, constraints, &tmpint, po);
|
||||||
|
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
|
||||||
|
return er;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user