Commit Graph

1642 Commits

Author SHA1 Message Date
Sukchan Lee 66b2f6120e Release v2.6.1 2023-03-08 23:59:33 +09:00
Sukchan Lee cedec3a7b9 Added log message for troubleshooting #2117 2023-03-06 21:19:42 +09:00
Sukchan Lee e41afff7ac Added N32 Interface to implement SEPP 2023-03-05 22:55:36 +09:00
Sukchan Lee a8790713d7 [Release-17] Upgrade PFCP to v17.7.1 2023-03-05 22:33:01 +09:00
Sukchan Lee 3b8a1386e4 [Release-17] Upgrade GTPv1/v2 to v17.4.0/v17.7.0 2023-03-05 12:37:14 +09:00
Sukchan Lee fd9c211005 [PFCP/GTP] Fixed security bug (#2127,#2128,#2129) 2023-03-05 08:35:30 +09:00
Sukchan Lee 62b6b42e88 [Release-17] Upgrade NAS to v17.8.0 2023-03-04 23:47:40 +09:00
Sukchan Lee 4d44b1843e [Release-17] Upgrade SBI to v17.x.0 2023-03-01 19:56:49 +09:00
Sukchan Lee 969c116e77 [SBI] Crash occurs when ENUM in the MAP (#2103) 2023-03-01 17:50:25 +09:00
Sukchan Lee ce668c556c [SBI] Fixed openapitools MAP generation (#2103)
MAP was generated incorrectly because {{#items}}..{{#items}} was
missing.

Because of this, If scpInfo has scpPort, NRF crashes.
2023-02-26 10:01:08 +09:00
mitmitmitm 1d8324af9f [PFCP] Support pfcp advertise address 2023-02-24 20:53:28 +09:00
Sukchan Lee 10477ecdc9 [Release-17] Upgrade S1AP/NGAP to v17.3.9 2023-02-21 21:48:06 +09:00
Sukchan Lee 82e9016164 [AMF/SMF] Fixed a crash (#2030, #2074, #2085) 2023-02-20 20:49:48 +09:00
Sukchan Lee 0df402bd49 [SBI] Move HNET PKI conf inside UDM 2023-02-18 12:41:08 +09:00
Sukchan Lee 05fbaf6958 [SBI] HTTP2-TLS verification - ConfFile Changed
You should add the following configuration if you would not use TLS.

sbi:
    server:
      no_tls: true
    client:
      no_tls: true
2023-02-18 10:58:29 +09:00
Sukchan Lee b80db453e8 [GTP/PFCP] Follow-up on #2073 2023-02-17 06:55:22 +09:00
Spencer Sevilla d30fcbb848
[pfcp] response_timeout should not call ogs_pfcp_xact_delete (#2072)
* [pfcp] response_timeout should never call ogs_pfcp_xact_delete (#50)

* also remove ogs_pfcp_xact_delete since never called

* also had to catch one more ogs_pfcp_sendto()

---------

Co-authored-by: Spencer Sevilla <spencer@MacBook-Air.local>
2023-02-17 06:50:50 +09:00
Sukchan Lee 512cc2d01b Further Follow-up on #2063 2023-02-16 22:16:20 +09:00
Sukchan Lee e20faeb1ef Follow-up on #2069 2023-02-14 23:07:23 -10:00
Bostjan Meglic dfcd3431c3 [SBI] Fix possible crash when handling PatchItems in NFProfile PATCH req 2023-02-14 23:01:56 -10:00
Bostjan Meglic cef5b38087 [SBI] Do not treat removed streams as errors when sending responses
This is in line with the implementation with microhttpd server
(mhd-server.c).
2023-02-14 10:12:26 -10:00
Sukchan Lee 888e58a94e [AMF] Network Deregister (#2056, #2014, #2021)
Fixed a crash on explicit network-initiated deregister
with SUBSCRIPTION_WITHDRAWN
2023-02-10 23:09:39 +09:00
Bostjan Meglic 474b2d4134 [SBI,NF] Don't treat SBI connection errors as asserts 2023-02-07 22:49:11 +09:00
Sukchan Lee b7905725ac [SBI] HTTP/2 user-agent header (#2048)
Open5GS now checks User-AGENT only in SCP.
2023-02-05 09:50:44 +09:00
Bostjan Meglic 5f9b941d25 Remove not valid UTF-8 characters
These UTF-8 characters are causing issues with static code analysis
tools.

Error: encoding error in ./lib/crypt/zuc.c
'utf-8' codec can't decode byte 0x97 in position 3948: invalid start byte
Python3 requires input character data to be perfectly encoded;
it also requires perfectly correct system encoding settings.
Unfortunately, your data and/or system settings are not.
2023-01-31 00:22:16 +09:00
Sukchan Lee 131ecb4a44 [CORE] Add defense code to ogs_pkbuf_copy (#2032)
Added a defense code to prevent NF crash when ogs_pkbuf_copy() size is 0.
2023-01-29 16:45:42 +09:00
Sukchan Lee b7386284a7 [NRF] Fixed a crash during NRF discovery (#2034)
Other NF instances are obtained through NRF
or created directly through configuration files.

Other NFs created by the config file should not be passed
through NRF discovery or anything like that.

Since self-created NF Instances do not have an ID,
they are implemented to exclude them from NRF Discovery.
2023-01-29 11:22:45 +09:00
Sukchan Lee f50591a8f7 Added Service-MAP to Requester-Features (#2027)
ALWAYS Added Service-MAP to Requester-Features in Discovery Option
2023-01-29 01:35:47 +09:00
mitmitmitm 739cb599d1 [UDR] Read framed routes from DB send them in sm-data
The framed routes are stored in mongo as

 {
     "imsi" : "$IMSI",
     ...,
     "slice" :
     [{
         ...,
         "session" :
             ...,
             "ipv4_framed_routes" : ["10.45.33.0/24", "10.45.35.0/24"],
         }],
     }],
 },
2023-01-26 22:37:58 +09:00
mitmitmitm 11568bbff7 ogs_session_s.framed_routes type change to (char **)
OpenAPI_list_t wasn't optimal as it created a dependency on ogs-sbi.h.
2023-01-26 22:37:58 +09:00
Sukchan Lee 3715b9ece3 [CORE] OGS_MAX_SDU_LEN->OGS_HUGE_LEN Stack (#2008)
Changed all OGS_MAX_SDU_LEN in the stack to OGS_HUGE_LEN.
2023-01-25 22:24:51 +09:00
Sukchan Lee 596a2f1b5e [SBI] Fixed crash if no BW Unit(Xbps) (#2000) 2023-01-24 21:55:06 +09:00
Sukchan Lee 218b31d006 [CORE] Increase SDU buffer to 32k (#2008) 2023-01-24 21:43:20 +09:00
Sukchan Lee 43eb5f3d7f Fixed warning 2023-01-24 19:06:01 +09:00
Sukchan Lee b108ae0aff [PFCP] buffer overflow in ALPINE (#1911, #2009)
A buffer overflow occurred in ALPINE
because the size of the pfcp message structure increased by

    ogs_pfcp_tlv_framed_route_t framed_route[8];
    ogs_pfcp_tlv_framed_ipv6_route_t framed_ipv6_route[8];
2023-01-24 19:03:00 +09:00
Sukchan Lee 11aac6a164 [CORE] Rollback ogs_pkbuf_copy() from (#2012)
In the previous #2012 working, I've added ogs_pkbuf_free() for original
buffer. But, this rasied double free. So, I've rollback it,
2023-01-24 00:17:10 +09:00
Sukchan Lee c6fd4ae6b8 [LOG] remove ogs_expect_or_return()/return_val() 2023-01-24 00:01:36 +09:00
Sukchan Lee 689574a2d9 [AMF/MME] Fixed crash when no NG/S1 context(#2012) 2023-01-23 10:37:22 +09:00
Sukchan Lee a8f83989f4 Follow-up on #2009 2023-01-23 09:29:00 +09:00
mitmitmitm f6439b998c [SMF] Handle framed routes, forward them to UPF and PCF 2023-01-23 09:26:26 +09:00
mitmitmitm 990abbab2c [UPF] Handle framed routes 2023-01-23 09:26:26 +09:00
mitmitmitm 337a4e5159 [PFCP] Allow up to 8 framed routes for each IP type 2023-01-23 09:26:26 +09:00
Sukchan Lee ff261681c0 [PROTO] Increase SDU buffer 8k->16k (#2008) 2023-01-21 12:58:43 +09:00
Sukchan Lee 0e0085c69f [UPF] Fixed bug when 2 PDRs with same TEID (#2003) 2023-01-18 23:31:54 +09:00
Sukchan Lee 01a7b3c9b8 Follow-up on #1991 2023-01-14 09:20:52 +09:00
jmasterfunk84 3fd7ecc9a2
[MME] Add Purge-UE Capability (#1991)
* [MME] Add Purge-UE Capability

* Add OGS_GTP_..._PURGE_AND_REMOVE to split CLR case
2023-01-14 09:13:48 +09:00
Sukchan Lee 5128ebc6c6 [SMF] Added User-ID, APP_DNN, S-NSSAI (#1986)
Added User-ID, APP_DNN, S-NSSAI in N4 PFCP Session Establishment Request
2023-01-13 10:28:40 +09:00
Bostjan Meglic ddfd7b9373 [pfcp] Fix code style 2023-01-09 21:47:30 +09:00
Sukchan Lee 7f9afa0213 [AMF] More Follow-up on #1987 2023-01-08 20:02:18 +09:00
Sukchan Lee 79d46be086 Introduced Subscription identifier de-concealing
o Generate the private key as below.
   $ openssl genpkey -algorithm X25519 -out /etc/open5gs/hnet/curve25519-1.key
   $ openssl ecparam -name prime256v1 -genkey -conv_form compressed -out /etc/open5gs/hnet/secp256r1-2.key

 o The private and public keys can be viewed with the command.
   The public key is used when creating the SIM.
   $ openssl pkey -in /etc/open5gs/hnet/curve25519-1.key -text
   $ openssl ec -in /etc/open5gs/hnet/secp256r1-2.key -conv_form compressed -text

In ausf/udm.yaml

 hnet:
    o Home network public key identifier(PKI) value : 1
      Protection scheme identifier : ECIES scheme profile A
    - id: 1
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 2
      Protection scheme identifier : ECIES scheme profile B
    - id: 2
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

    o Home network public key identifier(PKI) value : 3
      Protection scheme identifier : ECIES scheme profile A
    - id: 3
      scheme: 1
      key: /etc/open5gs/hnet/curve25519-1.key

    o Home network public key identifier(PKI) value : 4
      Protection scheme identifier : ECIES scheme profile B
    - id: 4
      scheme: 2
      key: /etc/open5gs/hnet/secp256r1-2.key

Related to #1779
2022-12-24 20:22:45 +09:00
mitmitmitm 0ebe07c83d [mongo] Use "ping" command instead of "serverStatus"
"serverStatus" on the "admin" database may fail due to insufficient privileges.
2022-12-21 23:15:34 +09:00
Gaber Stare b56c33479e Add NF load to NRF Heartbeat
The current load percentage of the NF Service Consumer is provided
in the payload body of the PATCH request when periodically
contacting the NRF (heart-beat).

AMF: ratio between currently connected ran_ue and maximum number of them
SMF: ratio between current PDU sessions and maximum available
PCF: ratio between current AM+SM policy associations and maximum available
     or ratio between currently connected UEs and maximum number of them
     (the load which is higher)
AUSF, UDM: ratio between currently connected UE and maximum number of them
BSF: ratio between current sessions and maximum available
NSSF: ratio between currently used NSIs and maximum number of them

NRF currently doesn't determine that the NF Profile has changed.
2022-12-14 22:53:56 +09:00
Lester bd080f5095 free socket fd
call ogs_sock_destroy to free sock when fail to get socket fd
2022-12-09 16:10:44 +09:00
Gaber Stare 0c2a3b0f39 [PCF] Add metrics support
Expose metrics with labels according to ETSI TS 128 552 V16.13.0 in
PCF by using hash.

The metrics are named respecting the rule:
<generation>_<measurement_object_class>_<measurement_family_name>_<metric_name_as_in_TS_128_552>

Since slice itself is not unique, the plmnid label is exposed in
addition to snssai.

AM policy:
fivegs_pcffunction_pa_policyamassoreq and
fivegs_pcffunction_pa_policyamassosucc do not expose snssai label
since it is not available at the time of exposure.
plmnid is defined during AM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policyamassoreq is preserved.

SM policy:
snssai is defined during SM policy processing, so not to lose the
difference to ...succ, the basic metric
fivegs_pcffunction_pa_policysmassoreq is preserved.

Those 2 basic metrics retain their position but are exposed with empty
labels.
Metrics with labels are called later, when the label values are known.

Exposed metrics example:
-standard counters:
fivegs_pcffunction_pa_policyamassoreq{plmnid=""} 3
fivegs_pcffunction_pa_policyamassoreq{plmnid="99970"} 3
fivegs_pcffunction_pa_policyamassosucc{plmnid="99970"} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="",snssai=""} 3
fivegs_pcffunction_pa_policysmassoreq{plmnid="99970",snssai="1000009"} 3
fivegs_pcffunction_pa_policysmassosucc{plmnid="99970",snssai="1000009"} 3

-nonstandard gauge (added for controlling purposes -
same metric as existing metric on AMF and SMF):
fivegs_pcffunction_pa_sessionnbr{plmnid="99970",snssai="1000009"} 0
2022-12-06 22:57:24 +09:00
Sukchan Lee a5fd315e11 [SBI] Case-Insensitive inside MIME message (#1939) 2022-12-05 21:30:24 +09:00
Sukchan Lee 0861a045ef [UPF] Fixed an infinte loop when ext_len is 0 2022-11-30 16:40:57 +09:00
Sukchan Lee 944adaabbf [AMF/MME] Added Timer Configuration (#1905) 2022-11-29 23:22:16 +09:00
mitmitmitm 3870216a6b [AMF] Add support for SDM subscription and authentication deletion 2022-11-29 23:10:49 +09:00
mitmitmitm dbd0e654c8 OpenAPI: Add functions OpenAPI_list_clear and OpenAPI_list_insert_prev 2022-11-29 23:10:49 +09:00
Sukchan Lee d82f338246 Fixed alpine stack overflow (#1911) 2022-11-27 00:03:56 +09:00
Sukchan Lee 8ce18b3828 [AMF/MME] Refactor SM to prevent crash (#1912) 2022-11-26 21:38:46 +09:00
mitmitmitm a951d683d2 OpenAPI: AnyType for ChangeItem's newValue and origValue properties 2022-11-24 17:30:38 +09:00
mitmitmitm b85ad61e2b OpenAPI: Generate patch_item.[ch] from OpenAPI specifications 2022-11-24 17:30:38 +09:00
mitmitmitm 36734cac7c OpenAPI: Move any_type.[ch] from custom/ into sbi/openapi/model/
This makes it possible to have object values of type "any_type" in OpenAPI
specifications.
2022-11-24 17:30:38 +09:00
Sukchan Lee 982ac61894 Prometheus metrics set to default 2022-11-21 22:06:29 +09:00
Sukchan Lee 57f1f2c21a Fixed crash after 48 hours of running (#1893) 2022-11-18 23:28:35 +09:00
Sukchan Lee d39bafc6d6 [SBI] Introduced HTTP2-TLS based on #1865
Verfication is not implemented.
2022-11-12 10:47:18 +09:00
Sukchan Lee 0859dd4453 Follow-up on #1865 2022-11-12 09:37:43 +09:00
Flander Bojan 4ba90fbd3b Fix TLS error handling 2022-11-12 09:30:31 +09:00
Flander Bojan 141c345b75 Add TLS support 2022-11-12 09:30:31 +09:00
Sukchan Lee fa35b06963 Follow-up on #1876 2022-11-04 14:58:47 +09:00
Bostjan Meglic 00a86c5a73 [SBI] Do not send empty arrays when registering to NRF
OpenAPI dictates that certain arrays should have at least one item,
otherwise they should not be present.
This includes lists for IPv4/v6 addresses, TAI/TAC lists, ...

Add a check if there is at least 1 item, before creating an array.
Also move variable declarations to inner blocks, to prevent some
accidental usage out of wanted scope.
2022-11-04 14:58:33 +09:00
Sukchan Lee cca53fb8e8 SCP had a serioud memory problem and fixed it 2022-10-30 13:35:25 +09:00
Sukchan Lee ec4acd4eca remove warning in MacOSX (#1797) 2022-10-25 21:14:53 +09:00
Sukchan Lee 5ccb5f0f99 SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
jmasterfunk84 8fb85db310 [DBI] Disable Change Streams with mongo Version
Support for change stream is only available in mongoc >=1.9.0
- Disabled related functions in dbi.
Support for bson to json used in debug statement only in libbson >=1.7.0
- Simple debug message in lower versions
2022-10-13 17:33:35 +09:00
Sukchan Lee 704fe72d11 Updated SBI module
- Introduced NF_INSTANCE_ID/NF_INSTANCE_TYPE
- Skip SCP in configuration validation
2022-10-08 11:48:12 +09:00
Bostjan Meglic a99a76d916 [AMF,UDM] Add support to subscribe to SDM changes
AMF subscribes to UDM for each registered UE.

At the moment, UDM does not send callback to AMF when any of the UE's
properties in the database changes.
At the moment, AMF does properly parse the ModificationNotification, but
does not do anything useful.
2022-10-06 21:20:10 +09:00
safaorhann e9aaceee98 fix dropped_dl_traffic_threshold ie. 2022-10-06 10:40:08 +09:00
Sukchan Lee dc6ca962bb Follow-up on #1797 2022-10-06 10:10:31 +09:00
Sukchan Lee 6d27fbb8cc Follow-up on #1797 2022-10-05 14:50:52 +09:00
jmasterfunk84 15680003b5
[MME] Cancel Location while Idle (#1797)
* Cancel Location while Idle Fix

* Forgot about SGSAP on MME Change.

Added "action" to sgsap_send_detach..

* Make handle_clr uniform with other handlers

* Added Robustness for Any Detach Type

* Memory wasn't freed upon CLR for unknown IMSIs

* Moving MME Detach to new PR
2022-10-05 11:06:01 +09:00
Sukchan Lee 7c8722d9d4 [SBI] Client Request timeout
TS29.500
Ch 6.11 Detection and handling of late arriving requests

In Open5GS, this part was hard-corded.

HTTP2 Client sends a request and waits for 10 seconds.
If no response is received from the HTTP2 Server,
HTTP2 Client performs the exception handling.

In this commit, HTTP2 client sends Header with setting Max-Rsp-Time to 10 seconds.
However, HTTP2 server has not yet been implemented to process this value.
The server is still processing using hard-corded values (10 seconds).
2022-10-03 11:43:34 +09:00
Sukchan Lee c537166d37 Follow-on up #1794 2022-10-02 19:41:52 +09:00
jmasterfunk84 1f2a8678ed
[MME] Support for Insert Subscriber Data (#1794)
* [MME] Support for Insert Subscriber Data

* Supported AVPs in IDR will overwrite existing subscription information
* Provide error on partial APN updates
* IDR and ULA use same function to process AVPs
* Move subdatamask values into s6a, so both HSS and MME can use them
* Updates are not actioned at this time.  A Re-attach is required for
  most changes to take effect

* Memory issue on IDR exceptions

* Remove of handling MSIDSN change until DSR is used
2022-10-02 19:36:24 +09:00
Sukchan Lee 71a1516b03 [Security] Fixed a crash for port scanning (#1767) 2022-10-01 13:28:41 +09:00
Bostjan Meglic 2d4fbf92eb [config,metrics] Move metrics configuration section under respective NF section
Without this change, using metrics with core setup configurations
(configs/vonr.yaml for example) would not be possible. Having one
metrics section for whole config file causes every NF to start metrics
server on same port causing an abort.
2022-09-25 19:17:49 +09:00
Sukchan Lee 31fcedc12e Follow-up on #1770 2022-09-25 16:42:46 +09:00
Spencer Sevilla 0759c2da5a [core] fix timer overflow on 32bit systems (#16)
must cast ts.tv_sec to 64bits before we multiply it to prevent 32bit math and overflow
2022-09-25 16:41:50 +09:00
Sukchan Lee 724fa56843 Fixed HTTP2 crashes for random JSON data (#1769) 2022-09-25 15:06:37 +09:00
Sukchan Lee c2f6a020a7 [TLV] Added more debug information (#1767) 2022-09-25 09:17:23 +09:00
Sukchan Lee a0d643e17f Follow-up on #1758 2022-09-23 21:25:58 +09:00
jmasterfunk84 7f5476b111
[HSS] Enable Change Streams (#1758)
* [HSS] Enable Change Streams
* Enable Events and Timers in HSS
* Integrate change streams in dbi
* mongodb should be configured with replica sets enabled to use feature
* Change streams are optional in HSS
* Timer will poll change stream for changes in the database
* As changes are detected, event is created to perform the correct
  action

* Changes made as suggested
2022-09-23 21:24:50 +09:00
Sukchan Lee 2b8db5d488 Follow-up on #1757 2022-09-23 20:42:04 +09:00
Gaber Stare d3d4e5ce60 [AMF] Add amfInfoList to NFProfile
The actual configured GUAMIs and TAIs are used to form NF profile.
Comparing to SMF the "info" section is not introduced into amf.yaml!
Each amf_id (region, set) produces a separate Info in the InfoList.
Guami list consists of all GUAMIs of particular Info.
taiList consists of all TAIs for all PLMNs of particular Info.

Examle:

amf.yaml:
    guami:
      - plmn_id:
          mcc: 999
          mnc: 70
        amf_id:
          region: 2
          set: 2
          pointer: 4
      - plmn_id:
          mcc: 001
          mnc: 01
        amf_id:
          region: 2
          set: 1
      - plmn_id:
          mcc: 001
          mnc: 02
        amf_id:
          region: 2
          set: 2
    tai:
      - plmn_id:
          mcc: 001
          mnc: 01
        tac: [1, 2, 3]
    tai:
      - plmn_id:
          mcc: 002
          mnc: 02
        tac: 4
      - plmn_id:
          mcc: 001
          mnc: 02
        tac: 10
    tai:
      - plmn_id:
          mcc: 004
          mnc: 04
        tac: [6, 7]
      - plmn_id:
          mcc: 005
          mnc: 05
        tac: 8
      - plmn_id:
          mcc: 999
          mnc: 70
        tac: [9, 10]

"amfInfoList":  {
        "1":    {
                "amfSetId":     "002",
                "amfRegionId":  "02",
                "guamiList":    [{
                                "plmnId":       {
                                        "mcc":  "999",
                                        "mnc":  "70"
                                },
                                "amfId":        "020084"
                        }, {
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "02"
                                },
                                "amfId":        "020080"
                        }],
                "taiList":      [{
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "02"
                                },
                                "tac":  "00000a"
                        }, {
                                "plmnId":       {
                                        "mcc":  "999",
                                        "mnc":  "70"
                                },
                                "tac":  "000009"
                        }, {
                                "plmnId":       {
                                        "mcc":  "999",
                                        "mnc":  "70"
                                },
                                "tac":  "00000a"
                        }]
        },
        "2":    {
                "amfSetId":     "001",
                "amfRegionId":  "02",
                "guamiList":    [{
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "01"
                                },
                                "amfId":        "020040"
                        }],
                "taiList":      [{
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "01"
                                },
                                "tac":  "000001"
                        }, {
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "01"
                                },
                                "tac":  "000002"
                        }, {
                                "plmnId":       {
                                        "mcc":  "001",
                                        "mnc":  "01"
                                },
                                "tac":  "000003"
                        }]
        }
}
2022-09-23 20:37:47 +09:00
Sukchan Lee ce7d631064 [GTP/PFCP] TLV length more acceptable (#1780)
Acceptable even if the TLV length is smaller than expected
2022-09-23 13:13:34 +09:00
Sukchan Lee 5520cb65a5 Follow-up on #1744 2022-09-13 17:03:18 +09:00
jmasterfunk84 775520d7a8
Introduce Cancel Location and Insert Subscriber Data features to HSS. (#1744)
* Introduce Cancel Location and Insert Subscriber Data features to HSS.
* HSS database will keep track of last known MME and Update Time
* Purged UE flag is established in HSS for future PUR handling
* HSS Thread will connect to database and watch change stream
  mongoDB must be configured with a Replica Set to use this
* HSS will send IDR if subscription data changes
* HSS will send CLR to old MME if MME host or realm changes
* Function created to allow ULA and IDR to generate Subscription-Data AVP
* MME Hostname and Realm shown in WebUI

* Resolve freeDiameter errors

During a ULR, if database does not contain a last known MME, a CLR is being sent to a Null destination.  This will ensure that a destination is available in the database before sending the CLR.

* Removed change streams.  Added PUR handling.

* newline needed at end of file.

* Removed temp variable.

* * Change WebUI to 2x2 display
* Including UE Purged indicator
* Using pointers in ogs_subscription_data_t
* better memory mangement with pointers
* Tweak to Destination used by hss_s6a_send_idr to use last known MME

* Check for null mme_host and mme_realms

Do this before trying to compare the strings.
2022-09-13 16:48:20 +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
Sukchan Lee c716a1294a [CORE] Check if timer is double free in SBI module 2022-09-03 15:59:39 +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 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 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
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 c835556623 Fixed Defects reported by Coverity Scan 2022-08-13 23:49:55 +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 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 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 9b762158a6 Refine code of discovery option param (#1671) 2022-07-24 19:47:04 +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 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
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
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 2b41a215d7 Fixed the crash in UERANSIM 500 test (#1652) 2022-07-21 00:02:31 +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 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
Sukchan Lee fce0eb4800 [SBI] fixed wrong request-nf-type (#1650) 2022-07-08 21:36:52 +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
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 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
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 0d61f7a7f9 [GTP] context when TEID=0 (#1620, #1606, #1594) 2022-06-28 15:32:14 +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 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
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 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
Sukchan Lee c528e0d5bc [SBI] Change NfInstance.Id to Optional 2022-06-18 23:56:12 +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
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
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 240c10888d [GTP] Fixed bugs if gNB changed (#1515, #1586) 2022-06-12 15:54:27 +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
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
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
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
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 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 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
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 1679f57ac7 [CORE] fix the linked-list bug (#1187) 2022-05-21 18:54:42 +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
Sukchan Lee 6710c13a44 update it 2022-05-17 21:44:52 +09:00
Pau Espin 46621538af
[SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy (#1539)
* [GTP] Fix trailing whitespace

* [SMF] Improve 3GPP-User-Location-Info in Gn,Gx,Gy
2022-05-17 10:29:11 +09:00
Pau Espin fe7f9d85bb
[SMF] Store IMEI from GTPv1C/2C and append AVP in Gy CCR (#1535) 2022-05-14 21:32:32 +09:00
Pau Espin c5715d6695
[SMF] Gy CCR: append 3GPP-RAT-Type AVP (#1536) 2022-05-14 06:15:28 +09:00
Sukchan Lee 71572ae563 [PFCP] fixed memcpy (#1531)
dnn ‘memcpy’ reading 808 bytes from a region of size 128
2022-05-13 18:26:54 +09:00
Pau Espin 99f59be5d7
[SMF] Store Charging Characteristics IE from GTPv1C/2C and append AVP in Gy CCR (#1532) 2022-05-13 06:32:20 +09:00
Sukchan Lee 4d2f7726b9 X2 handover with SGW change (#1367, #1459) 2022-05-12 22:52:36 +09:00
Pau Espin 11d4be1779
[SMF] Store Selection Mode IE from GTPv1C/2C and append as 3GPP-Selection-Mode AVP in Gy CCR (#1530)
* [GTPv1C] Make Selection Mode IE uint8

* [SMF] Store Selection Mode in GTPv1C and GTPv2C

* [SMF] Gy CCR: append 3GPP-Selection-Mode AVP
2022-05-12 22:43:12 +09:00
Pau Espin 5d478e2488
Pespin/pr (#1529)
* [SMF] rename function s/gtp/gtp2/

* [SMF] Store GTPC version in session

So far we always depended on an xact being present in the code path in
order to know which kind of session it is (GTPv1C vs GTPv2C). Let's
instead store that information in smf_sess_t so that we have it always
available in an easy way.

* [SMF] Move smf_sess_t GTPv1C specifics into gtp substruct

* [SMF] Gy CCR: append 3GPP-NSAPI AVP
2022-05-12 21:42:45 +09:00
Pau Espin e8d6b0be20
[SMF] Append PDP-Address AVP to Gy CCR msg (#1527)
* [SMF] Append PDP-Address AVP to Gy CCR msg

* [SMF] Gy CCR: Move some AVPs under Service-Information/PS-Information

They belong there. Nokia infocenter documentation seems to be document
the possibility to configure its software to have it in top level, but
that's not what 3GPP TS 32.299 states, so let's stick to it.

* [SMF] Gy CCR: append 3GPP-PDP-Type AVP

* [SMF] Gy CCR: append 3GPP-Charging-Id AVP

* [SMF] Gy CCR: append SGSN-Address AVP

* [SMF] Gy CCR: append GGSN-Address AVP
2022-05-11 15:53:24 +09:00
Sukchan Lee 7a9d06097e [PFCP] fix the unnecessary code (#1523) 2022-05-10 22:58:19 +09:00
Pau Espin 3a28ddce37
[PFCP] Fix typo in log line (#1526) 2022-05-10 22:40:32 +09:00
Sukchan Lee de2ecd6400 [GTP2] Fixed handling multi-bearer messages(#1498) 2022-04-29 21:28:16 +09:00