Compare commits

...

184 Commits

Author SHA1 Message Date
Sukchan Lee 53d75e74cb Added Release Notes for v2.4.10 2022-09-09 10:32:40 +09:00
Sukchan Lee a0b7865a43 Release v2.4.10 2022-09-09 09:40:50 +09:00
Sukchan Lee 1f165c1c33 Follow-up on #1747 2022-09-08 23:17:04 +09:00
Bostjan Meglic 31a3788021 [AMF] Handle APN/DNN names as case-insensitive
In case that APN name sent from UE does not case-match with the one
configured in the database, AMF would reject the registration with the
message:

[gmm] WARNING: [imsi-xxx] DNN Not Supported OR Not Subscribed in the
Slice (../src/amf/gmm-handler.c:1051)
2022-09-08 23:13:47 +09:00
Sukchan Lee f54bccacf5 Support service-based NF subscription 2022-09-08 22:12:01 +09:00
Bostjan Meglic 87cd34d300 Minor typo fix 2022-09-07 18:01:21 +09:00
jmasterfunk84 eb55e4ee3a Also format for pcc_rule. UE and SMF look okay as medium_data as first section. 2022-09-07 17:58:32 +09:00
jmasterfunk84 36254e5df4 When using longer APN name, it is obscured due to short field. 2022-09-07 17:58:32 +09:00
Bostjan Meglic 51669d73a0
[AMF] Accept Deregistration Notification from UDM only for registered UE (#1737)
Add additional check when receiving Deregistration Notification from
UDM. UE should already be in registered state before accepting the
request and deregistering the UE.

Also add additional check that PCF association policy exists before
sending a delete request to PCF.
2022-09-06 19:47:42 +09:00
EugeneBogush e55d4d8300 removing extra lines
I did not find the purpose of their use
2022-09-05 23:35:18 +09:00
Sukchan Lee c716a1294a [CORE] Check if timer is double free in SBI module 2022-09-03 15:59:39 +09:00
Sukchan Lee acc36a344f [PCF] Check NF service configuration
* npcf-smpolicycontrol - enabled or disabled
* npcf-policyauthorization - enabled or disabled

Only one of npcf-smpolicycontrol and npcf-policyauthorization cannot be enabled. (../src/pcf/sbi-path.c:151)

They can be enabled or disabled together.
2022-09-03 13:07:00 +09:00
Bostjan Meglic 9c84570a48 [SBI] Send NF discovery query with service-names delimited with comma
OpenAPI specification for sending NF discovery query with
"service-names" parameter is defined as folowing:

- name: service-names
  ...
  style: form
  explode: false

According to OpenAPI specification, this means array items
should be delimited with a comma character (example: /users?id=3,4,5).
2022-09-03 10:43:59 +09:00
Sukchan Lee d87d61e851 Follow-up on #1729 2022-09-03 09:20:48 +09:00
mitmitmitm af1f8d4f4a [SMF] Handle upCnxState=ACTIVATING by replying with 200 instead of 204
According to TS 29.502 5.2.2.3.2.2., we should reply with a 200 response
including the upCnxState attribute.
2022-09-03 09:08:27 +09:00
Sukchan Lee c28faf00ea Added simple test program
./tests/registration/registration simple-test
./tests/vonr/vonr simple-test
./tests/attach/attach simple-test
./tests/volte/volte simple-test
2022-09-03 07:28:48 +09:00
Sukchan Lee fcb15b69f7 [MME] Fixed buffer overflow (#1728) 2022-09-02 23:39:59 +09:00
Sukchan Lee 1d17e68c56 [ALL] Removing trailing whitespace and tab 2022-09-02 23:38:39 +09:00
Sukchan Lee 5295c108ad Added Service-based NF discovery
== Known limitation ==
Placing npcf-smpolicycontrol and pcf-policyauthorization
in different NFs is not supported. Both npcf-smpolicycontrol
and pcf-policyauthorization should be placed in the same NF.
2022-09-02 23:04:57 +09:00
Alexander Couzens b175394839 [SMF] fixup send 3GPP-Charging-Characteristics on Gx if received on S5/8c
- Gy instead of Gx AVP was used.
- Use correct avp position and avp variables.

Fixes: 657eef9169 ("[SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c")
2022-08-31 06:38:08 +09:00
Sukchan Lee c7830a78e6 [Conf] Changed MTU size from 1500 to 1400 2022-08-28 23:10:36 +09:00
Sukchan Lee eab29fad9a Follow up on #1715
* Changed <TAB> to <SPACE>*4

* Changed snprintf to ogs_snprintf
2022-08-27 18:43:34 +09:00
Alexander Couzens 657eef9169 [SMF] send 3GPP-Charging-Characteristics on Gx if received on S5/8c
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and forwarded by the MME towards the SMF.
2022-08-27 18:36:54 +09:00
Alexander Couzens 41e4460769 diameter: Gx: add AVP 3GPP-Charging-Characteristics
The 3GPP-Charging-Characteristics is an operator specific AVP
(optional). The 3GPP-Charging-Characteristics can be filled by the HSS
and pass through to the Gx interface.

See ETSI 29.212 5.4.0.1 for further details.
2022-08-27 18:36:54 +09:00
Sukchan Lee 9f98d421a0 [SBI] Added config for service-names discovery 2022-08-27 10:49:07 +09:00
Sukchan Lee f020732ce9 [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
Bostjan Meglic e79e35dd74
[metrics] Fix double-free on application exit (#1717) 2022-08-26 18:15:32 +09:00
Sukchan Lee 9b10d70c77 [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
Sukchan Lee 83a20b82c7 Follow up on #1714
* Changed sprintf to ogs_snprintf

* Limited to 80 column
2022-08-25 16:35:27 +09:00
jmasterfunk84 49349cdb75
[MME] Dictionary Updates and IDR Support (#1714)
* Add Diameter Dictionary Elements

* Initial IDR Framework

* Resolve Compile Issues

* Moving Closer

* Compile error

* Somewhat Working stuffing Code

* Add Timestamp Changes

* Cleanup some of this code.  mme_s6a_handle_idr in s6a-handler.c removed for now, since it will only come in handy when IDR flag is set to request current location, which would involve breaking out into paging.  I think there's a few other things we can do just within fd-path first.

* further removal of mme_s6a_handle_idr
2022-08-25 15:43:21 +09:00
Bostjan Meglic def99aff7f [SMF] Fix abort on app exit when no Diameter configuration
In case that SMF was configured to run without Diameter, it would crash
on application exit due to uninitialized variables/pointers.

ERROR  pid:unnamed in fd_sess_handler_destroy@sessions.c:324: ERROR: Invalid parameter '(handler && ( ((*handler) != ((void *)0)) && ( ((struct session_handler *)(*handler))->eyec == 0x53554AD1) ))', 22
[smf] FATAL: smf_gx_final: Assertion `ret == 0' failed. (../src/smf/gx-path.c:1353)
2022-08-24 01:39:24 +09:00
Sukchan Lee 242b138597 [MME] UE-initiated detach removes S1 only (#1698) 2022-08-20 01:08:20 +09:00
Sukchan Lee 9bb9a4cae9 [MME] Detach removed MME-UE context (#1698) 2022-08-20 00:17:55 +09:00
Sukchan Lee 321c8d4cf9 [SGsAP] Changed message if Paging failed (#1701)
The problem occurred in the following scenario:

1. VLR sent PAGING-REQUEST to the MME
2. MME sent S1-Paging to the UE
3. Paging failed
4. MME responded SERVICE-REQUEST to the VLR
5. VLR sent DOWNLINK-UNITDATA to the MME
6. Even though there is no S1 Context,
   MME try to sent DownlinkNASTransport message to the UE.
7. So, the problem occurred.

I've changed the number 4 PAGING-REJECT instead of SERVICE-REQUEST.
2022-08-19 18:58:55 +09:00
Sukchan Lee 909f407c20 [MME] Fixed GTP transaction crash (#1696) 2022-08-19 17:23:10 +09:00
Sukchan Lee a9694d6474 [MME] Follow-up Cancel Location Handling (#1698) 2022-08-19 16:52:39 +09:00
jmasterfunk84 c98333bbfe
[MME] Cancel Location Handling (#1698)
* CLR while idle is broken after 7031856cd7

Cancel Location Request arriving while UE is idle will not proceed to paging due to this check for S1 connection.  Using new flag "isAnswer" to bypass this check to allow paging to occur when we are not doing a AIA/ULA related procedure.

* No Context Setup is required when sending the detach request.  If the paging was due to wanting to send a Detach Request to the UE, then we fast track to sending the detach request.

* emm-sm.c:
In the case of MME initiated detach while UE is idle, there is no initial conext setup.  We go right from the service request after paging into sending the detach request.  TS23.401

mme-path.c:
Using nas_eps.type in the case of MME Initiated Detach while UE is idle does not work.  nas_eps.type would represent the service request.

mme-s11-handler.c:
After S11 action, no action should be taken.  We want to wait for the detach accept from the UE before proceeding with the S1 release (detach).

* InitialContextSetup should occur for detach.
2022-08-19 16:44:06 +09:00
Sukchan Lee 444e182288 [PFCP] security vulnerability continued in d99491a 2022-08-16 20:32:42 +09:00
Sukchan Lee dbf6971dcf [DOCS] Updated if subscribers changed [#1694] 2022-08-14 15:36:41 +09:00
Sukchan Lee c835556623 Fixed Defects reported by Coverity Scan 2022-08-13 23:49:55 +09:00
Sukchan Lee dbb52592d8 Removed duplicated document link 2022-08-13 17:45:39 +09:00
Sukchan Lee 291b63f41a Update docs @s5uishida 2022-08-13 10:17:38 +09:00
Sukchan Lee f78f042d75 Update docs @nickvsnetworking and @@s5uishida 2022-08-13 09:44:23 +09:00
herlesupreeth 7162684486 [SMF]: Update stored PCO IE requested over Gn in SMF context
As per 3GPP TS 29.060 version 15.3.0, section 7.3.3, 7.3.4, 7.3.5 and 7.3.6

Only if PCO IE is included in Update/Delete PDP Context Request then it
must be present in Update/Delete PDP Context Response.

In order to reflect on whether the request contained PCO IE or not
the SMF context containing the GTP request needs to be updated
i.e. update if present else clear the contents
2022-08-13 09:30:28 +09:00
herlesupreeth 16ea972937 [SMF]: Update stored PCO IE requested in GTPv2 over S5c in SMF context
As per 3GPP TS 29.274 version 10.5.0, section 7.2.9 and 7.2.10,
Only if PCO IE is included in Delete Session Request then it
must be present in Delete Session Response.

In order to reflect on whether the request contained PCO IE or not
the SMF context containing the GTP request needs to be updated
i.e. update if present else clear the contents
2022-08-13 09:30:28 +09:00
Sukchan Lee 603a746f49 Lower Linux version cannot change HTTP2 max stream
CURLMOPT_MAX_CONCURRENT_STREAMS can be supported as of curl 7.67.0
2022-08-12 17:11:23 +09:00
Sukchan Lee d99491aca5 [PFCP] Fixed security protection
Check the length to prevent buffer overflow attacks.
2022-08-12 15:38:40 +09:00
Sukchan Lee e6a14cb73d Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
Sukchan Lee ec9fe7b31d [SBI] CLIENT max concurrent streams to 16384 2022-08-10 12:31:50 +09:00
Sukchan Lee db37bc8944 [SBI] Increased the max stream number 2022-08-10 11:03:10 +09:00
Sukchan Lee 4cb657c804 [MME] Changed CauseNas_detach in DETACH (#1676) 2022-08-06 14:00:54 +09:00
Sukchan Lee da20b2d035 [GTP] gtp_peer override the pool size of GTP node 2022-08-06 13:54:05 +09:00
Sukchan Lee 700c71ef4c Changed configuration name from gnb to peer
And restored gtp_peer configuration
2022-08-05 16:56:36 +09:00
Sukchan Lee f772bf3a62 [PFCP] Revert Changes 5e18b2b and d21e9aa
To protect malicious or buggy, we need to check that session context is NULL.
2022-08-04 09:55:17 +09:00
Sukchan Lee cca3027e90 [NRF] Fixed the nfInstanceUri (#1683) 2022-08-03 17:32:15 +09:00
Sukchan Lee e88c43e8df [Diameter] Fixed Coding convention (#1680) 2022-08-03 14:34:21 +09:00
jmasterfunk84 415e5276ba [MME+HSS] AVP Occurring Too Many Times
Do not Set Origin-Hosts with fd_msg_rescode_set before potential use of ogs_diam_message_experimental_rescode_set.  This results in multiple Origin-Host/Realm AVPs.
2022-08-03 14:32:57 +09:00
Sukchan Lee d21e9aa5e0 [PFCP] Revert Changes 5e18b2b 2022-08-03 14:13:35 +09:00
Sukchan Lee 7231dafbf1 [SBI] Fixed nf_instance memory leak
- Rollback commit ed3444eef5
- Do not modify reference count when REGISTER/DEREGISTER notified from NRF
2022-08-02 09:44:13 +09:00
Sukchan Lee 7031856cd7 [MME] Changed S1AP_Cause in S1AP Release (#1676)
S1AP_CauseNas_detach -> S1AP_CauseNas_normal_release
2022-07-31 12:38:11 +09:00
Sukchan Lee 5524dc5e29 Refact paging module (#1676) 2022-07-30 14:44:34 +09:00
jmasterfunk84 47cbaca149 [MME] Introduce support for S6a Cancel Location Request
- Added diameter dictionary definitions for Cancel Location
- Cancel Location will completely remove UE from MME, allow for a fresh IMSI attach to occur on next attempt.
- T3422 is used for detach request.
- Added new handling for s6a events in mme-sm, as not all s6a messages are at attach now.  Maybe there's something in a state machine I should've been using here instead of a new flag?

- Testing was completed with UE in idle and connected.  With CLR flags indicating re-attach required and without.  Also sending CLR after UE detach.  And then sending again when mme_ue is empty.
2022-07-30 14:37:43 +09:00
Sukchan Lee ff5023e95b Release v2.4.9 2022-07-25 21:50:06 +09:00
Sukchan Lee 9b762158a6 Refine code of discovery option param (#1671) 2022-07-24 19:47:04 +09:00
Sukchan Lee 4e8492e878 Oops! Warning removed! 2022-07-24 15:15:06 +09:00
Sukchan Lee a5010a61ef Support Discovery Optional Parameter (#1671)
To support target-nf-instance-id in the discovery,
Discovery optional parameter is implemeted
2022-07-24 15:10:09 +09:00
jmasterfunk84 eb03704015 Moving handling of assigning sub level cc into the pdn to s11. 2022-07-24 12:29:01 +09:00
jmasterfunk84 68140efce4 [MME] Handle Charging Characteristics
Found no support for HSS provided charging characteristics.  Following TS32.251 A.4:
- Use PDN level CC, if one wasn't provided then use subscription level CC
- Don't send CC in S11 if it wasn't included
2022-07-24 12:29:01 +09:00
jmasterfunk84 d2ef555ce4 Set default Network-Access-Mode to 0
For HSS's which do not include the NAM, the MME should not treat this as a fatal error.  MME should just assume PACKET_AND_CIRCUIT (0), as was decided in a previous PR.
2022-07-23 00:26:55 +09:00
Bostjan Meglic 7e6568d800 [SMF] Send PDU Session Establish Accept to serving AMF
In case there are multiple AMF registered to NRF, SMF would pick only
the first AMF from the list.
In the case of sending PDU Session Establishment Accept from SMF to
AMF, this would mean a high chance of failure since the AMF might
be different than the original requester, and would not know about a
particular UE.

Modify SMF to use ServingNfId field from original request
SmContextCreateData from AMF to determine to which AMF should it send
PDU Session Establishment Accept message.
2022-07-22 12:24:26 +09:00
Bostjan Meglic 9a958d7af8 [SBI] Add function to request NF Instance from NRF by providing it's Instance Id 2022-07-22 12:24:26 +09:00
Bostjan Meglic 83b28b5649 [tests] Fix running unit tests inside docker environment
The issue was introduced with the commit, which builds Open5GS from
local sources instead of downloading them each time from Github.

Fixes: d2cbcf711 ("[build] Use local sources to build applications (#1583)")
2022-07-21 21:07:35 +09:00
Sukchan Lee eb50d64271 Add more protection code for (#1652) 2022-07-21 17:13:32 +09:00
Sukchan Lee 9aa5559c5f Refactor for the UERANSIM 500 test (#1652) 2022-07-21 12:41:19 +09:00
Sukchan Lee f35afa2ff7 Add missing pkbuf_free() (#1652) 2022-07-21 01:00:44 +09:00
Sukchan Lee 776103698d Oops! Redundant code is removed (#1652) 2022-07-21 00:35:08 +09:00
Sukchan Lee 2b41a215d7 Fixed the crash in UERANSIM 500 test (#1652) 2022-07-21 00:02:31 +09:00
Sukchan Lee da1905b36c fixed the memory leak in test program 2022-07-20 12:08:17 +09:00
Sukchan Lee fb95f1ff71 Fixed ASSERT when context has already been removed 2022-07-19 19:42:24 +09:00
Sukchan Lee 668cc59f94 [AMF] Fixed 5GMM cause in Reject message (#1660)
When a UE that requests slices tries to connect and there are no slices configured, the reject message is:

5GMM cause = 0x7 (5GS Services not allowed)

however it should be:

5GMM cause = 0x3e (No network slices available)

All 5GMM cause value in reject message is reviewed in this commit
2022-07-19 12:42:02 +09:00
Sukchan Lee 3885cb20d9 [asn1c] rework aper from mouse07410/asn1c#94
Merge @pespin the following work
- mouse07410/asn1c#93
- mouse07410/asn1c#100
2022-07-16 14:30:00 +09:00
Sukchan Lee 5e18b2bd13 [SCP] Support of Indirect Communication 2022-07-16 13:27:18 +09:00
Sukchan Lee 1518a4f334 [CORE] Increased memory pool for poll (#1652) 2022-07-13 16:54:55 +09:00
Sukchan Lee 80ee4c8aa8 [SBI] incrased session pool of server (#1652) 2022-07-12 17:31:36 +09:00
Bostjan Meglic aa3cded11a [AMF] Handle namf-callback DeregNotify message from UDM
UDM may send a Deregistration Notification to AMF, to deregister
specific UE from the network - Network-Initiated Deregistration.
Deregistration procedure includes sending Deregistration Request to UE,
starting a timer T3522, releasing PDU sessions from SMF, releasing PCF
policies from PCF, and waiting for Deregistration Accept from UE.

Not yet implemented is:
- to prevent deregistration of UE in case it has any emergency sessions,
- page UE when UE is in IDLE mode.
2022-07-11 22:53:21 +09:00
Bostjan Meglic 0633774972 [SBI] Add support for DeregistrationData in SBI messages 2022-07-11 22:53:21 +09:00
Bostjan Meglic d1a2971990 [NAS] modify library to include both directions of deregistration requests
Definitions in NAS library now include both directions of deregistration
requests/accepts - from UE and from network.
2022-07-11 22:53:21 +09:00
Bostjan Meglic babc30940a [AMF] Do not send Deregistration Event to UDM when UE deregisters
According to TS 23.502, 4.2.2.2.2, AMF sends Registration event to UDM
in the following cases:
- If the AMF has changed since the last Registration procedure, or
- if the UE provides a SUPI which doesn't refer to a valid context in
the AMF,
- or if the UE registers to the same AMF it has already registered
to a non- 3GPP access (i.e. the UE is registered over a non-3GPP access
and initiates this Registration procedure to add a 3GPP access).

In case that UE re-registers to the network with a GUTI, it bypasses
authentication check to the AUSF. In this case, AMF does not send
Registration event to UDM.
Consequently, when UE deregisters again, AMF would send a Deregistration
Event to a UDM, which does not have a context for it.

3GPP standard does not say when AMF sends Deregistration Event to UDM,
only that it is optional.

These (De-)Registration events are for (de-)registering AMF to the UDM
for serving the UE. And not for (de-)registering UE itself for purpose
of tracking when UE is registered on the network.

This partially reverts commit 7be7029ac4
2022-07-11 22:44:07 +09:00
Sukchan Lee fce0eb4800 [SBI] fixed wrong request-nf-type (#1650) 2022-07-08 21:36:52 +09:00
Oliver Smith fe11ee161c d/open5gs-upf.postinst: don't restart service in chroot
Don't attempt to restart systemd-networkd if systemd is not running
(e.g. installing open5gs inside a chroot).

Fix for:
  System has not been booted with systemd as init system (PID 1). Can't operate.
  Failed to connect to bus: Host is down
  dpkg: error processing package open5gs-upf:amd64 (--configure):
   installed open5gs-upf:amd64 package post-installation script subprocess returned error exit status 1
2022-07-05 10:22:36 +09:00
Sukchan Lee eabe8dfec5 [PFCP] Added UE IP address in the EPC (#1642) 2022-07-04 17:37:00 +09:00
Networkmama 29525b21a4 [SMF] copy UE ip address to uplink PDR rules.
This helps UPF to add ACL based on src ip

Signed-off-by: Networkmama <networkmama12@gmail.com>
2022-07-04 17:34:40 +09:00
Sukchan Lee af4021bff4 [PFCP] Fixed a endianness Apply Action (#1640) 2022-07-04 17:30:19 +09:00
Sukchan Lee 318fc25535 [CORE] Added memory check (#1638) 2022-07-01 21:49:31 +09:00
Bostjan Meglic 6adf541346 [CORE] Fix detection of a failed memory allocation 2022-07-01 21:38:47 +09:00
Bostjan Meglic ab11220dcc [ALL] Fix differences in function parameter names between definition and declaration 2022-07-01 21:38:47 +09:00
Bostjan Meglic 114f783d06 [MISC] Add support for static code analysis
Static code analysis can be executed with following commands:
  meson build
  ninja -C build analyze-cppcheck
  ninja -C build analyze-clang-tidy

These commands are available only if additional tools are installed:
  - cppcheck
  - clang-tidy
  - clang-tools is optional if you want to paralelize the clang-tidy

In case of cppcheck analysis, a file called build/cppchecklog.log is
created with the analysis results.

In case of clang-tidy analysis, some checks are disabled. See file
.clang-tidy, and reenable them if you see fit.
Also it does not scan all the files in the project, since some of them
are imported from other sources. It does not scan any sources under:
  - subprojects/
  - lib/asn1c/
  - lib/ipfw/
2022-07-01 21:38:47 +09:00
Sukchan Lee 50be661cf9 Fixed a crash when slice/session overflow (#1637) 2022-06-30 13:33:16 +09:00
Sukchan Lee ad159d1755 [GTP] Refine error code path without assertion
Refer to #1635, #1620, #1606, #1594
2022-06-30 10:53:19 +09:00
Sukchan Lee b1d982a1ee [PFCP] Refine error code path without assertion
Refer to #1635, #1620
2022-06-30 10:35:03 +09:00
Sukchan Lee 0be5e765c8 Revert "[SGWC] pfcp: Retrieve sess when SEID=0 (#1620)"
This reverts commit 9700563023.
2022-06-30 09:11:38 +09:00
Sukchan Lee 6332f10593 Revert "[GTP] context when TEID=0 (#1620, #1606, #1594)"
This reverts commit 0d61f7a7f9.
2022-06-30 09:11:31 +09:00
Sukchan Lee 051c19b7c8 Changes MAX TLV MORE to 16
OGS_MAX_NUM_OF_PDR is 16, but OGS_TLV_MAX_MORE is 8.
To match the size of two macros, increased OGS_TLV_MAX_MORE to 16.
2022-06-29 14:35:01 +09:00
Pau Espin b5956e5596
[UPF] N4: Remove unnecessary assert (#1634) 2022-06-29 11:10:43 +09:00
Sukchan Lee 52d5c61794 [GTP] avoid abort for ogs_gtp_node_new() (#1633) 2022-06-29 11:07:44 +09:00
Pau Espin c5a545039f
[GTP] Avoid abort if ogs_gtp_node_new() returns NULL (#1633)
* [GTP] Avoid abort if ogs_gtp_node_new() returns NULL

* [SGWC] Avoid abort if ogs_gtp_node_add_by_addr() returns NULL
2022-06-29 10:28:18 +09:00
Sukchan Lee 2dd577f88c [SCTP] Add protection code jumbo frame (#1632) 2022-06-28 16:58:15 +09:00
Sukchan Lee 0d61f7a7f9 [GTP] context when TEID=0 (#1620, #1606, #1594) 2022-06-28 15:32:14 +09:00
Sukchan Lee 9700563023 [SGWC] pfcp: Retrieve sess when SEID=0 (#1620) 2022-06-28 13:20:46 +09:00
Pau Espin 5eaf66262a
[SMF] pfcp: Retrieve sess when response with SEID=0 is received (#1620)
3GPP TS 29.244 7.2.2.4.2 documents that the peer will set SEID=0 in the
response when we request something for a session not existing at the peer.
If that's the case, we still want to locate the local session which
originated the request, so let's store the local SEID in the xact when
submitting the message, so that we can retrieve the related SEID and
find the session if we receive SEID=0.
2022-06-28 11:19:57 +09:00
Pau Espin a3593c6890
[SMF] Gn: QoS Profile and PCO IE improvements (#1631) 2022-06-27 21:51:14 +09:00
Sukchan Lee 8fe2e506c0 [PFCP] Added Network Instance to CP-UP FAR (#1630) 2022-06-25 07:56:28 +09:00
Sukchan Lee df68b231b8 [PFCP] Added DNN/APN in FAR (#1629, #1630) 2022-06-24 20:30:40 +09:00
Sukchan Lee f4eddf91b5 Set v4/v6 flags in local F-TEID (#1625) 2022-06-24 15:16:54 +09:00
Networkmama 99fd6c449a
[SMF] Set v4/6 flag in F-TEID IE request type (#1625)
Signed-off-by: Networkmama <networkmama12@gmail.com>
2022-06-24 15:11:16 +09:00
Pau Espin 7762da6992
[SMF] pfcp-sm: Fix ogs_fsm_dispatch() on NULL sess (#1628)
It was spotted that if DeleteSessionReq sent by SMF is answered by UPF
with cause="Session context not found", then it contains SEID=0 (this is
correct as per specs). Hence, since SEID=0 session is not looked up, so
sess=NULL.

A follow up commit improves the situation by looking up the SEID in the
originating request message in that case.
2022-06-23 23:38:52 +09:00
Pau Espin bfe214aafa
[UPF] Avoid crash if no default subnet configured (#1624)
In that case, ogs_pfcp_ue_ip_alloc() will fail with  the error message
"CHECK CONFIGURATION: Cannot find subnet [...]" and the assert will make
upf crash.
That's not desirable, let's keep it running and simply reject the
request. The error log is big enoguh to find out.
2022-06-23 22:04:01 +09:00
Pau Espin 96d689a402
[SGWC,SMF] Add specific config opt max.gtp_peer to set gtp_node mempool size (#1623)
This is needed specially for SMFs handling a pool of SGWs.
2022-06-23 22:03:48 +09:00
Pau Espin 3501cb0a5b
[SMF] track and fix scenario where gtp node mempool becomes full (#1622)
* [SMF] Avoid abort() if gtp_node mempool becomes full

Related: https://github.com/open5gs/open5gs/issues/1621

* [SMF] metrics: Add new ctr tracking gtp_node allocation failures

This metrics is useful to track whether at some point the mempool went
full, so that config needs to be updated to increase the mempool size.
2022-06-23 22:03:34 +09:00
Sukchan Lee b58ebda556 Change Default MCC/MNC 901/70 -> 999/70 (#1331) 2022-06-23 21:37:47 +09:00
Pau Espin 20d3dc0167
[CORE] fsm: Add asserts to validate ogs_fsm_t is not null (#1619) 2022-06-23 20:48:06 +09:00
Bostjan Meglic c9598fb9c6
[SBI] Fix memory leak for nghttp2 session (#1618)
Delete nghttp2 session to prevent memory leaks.
The issue was detected using valgrind.
2022-06-23 20:43:36 +09:00
Pau Espin 13421119c3
[SMF] Gy: Send Multiple-Services-Indicator AVP only during Initial CCR (#1616)
Gy (3GPP TS 32.299 ) refers to AVP in DCCA (RFC4006).

RFC4006 5.1.2:
"[...] by including the Multiple-Services-Indicator AVP in the first
interrogation."

Nokia's infocenter documentation also states it's sent during Initial CCR
only: "(CCR-I only)".
2022-06-21 23:56:56 +09:00
Sukchan Lee 50cfb5f3ac Initialize pgw_s5u_teid (#1559) 2022-06-20 22:36:51 +09:00
Bostjan Meglic d2cbcf7118
[build] Use local sources to build applications (#1583)
"build" Docker image previously downloaded latest version of Open5GS
from github, and built the project from that.
Use local source files for building instead.
2022-06-19 18:18:09 +09:00
Sukchan Lee 0f93ec23ab [MME/AMF] Fixed network name encoding (#1614) 2022-06-19 18:16:11 +09:00
Sukchan Lee c528e0d5bc [SBI] Change NfInstance.Id to Optional 2022-06-18 23:56:12 +09:00
JagannathS 0313910ac6
Added show commands in the dbctl (#1613) 2022-06-17 06:27:24 +09:00
Bostjan Meglic 361c3b7387
[SBI] Fix invalid read beyond allocated memory (#1610)
Valgrind memcheck tool reports an error, of invalid read beyond the
allocated memory.

Function "write_cb()" already allocates (realloc) +1 byte and
null-terminates the data. But the length "conn->size" does not contain
this extra null-terminated byte.
When a copy of the received data is made in "check_multi_info()", it
does not include the null character, resulting in potentially a
non-null terminated string.
Later on when parsing the data, "strlen()" will read beyond the
allocated memory to search for the null character, resulting in an
invalid read.

==1994== Invalid read of size 1
==1994==    at 0x484ED24: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1994==    by 0x4D3F401: cJSON_ParseWithOpts (cJSON.c:1109)
==1994==    by 0x4D3F65C: cJSON_Parse (cJSON.c:1197)
==1994==    by 0x4C927DE: parse_json (message.c:913)
==1994==    by 0x4C972D8: parse_content (message.c:1790)
==1994==    by 0x4C90096: ogs_sbi_parse_response (message.c:589)
==1994==    by 0x136431: amf_state_operational (amf-sm.c:248)
...
==1994==  Address 0x668371d is 0 bytes after a block of size 253 alloc'd
==1994==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1994==    by 0x5107D7F: ??? (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.3.3)
==1994==    by 0x510814B: _talloc_memdup (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.3.3)
==1994==    by 0x4871568: ogs_talloc_memdup (ogs-strings.c:184)
==1994==    by 0x4CA7755: check_multi_info (client.c:475)
...
2022-06-15 22:32:23 +09:00
jmasterfunk84 59a457fa40
Update mme-sm.c (#1609) 2022-06-15 06:13:49 +09:00
Pau Espin 038d383584
[CORE] Compare port in ogs_sockaddr_is_equal() (#1608) 2022-06-15 06:13:15 +09:00
Bostjan Meglic 7be7029ac4
Send deregistration event from AMF to UDM (#1599)
* [SBI] Fix converting PatchItem to JSON

* [UDR] Add support for endpoint for patching subscription data

Add support for PATCH HTTP method for the following endpoint:
/subscription-data/{ueId}/context-data/amf-3gpp-access

Currently does not change any data in the database.

* [UDM] Add support for endpoint for patching subscription data

Add support for the following endpoint, HTTP PATCH method:
/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access

The endpoint is used when UE deregisters from the core, and AMF
sends a subscription modification request with "purgeFlag" set.

* [UDM] Add check for same GUAMI when patching subscription data

* [AMF] Send deregistration event to UDM

When UE sends deregistration request, AMF needs to send a
Nudm_UECM_Deregistration request to UDM.
The order of requests is now the following:
- send PDU session release to SMF
- send deregistration event to UDM
- send AM policy control release to PCF
2022-06-14 23:44:02 +09:00
Pau Espin 720b4d3c4c
[SMF] Gn: Drop already implemented TODO (#1604) 2022-06-13 23:58:39 +09:00
Pau Espin 4d9112870c
configs: use proper default IP address for metrics server (#1603)
* configs: use proper default IP address for metrics server

Let's use the IP address assigned to each process by default when
configuring the HTTP Prometheus server. Otherwise having several
processes listening on 0.0.0.0 cause collisions.

* configs: mme.yaml: Fix trailing whitespace
2022-06-13 23:13:58 +09:00
Safa Orhan 58a9d31fd8
Apply action ie (#1601) 2022-06-13 19:51:40 +09:00
Safa Orhan 0a3746c24d
PR open5gs#1581 (#1600) 2022-06-13 19:44:36 +09:00
Sukchan Lee 1daac541cf Oops! removed one time in the document 2022-06-12 17:18:03 +09:00
Sukchan Lee 9087a480a8 Update document for v2.4.8 2022-06-12 17:06:36 +09:00
Sukchan Lee 9d43646816 Release v2.4.8 2022-06-12 16:29:24 +09:00
Sukchan Lee 240c10888d [GTP] Fixed bugs if gNB changed (#1515, #1586) 2022-06-12 15:54:27 +09:00
Sukchan Lee 9c3b7dfe4b Added RRCEstablishmentCause to Test-Msg Param 2022-06-12 14:32:53 +09:00
Sukchan Lee 2aa40ca8c8 [PFCP] Added Data Status IE (#1582) 2022-06-12 09:02:59 +09:00
Sukchan Lee 12353178fb Upgrade PFCP to v16.9.1 (#1581) 2022-06-11 23:51:00 +09:00
Sukchan Lee b98c2c13f6 [SUCI] Handling exceptions for invalid RI (#1570)
If Routing Indicator is wrong, we forcely set to '0'.
2022-06-10 23:19:00 +09:00
Sukchan Lee 9d94b33c7b meson: Rollback libmicrohttpd >= 0.9.40
Ubuntu 18.04 (bionic) should continue to be supported until April 2023.
So I modified mhd_server to support older versions of libmicrohttpd.
2022-06-10 21:35:37 +09:00
Sukchan Lee 6c5a8a135a Reorder smf_gtp_node objects free (#1593)
smf_gtp_node_pool were properly freed.

However, the seqence was wrong, so we got a warning message.

To solve this problem, I've moved smf_gtp_node_alloc/free
from gtp_path.[ch] to context.[ch]
2022-06-10 21:08:15 +09:00
Pau Espin b116630fe8
meson: Depend explicitly on libmicrohttpd >=0.9.61 (#1595)
Recent commit re-enabling SBI HTTP/1.1 support
(10bdf39505cf525b95886c140b3c2e82e7427d29) started using libmicrohttpd's
API MHD_create_response_from_buffer_with_free_callback(), which is only
available starting from v0.9.61.
As a result, compilation in xUbuntu 18.04 started failing with errors
about the function not being found, since it ships with libmicrohttpd
v0.9.59.
Depending on 0.9.61 is fine since it's quite old (november 2018) and all
major current distros should for sure have an >= one. Let's simply bump
the version check so that it fails in an informative manner.
2022-06-10 20:53:55 +09:00
Pau Espin 28089e2b59
[SMF] Fix smf_gtp_node objects not freed during shutdown (#1593) 2022-06-10 00:06:13 +09:00
Sukchan Lee b1e7477904 [CORE] Improve logging error in PFCP (#1591) 2022-06-09 23:36:33 +09:00
Pau Espin 5238771295
[CORE] Improve logging error in ogs_gtp_sendto() (#1591) 2022-06-09 23:32:11 +09:00
Carlos Giraldo cfe21c61da
Structure AMF and MME metrics code similar to SMF (#1590)
* AMF metrics initial support

* MME metrics initial support

* set amf/mme metrics.[c|h] similar to smf
2022-06-09 21:39:03 +09:00
Sukchan Lee 0b97954208 Re-added to handle an exceptional case (#1589) 2022-06-09 21:35:59 +09:00
Bostjan Meglic 5084f6a71d
[AMF] Add support for SUCI protection schemes A and B (#1589)
For null protection scheme the SUCI needs to be BCD encoded. Whereas for
protection scheme profiles A and B the SUCI needs to be converted from
hexadecimal to ASCII.

This still needs the support for protection schemes A and B in UDM to
work.
2022-06-09 21:27:58 +09:00
Carlos Giraldo 109949d335
MME initial metrics support (#1587) 2022-06-09 06:23:51 +09:00
Pau Espin 9e25482d99
[SMF] Gn: Fixes handling/transmitting APN-AMBR IE (#1588) 2022-06-09 06:22:56 +09:00
Carlos Giraldo 816575dc8d
AMF metrics initial support (#1585) 2022-06-08 17:54:46 +09:00
Pau Espin 28e40a0f1b
Initial metrics support based on Prometheus (#1571)
* Initial metrics support based on Prometheus

This commit introduces initial support for metrics in open5gs.

The metrics code is added as libogsmetrics (lib/metrics/), with a well
defined opaque API to manage different types of metrics, allowing for
different implementations for different technologies to scrap the
metrics (placed as lib/metrics/<impl>/. The implementation is right now
selected at build time, in order to be able to opt-out the related dependencies
for users not interested in the features. 2 implementations are already
provided in this commit to start with:
* void: Default implementation. Empty stubs, acts as a NOOP.
* prometheus: open5gs processes become Prometheus servers, offering
  states through an http server to the Prometheus scrappers. Relies on
  libprom (prometheus-client-ci [1] project) to track the metrics and format
  them during export, and libmicrohttpd to make the export possible through
  HTTP.

[1] https://github.com/digitalocean/prometheus-client-c

The prometheus-client-c is not well maintained nowadays in upstream, and
furthermore it uses a quite peculiar mixture of build systems (autolib
on the main dir, cmake for libprom in a subdir). This makes it difficult
to have it widely available in distros, and difficult to find it if it
is installed in the system. Hence, the best is to include it as a
meson subproject like we already do for freeDiameter. An open5gs fork is
requried in order to have an extra patch adding a top-level
CMakeList.txt in order to be able to includ eit from open5gs's meson
build. Furthermore, this allows adding bugfixes to the subproject if any
are found in the future.

* [SMF] Initial metrics support

* [SMF] Add metrics at gtp_node level

* docs: Add tutorial documenting metrics with Prometheus
2022-06-08 05:51:02 +09:00
Pau Espin a9badd5520
GTP, SMF: More dec/enc improvements in QoS Profile IE MBR and GBRE fields (#1584) 2022-06-07 22:13:53 +09:00
Sukchan Lee 18cca7f5e4 Re-enabling HTTP/1.1 (#1570) 2022-06-06 22:20:52 +09:00
Sukchan Lee 828fa23d16 Increase Apply Action size to 2 bytes (#1581) 2022-06-06 21:12:18 +09:00
mitmitmitm a6abe1fffb
[NRF] Don't abort if there are too many registered NF instances (#1579)
Reply with an error instead.
2022-06-06 20:54:59 +09:00
Pau Espin 7dd5d27a71
[GTPv1] Several QoS Profile IE enc/dec fixes and improvements (#1575) 2022-06-03 06:56:28 +09:00
Pau Espin e32139009b
[SMF] Gn: Avoid building QoS Profile IE twice in UpdatePdpContextResp (#1574) 2022-06-03 01:02:14 +09:00
Pau Espin 502a886e43
[CORE] ogs-sockaddr: Fix trailing whitespace (#1573) 2022-06-02 20:20:16 +09:00
Pau Espin d99382d5bc
[CORE] Improve log error messages in ogs_ipsubnet() (#1572) 2022-06-02 20:19:55 +09:00
Sukchan Lee 8b3fa5ff9f Follow-up the contribution #1566, #1567 2022-05-31 21:44:53 +09:00
Pau Espin e1e8018919
[SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent (#1566)
* [SMF] Gn: Drop unreachable return line

* [SMF] Avoid crash if Create{Session,PdpContext}Resp fails to be sent

Crash spotted in a running open5gs-smfd process, triggered by:
ERROR: ogs_gtp_sendto() failed (1:Operation not permitted) (../lib/gtp/path.c:119)
ERROR: ogs_gtp_xact_commit: Expectation `rv == OGS_OK' failed. (../lib/gtp/xact.c:730)
ERROR: smf_gtp2_send_create_session_response: Expectation `rv == OGS_OK' failed. (../src/smf/gtp-path.c:451)
FATAL: smf_gsm_state_wait_pfcp_establishment: Assertion `OGS_OK == smf_gtp2_send_create_session_response( sess, gtp_xact)' failed. (../src/smf/gsm-sm.c:676)

* [SMF] Avoid crash if Delete{Sesson,PdpContext}Resp fails to be sent

Let's simply continuing with release of the session, there's not much we
can do about it. Peer will eventually realize the conn is no longer
there.
2022-05-31 21:27:42 +09:00
Pau Espin c2bda0b576
[GTP] Several fixes and improvements around ogs_gtp_xact_find_by_xid (#1567)
* [GTP] Add missing msg types to ogs_gtp_xact_get_stage()

* [GTP] Avoid returning wrong xact by xif if none found

* [GTP] Avoid crash if ogs_gtp_xact_get_stage() fails

* [GTP] Rename s/ogs_gtp_xact_get_stage/ogs_gtp2_xact_get_stage/
2022-05-31 21:24:00 +09:00
Sukchan Lee b6f2146594 [SGWC] Update remote PGW GTPv2-C address (#1560)
In Create Sesion Response, we updated remote PGW GTPv2-C address.
2022-05-28 17:06:36 +09:00
Miguel 78b1dc77ff
Update open5gs-dbctl (#1562)
I added four additional commands which are useful in case not using the GUI (add UE using a specific APN, add UE using a specific slice and APN, modify a slice adding an APN, modify an UE adding a new slice + APN)
2022-05-28 11:10:03 +09:00
endika de0ba3f9dc
fix tipo in amf logs (#1558) 2022-05-26 20:12:30 +09:00
Pau Espin c18e9f32cb
[PGW] Gy+PFCP improvements (#1555)
* [SMF] Gy,PFCP: Improve {Time,Volume} {Threshold,Quota} handling

* [UPF] Implement URR Usage Report for ValidityTime/TimeQuota/TimeThreshold

* [UPF] Implement Usage report trigger for Volume Quota/Threshold

* [SMF] Set Gy Reporting-Reason based on PFCP Report Trigger
2022-05-24 22:54:30 +09:00
Bostjan Meglic 2c2ce143a3
Fix minor typos (#1554)
* Fix minor typo in log output

* Remove unused struct members
2022-05-24 21:01:54 +09:00
Sukchan Lee 933f0b04c7 [TEST] Added IPv6 in GTPU (#1515) 2022-05-23 23:51:02 +09:00
Sukchan Lee 7d496e182b Update document for v2.4.7 2022-05-21 19:48:56 +09:00
Sukchan Lee dd845a2bb2 Release v2.4.7 2022-05-21 19:22:11 +09:00
Sukchan Lee 1679f57ac7 [CORE] fix the linked-list bug (#1187) 2022-05-21 18:54:42 +09:00
Pau Espin b6fe640641
[SMF] Gy CCR: Clarify use of Reporting-Request and set it to FINAL in TERMINATION_REQ (#1552) 2022-05-21 06:00:56 +09:00
Sukchan Lee a6927e18e6 [SBI] fixed mem leak SessionManagement (#1551) 2022-05-21 17:51:31 +09:00
Bostjan Meglic 8efa364f89
Change handling of SessionManagementSubscriptionData as an array (#1551)
According to the following standards the response to the endpoint
/nudm-sdm/${supi}/sm-data should be an array of
SessionManagementSubscriptionData objects, instead of only one object.

TS 29.503 version 16.6.0
TS 29.505 version 16.4.0

UDR now responds to the request with only item in the array.
UDM copies all items as is.
SMF uses only the first item in the array, even if there are more
present.
2022-05-20 17:33:49 +09:00
Pau Espin 43a7259781
[SMF] Prevent concurrent access to ogs_pool allocating smf_event (#1546) 2022-05-20 05:57:27 +09:00
Supreeth Herle aba1867902
Fix AN-Trusted AVP sent in CCR (#1542)
AN-Trusted AVP is only relevant for non-3GPP access networks e.g. WLAN.
This commit adds a check for non-3GPP access network in order to include
AN-Trusted AVP in CCR or not.
Also, clears the M bit for AN-trusted AVP as per TS 29.212 version 16.4.0, Table 5.4.0.1
2022-05-19 13:25:49 +09:00
Sukchan Lee 12d189af07 Document Update 2022-05-17 23:37:41 +09:00
Sukchan Lee d6c8d49ef4 Update Document for v2.4.6 2022-05-17 23:30:16 +09:00
1215 changed files with 24958 additions and 17499 deletions

69
.clang-tidy Normal file
View File

@ -0,0 +1,69 @@
---
Checks: '*,
-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-android-cloexec-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-sizeof-expression,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-err33-c,
-cert-err34-c,
-clang-analyzer-optin.performance.Padding,
-clang-analyzer-security.insecureAPI.bcmp,
-clang-analyzer-security.insecureAPI.bcopy,
-clang-analyzer-security.insecureAPI.bzero,
-clang-diagnostic-error,
-clang-diagnostic-typedef-redefinition,
-clang-diagnostic-unknown-warning-option,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-readability-function-size,
-google-readability-todo,
-hicpp-braces-around-statements,
-hicpp-function-size,
-hicpp-multiway-paths-covered,
-llvm-else-after-return,
-llvm-header-guard,
-llvm-include-order,
-llvmlibc-restrict-system-libc-headers,
-misc-no-recursion,
-misc-unused-parameters,
-performance-no-int-to-ptr,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-duplicate-include,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-non-const-parameter,
-readability-redundant-control-flow,
-readability-redundant-declaration,
-readability-suspicious-call-argument,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-cert-exp42-c,
-cert-flp37-c,
-clang-analyzer-core.NullDereference,
-clang-analyzer-deadcode.DeadStores,
-clang-analyzer-security.insecureAPI.strcpy,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-narrowing-conversions,
-hicpp-signed-bitwise,
'
WarningsAsErrors: false
HeaderFilterRegex: '(.*\.h)'

10
.dockerignore Normal file
View File

@ -0,0 +1,10 @@
**/*.md
**/docker-compose*.yml
**/docker-compose*.yaml
**/Dockerfile*
.git
.dockerignore
.cache
.gitignore
.github
build

View File

@ -6,11 +6,11 @@ jobs:
name: Build and Test on MacOS Latest
runs-on: macos-latest
steps:
- name: Install MongoDB with Package Manager
run: |
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community
# - name: Install MongoDB with Package Manager
# run: |
# brew tap mongodb/brew
# brew install mongodb-community
# brew services start mongodb-community
- name: Create the TUN device with the interface name `ogstun`.
run: |
sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
@ -33,6 +33,7 @@ jobs:
sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
- name: Install the dependencies for building the source code.
run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
- name: Check out repository code

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
# This directory is fetched during first build and is present in this directory
subprojects/freeDiameter
subprojects/libtins
subprojects/prometheus-client-c
subprojects/usrsctp
webui/.next

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -194,6 +195,11 @@ nrf:
- ::1
port: 7777
scp:
sbi:
- addr: 127.0.1.10
port: 7777
ausf:
sbi:
- addr: 127.0.0.11

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -47,12 +48,12 @@ mme:
map:
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 7
lai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
lac: 2342
map:
@ -68,7 +69,7 @@ mme:
lac: 51544
gummei:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
@ -79,7 +80,7 @@ mme:
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 7
tai:
@ -146,19 +147,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -114,19 +115,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1

View File

@ -35,7 +35,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: amf.key
@ -85,9 +85,42 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - namf-comm
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
# <NGAP Server>>
#
# o NGAP Server(all address avaiable)
# o NGAP Server(all address available)
# ngap:
#
# o NGAP Server(0.0.0.0:38412)
@ -104,7 +137,7 @@ logger:
# - addr: 127.0.0.5
# port: 38413
#
# o NGAP Server(address avaiable in `eth0` interface)
# o NGAP Server(address available in `eth0` interface)
# ngap:
# dev: eth0
#
@ -150,7 +183,7 @@ logger:
# o Multiple GUAMI
# guami:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# amf_id:
# region: 2
@ -199,13 +232,13 @@ logger:
# o Multiple PLMN Support
# plmn_support:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# s_nssai:
# - sst: 1
# sd: 010000
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# s_nssai:
# - sst: 1
@ -218,7 +251,7 @@ logger:
#
# <AMF Name>
#
# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc901.3gppnetwork.org
# amf_name: amf1.open5gs.amf.5gc.mnc70.mcc999.3gppnetwork.org
#
# <Relative Capacity> - Default(255)
#
@ -232,19 +265,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1
@ -317,10 +350,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:
@ -358,3 +391,17 @@ usrsctp:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 127.0.0.5
port: 9090

View File

@ -35,7 +35,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: ausf.key
@ -85,6 +85,39 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nausf-auth
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.11
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.11
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
ausf:
sbi:
- addr: 127.0.0.11
@ -152,10 +185,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -37,7 +37,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: bsf.key
@ -87,6 +87,39 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nbsf-management
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.15
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.15
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
bsf:
sbi:
- addr: 127.0.0.15
@ -154,10 +187,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -45,9 +45,9 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -29,6 +29,7 @@ open5gs_conf = '''
hss.yaml
pcrf.yaml
nrf.yaml
scp.yaml
ausf.yaml
udm.yaml
udr.yaml

View File

@ -26,7 +26,7 @@ logger:
#
# <S1AP Server>>
#
# o S1AP Server(all address avaiable)
# o S1AP Server(all address available)
# s1ap:
#
# o S1AP Server(0.0.0.0:36412)
@ -43,7 +43,7 @@ logger:
# - addr: 127.0.0.2
# port: 36413
#
# o S1AP Server(address avaiable in `eth0` interface)
# o S1AP Server(address available in `eth0` interface)
# s1ap:
# dev: eth0
#
@ -86,7 +86,7 @@ logger:
#
# <GTP-C Server>>
#
# o GTP-C Server(all address avaiable)
# o GTP-C Server(all address available)
# gtpc:
#
# o GTP-C Server(127.0.0.2:2123, [::1]:2123)
@ -248,15 +248,15 @@ mme:
- addr: 127.0.0.2
gtpc:
- addr: 127.0.0.2
gummei:
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -391,10 +391,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:
@ -421,3 +421,17 @@ usrsctp:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 127.0.0.2
port: 9090

View File

@ -1,5 +1,3 @@
db_uri: mongodb://localhost/open5gs
#
# logger:
#
@ -38,7 +36,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# tls:
# key: nrf.key
@ -77,6 +75,16 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nnrf-nfm
# - nnrf-disc
#
nrf:
sbi:
addr:
@ -101,10 +109,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -35,7 +35,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: nssf.key
@ -85,7 +85,7 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <List of avaiable Network Slice Instance(NSI)>
# <List of available Network Slice Instance(NSI)>
#
# o One NSI
# - NRF[http://::1:7777/nnrf-nfm/v1/nf-instances]
@ -134,6 +134,40 @@ logger:
# so_linger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nnssf-nsselection
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.14
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.14
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
nssf:
sbi:
- addr: 127.0.0.14
@ -194,10 +228,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -37,7 +37,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: pcf.key
@ -87,6 +87,46 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - npcf-am-policy-control
# - npcf-smpolicycontrol
# - npcf-policyauthorization
#
# == NOTE ==
# Placing npcf-smpolicycontrol and pcf-policyauthorization
# in different NFs is not supported. Both npcf-smpolicycontrol
# and pcf-policyauthorization should be placed in the same NF.
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.13
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.13
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
pcf:
sbi:
- addr: 127.0.0.13
@ -154,10 +194,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -42,9 +42,9 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

217
configs/open5gs/scp.yaml.in Normal file
View File

@ -0,0 +1,217 @@
db_uri: mongodb://localhost/open5gs
#
# logger:
#
# o Set OGS_LOG_INFO to all domain level
# - If `level` is omitted, the default level is OGS_LOG_INFO)
# - If `domain` is omitted, the all domain level is set from 'level'
# (Nothing is needed)
#
# o Set OGS_LOG_ERROR to all domain level
# - `level` can be set with none, fatal, error, warn, info, debug, trace
# level: error
#
# o Set OGS_LOG_DEBUG to mme/emm domain level
# level: debug
# domain: mme,emm
#
# o Set OGS_LOG_TRACE to all domain level
# level: trace
# domain: core,sbi,scp,event,tlv,mem,sock
#
logger:
file: @localstatedir@/log/open5gs/scp.log
#
# scp:
#
# <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 available>:443)
# sbi:
# - tls:
# key: scp.key
# pem: scp.pem
#
# o SBI Server(https://127.0.1.10:443, http://[::1]:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - addr: ::1
#
# o SBI Server(http://scp.open5gs.org:80)
# sbi:
# - name: scp.open5gs.org
#
# o SBI Server(http://127.0.1.10:7777)
# sbi:
# - addr: 127.0.1.10
# 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-scp.svc.local
#
# sbi:
# - addr: localhost
# advertise:
# - 127.0.0.99
# - ::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
# <Next hop SCP>
#
# o Next hop SCP Server(https://127.0.1.11:7777)
# next_scp:
# sbi:
# - addr: 127.0.1.11
# port: 7777
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# next_scp:
# sbi:
# - addr: 127.0.1.10
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# next_scp:
# sbi:
# - addr: 127.0.1.10
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
#
# nrf:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.0.10:7777)
# sbi:
# addr: 127.0.0.10
# port: 7777
#
# o SBI Client(https://127.0.0.10:443, http://nrf.open5gs.org:80)
# sbi:
# - addr: 127.0.0.10
# tls:
# key: nrf.key
# pem: nrf.pem
# - name: nrf.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fa::1]:80)
# If prefer_ipv4 is true, http://127.0.0.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.0.10
# - fd69:f21d:873c:fa::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.0.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
nrf:
sbi:
- addr:
- 127.0.0.10
- ::1
port: 7777
#
# parameter:
#
# 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
# ue: 1024
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:
#
# time:
#
# o NF Instance Heartbeat (Default : 0)
# NFs will not send heart-beat timer in NFProfile
# NRF will send heart-beat timer in NFProfile
#
# o NF Instance Heartbeat (20 seconds)
# NFs will send heart-beat timer (20 seconds) in NFProfile
# NRF can change heart-beat timer in NFProfile
#
# nf_instance:
# heartbeat: 20
#
# o Message Wait Duration (Default : 10,000 ms = 10 seconds)
#
# o Message Wait Duration (3000 ms)
# message:
# duration: 3000
time:

View File

@ -142,10 +142,12 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
# o Maximum Number of GTP peer nodes per SGWC/SMF
# gtp_peer: 64
#
max:

View File

@ -131,10 +131,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -35,7 +35,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: smf.key
@ -85,6 +85,40 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nsmf-pdusession
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.4
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.4
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
#
# <PFCP Server>
#
# o PFCP Server(127.0.0.4:8805, ::1:8805)
@ -269,7 +303,7 @@ logger:
# - internet
# - ims
#
# o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:90170 TAC:1]
# o S-NSSAI[SST:1] and DNN[internet] and TAI[PLMN-ID:99970 TAC:1]
# info:
# - s_nssai:
# - sst: 1
@ -277,14 +311,14 @@ logger:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mcc: 999
# 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:1] and DNN[internet] and TAI[PLMN-ID:99970 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]
# - S-NSSAI[SST:4] and DNN[internet] and TAI[PLMN-ID:99970 TAC:10-20,30-40]
#
# info:
# - s_nssai:
@ -293,7 +327,7 @@ logger:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# range:
# - 1-9
@ -309,7 +343,7 @@ logger:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# range:
# - 10-20
@ -339,27 +373,27 @@ logger:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# tac: [1, 2, 3]
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# tac: 4
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# tac:
# - 5
# - 6
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# range:
# - 100-200
# - 300-400
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# range:
# - 500-600
@ -371,7 +405,7 @@ logger:
# - internet
# tai:
# - plmn_id:
# mcc: 901
# mcc: 999
# mnc: 70
# tac: 99
#
@ -527,10 +561,12 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
# o Maximum Number of GTP peer nodes per SGWC/SMF
# gtp_peer: 64
#
max:
@ -563,3 +599,17 @@ max:
# handover:
# duration: 500
time:
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 127.0.0.4
port: 9090

View File

@ -35,7 +35,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: udm.key
@ -85,6 +85,41 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nudm-sdm
# - nudm-uecm
# - nudm-ueau
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.12
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.12
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
udm:
sbi:
- addr: 127.0.0.12
@ -152,10 +187,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -37,7 +37,7 @@ logger:
# - ::0
# port: 7777
#
# o SBI Server(https://<all address avaiable>:443)
# o SBI Server(https://<all address available>:443)
# sbi:
# - tls:
# key: udr.key
@ -87,6 +87,39 @@ logger:
# l_onoff: true
# l_linger: 10
#
# <NF Service>
#
# o NF Service Name(Default : all NF services available)
# service_name:
#
# o NF Service Name(Only some NF services are available)
# service_name:
# - nudr-dr
#
# <NF Discovery Query Parameter>
#
# o (Default) If you do not set Query Parameter as shown below,
#
# sbi:
# - addr: 127.0.0.20
# port: 7777
#
# - 'service-names' is included.
#
# sbi:
# - addr: 127.0.0.20
# port: 7777
# discovery:
# option:
# no_service_names: false
#
# o To remove 'service-names' from URI query parameters in NS Discovery
# no_service_names: true
#
# * For Indirect Communication with Delegated Discovery,
# 'service-names' is always included in the URI query parameter.
# * That is, 'no_service_names' has no effect.
#
udr:
sbi:
- addr: 127.0.0.20
@ -154,10 +187,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -205,10 +205,10 @@ parameter:
#
# max:
#
# o Maximum Number of UE per AMF/MME
# o Maximum Number of UE
# ue: 1024
# o Maximum Number of gNB/eNB per AMF/MME
# gnb: 64
# o Maximum Number of Peer(S1AP/NGAP, DIAMETER, GTP, PFCP or SBI)
# peer: 64
#
max:

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -104,6 +105,31 @@ smf:
connect:
- identity: pcrf.localdomain
addr: 127.0.0.9
#
# <For Indirect Communication with Delegated Discovery>
#
# o (Default) If you do not set Delegated Discovery as shown below,
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
#
# - Use SCP if SCP avaiable. Otherwise NRF is used.
# => App fails if both NRF and SCP are unavailable.
#
# sbi:
# - addr: 127.0.0.5
# port: 7777
# discovery:
# delegated: auto
#
# o To use SCP always => App fails if no SCP available.
# delegated: yes
#
# o Don't use SCP server => App fails if no NRF available.
# delegated: no
#
amf:
sbi:
- addr: 127.0.0.5
@ -112,19 +138,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1
@ -194,6 +220,50 @@ nrf:
- ::1
port: 7777
#
# scp:
#
# <SBI Client>>
#
# o SBI Client(http://127.0.1.10:7777)
# sbi:
# addr: 127.0.1.10
# port: 7777
#
# o SBI Client(https://127.0.1.10:443, http://scp.open5gs.org:80)
# sbi:
# - addr: 127.0.1.10
# tls:
# key: scp.key
# pem: scp.pem
# - name: scp.open5gs.org
#
# o SBI Client(http://[fd69:f21d:873c:fb::1]:80)
# If prefer_ipv4 is true, http://127.0.1.10:80 is selected.
#
# sbi:
# addr:
# - 127.0.1.10
# - fd69:f21d:873c:fb::1
#
# o SBI Option (Default)
# - tcp_nodelay : true
# - so_linger.l_onoff : false
#
# sbi:
# addr: 127.0.1.10
# option:
# tcp_nodelay: false
# so_linger:
# l_onoff: true
# l_linger: 10
#
#
scp:
sbi:
- addr: 127.0.1.10
port: 7777
ausf:
sbi:
- addr: 127.0.0.11

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -112,19 +113,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 202
set: 1016
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 7
security:
@ -112,19 +113,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1

View File

@ -6,4 +6,5 @@ Address=10.45.0.1/16
Address=2001:db8:cafe::1/48
[Link]
MTUBytes=1400
RequiredForOnline=false

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -115,19 +116,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1

View File

@ -4,6 +4,7 @@ logger:
parameter:
# no_nrf: true
# no_scp: true
# no_amf: true
# no_smf: true
# no_upf: true
@ -44,13 +45,13 @@ mme:
- addr: 127.0.0.2
gummei:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
security:
@ -115,19 +116,19 @@ amf:
- addr: 127.0.0.5
guami:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 901
mcc: 999
mnc: 70
s_nssai:
- sst: 1
@ -199,6 +200,11 @@ nrf:
- ::1
port: 7777
scp:
sbi:
- addr: 127.0.1.10
port: 7777
ausf:
sbi:
- addr: 127.0.0.11

108
debian/changelog vendored
View File

@ -1,3 +1,111 @@
open5gs (2.4.10) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Sep 2022 09:36:48 +0900
open5gs (2.4.10~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Sep 2022 09:35:23 +0900
open5gs (2.4.10~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Sep 2022 09:34:00 +0900
open5gs (2.4.10~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Fri, 09 Sep 2022 09:30:16 +0900
open5gs (2.4.9) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 20:49:38 +0900
open5gs (2.4.9~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 20:48:36 +0900
open5gs (2.4.9~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 20:47:16 +0900
open5gs (2.4.9~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Mon, 25 Jul 2022 20:45:33 +0900
open5gs (2.4.8) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:28:51 +0900
open5gs (2.4.8~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:27:13 +0900
open5gs (2.4.8~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:23:05 +0900
open5gs (2.4.8~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:22:04 +0900
open5gs (2.4.8~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sun, 12 Jun 2022 16:19:27 +0900
open5gs (2.4.7) unstable; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:20:07 +0900
open5gs (2.4.7~jammy) jammy; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:19:10 +0900
open5gs (2.4.7~focal) focal; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:18:11 +0900
open5gs (2.4.7~bionic) bionic; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:17:08 +0900
open5gs (2.4.7~impish) impish; urgency=medium
* Bug Fixed
-- Sukchan Lee <acetcom@gmail.com> Sat, 21 May 2022 19:14:58 +0900
open5gs (2.4.6) unstable; urgency=medium
* Bug Fixed

View File

@ -20,17 +20,17 @@ set -e
case "$1" in
configure)
# create a open5gs group and user
if ! getent passwd open5gs >/dev/null; then
adduser --system --disabled-password --disabled-login \
--home /var/run/open5gs --no-create-home \
--quiet --group open5gs
fi
for dir in /var/log/open5gs; do
if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
dpkg-statoverride --update --add open5gs open5gs 0755 "$dir"
fi
done
# create a open5gs group and user
if ! getent passwd open5gs >/dev/null; then
adduser --system --disabled-password --disabled-login \
--home /var/run/open5gs --no-create-home \
--quiet --group open5gs
fi
for dir in /var/log/open5gs; do
if ! dpkg-statoverride --list "$dir" >/dev/null 2>&1; then
dpkg-statoverride --update --add open5gs open5gs 0755 "$dir"
fi
done
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -20,18 +20,20 @@ set -e
case "$1" in
configure)
if test "x`sysctl -n net.ipv6.conf.all.disable_ipv6`" = x1; then
echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`systemctl is-enabled systemd-networkd`" = xdisabled; then
systemctl enable systemd-networkd
fi
deb-systemd-invoke restart systemd-networkd
if test -f /etc/sysctl.d/30-open5gs.conf && grep "ogstun" /proc/net/dev > /dev/null; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`sysctl -n net.ipv6.conf.all.disable_ipv6`" = x1; then
echo "net.ipv6.conf.all.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
if test "x`systemctl is-enabled systemd-networkd`" = xdisabled; then
systemctl enable systemd-networkd
fi
if test -d "/run/systemd"; then
deb-systemd-invoke restart systemd-networkd
fi
if test -f /etc/sysctl.d/30-open5gs.conf && grep "ogstun" /proc/net/dev > /dev/null; then
echo "net.ipv6.conf.ogstun.disable_ipv6=0" > /etc/sysctl.d/30-open5gs.conf
sysctl -p /etc/sysctl.d/30-open5gs.conf
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -24,7 +24,7 @@ case "$1" in
if grep "ogstun" /proc/net/dev > /dev/null; then
ip tuntap del name ogstun mode tun
fi
rm -f /etc/sysctl.d/30-open5gs.conf
rm -f /etc/sysctl.d/30-open5gs.conf
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

View File

@ -5,15 +5,8 @@ FROM ${username}/${dist}-${tag}-open5gs-base
MAINTAINER Sukchan Lee <acetcom@gmail.com>
WORKDIR /root
COPY setup.sh /root
WORKDIR /open5gs
COPY docker/build/setup.sh /root
COPY ./ /open5gs
ARG USER=open5gs
ARG REPO=open5gs
ARG BRANCH=main
RUN git clone https://github.com/$USER/$REPO
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/open5gs-ver.json
RUN cd $REPO && \
git fetch && git checkout -f -B $BRANCH origin/$BRANCH && \
meson build && ninja -C build install
RUN meson build && ninja -C build install

View File

@ -15,4 +15,4 @@ services:
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
hostname: open5gs-test
command: /bin/bash -c "/root/setup.sh; cd open5gs/build && meson test -v"
command: /bin/bash -c "/root/setup.sh; cd /open5gs/build && meson test -v"

View File

@ -33,7 +33,8 @@ services:
build:
build:
context: ./build
context: ../
dockerfile: docker/build/Dockerfile
args:
dist: ${DIST-ubuntu}
tag: ${TAG-latest}

View File

@ -112,6 +112,7 @@ https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbunt
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_22.04/
```
#### openSUSE
@ -149,6 +150,7 @@ https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_20.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.04/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_21.10/
https://download.opensuse.org/repositories/network:/osmocom:/nightly/xUbuntu_22.04/
```
@ -247,7 +249,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
@ -255,7 +257,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
mme_code: 1
tai:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001 # set your PLMN-MCC
@ -306,7 +308,7 @@ amf:
+ - addr: 10.10.0.5 # for external gNB - a local address that can be reached by the gNB
guami:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
@ -315,7 +317,7 @@ amf:
set: 1
tai:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001 # set your PLMN-MCC
@ -323,7 +325,7 @@ amf:
+ tac: 2 # should match the TAC used by your gNB
plmn_support:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001 # set your PLMN-MCC
+ mnc: 01 # set your PLMN-MNC
@ -377,8 +379,8 @@ To add subscriber information, you can do WebUI operations in the following orde
Enter the subscriber details of your SIM cards using this tool, to save the subscriber profile in the HSS and UDR MongoDB database backend. If you are using test SIMs, the details are normally printed on the card.
**Tip:** Subscribers added with this tool immediately register in the Open5GS HSS/ UDR without the need to restart any daemon.
{: .notice--info}
**Note:** Subscribers added with this tool immediately register in the Open5GS HSS/UDR without the need to restart any daemon. However, if you use the WebUI to change subscriber profile, you must restart the Open5GS AMF/MME daemon for the changes to take effect.
{: .notice--warning}
#### Adding a route for the UE to have WAN connectivity {#UEInternet}

View File

@ -97,8 +97,8 @@ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
--- amf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ amf.yaml.new 2020-09-05 20:55:07.453114885 -0400
@@ -165,23 +165,23 @@
- addr: 127.0.0.5
port: 7777
@ -107,7 +107,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
+ - addr: 10.10.0.5
guami:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
@ -116,7 +116,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
set: 1
tai:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001
@ -124,7 +124,7 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
+ tac: 2
plmn_support:
- plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
@ -136,8 +136,8 @@ $ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
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 -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
--- upf.yaml 2020-09-05 20:52:28.652234967 -0400
+++ upf.yaml.new 2020-09-05 20:52:55.279052142 -0400
@@ -137,9 +137,7 @@
pfcp:
- addr: 127.0.0.7
@ -156,8 +156,8 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
--- mme.yaml 2020-09-05 20:52:28.648235143 -0400
+++ mme.yaml.new 2020-09-05 20:56:05.434484208 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -168,7 +168,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 001
+ mnc: 01
@ -176,7 +176,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
mme_code: 1
tai:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 001
@ -190,8 +190,8 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
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 -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
--- sgwu.yaml 2020-09-05 20:50:39.393022566 -0400
+++ sgwu.yaml.new 2020-09-05 20:51:06.667838823 -0400
@@ -51,7 +51,7 @@
#
sgwu:
@ -425,7 +425,7 @@ To add subscriber information, you can do WebUI operations in the following orde
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click `SAVE` Button
**Tip:** This addition immediately affects Open5GS without restarting any daemon.
**Note:** Subscribers added with this tool immediately register in the Open5GS HSS/UDR without the need to restart any daemon. However, if you use the WebUI to change subscriber profile, you must restart the Open5GS AMF/MME daemon for the changes to take effect.
{: .notice--warning}
### IP routing + NAT for UE internet connectivity

View File

@ -56,8 +56,8 @@ Modify [install/etc/open5gs/mme.yaml](https://github.com/{{ site.github_username
```diff
$ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
--- mme.yaml.old 2020-08-22 11:36:40.512418765 -0400
+++ mme.yaml 2020-08-22 11:36:27.081466682 -0400
@@ -204,20 +204,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -70,7 +70,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mcc: 999
+ mnc: 70
mme_gid: 2
mme_code: 1
@ -79,7 +79,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
- mcc: 001
- mnc: 01
- tac: 7
+ mcc: 901
+ mcc: 999
+ mnc: 70
+ tac: 1
security:
@ -113,8 +113,8 @@ $ diff -u /etc/open5gs/sgwc.yaml.old /etc/open5gs/sgwc.yaml
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 -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
--- smf.yaml.old 2020-08-22 11:37:39.990816411 -0400
+++ smf.yaml 2020-08-22 11:38:18.647999952 -0400
@@ -187,8 +187,7 @@
- addr: 127.0.0.4
- addr: ::1
@ -141,8 +141,8 @@ Modify [install/etc/open5gs/amf.yaml](https://github.com/{{ site.github_username
```diff
diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
--- amf.yaml.old 2020-06-21 23:34:14.643114779 -0400
+++ amf.yaml 2020-06-21 23:34:28.718482095 -0400
@@ -67,25 +67,25 @@
- addr: 127.0.0.5
port: 7777
@ -153,7 +153,7 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mcc: 999
+ mnc: 70
amf_id:
region: 2
@ -163,14 +163,14 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
- mcc: 001
- mnc: 01
- tac: 7
+ mcc: 901
+ mcc: 999
+ mnc: 70
+ tac: 1
plmn_support:
- plmn_id:
- mcc: 001
- mnc: 01
+ mcc: 901
+ mcc: 999
+ mnc: 70
s_nssai:
- sst: 1
@ -183,8 +183,8 @@ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
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 -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
--- sgwu.yaml.old 2020-08-22 11:41:09.214670723 -0400
+++ sgwu.yaml 2020-08-22 11:41:27.433937124 -0400
@@ -51,9 +51,9 @@
#
sgwu:
@ -202,8 +202,8 @@ $ diff -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
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 -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
+++ upf.yaml 2020-08-22 11:43:13.268901616 -0400
--- upf.yaml.old 2020-08-22 11:42:57.781750067 -0400
+++ upf.yaml 2020-08-22 11:43:13.268901616 -0400
@@ -59,11 +59,9 @@
#
upf:

View File

@ -42,6 +42,8 @@ If you have tested radio hardware from a vendor not listed with Open5GS, please
* Nokia FW2PC BC28 Flexi Zone G2 Outdoor Micro FDD LTE 700 MHz High Power
* Nokia FWH1 B38 Flexi Zone Outdoor Micro TD LTE 2600 MHz
* Nokia FRGY Flexi BTS BBU with Nokia FRCG RRU Band 5 850Mhz FDD 40W. Version 16.1A to 19.0
* Nokia FW2FA Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 39
* Nokia FWGR Flexi Zone Mini-Macro Outdoor BTS, 2x20w Band 1
* Ruckus Q710 and Q910
### 4G/5G Software Stacks + SDRs

View File

@ -176,8 +176,8 @@ You can modify the configuration file to record more logs.
```diff
$ diff -u /etc/open5gs/amf.yaml.old /etc/open5gs/amf.yaml
--- amf.yaml.old 2020-08-22 12:26:56.132213488 -0400
+++ amf.yaml 2020-08-22 12:27:04.135901201 -0400
--- amf.yaml.old 2020-08-22 12:26:56.132213488 -0400
+++ amf.yaml 2020-08-22 12:27:04.135901201 -0400
@@ -20,6 +20,7 @@
#
logger:

View File

@ -96,63 +96,63 @@ $ mongo
> use open5gs
> db.subscribers.find().pretty()
{
"_id" : ObjectId("60969fe79459f8b40d8d3f68"),
"imsi" : "901700000000001",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"network_access_mode" : 2,
"security" : {
"k" : "465b5ce8b199b49faa5f0a2ee238a6bc",
"amf" : "8000",
"op" : null,
"opc" : "e8ed289deba952e4283b54e88e6183ca",
"sqn" : NumberLong(97)
},
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
{
"name" : "internet",
"type" : 3,
"_id" : ObjectId("60969fe7de8743b3c7b1a974"),
"pcc_rule" : [ ],
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"qos" : {
"index" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_capability" : 1,
"pre_emption_vulnerability" : 1
}
}
}
]
}
],
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
"_id" : ObjectId("60969fe79459f8b40d8d3f68"),
"imsi" : "999700000000001",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"network_access_mode" : 2,
"security" : {
"k" : "465b5ce8b199b49faa5f0a2ee238a6bc",
"amf" : "8000",
"op" : null,
"opc" : "e8ed289deba952e4283b54e88e6183ca",
"sqn" : NumberLong(97)
},
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
{
"name" : "internet",
"type" : 3,
"_id" : ObjectId("60969fe7de8743b3c7b1a974"),
"pcc_rule" : [ ],
"ambr" : {
"uplink" : {
"value" : 1,
"unit" : 3
},
"downlink" : {
"value" : 1,
"unit" : 3
}
},
"qos" : {
"index" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_capability" : 1,
"pre_emption_vulnerability" : 1
}
}
}
]
}
],
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
}
```
@ -163,43 +163,43 @@ $ mongo
> use open5gs
> db.subscribers.find().pretty()
{
"_id" : ObjectId("609715fda08851a0744e6ae7"),
"imsi" : "901700000021309",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"network_access_mode" : 2,
"pdn" : [
{
"apn" : "internet",
"_id" : ObjectId("609715fd455bcd38c884ce85"),
"pcc_rule" : [ ],
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"qos" : {
"qci" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_vulnerability" : 1,
"pre_emption_capability" : 0
}
},
"type" : 0
}
],
"security" : {
"k" : "70D49A71DD1A2B806A25ABE0EF749F1E",
"amf" : "8000",
"op" : null,
"opc" : "6F1BF53D624B3A43AF6592854E2444C7"
},
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
"_id" : ObjectId("609715fda08851a0744e6ae7"),
"imsi" : "999700000021309",
"__v" : 0,
"access_restriction_data" : 32,
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"network_access_mode" : 2,
"pdn" : [
{
"apn" : "internet",
"_id" : ObjectId("609715fd455bcd38c884ce85"),
"pcc_rule" : [ ],
"ambr" : {
"downlink" : NumberLong(1024000),
"uplink" : NumberLong(1024000)
},
"qos" : {
"qci" : 9,
"arp" : {
"priority_level" : 8,
"pre_emption_vulnerability" : 1,
"pre_emption_capability" : 0
}
},
"type" : 0
}
],
"security" : {
"k" : "70D49A71DD1A2B806A25ABE0EF749F1E",
"amf" : "8000",
"op" : null,
"opc" : "6F1BF53D624B3A43AF6592854E2444C7"
},
"subscribed_rau_tau_timer" : 12,
"subscriber_status" : 0
}
```
@ -226,12 +226,12 @@ $ mongo
> db.subscribers.find().pretty()
{
...
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
"slice" : [
{
"sst" : 1,
"default_indicator" : true,
"_id" : ObjectId("60969fe7de8743b3c7b1a973"),
"session" : [
...
}
```
@ -317,7 +317,7 @@ index 7e939e81..dfe4456d 100644
s_nssai:
- sst: 1
+ - plmn_id:
+ mcc: 901
+ mcc: 999
+ mnc: 70
+ s_nssai:
+ - sst: 1
@ -476,8 +476,8 @@ The Open5GS package contains a systemd-networkd configuration file for `ogstun`.
```diff
$ diff -u /etc/systemd/network/99-open5gs.network /etc/systemd/network/99-open5gs.network.new
--- /etc/systemd/network/99-open5gs.network 2020-09-17 09:29:09.137392040 -0400
+++ /etc/systemd/network/99-open5gs.network.new 2020-09-17 09:29:03.375719620 -0400
--- /etc/systemd/network/99-open5gs.network 2020-09-17 09:29:09.137392040 -0400
+++ /etc/systemd/network/99-open5gs.network.new 2020-09-17 09:29:03.375719620 -0400
@@ -2,5 +2,5 @@
Name=ogstun
@ -501,8 +501,8 @@ Now, you need to modify the configuration file of Open5GS to adjust the UE IP Po
```diff
$ diff -u smf.yaml smf.yaml.new
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
--- smf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ smf.yaml.new 2020-09-17 09:32:18.267726844 -0400
@@ -190,7 +190,7 @@
- addr: 127.0.0.4
- addr: ::1
@ -516,8 +516,8 @@ $ diff -u smf.yaml smf.yaml.new
```diff
$ diff -u upf.yaml upf.yaml.new
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
--- upf.yaml 2020-09-17 09:31:16.547882093 -0400
+++ upf.yaml.new 2020-09-17 09:32:25.199619989 -0400
@@ -139,7 +139,7 @@
gtpu:
- addr: 127.0.0.7
@ -766,8 +766,8 @@ Create **newtables** file as below.
```diff
$ diff -u oldtables newtables
--- oldtables 2019-06-01 23:43:50.354974226 +0900
+++ newtables 2019-06-01 23:44:16.110931684 +0900
--- oldtables 2019-06-01 23:43:50.354974226 +0900
+++ newtables 2019-06-01 23:44:16.110931684 +0900
@@ -8,6 +8,7 @@
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
@ -1089,12 +1089,12 @@ Currently, the number of UE is limited to `128*128`.
```
* AMF_ID
PLMN ID - MNC: 901, MCC: 70
PLMN ID - MNC: 999, MCC: 70
Region : 2
Set : 1
* TAI
PLMN ID - MNC: 901, MCC: 70
PLMN ID - MNC: 999, MCC: 70
TAC : 1
* S_NSSASI
@ -1105,12 +1105,12 @@ Currently, the number of UE is limited to `128*128`.
```
* GUMMEI
PLMN ID - MNC: 901, MCC: 70
PLMN ID - MNC: 999, MCC: 70
MME Group : 2
MME Code : 1
* TAI
PLMN ID - MNC: 901, MCC: 70
PLMN ID - MNC: 999, MCC: 70
TAC : 1
```
@ -1273,10 +1273,10 @@ $ echo $(cd $(dirname ./install/lib/x86_64-linux-gnu/) && pwd -P)/$(basename ./i
$ 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)
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)
...
```

View File

@ -190,14 +190,14 @@ Title : sysmocom SIM Card Details / AM93\PICK\00859
IMSI ICCID ACC PIN1 PUK1 PIN2 PUK2 Ki OPC ADM1 KIC1 KID1 KIK1
...
901700000017408 8988211000000174089 0100 3623 84724035 8774 57473966 B1233463AB9BC2AD2DB1830EB6417E7B 625150E2A943E3353DD23554101CAFD4 47190711 C865CAA0A54542333929B29B116F4375 7D7F65DCD99003C0A0D5D31CA3E5253E 5B27983AF628FC3FCB36B89300012944
999700000017408 8988211000000174089 0100 3623 84724035 8774 57473966 B1233463AB9BC2AD2DB1830EB6417E7B 625150E2A943E3353DD23554101CAFD4 47190711 C865CAA0A54542333929B29B116F4375 7D7F65DCD99003C0A0D5D31CA3E5253E 5B27983AF628FC3FCB36B89300012944
```
Here's my subscriber information from above.
```
MCC/MNC : 901/70
IMSI : 901700000017408
MCC/MNC : 999/70
IMSI : 999700000017408
K : B1233463AB9BC2AD2DB1830EB6417E7B
OPc : 625150E2A943E3353DD23554101CAFD4
```
@ -222,12 +222,15 @@ Then proceed as follows:
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click `SAVE` Button
**Note:** Subscribers added with this tool immediately register in the Open5GS HSS/UDR without the need to restart any daemon. However, if you use the WebUI to change subscriber profile, you must restart the Open5GS AMF/MME daemon for the changes to take effect.
{: .notice--warning}
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 -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
--- mme.yaml.old 2020-08-22 12:07:32.755250028 -0400
+++ mme.yaml 2020-08-22 12:08:17.309320211 -0400
@@ -208,20 +208,20 @@
mme:
freeDiameter: /home/acetcom/Documents/git/open5gs/install/etc/freeDiameter/mme.conf
@ -238,7 +241,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
addr: 127.0.0.2
gummei:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
+ mcc: 310
+ mnc: 789
@ -246,7 +249,7 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
mme_code: 1
tai:
plmn_id:
- mcc: 901
- mcc: 999
- mnc: 70
- tac: 1
+ mcc: 310
@ -260,8 +263,8 @@ $ diff -u /etc/open5gs/mme.yaml.old /etc/open5gs/mme.yaml
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 -u /etc/open5gs/sgwu.yaml.old /etc/open5gs/sgwu.yaml
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
--- sgwu.yaml.old 2020-08-22 12:08:44.782880778 -0400
+++ sgwu.yaml 2020-08-22 12:06:49.809299514 -0400
@@ -82,7 +82,7 @@
#
sgwu:
@ -335,8 +338,8 @@ You should check your phone frequency. If your phone does not support Band-3, yo
```diff
$ diff -u enb.conf.example enb.conf
-- enb.conf.example 2022-01-19 20:30:13.612993155 +0900
+++ enb.conf 2022-01-19 21:04:15.674419300 +0900
-- enb.conf.example 2022-01-19 20:30:13.612993155 +0900
+++ enb.conf 2022-01-19 21:04:15.674419300 +0900
@@ -20,9 +20,9 @@
#####################################################################
[enb]
@ -372,8 +375,8 @@ $ diff -u enb.conf.example enb.conf
```diff
$ diff -u rr.conf.example rr.conf
-- rr.conf.example 2022-01-19 20:30:13.620992794 +0900
+++ rr.conf 2022-01-19 21:05:21.959044145 +0900
-- rr.conf.example 2022-01-19 20:30:13.620992794 +0900
+++ rr.conf 2022-01-19 21:05:21.959044145 +0900
@@ -55,10 +55,10 @@
{
// rf_port = 0;
@ -406,8 +409,8 @@ Device Argument : Clock source from external GPS-DO
If you are not using GPS-DO, you can just comment out `device_args` as shown below.
```diff
$ diff -u enb.conf enb.conf.no_gps_do
--- enb.conf 2022-01-19 21:08:32.941527373 +0900
+++ enb.conf.no_gps_do 2022-01-19 21:10:18.612581261 +0900
--- enb.conf 2022-01-19 21:08:32.941527373 +0900
+++ enb.conf.no_gps_do 2022-01-19 21:10:18.612581261 +0900
@@ -81,7 +81,7 @@
# Example for ZMQ-based operation with TCP transport for I/Q samples

View File

@ -307,9 +307,9 @@ Username: test
Password: testpasswd
Server: ims.mnc001.mcc001.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
Optional Settings:
Authentication username: test
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
Authentication username: test
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
```
In Phone 2:
@ -319,9 +319,9 @@ Username: test2
Password: testpasswd
Server: ims.mnc001.mcc001.3gppnetwork.org (Created DNS Domain Name or IP to which IMS components are bound to, visible interface IP address)
Optional Settings:
Authentication username: test2
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
Authentication username: test2
Outbound proxy address: 172.24.15.30 (Floating IP of VM in case of OpenStack or else no need to fill in case of physical machine)
Transport type: UDP
```
- Set "Receive incoming calls" option to enabled state in both phones
@ -566,8 +566,8 @@ options {
// the all-0's placeholder.
//forwarders {
// Put here the IP address of other DNS server which could be used if name cannot be resolved with DNS server running in this machine (Optional)
//10.4.128.2;
// Put here the IP address of other DNS server which could be used if name cannot be resolved with DNS server running in this machine (Optional)
//10.4.128.2;
//};
//========================================================================
@ -1068,8 +1068,8 @@ In the below example. epc-ims is the hostname of the machine
```
root@epc-ims:~# cat /etc/hosts
127.0.0.1 localhost
127.0.0.1 epc-ims
127.0.0.1 localhost
127.0.0.1 epc-ims
```
#### 20. Add IMS subscription use in FoHSS as follows from the Web GUI
@ -1078,7 +1078,7 @@ Assuming IMSI of the user as 001010123456791 and MSISDN is 0198765432100
```
Login to the HSS web console.
Navigate to the User Identities page
Navigate to the User Identities page
Create the IMSU
Click IMS Subscription / Create
Enter:

View File

@ -0,0 +1,134 @@
---
title: Metrics with Prometheus
---
#### 0. Introduction
This tutorial explains how to export open5gs metrics to Prometheus, which can in
turn be used to visualize or export them to other systems such as Grafana or
StatsD.
When this method is used, any open5gs program exporting metrics becomes a
Prometheus server, which is basically an HTTP server serving Prometheus data to
the Prometheus scrapper.
Note: Only open5gs-smfd supports exporting metrics so far, though other may
hopefully follow soon.
#### 1. Enable Prometheus support during build
Open5GS programs use a generic internal API available in libogsmetrics. This
library implements the API based on configuration passed during open5gs build
time. By default, the library will be built using the `void` implementation,
which is basically a NO-OP implementation.
In order to use the Prometheus, the `prometheus` metrics implementation needs to
be selected at build time:
```
meson configure -Dmetrics_impl=prometheus build
```
This will enable building the implementation under lib/metrics/prometheus/,
which uses:
* prometheus-client-c project (libprom): To generate the Prometheus expected
output format of the metrics
* libmicrohttpd: To server the content generated by libprom as an HTTP server
The `prometheus-client-c` project is not currently well maintained, and uses a
weird mixture of build systems, which makes it difficult to make it available in
most Linux distributions. As a result, a fork of the project is available under
Open5GS GitHub namespace, with an extra patch applied making it possible to
include it as a subproject, which will be fetched and built automatically when
building the prometheus libmetrics implementation.
#### 2. Configuring for runtime
By default the created Prometheus HTTP server will be listening on `0.0.0.0`
port `9090`.
This can be configured under the following config file options:
```
#
# metrics:
#
# <Metrics Server>
#
# o Metrics Server(http://<any address>:9090)
# metrics:
# addr: 0.0.0.0
# port: 9090
#
metrics:
addr: 0.0.0.0
port: 9090
```
Note: You may want to change the default IP address or port if you are running
the Prometheus scrapper in the same host, since it will also spawn its own
Prometheus server also in port 9090, which will collide.
#### 3. Manual visualization
Simply open the web browser at the following URL (changing IP address and port
as configured in previous section):
```
http://127.0.0.1:9090/metrics
```
Note: URL `metrics/` (with a slash at the end) will not work.
You should see some output similar to this one below:
```
# HELP ues_active Active User Equipments
# TYPE ues_active gauge
ues_active 2
# HELP process_max_fds Maximum number of open file descriptors.
# TYPE process_max_fds gauge
process_max_fds 1024
# HELP process_virtual_memory_max_bytes Maximum amount of virtual memory available in bytes.
# TYPE process_virtual_memory_max_bytes gauge
process_virtual_memory_max_bytes -1
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total gauge
process_cpu_seconds_total 0
# HELP process_virtual_memory_bytes Virtual memory size in bytes.
# TYPE process_virtual_memory_bytes gauge
process_virtual_memory_bytes 3156643840
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 402433
# HELP process_open_fds Number of open file descriptors.
# TYPE process_open_fds gauge
process_open_fds 23
```
#### 3. Integration with Prometheus scrapper
Sample Prometheus scrapper configuration (`~/prometheus.yml`):
```
global:
scrape_interval: 10s
scrape_configs:
- job_name: open5gs-smfd
static_configs:
- targets: ["192.168.1.140:9091"]
```
Where `192.168.1.140:9091` is the IP address and port where `open5gs-smfd` is
serving its metrics, as configured in above sections.
The Prometheus scrapper can be easily started from a docker container:
```
docker run -p 9090:9090 -v /prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
```
Then open your browser to be able to visualize the data: `http://localhost:9090/graph`

View File

@ -13,6 +13,7 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [Your First LTE](tutorial/01-your-first-lte)
- [VoLTE Setup with Kamailio IMS and Open5GS](tutorial/02-VoLTE-setup)
- [Dockerized VoLTE Setup](tutorial/03-VoLTE-dockerized)
- [Metrics with Prometheus](tutorial/04-metrics-prometheus)
- Troubleshooting
- [Simple Issues](troubleshoot/01-simple-issues)
@ -26,24 +27,29 @@ head_inline: "<style> ul { padding-bottom: 1em; } </style>"
- [MacOSX(Intel)](platform/06-macosx-intel)
- [FreeBSD](platform/07-freebsd)
- [Alpine](platform/08-alpine)
- Hardware Specific Notes
- [eNodeBs/gNodeBs tested on Open5GS](hardware/01-genodebs)
- @infinitydon
- [Open5GS on Amazon Elastic Kubernetes Service](https://aws.amazon.com/blogs/opensource/open-source-mobile-core-network-implementation-on-amazon-elastic-kubernetes-service/)
- [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/)
- [Backing up and restoring Open5GS](https://nickvsnetworking.com/backing-up-and-restoring-open5gs/)
- [Open5Gs Without NAT](https://nickvsnetworking.com/open5gs-without-nat/)
- [Sending SMS in Open5GS LTE Networks using the SGs Interface and OsmoMSC](https://nickvsnetworking.com/sending-sms-in-open5gs-lte-networks-using-the-sgs-interface-and-osmomsc-with-smsos/)
- [OsmoMSC and Open5GS MME SGs Interface for CSCF / InterRAT Handover](https://nickvsnetworking.com/osmomsc-and-open5gs-mme-sgs-interface-for-cscf-interran-handover/)
- [Static IPs for UEs](http://nickvsnetworking.com/open5gs-epc-static-ip-addresses-for-ues-apns-subscribers/)
- [Open5GS without NAT](https://nickvsnetworking.com/open5gs-without-nat/)
- [Basics of EPC/LTE Online Charging (OCS)](https://nickvsnetworking.com/basics-of-epc-lte-online-charging-ocs/)
- [Backing up and Restoring Open5GS](https://nickvsnetworking.com/backing-up-and-restoring-open5gs/)
- Diameter Routing Agents - [Part 1](https://nickvsnetworking.com/diameter-routing-agents-why-you-need-them-and-how-to-build-them-part-1/), [Part 2](https://nickvsnetworking.com/diameter-routing-agents-why-you-need-them-and-how-to-build-them-part-2-routing/), [Part 3](https://nickvsnetworking.com/diameter-routing-agents-part-3-building-a-dra-with-freediameter/)
- @s5uishida
- [Open5GS EPC & OpenAirInterface UE/RAN Sample configuration](https://github.com/s5uishida/open5gs_epc_oai_sample_config)
- [Open5GS 5GC & UERANSIM UE/RAN Sample Configuration](https://github.com/s5uishida/open5gs_5gc_ueransim_sample_config)
- [Open5GS & UERANSIM - Select nearby UPF according to the connected gNodeB](https://github.com/s5uishida/open5gs_5gc_ueransim_nearby_upf_sample_config)
- [VoLTE and SMS Configuration for docker_open5gs](https://github.com/s5uishida/docker_open5gs_volte_sms_config)
- [Select UPF based on S-NSSAI](https://github.com/s5uishida/open5gs_5gc_ueransim_snssai_upf_sample_config)
- [SCP Indirect communication Model C](https://github.com/s5uishida/open5gs_5gc_ueransim_scp_model_c_sample_config)
- [Monitoring Metrics with Prometheus](https://github.com/s5uishida/open5gs_5gc_ueransim_metrics_sample_config)

View File

@ -0,0 +1,45 @@
---
title: "v2.4.7 - Gy interface provided by sysmocom"
date: 2022-05-21 19:42:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [SMF] Introduced Gy interface Support provided by [sysmocom](https://sysmocom.de) -- [pespin](https://github.com/pespin)
- [GTP] X2 Handover with SGW relocation ([#1367](https://github.com/open5gs/open5gs/issues/1367), [#1459](https://github.com/open5gs/open5gs/issues/1459)) -- [pespin](https://github.com/pespin), [cbrasho](https://github.com/cbrasho)
#### Enhancements
- [GY] Clarify use of Reporting-Request and set it to FINAL in TERMINATION_REQ ([#1552](https://github.com/open5gs/open5gs/pull/1552)) -- [pespin](https://github.com/pespin)
- [SBI] Change handling of SessionManagementSubscriptionData as an array ([#1551](https://github.com/open5gs/open5gs/pull/1551)) -- [bmeglicit](https://github.com/bmeglicit)
- [PFCP] Support Multi-CP with One-UP ([c6c8dc1](https://github.com/open5gs/open5gs/commit/c6c8dc1256c304aea1fc44cd70fbaeb290f31ad3))
- [SMF] Use Only One PFCP Session Modification Message in the ViNR([e0a487f](https://github.com/open5gs/open5gs/commit/e0a487f479b7d916044d6595228de6211d548656))
- [SMF] Parallelize Gx+Gy CCR Initial ([#1491](https://github.com/open5gs/open5gs/pull/1491)) -- [pespin](https://github.com/pespin)
- [SMF] Integrate Session Setup Cycle into GSM State Machine ([#1489](https://github.com/open5gs/open5gs/pull/1489)) -- [pespin](https://github.com/pespin)
- [CX] Functionality for send SMS with using IMS service ([#1477](https://github.com/open5gs/open5gs/pull/1477)) -- [EugeneBogush](https://github.com/EugeneBogush)
- [MEM] Improve data-path performance using talloc_pool() -- ([e213f65](https://github.com/open5gs/open5gs/commit/e213f654060b7b9f2bae11420c5175e876cf006e))
- [TEST] Automatic CI for github PRs ([#1454](https://github.com/open5gs/open5gs/issues/1454)) -- [pespin](https://github.com/pespin)
- [DB] Add/update current IMEISV of UE in subscriber profile ([#1464](https://github.com/open5gs/open5gs/pull/1464)) -- [EugeneBogush](https://github.com/EugeneBogush)
#### Bug Fixes
- [CORE] Fixed the linked-list BUG ([#1187](https://github.com/open5gs/open5gs/issues/1187)) -- [Vomvas](https://github.com/Vomvas)
- [SMF] Prevent concurrent access to ogs_pool allocating smf_event ([#1546](https://github.com/open5gs/open5gs/issues/1546)) -- [pespin](https://github.com/pespin)
- [DIAMETER] Fix AN-Trusted AVP sent in CCR ([#1542](https://github.com/open5gs/open5gs/pull/1542)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [PFCP] Fixed incorrect memcpy usage ([#1531](https://github.com/open5gs/open5gs/issues/1531)) -- [pespin](https://github.com/pespin)
- [AMF] Fixed the bug Not Sending NG RESET Acknowledge ([#1525](https://github.com/open5gs/open5gs/issues/1525)) -- [mcatalancid](https://github.com/mcatalancid)
- [IPv6] IPv6 RS/RA with QFI Extended Header ([#1506](https://github.com/open5gs/open5gs/issues/1506)) -- [irazairspan](https://github.com/irazairspan)
- [SBI] cJSON v1.7.7 to v1.7.15 to solve HTTP2 request with incorrect payload ([#1503](https://github.com/open5gs/open5gs/issues/1503)) -- [bmeglicit](https://github.com/bmeglicit)
- [GTP] Handling multiple bearer message ([#1498](https://github.com/open5gs/open5gs/issues/1498)) -- [cbrasho](https://github.com/cbrasho)
- [MME] SCTP Crash when eNB, SGW-U and UPF are going down ([#1497](https://github.com/open5gs/open5gs/pull/1497)) -- [spencersevilla](https://github.com/spencersevilla)
- [SBI] fixed HTTP2 header values is 0 ([#1488](https://github.com/open5gs/open5gs/issues/1488)) -- [bmeglicit](https://github.com/bmeglicit)
- [MME] Send EMM Cause when Attach Request type is not same as HSS Network-Access-Mode ([#1484](https://github.com/open5gs/open5gs/pull/1484)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [GX] Prevent sending Gx messages to non-PCRF Diameter peers ([#1468](https://github.com/open5gs/open5gs/pull/1468)) -- [pespin](https://github.com/pespin)
- [AMF] AMF crashes when requesting a PDU session for a S-NSSAI with an SST when the network is configured with multiple S-NSSAIs with the same SST ([#1440](https://github.com/open5gs/open5gs/issues/1440)) -- [dcandal-gti](https://github.com/dcandal-gti)
Download -- [v2.4.7.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.7.tar.gz)
{: .notice--info}

View File

@ -0,0 +1,30 @@
---
title: "v2.4.8 - Upgrade PFCP to v16.9.1"
date: 2022-06-12 16:35:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [Metrics] Initial metrics support based on Prometheus ([#1571](https://github.com/open5gs/open5gs/pull/1571)) -- [pespin](https://github.com/pespin)
#### Enhancements
- [PFCP] Upgrade PFCP to v16.9.1 -- [1235317](https://github.com/open5gs/open5gs/commit/12353178fb7c15a5c78035e19501412af9c76ad0)
- [NRF] Don't abort if there are too many registered NF instances ([#1579](https://github.com/open5gs/open5gs/pull/1579)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [SGW-C] Consider if SMF/PGW GTPv2-C address changed ([#1560](https://github.com/open5gs/open5gs/issues/1560)) -- [pespin](https://github.com/pespin)
- [CLI] Added four addtional commands in dbctl ([#1562](https://github.com/open5gs/open5gs/pull/1562)) -- [mcatalancid](https://github.com/mcatalancid)
- [GY] Gy+PFCP improvements ([#1555](https://github.com/open5gs/open5gs/pull/1555)) -- [pespin](https://github.com/pespin)
#### Bug Fixes
- [AMF] Added to handle an invalid RI(Routing Indicator) ([#1570](https://github.com/open5gs/open5gs/issues/1570)) -- [ray28850101](https://github.com/ray28850101)
- [SBI] Re-enabling HTTP/1.1 ([#1254](https://github.com/open5gs/open5gs/issues/1254)) -- [hidingturtle](https://github.com/hidingturtle), [22username2022](https://github.com/22username2022)
- [GTP] GTP-U address does not change when gNB with IPv6-only changes
([#1515](https://github.com/open5gs/open5gs/issues/1515), [#1586](https://github.com/open5gs/open5gs/issues/1586)) -- [irazairspan](https://github.com/irazairspan), [dmartyushev](https://github.com/dmartyushev)
Download -- [v2.4.8.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.8.tar.gz)
{: .notice--info}

View File

@ -0,0 +1,52 @@
---
title: "v2.4.9 - Default MCC/MNC from 901/70 to 999/70"
date: 2022-07-25 20:52:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [CONF] Changed default MCC/MNC from 901/70 to 999/70 -- [b58ebda](https://github.com/open5gs/open5gs/commit/b58ebda556cf0278fd361bcd6ca044502398e6dc)
- [MISC] Added static analysis & Fixed the results ([#1638](https://github.com/open5gs/open5gs/pull/1638)) -- [bmeglicit](https://github.com/bmeglicit)
#### Enhancements
- [SBI] Support Discovery Optional Parameter -- [a5010a6](https://github.com/open5gs/open5gs/commit/a5010a61effce92fe9dfb2cbf8df1f04ddc1de64), [9b76215](https://github.com/open5gs/open5gs/commit/9b762158a6ef3f8c4f3967d04e01d1a13cc9908a)
- [SMF] Send PDU Session Establish Accept to serving AMF ([#1671](https://github.com/open5gs/open5gs/pull/1671)) -- [bmeglicit](https://github.com/bmeglicit)
- [MME] Introduce support for handling Charging Characteristics from HSS ([#1673](https://github.com/open5gs/open5gs/pull/1673)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [MME] Set default Network-Access-Mode to 0 ([#1672](https://github.com/open5gs/open5gs/pull/1672)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [AMF] Handle namf-callback DeregNotify message from UDM ([#1654](https://github.com/open5gs/open5gs/pull/1654)) -- [bmeglicit](https://github.com/bmeglicit)
- [Systemd] upf.postinst: Don't restart service in chroot ([#1644](https://github.com/open5gs/open5gs/pull/1644)) -- [osmith42](https://github.com/osmith42)
- [PFCP] Added UE IP address in Uplink PDR rules ([#1642](https://github.com/open5gs/open5gs/pull/1642)) -- [Networkmama](https://github.com/Networkmama)
- [TLV] Changed MAX TLV More to 16 -- [051c19b](https://github.com/open5gs/open5gs/commit/051c19b7c8277ecf0465eb895249e9e520ba5e63)
- [PFCP] Error code paths replaced with asserts() ([#1635](https://github.com/open5gs/open5gs/pull/1635)) -- [pespin](https://github.com/pespin)
- [PFCP/GTP] context when TEID=0, SEID=0 ([#1594](https://github.com/open5gs/open5gs/pull/1594), [#1606](https://github.com/open5gs/open5gs/pull/1606), [#1620](https://github.com/open5gs/open5gs/pull/1620)) -- [pespin](https://github.com/pespin)
- [SMF] Gn: QoS Profile and PCO IE improvements ([#1631](https://github.com/open5gs/open5gs/pull/1631)) -- [pespin](https://github.com/pespin)
- [PFCP] Added Network Instance to CP-UP FAR ([#1630](https://github.com/open5gs/open5gs/pull/1630)) -- [Networkmama](https://github.com/Networkmama)
- [PFCP] Added DNN/APN in FAR ([#1629](https://github.com/open5gs/open5gs/pull/1629)) -- [Networkmama](https://github.com/Networkmama)
- [PFCP] Set v4/6 flag in F-TEID IE request type ([#1625](https://github.com/open5gs/open5gs/pull/1625)) -- [Networkmama](https://github.com/Networkmama)
- [SMF] pfcp-sm: Fix ogs_fsm_dispatch() on NULL sess ([#1628](https://github.com/open5gs/open5gs/pull/1628)) -- [pespin](https://github.com/pespin)
- [UPF] Avoid crash if no default subnet configured ([#1624](https://github.com/open5gs/open5gs/pull/1624)) -- [pespin](https://github.com/pespin)
- [SMF] Gy: Send Multiple-Services-Indicator AVP only during Initial CCR ([#1616](https://github.com/open5gs/open5gs/pull/1616)) -- [pespin](https://github.com/pespin)
- [Docker] Use local sources to build applications ([#1583](https://github.com/open5gs/open5gs/pull/1583)) -- [bmeglicit](https://github.com/bmeglicit)
- [SBI] Change nf-instance-id to Optional in nf-instance context -- [c528e0d](https://github.com/open5gs/open5gs/commit/c528e0d5bc258336ab302efe08df7ca5472d0134)
- [CLI] Added show commands in the dbctl ([#1613](https://github.com/open5gs/open5gs/pull/1613)) -- [JagannathS](https://github.com/JagannathS)
#### Bug Fixes
- [AMF] Fixed 5GMM cause in 5GMM reject message ([#1660](https://github.com/open5gs/open5gs/issues/1660)) -- [takgr](https://github.com/takgr)
- [ASN1C] Rework APER from [mouse07410/asn1c#94](https://github.com/mouse07410/asn1c/issues/94)
- [TEST] Fixed a crash for UERANSIM 500 Test ([#1652](https://github.com/open5gs/open5gs/pull/1652)) -- [lemon1009](https://github.com/lemon1009)
- [SBI] from NRF with wrong requester-nf-type ([#1650](https://github.com/open5gs/open5gs/issues/1650)) -- [bmeglicit](https://github.com/bmeglicit)
- [PFCP] Fixed a endianness of OGS_PFCP_APPLY_ACTION ([#1640](https://github.com/open5gs/open5gs/issues/1640)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [DBI] Fixed a crash when slice/session overflow ([#1637](https://github.com/open5gs/open5gs/issues/1637)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [AMF/MME] Added a protection code for SCTP jumbo frame ([#1632](https://github.com/open5gs/open5gs/issues/1632)) -- [kbaccar](https://github.com/kbaccar)
- [SBI] Fix memory leak for nghttp2 session ([#1618](https://github.com/open5gs/open5gs/pull/1618)) -- [bmeglicit](https://github.com/bmeglicit)
- [MME/AMF] Fixed network name encoding ([#1614](https://github.com/open5gs/open5gs/issues/1614)) -- [Mozartor2](https://github.com/Mozartor2)
- [SBI] Fixed invalid read beyond allocated memory ([#1610](https://github.com/open5gs/open5gs/pull/1610)) -- [bmeglicit](https://github.com/bmeglicit)
- [CORE] Compare port in ogs_sockaddr_is_equal() ([#1608](https://github.com/open5gs/open5gs/pull/1608)) -- [pespin](https://github.com/pespin)
Download -- [v2.4.9.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.9.tar.gz)
{: .notice--info}

View File

@ -0,0 +1,43 @@
---
title: "v2.4.10 - Service-name based NF Discovery"
date: 2022-09-09 09:43:00 +0900
categories:
- Release
tags:
- News
- Release
head_inline: "<style> ul { padding-bottom: 1em; } .blue { color: blue; }</style>"
---
#### New Features
- [CONF] Service-name based NF Discovery -- [f020732](https://github.com/open5gs/open5gs/commit/f020732ce9f60217dfcd0b7e9ba5c8949db966d5), [9f98d42](https://github.com/open5gs/open5gs/commit/9f98d421a081a5edc3a525d1cf2504b8b6cf059e), [5295c10](https://github.com/open5gs/open5gs/commit/5295c108adc2fc5ae97ee5007760334ef7a6297b)
#### Enhancements
- [SBI] Move state machine from src to lib directory -- [e6a14cb](https://github.com/open5gs/open5gs/commit/e6a14cb73debbdc21e91499b75dde3d71a5aa02b)
- [SBI] Increased the MAX stream number from UE * 16 -- [db37bc8](https://github.com/open5gs/open5gs/commit/db37bc894459df38661bdf98891938ec3513bc72), [ec9fe7b](https://github.com/open5gs/open5gs/commit/ec9fe7b31d0253003244be498e8f963da63e7657), [603a746](https://github.com/open5gs/open5gs/commit/603a746f49c68b06ab5d8b3ceeca3afde987cab5)
- [Diameter] Improve S6A interface ([#1676](https://github.com/open5gs/open5gs/pull/1676), [#1698](https://github.com/open5gs/open5gs/pull/1698), [#1714](https://github.com/open5gs/open5gs/pull/1714)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
#### Security Issues
- [PFCP] Fixed security protection -- [CVE-2022-39063](https://cve.report/CVE-2022-39063), [d99491a](https://github.com/open5gs/open5gs/commit/d99491aca5304460d3929b37bf26e064efd86686), [444e182](https://github.com/open5gs/open5gs/commit/444e1822887a78d3c3ef1f0bcaad9ee10ac951c3)
#### Bug Fixes
- [SBI] Fixed memory leak and CPU usage 100% -- [7231daf](https://github.com/open5gs/open5gs/commit/7231dafbf12c2009ec6fe740686342e2c5d245a2), [c716a12](https://github.com/open5gs/open5gs/commit/c716a1294a6120f4100ba2efa9039f6168d74ce7)
- [Metrics] Fixed double-free on application exit load error ([#1717](https://github.com/open5gs/open5gs/issues/1717)) -- [bmeglicit](https://github.com/bmeglicit)
- [NRF] Fixed library load error -- [9b10d70](https://github.com/open5gs/open5gs/commit/9b10d70c7730ba86800b85fe05260c5bb072d91e)
- [SMF] Fixed abort on app exit when no diameter configuration -- ([#1710](https://github.com/open5gs/open5gs/issues/1710)) -- [bmeglicit](https://github.com/bmeglicit)
- [MME] Fixed crash on sending SMS between UEs -- ([#1701](https://github.com/open5gs/open5gs/issues/1701)) -- [salibeh](https://github.com/salibeh)
- [MME] Fixed GTP transaction crash if it has already been removed during paging-- ([#1696](https://github.com/open5gs/open5gs/issues/1696)) -- [vsbc2010](https://github.com/vsbc2010)
#### Specification Compliance
- [5GC] Handle APN/DNN names as case-insensitive ([#1747](https://github.com/open5gs/open5gs/pull/1747)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
- [AMF] Accept Deregistration Notification from UDM only for registered UE -- ([#1737](https://github.com/open5gs/open5gs/pull/1737)) -- [bmeglicit](https://github.com/bmeglicit)
- [SBI] Send NF discovery query with service-names delimited with comma -- ([#1730](https://github.com/open5gs/open5gs/pull/1730)) -- [bmeglicit](https://github.com/bmeglicit)
- [Gx] Handle upCnxState=ACTIVATION by later replaying with 200 instead of 204 ([#1729](https://github.com/open5gs/open5gs/pull/1729)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [MME] Fixed buffer overflow in S6A IDR([#1728](https://github.com/open5gs/open5gs/pull/1728)) -- [mitmitmitm](https://github.com/mitmitmitm)
- [Gx] Added 3GPP-Charging-Characteristics if received on S5/8c ([#1724](https://github.com/open5gs/open5gs/pull/1724)) -- [lynxis](https://github.com/lynxis)
- [S5c/Gn] Fix PCO IE sent in response its presence in request ([#1691](https://github.com/open5gs/open5gs/pull/1691)) -- [herlesupreeth](https://github.com/herlesupreeth)
- [Diameter] Fixed the path of Nnrf_NFManagement Service ([#1683](https://github.com/open5gs/open5gs/issues/1683)) -- [s5uishida](https://github.com/s5uishida)
- [Diameter] Fixed AVP Occurring Too Many Times ([#1680](https://github.com/open5gs/open5gs/pull/1680)) -- [jmasterfunk84](https://github.com/jmasterfunk84)
Download -- [v2.4.10.tar.gz](https://github.com/open5gs/open5gs/archive/v2.4.10.tar.gz)
{: .notice--info}

View File

@ -10,7 +10,7 @@
#
PACKAGE="open5gs"
VERSION="2.4.6"
VERSION="2.4.7"
print_status() {
echo

View File

@ -20,7 +20,7 @@
#ifndef OGS_APP_H
#define OGS_APP_H
#include "ogs-core.h"
#include "proto/ogs-proto.h"
#define OGS_APP_INSIDE
@ -94,6 +94,9 @@ void smf_terminate(void);
int amf_initialize(void);
void amf_terminate(void);
int scp_initialize(void);
void scp_terminate(void);
#ifdef __cplusplus
}
#endif

View File

@ -29,7 +29,7 @@ extern "C" {
#endif
int ogs_app_config_parse_sockopt(
ogs_yaml_iter_t *parent, ogs_sockopt_t *sockopt);
ogs_yaml_iter_t *parent, ogs_sockopt_t *option);
#ifdef __cplusplus
}

View File

@ -64,38 +64,32 @@ ogs_app_context_t *ogs_app()
static void recalculate_pool_size(void)
{
self.pool.packet = self.max.ue * OGS_MAX_NUM_OF_PACKET_BUFFER;
#define MAX_NUM_OF_TUNNEL 3 /* Num of Tunnel per Bearer */
self.pool.sess = self.max.ue * OGS_MAX_NUM_OF_SESS;
self.pool.bearer = self.pool.sess * OGS_MAX_NUM_OF_BEARER;
self.pool.tunnel = self.pool.bearer * MAX_NUM_OF_TUNNEL;
#define MAX_NUM_OF_TIMER 16
self.pool.timer = self.max.ue * MAX_NUM_OF_TIMER;
self.pool.message = self.max.ue;
self.pool.event = self.max.ue;
#define POOL_NUM_PER_UE 16
self.pool.timer = self.max.ue * POOL_NUM_PER_UE;
self.pool.message = self.max.ue * POOL_NUM_PER_UE;
self.pool.event = self.max.ue * POOL_NUM_PER_UE;
self.pool.socket = self.max.ue * POOL_NUM_PER_UE;
self.pool.subscription = self.max.ue * POOL_NUM_PER_UE;
self.pool.xact = self.max.ue * POOL_NUM_PER_UE;
self.pool.stream = self.max.ue * POOL_NUM_PER_UE;
self.pool.packet = self.max.ue * OGS_MAX_NUM_OF_PACKET_BUFFER;
self.pool.nf = self.max.peer;
#define NF_SERVICE_PER_NF_INSTANCE 16
self.pool.nf_service = self.pool.nf * NF_SERVICE_PER_NF_INSTANCE;
self.pool.nf = self.max.gnb;
#define MAX_NUM_OF_SOCKET 4 /* Num of socket per NF */
self.pool.socket = self.pool.nf * MAX_NUM_OF_SOCKET;
#define MAX_NUM_OF_XACT 8
self.pool.gtp_xact = self.max.ue * MAX_NUM_OF_XACT;
self.pool.gtp_node = self.pool.nf;
if (self.max.gtp_peer)
self.pool.gtp_node = self.max.gtp_peer;
self.pool.pfcp_xact = self.max.ue * MAX_NUM_OF_XACT;
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_SBI_MESSAGE 4 /* Num of HTTP(s) Request/Response 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_subscription = self.pool.nf * MAX_NUM_OF_NF_SUBSCRIPTION;
#define MAX_CSMAP_POOL 128
self.pool.csmap = MAX_CSMAP_POOL; /* Num of TAI-LAI Mapping Table */
/* Num of TAI-LAI Mapping Table */
self.pool.csmap = self.pool.nf;
#define MAX_NUM_OF_IMPU 8
self.pool.impi = self.max.ue;
@ -113,7 +107,7 @@ static void regenerate_all_timer_duration(void)
ogs_max(ogs_time_from_sec(3),
self.time.message.sbi.client_wait_duration + ogs_time_from_sec(1));
self.time.message.sbi.nf_register_interval_in_exception =
ogs_time_from_msec(300);
ogs_time_from_sec(2);
#define PFCP_N1_RESPONSE_RETRY_COUNT 3
self.time.message.pfcp.n1_response_rcount = PFCP_N1_RESPONSE_RETRY_COUNT;
@ -176,23 +170,13 @@ static void app_context_prepare(void)
#define USRSCTP_LOCAL_UDP_PORT 9899
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_GNB 64 /* Num of gNB per AMF/MME */
#define MAX_NUM_OF_UE 1024 /* Num of UEs */
#define MAX_NUM_OF_PEER 64 /* Num of Peer */
self.max.gnb = MAX_NUM_OF_GNB;
self.max.ue = MAX_NUM_OF_UE;
self.max.peer = MAX_NUM_OF_PEER;
ogs_pkbuf_default_init(&self.pool.defconfig);
@ -226,9 +210,12 @@ static void app_context_prepare(void)
*/
self.time.handover.duration = ogs_time_from_msec(300);
/* Size of internal metrics pool (amount of ogs_metrics_spec_t) */
self.metrics.max_specs = 512;
regenerate_all_timer_duration();
}
static int app_context_validation(void)
{
if (self.parameter.no_ipv4 == 1 &&
@ -311,6 +298,9 @@ int ogs_app_context_parse_config(void)
} else if (!strcmp(parameter_key, "no_nrf")) {
self.parameter.no_nrf =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_scp")) {
self.parameter.no_scp =
ogs_yaml_iter_bool(&parameter_iter);
} else if (!strcmp(parameter_key, "no_amf")) {
self.parameter.no_amf =
ogs_yaml_iter_bool(&parameter_iter);
@ -379,48 +369,6 @@ int ogs_app_context_parse_config(void)
} else
ogs_warn("unknown key `%s`", sockopt_key);
}
} else if (!strcmp(root_key, "sctp")) {
ogs_yaml_iter_t sctp_iter;
ogs_yaml_iter_recurse(&root_iter, &sctp_iter);
while (ogs_yaml_iter_next(&sctp_iter)) {
const char *sctp_key = ogs_yaml_iter_key(&sctp_iter);
ogs_assert(sctp_key);
if (!strcmp(sctp_key, "heartbit_interval")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
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")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) self.sctp.rto_initial = atoi(v);
} else if (!strcmp(sctp_key, "rto_min")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) self.sctp.rto_min = atoi(v);
} else if (!strcmp(sctp_key, "rto_max")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) self.sctp.rto_max = atoi(v);
} else if (!strcmp(sctp_key, "max_num_of_ostreams")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v)
self.sctp.max_num_of_ostreams = atoi(v);
} else if (!strcmp(sctp_key, "max_num_of_istreams")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v)
self.sctp.max_num_of_istreams = atoi(v);
} else if (!strcmp(sctp_key, "max_attempts")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) self.sctp.max_attempts = atoi(v);
} else if (!strcmp(sctp_key, "max_initial_timeout")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v)
self.sctp.max_initial_timeout = atoi(v);
} else if (!strcmp(sctp_key, "usrsctp_udp_port")) {
const char *v = ogs_yaml_iter_value(&sctp_iter);
if (v) self.usrsctp.udp_port = atoi(v);
} else
ogs_warn("unknown key `%s`", sctp_key);
}
} else if (!strcmp(root_key, "max")) {
ogs_yaml_iter_t max_iter;
ogs_yaml_iter_recurse(&root_iter, &max_iter);
@ -430,10 +378,14 @@ int ogs_app_context_parse_config(void)
if (!strcmp(max_key, "ue")) {
const char *v = ogs_yaml_iter_value(&max_iter);
if (v) self.max.ue = atoi(v);
} else if (!strcmp(max_key, "gnb") ||
} else if (!strcmp(max_key, "peer") ||
!strcmp(max_key, "enb")) {
const char *v = ogs_yaml_iter_value(&max_iter);
if (v) self.max.gnb = atoi(v);
if (v) self.max.peer = atoi(v);
} else if (!strcmp(max_key, "gtp_peer") ||
!strcmp(max_key, "enb")) {
const char *v = ogs_yaml_iter_value(&max_iter);
if (v) self.max.gtp_peer = atoi(v);
} else
ogs_warn("unknown key `%s`", max_key);
}

View File

@ -64,6 +64,7 @@ typedef struct ogs_app_context_s {
int no_nssf;
int no_bsf;
int no_udr;
int no_scp;
int no_nrf;
/* Network */
@ -84,50 +85,39 @@ typedef struct ogs_app_context_s {
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 {
int udp_port;
} usrsctp;
struct {
uint64_t ue;
uint64_t gnb;
uint64_t peer;
uint64_t gtp_peer;
} max;
struct {
ogs_pkbuf_config_t defconfig;
uint64_t packet;
uint64_t nf;
uint64_t packet;
uint64_t sess;
uint64_t bearer;
uint64_t tunnel;
uint64_t nf_service;
uint64_t nf_subscription;
uint64_t csmap;
uint64_t timer;
uint64_t message;
uint64_t event;
uint64_t timer;
uint64_t socket;
uint64_t gtp_xact;
uint64_t subscription;
uint64_t xact;
uint64_t stream;
uint64_t nf;
uint64_t gtp_node;
uint64_t pfcp_xact;
uint64_t pfcp_node;
uint64_t csmap;
uint64_t impi;
uint64_t impu;
@ -175,6 +165,10 @@ typedef struct ogs_app_context_s {
} handover;
} time;
struct metrics {
uint64_t max_specs;
} metrics;
} ogs_app_context_t;
int ogs_app_context_init(void);

View File

@ -32,9 +32,6 @@ int ogs_app_initialize(
char *log_file;
char *log_level;
char *domain_mask;
bool enable_debug;
bool enable_trace;
} optarg;
ogs_core_initialize();

View File

@ -32,6 +32,11 @@ asn_TYPE_operation_t asn_OP_ANY = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
ANY_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
0,

View File

@ -42,6 +42,10 @@ extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;
xer_type_encoder_f ANY_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f ANY_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;

View File

@ -132,7 +132,7 @@ ANY_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
int ret;
/* Get the PER length */
raw_len = aper_get_length(pd, -1, 0, &repeat);
raw_len = aper_get_length(pd, -1, -1, 0, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
if(raw_len == 0 && st->buf) break;
@ -173,7 +173,7 @@ ANY_encode_aper(const asn_TYPE_descriptor_t *td,
size = st->size;
do {
int need_eom = 0;
ssize_t may_save = aper_put_length(po, -1, size, &need_eom);
ssize_t may_save = aper_put_length(po, -1, -1, size, &need_eom);
if(may_save < 0) ASN__ENCODE_FAILED;
ret = per_put_many_bits(po, buf, may_save * 8);
@ -182,7 +182,7 @@ ANY_encode_aper(const asn_TYPE_descriptor_t *td,
buf += may_save;
size -= may_save;
assert(!(may_save & 0x07) || !size);
if(need_eom && aper_put_length(po, -1, 0, 0))
if(need_eom && aper_put_length(po, -1, -1, 0, NULL))
ASN__ENCODE_FAILED; /* End of Message length */
} while(size);

View File

@ -0,0 +1,17 @@
/*
* 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>
asn_enc_rval_t
ANY_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
enum jer_encoder_flags_e flags, asn_app_consume_bytes_f *cb,
void *app_key) {
ASN__ENCODE_FAILED;
/* Dump as binary */
return OCTET_STRING_encode_jer(td, sptr, ilevel, flags, cb, app_key);
}

View File

@ -38,6 +38,11 @@ asn_TYPE_operation_t asn_OP_BIT_STRING = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
BIT_STRING_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
BIT_STRING_decode_oer,
BIT_STRING_encode_oer,

View File

@ -44,6 +44,10 @@ asn_constr_check_f BIT_STRING_constraint;
xer_type_encoder_f BIT_STRING_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f BIT_STRING_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer;

View File

@ -0,0 +1,70 @@
/*
* 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>
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_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_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 = 0;
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;
}

View File

@ -34,6 +34,11 @@ asn_TYPE_operation_t asn_OP_GraphicString = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer, /* Can't expect it to be ASCII/UTF8 */
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,

View File

@ -36,6 +36,10 @@ extern asn_TYPE_operation_t asn_OP_GraphicString;
#define GraphicString_encode_xer OCTET_STRING_encode_xer
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define GraphicString_encode_jer OCTET_STRING_encode_jer
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define GraphicString_decode_uper OCTET_STRING_decode_uper
#define GraphicString_encode_uper OCTET_STRING_encode_uper

View File

@ -36,6 +36,11 @@ asn_TYPE_operation_t asn_OP_INTEGER = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
INTEGER_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
INTEGER_decode_oer, /* OER decoder */
INTEGER_encode_oer, /* Canonical OER encoder */

View File

@ -60,6 +60,10 @@ xer_type_decoder_f INTEGER_decode_xer;
xer_type_encoder_f INTEGER_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f INTEGER_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f INTEGER_decode_oer;
oer_type_encoder_f INTEGER_encode_oer;

View File

@ -129,7 +129,7 @@ INTEGER_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
int ret;
/* Get the PER length */
len = aper_get_length(pd, -1, -1, &repeat);
len = aper_get_length(pd, -1, -1, -1, &repeat);
if(len < 0) ASN__DECODE_STARVED;
p = REALLOC(st->buf, st->size + len + 1);
@ -291,13 +291,14 @@ INTEGER_encode_aper(const asn_TYPE_descriptor_t *td,
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);
ssize_t mayEncode = aper_put_length(po, -1, -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;
if(need_eom && (aper_put_length(po, -1, -1, 0, NULL) < 0))
ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er);

View 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>
asn_enc_rval_t
INTEGER_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const INTEGER_t *st = (const INTEGER_t *)sptr;
asn_enc_rval_t er = {0,0,0};
(void)ilevel;
(void)flags;
if(!st || !st->buf)
ASN__ENCODE_FAILED;
er.encoded = INTEGER__dump(td, st, cb, app_key, 1);
if(er.encoded < 0) ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);
}

View File

@ -33,6 +33,11 @@ asn_TYPE_operation_t asn_OP_NULL = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
NULL_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
NULL_decode_oer,
NULL_encode_oer,

View File

@ -40,6 +40,10 @@ xer_type_decoder_f NULL_decode_xer;
xer_type_encoder_f NULL_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f NULL_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f NULL_decode_oer;
oer_type_encoder_f NULL_encode_oer;

View 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 <asn_codecs_prim.h>
#include <NULL.h>
asn_enc_rval_t
NULL_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
enum jer_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);
}

View File

@ -40,6 +40,11 @@ asn_TYPE_operation_t asn_OP_NativeEnumerated = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
NativeEnumerated_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
NativeEnumerated_decode_oer,
NativeEnumerated_encode_oer,

View File

@ -41,6 +41,10 @@ extern asn_TYPE_operation_t asn_OP_NativeEnumerated;
xer_type_encoder_f NativeEnumerated_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f NativeEnumerated_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f NativeEnumerated_decode_oer;
oer_type_encoder_f NativeEnumerated_encode_oer;

View File

@ -0,0 +1,36 @@
/*
* 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_enc_rval_t
NativeEnumerated_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_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;
}
}

View File

@ -41,6 +41,11 @@ asn_TYPE_operation_t asn_OP_NativeInteger = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
NativeInteger_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
NativeInteger_decode_oer, /* OER decoder */
NativeInteger_encode_oer, /* Canonical OER encoder */

View File

@ -42,6 +42,10 @@ xer_type_decoder_f NativeInteger_decode_xer;
xer_type_encoder_f NativeInteger_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f NativeInteger_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f NativeInteger_decode_oer;
oer_type_encoder_f NativeInteger_encode_oer;

View File

@ -0,0 +1,32 @@
/*
* 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_enc_rval_t
NativeInteger_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_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);
}

View File

@ -38,6 +38,11 @@ asn_TYPE_operation_t asn_OP_OBJECT_IDENTIFIER = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OBJECT_IDENTIFIER_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OBJECT_IDENTIFIER_decode_oer,
OBJECT_IDENTIFIER_encode_oer,

View File

@ -45,6 +45,10 @@ xer_type_decoder_f OBJECT_IDENTIFIER_decode_xer;
xer_type_encoder_f OBJECT_IDENTIFIER_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f OBJECT_IDENTIFIER_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
#define OBJECT_IDENTIFIER_decode_oer oer_decode_primitive
#define OBJECT_IDENTIFIER_encode_oer oer_encode_primitive

View File

@ -0,0 +1,28 @@
/*
* 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 <OBJECT_IDENTIFIER.h>
asn_enc_rval_t
OBJECT_IDENTIFIER_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const OBJECT_IDENTIFIER_t *st = (const OBJECT_IDENTIFIER_t *)sptr;
asn_enc_rval_t er = {0,0,0};
(void)ilevel;
(void)flags;
if(!st || !st->buf) {
ASN__ENCODE_FAILED;
}
er.encoded = OBJECT_IDENTIFIER__dump_body(st, cb, app_key);
if(er.encoded < 0) ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);
}

View File

@ -40,6 +40,11 @@ asn_TYPE_operation_t asn_OP_OCTET_STRING = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,

View File

@ -45,6 +45,11 @@ xer_type_encoder_f OCTET_STRING_encode_xer;
xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f OCTET_STRING_encode_jer;
jer_type_encoder_f OCTET_STRING_encode_jer_utf8;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
oer_type_decoder_f OCTET_STRING_decode_oer;
oer_type_encoder_f OCTET_STRING_encode_oer;

View File

@ -173,9 +173,10 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
/* Get the PER length */
if (csiz->upper_bound - csiz->lower_bound == 0)
/* Indefinite length case */
raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
raw_len = aper_get_length(pd, -1, -1, csiz->effective_bits, &repeat);
else
raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
raw_len = aper_get_length(pd, csiz->lower_bound, csiz->upper_bound,
csiz->effective_bits, &repeat);
if(raw_len < 0) RETURN(RC_WMORE);
raw_len += csiz->lower_bound;
@ -342,10 +343,9 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
st->size, sizeinunits - csiz->lower_bound,
csiz->effective_bits);
if (csiz->effective_bits > 0) {
ret = aper_put_length(po,
csiz->upper_bound - csiz->lower_bound + 1,
sizeinunits - csiz->lower_bound, 0);
if(ret) ASN__ENCODE_FAILED;
ret = aper_put_length(po, csiz->lower_bound, csiz->upper_bound,
sizeinunits - csiz->lower_bound, NULL);
if(ret < 0) ASN__ENCODE_FAILED;
}
if (csiz->effective_bits > 0 || (st->size > 2)
|| (csiz->upper_bound > (2 * 8 / unit_bits))
@ -372,7 +372,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
ASN_DEBUG("Encoding %lu bytes", st->size);
if(sizeinunits == 0) {
if(aper_put_length(po, -1, 0, 0))
if(aper_put_length(po, -1, -1, 0, NULL) < 0)
ASN__ENCODE_FAILED;
ASN__ENCODED_OK(er);
}
@ -380,7 +380,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
buf = st->buf;
while(sizeinunits) {
int need_eom = 0;
ssize_t maySave = aper_put_length(po, -1, sizeinunits, &need_eom);
ssize_t maySave = aper_put_length(po, -1, -1, sizeinunits, &need_eom);
if(maySave < 0) ASN__ENCODE_FAILED;
@ -404,7 +404,7 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
buf += maySave >> 3;
sizeinunits -= maySave;
assert(!(maySave & 0x07) || !sizeinunits);
if(need_eom && aper_put_length(po, -1, 0, 0))
if(need_eom && (aper_put_length(po, -1, -1, 0, NULL) < 0))
ASN__ENCODE_FAILED; /* End of Message length */
}

View File

@ -0,0 +1,151 @@
/*
* 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 <OCTET_STRING.h>
#include <BIT_STRING.h> /* for .bits_unused member */
asn_enc_rval_t
OCTET_STRING_encode_jer(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const char * const h2c = "0123456789ABCDEF";
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er = { 0, 0, 0 };
char scratch[16 * 3 + 4];
char *p = scratch;
uint8_t *buf;
uint8_t *end;
size_t i;
if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED;
er.encoded = 0;
/*
* Dump the contents of the buffer in hexadecimal.
*/
buf = st->buf;
end = buf + st->size;
for(i = 0; buf < end; buf++, i++) {
if(!(i % 16) && (i || st->size > 16)) {
ASN__CALLBACK(scratch, p-scratch);
p = scratch;
ASN__TEXT_INDENT(1, ilevel);
}
*p++ = h2c[(*buf >> 4) & 0x0F];
*p++ = h2c[*buf & 0x0F];
*p++ = 0x20;
}
if(p - scratch) {
p--; /* Remove the tail space */
ASN__CALLBACK3("\"", 1, scratch, p-scratch, "\"", 1); /* Dump the rest */
if(st->size > 16)
ASN__TEXT_INDENT(1, ilevel-1);
}
ASN__ENCODED_OK(er);
cb_failed:
ASN__ENCODE_FAILED;
}
static const struct OCTET_STRING__jer_escape_table_s {
const char *string;
int size;
} OCTET_STRING__jer_escape_table[] = {
#define OSXET(s) { s, sizeof(s) - 1 }
OSXET("\074\156\165\154\057\076"), /* <nul/> */
OSXET("\074\163\157\150\057\076"), /* <soh/> */
OSXET("\074\163\164\170\057\076"), /* <stx/> */
OSXET("\074\145\164\170\057\076"), /* <etx/> */
OSXET("\074\145\157\164\057\076"), /* <eot/> */
OSXET("\074\145\156\161\057\076"), /* <enq/> */
OSXET("\074\141\143\153\057\076"), /* <ack/> */
OSXET("\074\142\145\154\057\076"), /* <bel/> */
OSXET("\074\142\163\057\076"), /* <bs/> */
OSXET("\011"), /* \t */
OSXET("\012"), /* \n */
OSXET("\074\166\164\057\076"), /* <vt/> */
OSXET("\074\146\146\057\076"), /* <ff/> */
OSXET("\015"), /* \r */
OSXET("\074\163\157\057\076"), /* <so/> */
OSXET("\074\163\151\057\076"), /* <si/> */
OSXET("\074\144\154\145\057\076"), /* <dle/> */
OSXET("\074\144\143\061\057\076"), /* <de1/> */
OSXET("\074\144\143\062\057\076"), /* <de2/> */
OSXET("\074\144\143\063\057\076"), /* <de3/> */
OSXET("\074\144\143\064\057\076"), /* <de4/> */
OSXET("\074\156\141\153\057\076"), /* <nak/> */
OSXET("\074\163\171\156\057\076"), /* <syn/> */
OSXET("\074\145\164\142\057\076"), /* <etb/> */
OSXET("\074\143\141\156\057\076"), /* <can/> */
OSXET("\074\145\155\057\076"), /* <em/> */
OSXET("\074\163\165\142\057\076"), /* <sub/> */
OSXET("\074\145\163\143\057\076"), /* <esc/> */
OSXET("\074\151\163\064\057\076"), /* <is4/> */
OSXET("\074\151\163\063\057\076"), /* <is3/> */
OSXET("\074\151\163\062\057\076"), /* <is2/> */
OSXET("\074\151\163\061\057\076"), /* <is1/> */
{ 0, 0 }, /* " " */
{ 0, 0 }, /* ! */
{ 0, 0 }, /* \" */
{ 0, 0 }, /* # */
{ 0, 0 }, /* $ */
{ 0, 0 }, /* % */
OSXET("\046\141\155\160\073"), /* &amp; */
{ 0, 0 }, /* ' */
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* ()*+,-./ */
{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, /* 01234567 */
{0,0},{0,0},{0,0},{0,0}, /* 89:; */
OSXET("\046\154\164\073"), /* &lt; */
{ 0, 0 }, /* = */
OSXET("\046\147\164\073"), /* &gt; */
};
asn_enc_rval_t
OCTET_STRING_encode_jer_utf8(const asn_TYPE_descriptor_t *td, const void *sptr,
int ilevel, enum jer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
asn_enc_rval_t er = { 0, 0, 0 };
uint8_t *buf, *end;
uint8_t *ss; /* Sequence start */
ssize_t encoded_len = 0;
(void)ilevel; /* Unused argument */
(void)flags; /* Unused argument */
if(!st || (!st->buf && st->size))
ASN__ENCODE_FAILED;
buf = st->buf;
end = buf + st->size;
for(ss = buf; buf < end; buf++) {
unsigned int ch = *buf;
int s_len; /* Special encoding sequence length */
/*
* Escape certain characters: X.680/11.15
*/
if(ch < sizeof(OCTET_STRING__jer_escape_table)
/ sizeof(OCTET_STRING__jer_escape_table[0])
&& (s_len = OCTET_STRING__jer_escape_table[ch].size)) {
if(((buf - ss) && cb(ss, buf - ss, app_key) < 0)
|| cb(OCTET_STRING__jer_escape_table[ch].string, s_len, app_key) < 0)
ASN__ENCODE_FAILED;
encoded_len += (buf - ss) + s_len;
ss = buf + 1;
}
}
encoded_len += (buf - ss);
if((buf - ss) && cb(ss, buf - ss, app_key) < 0)
ASN__ENCODE_FAILED;
er.encoded = encoded_len;
ASN__ENCODED_OK(er);
}

View File

@ -28,6 +28,11 @@ asn_TYPE_operation_t asn_OP_OPEN_TYPE = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OPEN_TYPE_encode_jer,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OPEN_TYPE_decode_oer,
OPEN_TYPE_encode_oer,

View File

@ -58,6 +58,10 @@ asn_dec_rval_t OPEN_TYPE_xer_get(
#define OPEN_TYPE_encode_xer CHOICE_encode_xer
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define OPEN_TYPE_encode_jer CHOICE_encode_jer
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
asn_dec_rval_t OPEN_TYPE_oer_get(
const asn_codec_ctx_t *opt_codec_ctx,

View File

@ -146,7 +146,7 @@ OPEN_TYPE_aper_unknown_type_discard_bytes (asn_per_data_t *pd) {
rv.code = RC_FAIL;
do {
bytes = aper_get_length(pd, -1, -1, &repeat);
bytes = aper_get_length(pd, -1, -1, -1, &repeat);
if (bytes > 10 * ASN_DUMMY_BYTES)
{
return rv;
@ -171,4 +171,3 @@ OPEN_TYPE_aper_unknown_type_discard_bytes (asn_per_data_t *pd) {
return rv;
#undef ASN_DUMMY_BYTES
}

View File

@ -34,6 +34,11 @@ asn_TYPE_operation_t asn_OP_ObjectDescriptor = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer_utf8,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
0,

View File

@ -34,6 +34,10 @@ extern asn_TYPE_operation_t asn_OP_ObjectDescriptor;
#define ObjectDescriptor_encode_xer OCTET_STRING_encode_xer_utf8
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define ObjectDescriptor_encode_jer OCTET_STRING_encode_jer_utf8
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define ObjectDescriptor_decode_uper OCTET_STRING_decode_uper
#define ObjectDescriptor_encode_uper OCTET_STRING_encode_uper

View File

@ -71,6 +71,11 @@ asn_TYPE_operation_t asn_OP_PrintableString = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer_utf8,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,

View File

@ -36,6 +36,10 @@ asn_constr_check_f PrintableString_constraint;
#define PrintableString_encode_xer OCTET_STRING_encode_xer_utf8
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define PrintableString_encode_jer OCTET_STRING_encode_jer_utf8
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define PrintableString_decode_uper OCTET_STRING_decode_uper
#define PrintableString_encode_uper OCTET_STRING_encode_uper

View File

@ -35,6 +35,11 @@ asn_TYPE_operation_t asn_OP_UTF8String = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer_utf8,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,

View File

@ -36,6 +36,10 @@ asn_constr_check_f UTF8String_constraint;
#define UTF8String_encode_xer OCTET_STRING_encode_xer_utf8
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define UTF8String_encode_jer OCTET_STRING_encode_jer_utf8
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define UTF8String_decode_uper OCTET_STRING_decode_uper
#define UTF8String_encode_uper OCTET_STRING_encode_uper

View File

@ -41,6 +41,11 @@ asn_TYPE_operation_t asn_OP_VisibleString = {
0,
0,
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
OCTET_STRING_encode_jer_utf8,
#else
0,
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_OER_SUPPORT)
OCTET_STRING_decode_oer,
OCTET_STRING_encode_oer,

View File

@ -36,6 +36,10 @@ asn_constr_check_f VisibleString_constraint;
#define VisibleString_encode_xer OCTET_STRING_encode_xer
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
#if !defined(ASN_DISABLE_JER_SUPPORT)
#define VisibleString_encode_jer OCTET_STRING_encode_jer
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT)
#define VisibleString_decode_uper OCTET_STRING_decode_uper
#define VisibleString_encode_uper OCTET_STRING_encode_uper

View File

@ -75,7 +75,7 @@ aper_decode(const asn_codec_ctx_t *opt_codec_ctx,
*/
if(!td->op->aper_decoder)
ASN__DECODE_FAILED; /* PER is not compiled in */
rval = td->op->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
rval = td->op->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
if(rval.code == RC_OK) {
/* Return the number of consumed bits */
rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)

View File

@ -25,7 +25,7 @@ aper_open_type_get_simple(const asn_codec_ctx_t *ctx,
ASN_DEBUG("Getting open type %s...", td->name);
do {
chunk_bytes = aper_get_length(pd, -1, -1, &repeat);
chunk_bytes = aper_get_length(pd, -1, -1, -1, &repeat);
if(chunk_bytes < 0) {
FREEMEM(buf);
ASN__DECODE_STARVED;
@ -101,12 +101,12 @@ aper_open_type_put(const asn_TYPE_descriptor_t *td,
for(bptr = buf, toGo = size; toGo;) {
int need_eom = 0;
ssize_t maySave = aper_put_length(po, -1, toGo, &need_eom);
ssize_t maySave = aper_put_length(po, -1, -1, toGo, &need_eom);
if(maySave < 0) break;
if(per_put_many_bits(po, bptr, maySave * 8)) break;
bptr = (char *)bptr + maySave;
toGo -= maySave;
if(need_eom && aper_put_length(po, -1, 0, 0)) {
if(need_eom && (aper_put_length(po, -1, -1, 0, NULL) < 0)) {
FREEMEM(buf);
return -1;
}

View File

@ -17,26 +17,17 @@ aper_get_align(asn_per_data_t *pd) {
}
ssize_t
aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
aper_get_length(asn_per_data_t *pd, ssize_t lb, ssize_t ub,
int ebits, int *repeat) {
int constrained = (lb >= 0) && (ub >= 0);
ssize_t value;
*repeat = 0;
/*
* ITU-T X.691(08/2015)
* #11.9.4.2
*
* If the length determinant "n" to be encoded is a normally small length,
* or a constrained whole number with "ub" greater than or equal to 64K,
* or is a semi-constrained whole number, then "n" shall be encoded
* as specified in 11.9.3.4 to 11.9.3.8.4.
*
* NOTE Thus, if "ub" is greater than or equal to 64K,
* the encoding of the length determinant is the same as it would be
* if the length were unconstrained.
*/
if (range <= 65535 && range >= 0)
if (constrained && ub < 65536) {
int range = ub - lb + 1;
return aper_get_nsnnwn(pd, range);
}
if (aper_get_align(pd) < 0)
return -1;
@ -72,13 +63,12 @@ aper_get_nslength(asn_per_data_t *pd) {
return length;
} else {
int repeat;
length = aper_get_length(pd, -1, -1, &repeat);
length = aper_get_length(pd, -1, -1, -1, &repeat);
if(length >= 0 && !repeat) return length;
return -1; /* Error, or do not support >16K extensions */
}
}
#if !defined(USE_OLDER_APER_NSNNWN)
ssize_t
aper_get_nsnnwn(asn_per_data_t *pd, int range) {
ssize_t value;
@ -108,53 +98,28 @@ aper_get_nsnnwn(asn_per_data_t *pd, int range) {
//return -1;
int length;
/* handle indefinite range */
length = per_get_few_bits(pd, 1);
if (length == 0)
return per_get_few_bits(pd, 6);
/* handle indefinite range */
length = per_get_few_bits(pd, 1);
if (length == 0)
return per_get_few_bits(pd, 6);
if (aper_get_align(pd) < 0)
return -1;
if (aper_get_align(pd) < 0)
return -1;
length = per_get_few_bits(pd, 8);
/* the length is not likely to be that big */
if (length > 4)
return -1;
value = 0;
if (per_get_many_bits(pd, (uint8_t *)&value, 0, length * 8) < 0)
return -1;
return value;
length = per_get_few_bits(pd, 8);
/* the length is not likely to be that big */
if (length > 4)
return -1;
value = 0;
if (per_get_many_bits(pd, (uint8_t *)&value, 0, length * 8) < 0)
return -1;
return value;
}
if (aper_get_align(pd) < 0)
return -1;
value = per_get_few_bits(pd, 8 * bytes);
return value;
}
#else /* old APER codec */
ssize_t
aper_get_nsnnwn(asn_per_data_t *pd, int dummy_range) {
ssize_t value;
ASN_DEBUG("Get the normally small non-negative whole number APER");
value = per_get_few_bits(pd, 7);
if(value & 64) { /* implicit (value < 0) */
value &= 63;
value <<= 2;
value |= per_get_few_bits(pd, 2);
if(value & 128) /* implicit (value < 0) */
return -1;
if(value == 0)
return 0;
if(value >= 3)
return -1;
value = per_get_few_bits(pd, 8 * value);
return value;
}
return value;
}
#endif /* don't use old APER */
int aper_put_align(asn_per_outp_t *po) {
@ -167,38 +132,42 @@ int aper_put_align(asn_per_outp_t *po) {
}
ssize_t
aper_put_length(asn_per_outp_t *po, int range, size_t length, int *need_eom) {
int dummy = 0;
if(!need_eom) need_eom = &dummy;
aper_put_length(asn_per_outp_t *po, ssize_t lb, ssize_t ub, size_t n, int *need_eom) {
int constrained = (lb >= 0) && (ub >= 0);
int dummy = 0;
if(!need_eom) need_eom = &dummy;
*need_eom = 0;
*need_eom = 0;
ASN_DEBUG("APER put length %zu with range %d", length, range);
ASN_DEBUG("APER put length %zu with range (%zd..%zd)", n, lb, ub);
/* 11.9 X.691 Note 2 */
if (range <= 65536 && range >= 0)
return aper_put_nsnnwn(po, range, length);
if (constrained && ub < 65536) {
int range = ub - lb + 1;
return aper_put_nsnnwn(po, range, n) ? -1 : (ssize_t)n;
}
if (aper_put_align(po) < 0)
return -1;
if(length <= 127) /* #11.9.3.6 */{
return per_put_few_bits(po, length, 8)
? -1 : (ssize_t)length;
if(n <= 127) { /* #11.9.3.6 */
return per_put_few_bits(po, n, 8)
? -1 : (ssize_t)n;
}
else if(length < 16384) /* #11.9.3.7 */
return per_put_few_bits(po, length|0x8000, 16)
? -1 : (ssize_t)length;
else if(n < 16384) /* #11.9.3.7 */
return per_put_few_bits(po, n|0x8000, 16)
? -1 : (ssize_t)n;
*need_eom = 0 == (length & 16383);
length >>= 14;
if(length > 4) {
*need_eom = 0;
length = 4;
}
*need_eom = 0 == (n & 16383);
n >>= 14;
if(n > 4) {
*need_eom = 0;
n = 4;
}
return per_put_few_bits(po, 0xC0 | length, 8)
? -1 : (ssize_t)(length << 14);
return per_put_few_bits(po, 0xC0 | n, 8)
? -1 : (ssize_t)(n << 14);
}
@ -210,7 +179,7 @@ aper_put_nslength(asn_per_outp_t *po, size_t length) {
if(length == 0) return -1;
return per_put_few_bits(po, length-1, 7) ? -1 : 0;
} else {
if(aper_put_length(po, -1, length, 0) != (ssize_t)length) {
if(aper_put_length(po, -1, -1, length, NULL) != (ssize_t)length) {
/* This might happen in case of >16K extensions */
return -1;
}
@ -219,12 +188,11 @@ aper_put_nslength(asn_per_outp_t *po, size_t length) {
return 0;
}
#if !defined(USE_OLDER_APER_NSNNWN)
int
aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
int bytes;
ASN_DEBUG("aper put nsnnwn %d with range %d", number, range);
ASN_DEBUG("aper put nsnnwn %d with range %d", number, range);
/* 10.5.7.1 X.691 */
if(range < 0) {
int i;
@ -245,8 +213,12 @@ aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
}
return per_put_few_bits(po, number, i);
} else if(range == 256) {
if (number >= range)
return -1;
bytes = 1;
} else if(range <= 65536) {
if (number >= range)
return -1;
bytes = 2;
} else { /* Ranges > 64K */
int i;
@ -263,30 +235,5 @@ aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
/* if(per_put_few_bits(po, bytes, 8))
return -1;
*/
return per_put_few_bits(po, number, 8 * bytes);
return per_put_few_bits(po, number, 8 * bytes);
}
#else /* preserve old code base in case */
int
aper_put_nsnnwn(asn_per_outp_t *po, int dummy_range, int n) {
int bytes;
ASN_DEBUG("aper_put_nsnnwn");
if(n <= 63) {
if(n < 0) return -1;
return per_put_few_bits(po, n, 7);
}
if(n < 256)
bytes = 1;
else if(n < 65536)
bytes = 2;
else if(n < 256 * 65536)
bytes = 3;
else
return -1; /* This is not a "normally small" value */
if(per_put_few_bits(po, bytes, 8))
return -1;
return per_put_few_bits(po, n, 8 * bytes);
}
#endif /* which aper_put_nsnnwn() */

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