Changes of Revision 303

open5gs_2.6.2.8.aed52.202304210026.dsc -> open5gs_2.6.2.15.7580d.202304220026.dsc Changed
x
 
1
@@ -2,7 +2,7 @@
2
 Source: open5gs
3
 Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg
4
 Architecture: any
5
-Version: 2.6.2.8.aed52.202304210026
6
+Version: 2.6.2.15.7580d.202304220026
7
 Maintainer: Harald Welte <laforge@gnumonks.org>
8
 Uploaders: Sukchan Lee <acetcom@gmail.com>
9
 Homepage: https://open5gs.org
10
@@ -31,8 +31,8 @@
11
  open5gs-udr deb net optional arch=any
12
  open5gs-upf deb net optional arch=any
13
 Checksums-Sha1:
14
- 8d11e58e6874d8f49f3e2ada725a0314b9e098b8 14115324 open5gs_2.6.2.8.aed52.202304210026.tar.xz
15
+ d0f4709f69f169fff892576263b677be4713a0dc 14115684 open5gs_2.6.2.15.7580d.202304220026.tar.xz
16
 Checksums-Sha256:
17
- 0ff1e884e543d287c8cab7714e195762b55aa0f5771390218d4bb3efbe338a50 14115324 open5gs_2.6.2.8.aed52.202304210026.tar.xz
18
+ b35aefbb99b54658e6d98f90d8cd2f9f355f8ed060762996d115c01b7ab9b51f 14115684 open5gs_2.6.2.15.7580d.202304220026.tar.xz
19
 Files:
20
- 4f8c1b4f1b347651c90d7d87c46c2a39 14115324 open5gs_2.6.2.8.aed52.202304210026.tar.xz
21
+ 526eb384b4f9b350672a5c5b76f58ade 14115684 open5gs_2.6.2.15.7580d.202304220026.tar.xz
22
open5gs_2.6.2.8.aed52.202304210026.tar.xz/.tarball-version -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-2.6.2.8-aed52.202304210026
3
+2.6.2.15-7580d.202304220026
4
open5gs_2.6.2.8.aed52.202304210026.tar.xz/debian/changelog -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-open5gs (2.6.2.8.aed52.202304210026) unstable; urgency=medium
3
+open5gs (2.6.2.15.7580d.202304220026) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom nightly feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Fri, 21 Apr 2023 00:27:39 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Sat, 22 Apr 2023 00:27:36 +0000
9
 
10
 open5gs (2.6.2) unstable; urgency=medium
11
 
12
open5gs_2.6.2.8.aed52.202304210026.tar.xz/docs/_pages/docs.md -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/docs/_pages/docs.md Changed
9
 
1
@@ -40,6 +40,7 @@
2
 - @infinitydon
3
   - Open5GS on Amazon Elastic Kubernetes Service(https://aws.amazon.com/blogs/opensource/open-source-mobile-core-network-implementation-on-amazon-elastic-kubernetes-service/)
4
   - Kubernetes Open5GS Deployment(https://dev.to/infinitydon/virtual-4g-simulation-using-kubernetes-and-gns3-3b7k?fbclid=IwAR1p99h13a-mCfejanbBQe0H0-jp5grXkn5mWf1WrTHf47UtegB2-UHGGZQ)
5
+  - 5G Core SBI mTLS Using External Certificate PKI(https://futuredon.medium.com/5g-core-sbi-mtls-using-external-certificate-pki-4ffc02ac7728)
6
 
7
 - @nickvsnetworking
8
   - My first 5G Core : Open5GS and UERANSIM(http://nickvsnetworking.com/my-first-5g-core-open5gs-and-ueransim/)
9
open5gs_2.6.2.8.aed52.202304210026.tar.xz/docs/_pages/support.md -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/docs/_pages/support.md Changed
10
 
1
@@ -21,7 +21,7 @@
2
 
3
 We work with leading partners in mobile communications to offer our customers complete solutions.
4
 
5
-**NextEPC(https://nextepc.com/)**: Established in U.S. in 2019, NextEPC Inc. provides the latest wireless telecommunications technologies and outstanding support to wireless solution providers and vendors around the world. Their solutions include scalable and versatile 4G/5G core network systems. They also offer professional development and customization services for Enterprise users.
6
+**NextEPC(https://nextepc.com/)**: Established in U.S. in 2019, NextEPC Inc. provides the latest wireless telecommunications technologies and outstanding support to wireless solution providers and vendors around the world. Their solutions include scalable and versatile 4G/5G core network systems, recently a commercial-grade DPDK-accelerated UPF is also available. They offer professional development and customization services for Enterprise users.
7
 
8
 Please contact sales@nextepc.com(mailto:sales@nextepc.com) for more informations.
9
 
10
open5gs_2.6.2.8.aed52.202304210026.tar.xz/lib/proto/types.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/lib/proto/types.h Changed
9
 
1
@@ -80,6 +80,7 @@
2
 #define OGS_MAX_DNN_LEN                 100
3
 #define OGS_MAX_APN_LEN                 OGS_MAX_DNN_LEN
4
 #define OGS_MAX_PCO_LEN                 251
5
+#define OGS_MAX_EPCO_LEN                65535
6
 #define OGS_MAX_FQDN_LEN                256
7
 
8
 #define OGS_MAX_NUM_OF_SERVED_GUAMI     8
9
open5gs_2.6.2.8.aed52.202304210026.tar.xz/lib/sbi/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/lib/sbi/context.c Changed
173
 
1
@@ -122,8 +122,6 @@
2
 
3
 static int ogs_sbi_context_prepare(void)
4
 {
5
-    self.sbi_port = OGS_SBI_HTTP_PORT;
6
-
7
 #if ENABLE_ACCEPT_ENCODING
8
     self.content_encoding = "gzip";
9
 #endif
10
@@ -242,7 +240,7 @@
11
                         int num_of_advertise = 0;
12
                         const char *advertiseOGS_MAX_NUM_OF_HOSTNAME;
13
 
14
-                        uint16_t port = self.sbi_port;
15
+                        uint16_t port = ogs_sbi_server_default_port();
16
                         const char *dev = NULL;
17
                         ogs_sockaddr_t *addr = NULL;
18
 
19
@@ -410,7 +408,7 @@
20
                         rv = ogs_socknode_probe(
21
                             ogs_app()->parameter.no_ipv4 ? NULL : &list,
22
                             ogs_app()->parameter.no_ipv6 ? NULL : &list6,
23
-                            NULL, self.sbi_port, NULL);
24
+                            NULL, ogs_sbi_server_default_port(), NULL);
25
                         ogs_assert(rv == OGS_OK);
26
 
27
                         node = ogs_list_first(&list);
28
@@ -506,7 +504,7 @@
29
                         int family = AF_UNSPEC;
30
                         int i, num = 0;
31
                         const char *hostnameOGS_MAX_NUM_OF_HOSTNAME;
32
-                        uint16_t port = self.sbi_port;
33
+                        uint16_t port = ogs_sbi_client_default_port();
34
 
35
                         if (ogs_yaml_iter_type(&sbi_array) ==
36
                                 YAML_MAPPING_NODE) {
37
@@ -583,10 +581,7 @@
38
                         if (addr == NULL) continue;
39
 
40
                         client = ogs_sbi_client_add(
41
-                                    ogs_app()->sbi.client.no_tls == false ?
42
-                                        OpenAPI_uri_scheme_https :
43
-                                        OpenAPI_uri_scheme_http,
44
-                                    addr);
45
+                                    ogs_sbi_client_default_scheme(), addr);
46
                         ogs_assert(client);
47
                         OGS_SBI_SETUP_CLIENT(self.nrf_instance, client);
48
 
49
@@ -612,7 +607,7 @@
50
                         int family = AF_UNSPEC;
51
                         int i, num = 0;
52
                         const char *hostnameOGS_MAX_NUM_OF_HOSTNAME;
53
-                        uint16_t port = self.sbi_port;
54
+                        uint16_t port = ogs_sbi_client_default_port();
55
 
56
                         if (ogs_yaml_iter_type(&sbi_array) ==
57
                                 YAML_MAPPING_NODE) {
58
@@ -689,10 +684,7 @@
59
                         if (addr == NULL) continue;
60
 
61
                         client = ogs_sbi_client_add(
62
-                                    ogs_app()->sbi.client.no_tls == false ?
63
-                                        OpenAPI_uri_scheme_https :
64
-                                        OpenAPI_uri_scheme_http,
65
-                                    addr);
66
+                                    ogs_sbi_client_default_scheme(), addr);
67
                         ogs_assert(client);
68
                         OGS_SBI_SETUP_CLIENT(self.scp_instance, client);
69
 
70
@@ -1404,6 +1396,7 @@
71
         }
72
 
73
         if (nf_service->num_of_addr < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
74
+            bool is_port = true;
75
             int port = 0;
76
             ogs_sockaddr_t *addr = NULL;
77
             ogs_assert(OGS_OK == ogs_copyaddrinfo(&addr, advertise));
78
@@ -1411,11 +1404,12 @@
79
 
80
             port = OGS_PORT(addr);
81
             if (nf_service->scheme == OpenAPI_uri_scheme_https) {
82
-                if (port == OGS_SBI_HTTPS_PORT) port = 0;
83
+                if (port == OGS_SBI_HTTPS_PORT) is_port = false;
84
             } else if (nf_service->scheme == OpenAPI_uri_scheme_http) {
85
-                if (port == OGS_SBI_HTTP_PORT) port = 0;
86
+                if (port == OGS_SBI_HTTP_PORT) is_port = false;
87
             }
88
 
89
+            nf_service->addrnf_service->num_of_addr.is_port = is_port;
90
             nf_service->addrnf_service->num_of_addr.port = port;
91
             if (addr->ogs_sa_family == AF_INET) {
92
                 nf_service->addrnf_service->num_of_addr.ipv4 = addr;
93
@@ -1439,17 +1433,21 @@
94
 }
95
 
96
 static ogs_sbi_client_t *find_client_by_fqdn(
97
-        OpenAPI_uri_scheme_e scheme, char *fqdn, int port)
98
+        OpenAPI_uri_scheme_e scheme, char *fqdn)
99
 {
100
     int rv;
101
     ogs_sockaddr_t *addr = NULL;
102
     ogs_sbi_client_t *client = NULL;
103
 
104
-    ogs_assert(scheme);
105
+    ogs_assert(scheme == OpenAPI_uri_scheme_https ||
106
+                scheme == OpenAPI_uri_scheme_http);
107
     ogs_assert(fqdn);
108
 
109
-    rv = ogs_getaddrinfo(&addr, AF_UNSPEC, fqdn,
110
-            port ? port : ogs_sbi_self()->sbi_port, 0);
111
+    rv = ogs_getaddrinfo(
112
+            &addr, AF_UNSPEC, fqdn,
113
+            scheme == OpenAPI_uri_scheme_https ?
114
+                OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT,
115
+            0);
116
     if (rv != OGS_OK) {
117
         ogs_error("Invalid NFProfile.fqdn");
118
         return NULL;
119
@@ -1473,11 +1471,10 @@
120
     ogs_sockaddr_t *addr = NULL;
121
     OpenAPI_uri_scheme_e scheme = OpenAPI_uri_scheme_NULL;
122
 
123
-    scheme = ogs_app()->sbi.client.no_tls == false ?
124
-                OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http;
125
+    scheme = ogs_sbi_client_default_scheme();
126
 
127
     if (nf_instance->fqdn)
128
-        client = find_client_by_fqdn(scheme, nf_instance->fqdn, 0);
129
+        client = find_client_by_fqdn(scheme, nf_instance->fqdn);
130
 
131
     if (!client) {
132
         /* At this point, CLIENT selection method is very simple. */
133
@@ -1504,7 +1501,7 @@
134
     ogs_assert(nf_service->scheme);
135
 
136
     if (nf_service->fqdn)
137
-        client = find_client_by_fqdn(nf_service->scheme, nf_service->fqdn, 0);
138
+        client = find_client_by_fqdn(nf_service->scheme, nf_service->fqdn);
139
 
140
     if (!client) {
141
         /* At this point, CLIENT selection method is very simple. */
142
@@ -1620,9 +1617,28 @@
143
     nf_service_associate_client_all(nf_instance);
144
 }
145
 
146
-OpenAPI_uri_scheme_e ogs_sbi_default_uri_scheme(void)
147
+OpenAPI_uri_scheme_e ogs_sbi_server_default_scheme(void)
148
+{
149
+    return ogs_app()->sbi.server.no_tls == false ?
150
+            OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http;
151
+}
152
+
153
+OpenAPI_uri_scheme_e ogs_sbi_client_default_scheme(void)
154
+{
155
+    return ogs_app()->sbi.client.no_tls == false ?
156
+            OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http;
157
+}
158
+
159
+int ogs_sbi_server_default_port(void)
160
+{
161
+    return ogs_app()->sbi.server.no_tls == false ?
162
+            OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT;
163
+}
164
+
165
+int ogs_sbi_client_default_port(void)
166
 {
167
-    return OpenAPI_uri_scheme_http;
168
+    return ogs_app()->sbi.client.no_tls == false ?
169
+            OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT;
170
 }
171
 
172
 ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
173
open5gs_2.6.2.8.aed52.202304210026.tar.xz/lib/sbi/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/lib/sbi/context.h Changed
30
 
1
@@ -58,8 +58,6 @@
2
         uint8_t keyOGS_ECCKEY_LEN; /* 32 bytes Private Key */
3
     } hnetOGS_HOME_NETWORK_PKI_VALUE_MAX+1; /* PKI Value : 1 ~ 254 */
4
 
5
-    uint16_t sbi_port;                      /* SBI local port */
6
-
7
     ogs_list_t server_list;
8
     ogs_list_t client_list;
9
 
10
@@ -218,6 +216,7 @@
11
     struct {
12
         ogs_sockaddr_t *ipv4;
13
         ogs_sockaddr_t *ipv6;
14
+        bool is_port;
15
         int port;
16
     } addrOGS_SBI_MAX_NUM_OF_IP_ADDRESS;
17
 
18
@@ -401,7 +400,10 @@
19
 
20
 void ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance);
21
 
22
-OpenAPI_uri_scheme_e ogs_sbi_default_uri_scheme(void);
23
+OpenAPI_uri_scheme_e ogs_sbi_server_default_scheme(void);
24
+OpenAPI_uri_scheme_e ogs_sbi_client_default_scheme(void);
25
+int ogs_sbi_server_default_port(void);
26
+int ogs_sbi_client_default_port(void);
27
 
28
 #define OGS_SBI_SETUP_NF_INSTANCE(__cTX, __nFInstance) \
29
     do { \
30
open5gs_2.6.2.8.aed52.202304210026.tar.xz/lib/sbi/nnrf-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/lib/sbi/nnrf-build.c Changed
10
 
1
@@ -569,7 +569,7 @@
2
                     return NULL;
3
                 }
4
             }
5
-            IpEndPoint->is_port = true;
6
+            IpEndPoint->is_port = nf_service->addri.is_port;
7
             IpEndPoint->port = nf_service->addri.port;
8
             OpenAPI_list_add(IpEndPointList, IpEndPoint);
9
         }
10
open5gs_2.6.2.8.aed52.202304210026.tar.xz/lib/sbi/nnrf-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/lib/sbi/nnrf-handler.c Changed
50
 
1
@@ -83,7 +83,7 @@
2
         if (nf_instance->num_of_ipv4 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
3
 
4
             rv = ogs_getaddrinfo(&addr, AF_UNSPEC,
5
-                    node->data, ogs_sbi_self()->sbi_port, 0);
6
+                    node->data, ogs_sbi_client_default_port(), 0);
7
             if (rv != OGS_OK) continue;
8
 
9
             nf_instance->ipv4nf_instance->num_of_ipv4 = addr;
10
@@ -101,7 +101,7 @@
11
         if (nf_instance->num_of_ipv6 < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
12
 
13
             rv = ogs_getaddrinfo(&addr, AF_UNSPEC,
14
-                    node->data, ogs_sbi_self()->sbi_port, 0);
15
+                    node->data, ogs_sbi_client_default_port(), 0);
16
             if (rv != OGS_OK) continue;
17
 
18
             nf_instance->ipv6nf_instance->num_of_ipv6 = addr;
19
@@ -257,18 +257,10 @@
20
         }
21
 
22
         if (nf_service->num_of_addr < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
23
-            if (!IpEndPoint->is_port) {
24
-                if (nf_service->scheme == OpenAPI_uri_scheme_http)
25
-                    port = OGS_SBI_HTTP_PORT;
26
-                else if (nf_service->scheme == OpenAPI_uri_scheme_https)
27
-                    port = OGS_SBI_HTTPS_PORT;
28
-                else {
29
-                    ogs_error("Invalid scheme %d", nf_service->scheme);
30
-                    continue;
31
-                }
32
-            } else {
33
+            if (!IpEndPoint->is_port)
34
+                port = ogs_sbi_client_default_port();
35
+            else
36
                 port = IpEndPoint->port;
37
-            }
38
 
39
             if (IpEndPoint->ipv4_address) {
40
                 rv = ogs_getaddrinfo(&addr, AF_UNSPEC,
41
@@ -291,6 +283,8 @@
42
 
43
             if (addr || addr6) {
44
                 nf_service->addrnf_service->num_of_addr.
45
+                    is_port = IpEndPoint->is_port;
46
+                nf_service->addrnf_service->num_of_addr.
47
                     port = port;
48
                 nf_service->addrnf_service->num_of_addr.
49
                     ipv4 = addr;
50
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/amf/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/amf/context.c Changed
11
 
1
@@ -2112,9 +2112,6 @@
2
     if (sess->nssf.nrf.client)
3
         ogs_sbi_client_remove(sess->nssf.nrf.client);
4
 
5
-    OGS_NAS_CLEAR_DATA(&sess->ue_pco);
6
-    OGS_TLV_CLEAR_DATA(&sess->pgw_pco);
7
-
8
     ogs_pool_free(&amf_sess_pool, sess);
9
 
10
     stats_remove_amf_session();
11
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/amf/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/amf/context.h Changed
17
 
1
@@ -648,15 +648,6 @@
2
     ogs_s_nssai_t mapped_hplmn;
3
     char *dnn;
4
 
5
-    /* Save Protocol Configuration Options from UE */
6
-    struct {
7
-        uint8_t length;
8
-        uint8_t *buffer;
9
-    } ue_pco; 
10
-
11
-    /* Save Protocol Configuration Options from PGW */
12
-    ogs_tlv_octet_t pgw_pco;
13
-
14
 } amf_sess_t;
15
 
16
 void amf_context_init(void);
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/bsf/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/bsf/context.h Changed
16
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -71,6 +71,7 @@
9
     struct {
10
         char *addr;
11
         char *addr6;
12
+        bool is_port;
13
         int port;
14
     } pcf_ipOGS_SBI_MAX_NUM_OF_IP_ADDRESS;
15
 
16
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/bsf/nbsf-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/bsf/nbsf-handler.c Changed
59
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -148,27 +148,10 @@
9
 
10
                 OpenAPI_list_for_each(PcfIpEndPointList, node) {
11
                     OpenAPI_ip_end_point_t *IpEndPoint = node->data;
12
-                    int port = 0;
13
 
14
                     if (!IpEndPoint) continue;
15
 
16
                     if (sess->num_of_pcf_ip < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
17
-                        if (!IpEndPoint->is_port) {
18
-                            if (ogs_sbi_default_uri_scheme() ==
19
-                                    OpenAPI_uri_scheme_http)
20
-                                port = OGS_SBI_HTTP_PORT;
21
-                            else if (ogs_sbi_default_uri_scheme() ==
22
-                                    OpenAPI_uri_scheme_https)
23
-                                port = OGS_SBI_HTTPS_PORT;
24
-                            else {
25
-                                ogs_fatal("Invalid scheme %d",
26
-                                    ogs_sbi_default_uri_scheme());
27
-                                ogs_assert_if_reached();
28
-                            }
29
-                        } else {
30
-                            port = IpEndPoint->port;
31
-                        }
32
-
33
                         if (IpEndPoint->ipv4_address ||
34
                             IpEndPoint->ipv6_address) {
35
                             if (IpEndPoint->ipv4_address) {
36
@@ -179,7 +162,12 @@
37
                                 sess->pcf_ipsess->num_of_pcf_ip.addr6 =
38
                                     ogs_strdup(IpEndPoint->ipv6_address);
39
                             }
40
-                            sess->pcf_ipsess->num_of_pcf_ip.port = port;
41
+                            if (IpEndPoint->is_port) {
42
+                                sess->pcf_ipsess->num_of_pcf_ip.is_port =
43
+                                    IpEndPoint->is_port;
44
+                                sess->pcf_ipsess->num_of_pcf_ip.port =
45
+                                    IpEndPoint->port;
46
+                            }
47
                             sess->num_of_pcf_ip++;
48
                         }
49
                     }
50
@@ -259,7 +247,7 @@
51
                     PcfIpEndPoint->ipv4_address = sess->pcf_ipi.addr;
52
                     PcfIpEndPoint->ipv6_address = sess->pcf_ipi.addr6;
53
 
54
-                    PcfIpEndPoint->is_port = true;
55
+                    PcfIpEndPoint->is_port = sess->pcf_ipi.is_port;
56
                     PcfIpEndPoint->port = sess->pcf_ipi.port;
57
 
58
                     OpenAPI_list_add(PcfIpEndPointList, PcfIpEndPoint);
59
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/esm-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/esm-build.c Changed
44
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -228,21 +228,20 @@
9
         apn_ambr_build(apn_ambr, session->ambr.downlink, session->ambr.uplink);
10
     }
11
 
12
-    if (sess->pgw_pco.presence && sess->pgw_pco.len && sess->pgw_pco.data) {
13
-        if (mme_ue->ue_network_capability.
14
-                extended_protocol_configuration_options) {
15
-            activate_default_eps_bearer_context_request->presencemask |=
16
-                OGS_NAS_EPS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
17
-            extended_protocol_configuration_options->length = sess->pgw_pco.len;
18
-            extended_protocol_configuration_options->buffer =
19
-                sess->pgw_pco.data;
20
-        } else {
21
-            activate_default_eps_bearer_context_request->presencemask |=
22
-                OGS_NAS_EPS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
23
-            protocol_configuration_options->length = sess->pgw_pco.len;
24
-            memcpy(protocol_configuration_options->buffer,
25
-                    sess->pgw_pco.data, protocol_configuration_options->length);
26
-        }
27
+    if (sess->pgw_epco.presence && sess->pgw_epco.len && sess->pgw_epco.data) {
28
+        activate_default_eps_bearer_context_request->presencemask |=
29
+            OGS_NAS_EPS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
30
+        extended_protocol_configuration_options->length =
31
+            sess->pgw_epco.len;
32
+        extended_protocol_configuration_options->buffer =
33
+            sess->pgw_epco.data;
34
+    } else if (sess->pgw_pco.presence && sess->pgw_pco.len &&
35
+            sess->pgw_pco.data) {
36
+        activate_default_eps_bearer_context_request->presencemask |=
37
+            OGS_NAS_EPS_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
38
+        protocol_configuration_options->length = sess->pgw_pco.len;
39
+        memcpy(protocol_configuration_options->buffer,
40
+                sess->pgw_pco.data, protocol_configuration_options->length);
41
     }
42
 
43
     if (create_action == OGS_GTP_CREATE_IN_ATTACH_REQUEST)
44
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/esm-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/esm-handler.c Changed
46
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -106,9 +106,17 @@
9
     }
10
 
11
     if (req->presencemask &
12
+        OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
13
+        ogs_nas_extended_protocol_configuration_options_t
14
+            *extended_protocol_configuration_options =
15
+            &req->extended_protocol_configuration_options;
16
+
17
+        OGS_NAS_STORE_DATA(&sess->ue_epco,
18
+            extended_protocol_configuration_options);
19
+    } else if (req->presencemask &
20
         OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
21
         ogs_nas_protocol_configuration_options_t
22
-            *protocol_configuration_options = 
23
+            *protocol_configuration_options =
24
             &req->protocol_configuration_options;
25
 
26
         OGS_NAS_STORE_DATA(&sess->ue_pco, protocol_configuration_options);
27
@@ -182,9 +190,17 @@
28
     }
29
 
30
     if (rsp->presencemask &
31
+        OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
32
+        ogs_nas_extended_protocol_configuration_options_t
33
+            *extended_protocol_configuration_options =
34
+            &rsp->extended_protocol_configuration_options;
35
+
36
+        OGS_NAS_STORE_DATA(&sess->ue_epco,
37
+            extended_protocol_configuration_options);
38
+    } else if (rsp->presencemask &
39
         OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
40
         ogs_nas_protocol_configuration_options_t
41
-            *protocol_configuration_options = 
42
+            *protocol_configuration_options =
43
                 &rsp->protocol_configuration_options;
44
         OGS_NAS_STORE_DATA(&sess->ue_pco, protocol_configuration_options);
45
     }
46
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/mme-context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/mme-context.c Changed
11
 
1
@@ -3260,7 +3260,9 @@
2
     mme_bearer_remove_all(sess);
3
 
4
     OGS_NAS_CLEAR_DATA(&sess->ue_pco);
5
+    OGS_NAS_CLEAR_DATA(&sess->ue_epco);
6
     OGS_TLV_CLEAR_DATA(&sess->pgw_pco);
7
+    OGS_TLV_CLEAR_DATA(&sess->pgw_epco);
8
 
9
     ogs_pool_free(&mme_sess_pool, sess);
10
 
11
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/mme-context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/mme-context.h Changed
19
 
1
@@ -641,8 +641,17 @@
2
         uint8_t *buffer;
3
     } ue_pco;
4
 
5
+    /* Save Extended Protocol Configuration Options from UE */
6
+    struct {
7
+        uint16_t length;
8
+        uint8_t *buffer;
9
+    } ue_epco;
10
+
11
     /* Save Protocol Configuration Options from PGW */
12
     ogs_tlv_octet_t pgw_pco;
13
+
14
+    /* Save Extended Protocol Configuration Options from PGW */
15
+    ogs_tlv_octet_t pgw_epco;
16
 } mme_sess_t;
17
 
18
 #define MME_HAVE_ENB_S1U_PATH(__bEARER) \
19
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/mme-s11-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/mme-s11-build.c Changed
23
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -253,7 +253,13 @@
9
         req->aggregate_maximum_bit_rate.len = sizeof(ambr);
10
     }
11
 
12
-    if (sess->ue_pco.length && sess->ue_pco.buffer) {
13
+    if (sess->ue_epco.length && sess->ue_epco.buffer) {
14
+        req->extended_protocol_configuration_options.presence = 1;
15
+        req->extended_protocol_configuration_options.data =
16
+            sess->ue_epco.buffer;
17
+        req->extended_protocol_configuration_options.len =
18
+            sess->ue_epco.length;
19
+    } else if (sess->ue_pco.length && sess->ue_pco.buffer) {
20
         req->protocol_configuration_options.presence = 1;
21
         req->protocol_configuration_options.data = sess->ue_pco.buffer;
22
         req->protocol_configuration_options.len = sess->ue_pco.length;
23
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/mme/mme-s11-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/mme/mme-s11-handler.c Changed
23
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -373,8 +373,13 @@
9
                 rsp->pdn_address_allocation.len);
10
     }
11
 
12
+    /* ePCO */
13
+    if (rsp->extended_protocol_configuration_options.presence) {
14
+        OGS_TLV_STORE_DATA(&sess->pgw_epco,
15
+                &rsp->extended_protocol_configuration_options);
16
+
17
     /* PCO */
18
-    if (rsp->protocol_configuration_options.presence) {
19
+    } else if (rsp->protocol_configuration_options.presence) {
20
         OGS_TLV_STORE_DATA(&sess->pgw_pco,
21
                 &rsp->protocol_configuration_options);
22
     }
23
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/nssf/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/nssf/context.c Changed
17
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -110,7 +110,7 @@
9
                         int family = AF_UNSPEC;
10
                         int i, num = 0;
11
                         const char *hostnameOGS_MAX_NUM_OF_HOSTNAME;
12
-                        uint16_t port = ogs_sbi_self()->sbi_port;
13
+                        uint16_t port = ogs_sbi_server_default_port();
14
                         const char *dev = NULL;
15
                         ogs_sockaddr_t *addr = NULL;
16
                         const char *sst = NULL, *sd = NULL;
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/pcf/nbsf-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/pcf/nbsf-build.c Changed
17
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -121,7 +121,7 @@
9
                     goto end;
10
                 }
11
             }
12
-            IpEndPoint->is_port = true;
13
+            IpEndPoint->is_port = nf_service->addri.is_port;
14
             IpEndPoint->port = nf_service->addri.port;
15
             OpenAPI_list_add(PcfIpEndPointList, IpEndPoint);
16
         }
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/context.c Changed
16
 
1
@@ -1667,12 +1667,13 @@
2
     ogs_fsm_fini(&sess->sm, &e);
3
 
4
     OGS_TLV_CLEAR_DATA(&sess->gtp.ue_pco);
5
+    OGS_TLV_CLEAR_DATA(&sess->gtp.ue_epco);
6
     OGS_TLV_CLEAR_DATA(&sess->gtp.user_location_information);
7
     OGS_TLV_CLEAR_DATA(&sess->gtp.ue_timezone);
8
     OGS_TLV_CLEAR_DATA(&sess->gtp.charging_characteristics);
9
     OGS_TLV_CLEAR_DATA(&sess->gtp.v1.qos);
10
 
11
-    OGS_NAS_CLEAR_DATA(&sess->nas.ue_pco);
12
+    OGS_NAS_CLEAR_DATA(&sess->nas.ue_epco);
13
 
14
     for (i = 0; i < sess->policy.num_of_pcc_rule; i++)
15
         OGS_PCC_RULE_FREE(&sess->policy.pcc_rulei);
16
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/context.h Changed
18
 
1
@@ -325,6 +325,7 @@
2
     struct {
3
         uint8_t version; /* GTPC version */
4
         ogs_tlv_octet_t ue_pco;
5
+        ogs_tlv_octet_t ue_epco;
6
         ogs_tlv_octet_t user_location_information;
7
         ogs_tlv_octet_t ue_timezone;
8
         ogs_tlv_octet_t charging_characteristics;
9
@@ -354,7 +355,7 @@
10
     } gy;
11
 
12
     struct {
13
-        ogs_nas_extended_protocol_configuration_options_t ue_pco;
14
+        ogs_nas_extended_protocol_configuration_options_t ue_epco;
15
     } nas; /* Saved from NAS-5GS */
16
 
17
     struct {
18
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/gsm-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/gsm-build.c Changed
92
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -48,8 +48,8 @@
9
     ogs_nas_qos_flow_description_t
10
         qos_flow_descriptionOGS_NAS_MAX_NUM_OF_QOS_FLOW_DESCRIPTION;
11
 
12
-    uint8_t pco_bufOGS_MAX_PCO_LEN;
13
-    int16_t pco_len;
14
+    uint8_t *epco_buf = NULL;
15
+    int16_t epco_len;
16
 
17
     selected_pdu_session_type = &pdu_session_establishment_accept->
18
         selected_pdu_session_type;
19
@@ -134,11 +134,11 @@
20
     rv = ogs_nas_build_qos_rules(authorized_qos_rules, qos_rule, 1);
21
     if (rv != OGS_OK) {
22
         ogs_error("ogs_nas_build_qos_rules() failed");
23
-        return NULL;
24
+        goto cleanup;
25
     }
26
     if (!authorized_qos_rules->length) {
27
         ogs_error("No length");
28
-        return NULL;
29
+        goto cleanup;
30
     }
31
 
32
     /* Session-AMBR */
33
@@ -167,7 +167,7 @@
34
         pdu_address->length = OGS_NAS_PDU_ADDRESS_IPV4V6_LEN;
35
     } else {
36
         ogs_error("Unexpected PDN Type %u", pdu_address->pdn_type);
37
-        return NULL;
38
+        goto cleanup;
39
     }
40
 
41
     /* GSM cause */
42
@@ -211,22 +211,24 @@
43
             authorized_qos_flow_descriptions, qos_flow_description, 1);
44
     if (rv != OGS_OK) {
45
         ogs_error("ogs_nas_build_qos_flow_descriptions() failed");
46
-        return NULL;
47
+        goto cleanup;
48
     }
49
     if (!authorized_qos_flow_descriptions->length) {
50
         ogs_error("No length");
51
-        return NULL;
52
+        goto cleanup;
53
     }
54
 
55
     /* Extended protocol configuration options */
56
-    if (sess->nas.ue_pco.buffer && sess->nas.ue_pco.length) {
57
-        pco_len = smf_pco_build(pco_buf,
58
-                sess->nas.ue_pco.buffer, sess->nas.ue_pco.length);
59
-        ogs_assert(pco_len > 0);
60
+    if (sess->nas.ue_epco.buffer && sess->nas.ue_epco.length) {
61
+        epco_buf = ogs_calloc(OGS_MAX_EPCO_LEN, sizeof(uint8_t));
62
+        ogs_assert(epco_buf);
63
+        epco_len = smf_pco_build(epco_buf,
64
+                sess->nas.ue_epco.buffer, sess->nas.ue_epco.length);
65
+        ogs_assert(epco_len > 0);
66
         pdu_session_establishment_accept->presencemask |=
67
             OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
68
-        extended_protocol_configuration_options->buffer = pco_buf;
69
-        extended_protocol_configuration_options->length = pco_len;
70
+        extended_protocol_configuration_options->buffer = epco_buf;
71
+        extended_protocol_configuration_options->length = epco_len;
72
     }
73
 
74
     /* DNN */
75
@@ -240,8 +242,14 @@
76
     pkbuf = ogs_nas_5gs_plain_encode(&message);
77
     ogs_assert(pkbuf);
78
 
79
-    ogs_free(authorized_qos_rules->buffer);
80
-    ogs_free(authorized_qos_flow_descriptions->buffer);
81
+cleanup:
82
+    if (epco_buf)
83
+        ogs_free(epco_buf);
84
+
85
+    if (authorized_qos_rules->buffer)
86
+        ogs_free(authorized_qos_rules->buffer);
87
+    if (authorized_qos_flow_descriptions->buffer)
88
+        ogs_free(authorized_qos_flow_descriptions->buffer);
89
 
90
     return pkbuf;
91
 }
92
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/gsm-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/gsm-handler.c Changed
17
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -62,7 +62,7 @@
9
 
10
     if (pdu_session_establishment_request->presencemask &
11
         OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT) {
12
-        OGS_NAS_STORE_DATA(&sess->nas.ue_pco,
13
+        OGS_NAS_STORE_DATA(&sess->nas.ue_epco,
14
             &pdu_session_establishment_request->
15
                 extended_protocol_configuration_options);
16
     }
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/s5c-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/s5c-build.c Changed
126
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -28,6 +28,8 @@
9
     int rv;
10
     smf_bearer_t *bearer = NULL;
11
 
12
+    ogs_pkbuf_t *pkbuf = NULL;
13
+
14
     ogs_gtp2_message_t gtp_message;
15
     ogs_gtp2_create_session_response_t *rsp = NULL;
16
 
17
@@ -45,6 +47,8 @@
18
     int len;
19
     uint8_t pco_bufOGS_MAX_PCO_LEN;
20
     int16_t pco_len;
21
+    uint8_t *epco_buf = NULL;
22
+    int16_t epco_len;
23
 
24
     ogs_debug("SMF Create Session Response");
25
 
26
@@ -85,7 +89,7 @@
27
             &smf_s5c_teid, &len);
28
     if (rv != OGS_OK) {
29
         ogs_error("ogs_gtp2_sockaddr_to_f_teid() failed");
30
-        return NULL;
31
+        goto cleanup;
32
     }
33
     rsp->pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface.
34
         presence = 1;
35
@@ -141,6 +145,19 @@
36
         rsp->protocol_configuration_options.len = pco_len;
37
     }
38
 
39
+    /* ePCO */
40
+    if (sess->gtp.ue_epco.presence &&
41
+            sess->gtp.ue_epco.len && sess->gtp.ue_epco.data) {
42
+        epco_buf = ogs_calloc(OGS_MAX_EPCO_LEN, sizeof(uint8_t));
43
+        ogs_assert(epco_buf);
44
+        epco_len = smf_pco_build(
45
+                epco_buf, sess->gtp.ue_epco.data, sess->gtp.ue_epco.len);
46
+        ogs_assert(epco_len > 0);
47
+        rsp->extended_protocol_configuration_options.presence = 1;
48
+        rsp->extended_protocol_configuration_options.data = epco_buf;
49
+        rsp->extended_protocol_configuration_options.len = epco_len;
50
+    }
51
+
52
     i = 0;
53
     ogs_list_for_each(&sess->bearer_list, bearer) {
54
         ogs_assert(i < OGS_BEARER_PER_UE);
55
@@ -190,7 +207,7 @@
56
             &pgw_s5u_teidi, &pgw_s5u_leni);
57
         if (rv != OGS_OK) {
58
             ogs_error("ogs_gtp2_sockaddr_to_f_teid() failed");
59
-            return NULL;
60
+            goto cleanup;
61
         }
62
 
63
         switch (sess->gtp_rat_type) {
64
@@ -219,18 +236,28 @@
65
     }
66
 
67
     gtp_message.h.type = type;
68
-    return ogs_gtp2_build_msg(&gtp_message);
69
+    pkbuf = ogs_gtp2_build_msg(&gtp_message);
70
+
71
+cleanup:
72
+    if (epco_buf)
73
+        ogs_free(epco_buf);
74
+
75
+    return pkbuf;
76
 }
77
 
78
 ogs_pkbuf_t *smf_s5c_build_delete_session_response(
79
         uint8_t type, smf_sess_t *sess)
80
 {
81
+    ogs_pkbuf_t *pkbuf = NULL;
82
+
83
     ogs_gtp2_message_t gtp_message;
84
     ogs_gtp2_delete_session_response_t *rsp = NULL;
85
 
86
     ogs_gtp2_cause_t cause;
87
     uint8_t pco_bufOGS_MAX_PCO_LEN;
88
     int16_t pco_len;
89
+    uint8_t *epco_buf = NULL;
90
+    int16_t epco_len;
91
 
92
     /* prepare cause */
93
     memset(&cause, 0, sizeof(cause));
94
@@ -257,11 +284,30 @@
95
         rsp->protocol_configuration_options.len = pco_len;
96
     }
97
 
98
+    /* ePCO */
99
+    if (sess->gtp.ue_epco.presence &&
100
+            sess->gtp.ue_epco.len && sess->gtp.ue_epco.data) {
101
+        epco_buf = ogs_calloc(OGS_MAX_EPCO_LEN, sizeof(uint8_t));
102
+        ogs_assert(epco_buf);
103
+        epco_len = smf_pco_build(
104
+                epco_buf, sess->gtp.ue_epco.data, sess->gtp.ue_epco.len);
105
+        ogs_assert(epco_len > 0);
106
+        rsp->extended_protocol_configuration_options.presence = 1;
107
+        rsp->extended_protocol_configuration_options.data = epco_buf;
108
+        rsp->extended_protocol_configuration_options.len = epco_len;
109
+    }
110
+
111
     /* Private Extension */
112
 
113
     /* build */
114
     gtp_message.h.type = type;
115
-    return ogs_gtp2_build_msg(&gtp_message);
116
+    pkbuf = ogs_gtp2_build_msg(&gtp_message);
117
+
118
+cleanup:
119
+    if (epco_buf)
120
+        ogs_free(epco_buf);
121
+
122
+    return pkbuf;
123
 }
124
 
125
 ogs_pkbuf_t *smf_s5c_build_modify_bearer_response(
126
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/smf/s5c-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/smf/s5c-handler.c Changed
49
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -347,8 +347,13 @@
9
         sess->session.ambr.uplink = be32toh(ambr->uplink) * 1000;
10
     }
11
 
12
+    /* ePCO */
13
+    if (req->extended_protocol_configuration_options.presence) {
14
+        OGS_TLV_STORE_DATA(&sess->gtp.ue_epco,
15
+                &req->extended_protocol_configuration_options);
16
+
17
     /* PCO */
18
-    if (req->protocol_configuration_options.presence) {
19
+    } else if (req->protocol_configuration_options.presence) {
20
         OGS_TLV_STORE_DATA(&sess->gtp.ue_pco,
21
                 &req->protocol_configuration_options);
22
     }
23
@@ -420,13 +425,24 @@
24
         OGS_TLV_STORE_DATA(&sess->gtp.ue_pco,
25
                 &req->protocol_configuration_options);
26
     } else {
27
-        /* 
28
+        /*
29
          * Clear contents to reflect whether PCO IE was included or not as part
30
          * of session deletion procedure
31
          */
32
         OGS_TLV_CLEAR_DATA(&sess->gtp.ue_pco);
33
     }
34
 
35
+    if (req->extended_protocol_configuration_options.presence) {
36
+        OGS_TLV_STORE_DATA(&sess->gtp.ue_epco,
37
+                &req->extended_protocol_configuration_options);
38
+    } else {
39
+        /*
40
+         * Clear contents to reflect whether PCO IE was included or not as part
41
+         * of session deletion procedure
42
+         */
43
+        OGS_TLV_CLEAR_DATA(&sess->gtp.ue_epco);
44
+    }
45
+
46
     ogs_debug("    SGW_S5C_TEID0x%x SMF_N4_TEID0x%x",
47
             sess->sgw_s5c_teid, sess->smf_n4_teid);
48
 
49
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/upf/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/upf/context.c Changed
11
 
1
@@ -243,7 +243,8 @@
2
 
3
     ogs_pool_free(&upf_n4_seid_pool, sess->upf_n4_seid_node);
4
     ogs_pool_free(&upf_sess_pool, sess);
5
-
6
+    if (sess->apn_dnn)
7
+        ogs_free(sess->apn_dnn);
8
     upf_metrics_inst_global_dec(UPF_METR_GLOB_GAUGE_UPF_SESSIONNBR);
9
 
10
     ogs_info("Removed Number of UPF-sessions is now %d",
11
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/upf/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/upf/context.h Changed
9
 
1
@@ -122,6 +122,7 @@
2
 
3
     /* Accounting: */
4
     upf_sess_urr_acc_t urr_accOGS_MAX_NUM_OF_URR; /* FIXME: This probably needs to be mved to a hashtable or alike */
5
+    char            *apn_dnn;            /* APN/DNN Item */
6
 } upf_sess_t;
7
 
8
 void upf_context_init(void);
9
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/upf/metrics.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/upf/metrics.c Changed
10
 
1
@@ -286,7 +286,7 @@
2
     ogs_assert(dnn_key);
3
 
4
     if (dnn) {
5
-        strcpy(dnn_key->dnn, dnn);
6
+        ogs_cpystrn(dnn_key->dnn, dnn, ogs_min(strlen(dnn), OGS_MAX_DNN_LEN)+1);
7
     } else {
8
         dnn_key->dnn0 = '\0';
9
     }
10
open5gs_2.6.2.8.aed52.202304210026.tar.xz/src/upf/n4-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/src/upf/n4-handler.c Changed
63
 
1
@@ -104,17 +104,24 @@
2
     if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED)
3
         goto cleanup;
4
 
5
+    if (req->apn_dnn.presence) {
6
+        char apn_dnnOGS_MAX_DNN_LEN+1;
7
+
8
+        ogs_assert(0 < ogs_fqdn_parse(apn_dnn, req->apn_dnn.data,
9
+                ogs_min(req->apn_dnn.len, OGS_MAX_DNN_LEN)));
10
+
11
+        if (sess->apn_dnn)
12
+            ogs_free(sess->apn_dnn);
13
+        sess->apn_dnn = ogs_strdup(apn_dnn);
14
+        ogs_assert(sess->apn_dnn);
15
+    }
16
+
17
     for (i = 0; i < OGS_MAX_NUM_OF_QER; i++) {
18
         if (ogs_pfcp_handle_create_qer(&sess->pfcp, &req->create_qeri,
19
                     &cause_value, &offending_ie_value) == NULL)
20
             break;
21
-        if (req->apn_dnn.presence == 1) {
22
-            upf_metrics_inst_by_dnn_add(req->apn_dnn.data,
23
-                    UPF_METR_GAUGE_UPF_QOSFLOWS, 1);
24
-        } else {
25
-            upf_metrics_inst_by_dnn_add(NULL,
26
-                    UPF_METR_GAUGE_UPF_QOSFLOWS, 1);
27
-        }
28
+        upf_metrics_inst_by_dnn_add(sess->apn_dnn,
29
+                UPF_METR_GAUGE_UPF_QOSFLOWS, 1);
30
     }
31
     if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED)
32
         goto cleanup;
33
@@ -329,7 +336,7 @@
34
         if (ogs_pfcp_handle_create_qer(&sess->pfcp, &req->create_qeri,
35
                     &cause_value, &offending_ie_value) == NULL)
36
             break;
37
-        upf_metrics_inst_by_dnn_add(NULL,
38
+        upf_metrics_inst_by_dnn_add(sess->apn_dnn,
39
                 UPF_METR_GAUGE_UPF_QOSFLOWS, 1);
40
     }
41
     if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED)
42
@@ -347,7 +354,7 @@
43
         if (ogs_pfcp_handle_remove_qer(&sess->pfcp, &req->remove_qeri,
44
                 &cause_value, &offending_ie_value) == false)
45
             break;
46
-        upf_metrics_inst_by_dnn_add(NULL,
47
+        upf_metrics_inst_by_dnn_add(sess->apn_dnn,
48
                 UPF_METR_GAUGE_UPF_QOSFLOWS, -1);
49
     }
50
     if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED)
51
@@ -426,10 +433,9 @@
52
 
53
     ogs_list_for_each(&sess->pfcp.pdr_list, pdr) {
54
         ogs_list_for_each(&sess->pfcp.qer_list, qer) {
55
-            upf_metrics_inst_by_dnn_add(NULL,
56
+            upf_metrics_inst_by_dnn_add(sess->apn_dnn,
57
                     UPF_METR_GAUGE_UPF_QOSFLOWS, -1);
58
         }
59
-        break;
60
     }
61
     upf_sess_remove(sess);
62
 }
63
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/af/context.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/af/context.c Changed
43
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -267,17 +267,21 @@
9
 }
10
 
11
 static ogs_sbi_client_t *find_client_by_fqdn(
12
-        OpenAPI_uri_scheme_e scheme, char *fqdn, int port)
13
+        OpenAPI_uri_scheme_e scheme, char *fqdn)
14
 {
15
     int rv;
16
     ogs_sockaddr_t *addr = NULL;
17
     ogs_sbi_client_t *client = NULL;
18
 
19
-    ogs_assert(scheme);
20
+    ogs_assert(scheme == OpenAPI_uri_scheme_https ||
21
+                scheme == OpenAPI_uri_scheme_http);
22
     ogs_assert(fqdn);
23
 
24
-    rv = ogs_getaddrinfo(&addr, AF_UNSPEC, fqdn,
25
-            port ? port : ogs_sbi_self()->sbi_port, 0);
26
+    rv = ogs_getaddrinfo(
27
+            &addr, AF_UNSPEC, fqdn,
28
+            scheme == OpenAPI_uri_scheme_https ?
29
+                OGS_SBI_HTTPS_PORT : OGS_SBI_HTTP_PORT,
30
+            0);
31
     if (rv != OGS_OK) {
32
         ogs_error("Invalid NFProfile.fqdn");
33
         return NULL;
34
@@ -306,7 +310,7 @@
35
                 OpenAPI_uri_scheme_https : OpenAPI_uri_scheme_http;
36
 
37
     if (sess->pcf.fqdn && strlen(sess->pcf.fqdn))
38
-        client = find_client_by_fqdn(scheme, sess->pcf.fqdn, 0);
39
+        client = find_client_by_fqdn(scheme, sess->pcf.fqdn);
40
 
41
     if (!client) {
42
         /* At this point, CLIENT selection method is very simple. */
43
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/af/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/af/context.h Changed
16
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -72,6 +72,7 @@
9
         struct {
10
             ogs_sockaddr_t *addr;
11
             ogs_sockaddr_t *addr6;
12
+            bool is_port;
13
             int port;
14
         } ipOGS_SBI_MAX_NUM_OF_IP_ADDRESS;
15
 
16
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/af/nbsf-handler.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/af/nbsf-handler.c Changed
41
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -67,21 +67,10 @@
9
         if (!IpEndPoint) continue;
10
 
11
         if (sess->pcf.num_of_ip < OGS_SBI_MAX_NUM_OF_IP_ADDRESS) {
12
-            if (!IpEndPoint->is_port) {
13
-                if (ogs_sbi_default_uri_scheme() ==
14
-                        OpenAPI_uri_scheme_http)
15
-                    port = OGS_SBI_HTTP_PORT;
16
-                else if (ogs_sbi_default_uri_scheme() ==
17
-                        OpenAPI_uri_scheme_https)
18
-                    port = OGS_SBI_HTTPS_PORT;
19
-                else {
20
-                    ogs_fatal("Invalid scheme %d",
21
-                        ogs_sbi_default_uri_scheme());
22
-                    ogs_assert_if_reached();
23
-                }
24
-            } else {
25
+            if (!IpEndPoint->is_port)
26
+                port = ogs_sbi_client_default_port();
27
+            else
28
                 port = IpEndPoint->port;
29
-            }
30
 
31
             if (IpEndPoint->ipv4_address) {
32
                 rv = ogs_getaddrinfo(&addr, AF_UNSPEC,
33
@@ -95,6 +84,7 @@
34
             }
35
 
36
             if (addr || addr6) {
37
+                sess->pcf.ipsess->pcf.num_of_ip.is_port = IpEndPoint->is_port;
38
                 sess->pcf.ipsess->pcf.num_of_ip.port = port;
39
                 sess->pcf.ipsess->pcf.num_of_ip.addr = addr;
40
                 sess->pcf.ipsess->pcf.num_of_ip.addr6 = addr6;
41
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/attach/guti-test.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/attach/guti-test.c Changed
17
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -228,7 +228,7 @@
9
     memset(&sess->pdn_connectivity_param,
10
             0, sizeof(sess->pdn_connectivity_param));
11
     sess->pdn_connectivity_param.eit = 1;
12
-    sess->pdn_connectivity_param.pco = 1;
13
+    sess->pdn_connectivity_param.epco = 1;
14
     sess->pdn_connectivity_param.request_type =
15
         OGS_NAS_EPS_REQUEST_TYPE_INITIAL;
16
     esmbuf = testesm_build_pdn_connectivity_request(sess, false);
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/attach/simple-test.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/attach/simple-test.c Changed
17
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -149,7 +149,7 @@
9
     tests1ap_recv(test_ue, recvbuf);
10
 
11
     /* Send ESM Information Response */
12
-    sess->esm_information_param.pco = 1;
13
+    sess->esm_information_param.epco = 1;
14
     esmbuf = testesm_build_esm_information_response(sess);
15
     ABTS_PTR_NOTNULL(tc, esmbuf);
16
     sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, esmbuf);
17
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/common/context.h -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/common/context.h Changed
23
 
1
@@ -257,10 +257,11 @@
2
 typedef struct test_pdn_connectivity_param_s {
3
     union {
4
         struct {
5
-        ED6(uint8_t eit:1;,
6
+        ED7(uint8_t eit:1;,
7
             uint8_t eit_no_required:1;,
8
             uint8_t apn:1;,
9
             uint8_t pco:1;,
10
+            uint8_t epco:1;,
11
             uint8_t spare:1;,
12
             uint8_t request_type:3;)
13
         };
14
@@ -272,7 +273,7 @@
15
     union {
16
         struct {
17
         ED8(uint8_t pco:1;,
18
-            uint8_t spare1:1;,
19
+            uint8_t epco:1;,
20
             uint8_t spare2:1;,
21
             uint8_t spare3:1;,
22
             uint8_t spare4:1;,
23
open5gs_2.6.2.8.aed52.202304210026.tar.xz/tests/common/esm-build.c -> open5gs_2.6.2.15.7580d.202304220026.tar.xz/tests/common/esm-build.c Changed
78
 
1
@@ -1,5 +1,5 @@
2
 /*
3
- * Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
4
+ * Copyright (C) 2019-2023 by Sukchan Lee <acetcom@gmail.com>
5
  *
6
  * This file is part of Open5GS.
7
  *
8
@@ -34,6 +34,8 @@
9
         &pdn_connectivity_request->esm_information_transfer_flag;
10
     ogs_nas_protocol_configuration_options_t *protocol_configuration_options =
11
         &pdn_connectivity_request->protocol_configuration_options;
12
+    ogs_nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options =
13
+        &pdn_connectivity_request->extended_protocol_configuration_options;
14
 #if 0
15
     uint8_t ue_pco29 =
16
             "\x80\x80\x21\x10\x01\x01\x00\x10\x81\x06\x00\x00\x00\x00"
17
@@ -87,12 +89,25 @@
18
         pdn_connectivity_request->presencemask |= OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
19
         protocol_configuration_options->length = sizeof(ue_pco);
20
         memcpy(protocol_configuration_options->buffer, ue_pco, sizeof(ue_pco));
21
+    } else if (sess->pdn_connectivity_param.epco) {
22
+        pdn_connectivity_request->presencemask |= OGS_NAS_EPS_PDN_CONNECTIVITY_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
23
+        extended_protocol_configuration_options->length = sizeof(ue_pco);
24
+        extended_protocol_configuration_options->buffer =
25
+            ogs_calloc(sizeof(uint8_t), extended_protocol_configuration_options->length);
26
+        ogs_assert(extended_protocol_configuration_options->buffer);
27
+        memcpy(extended_protocol_configuration_options->buffer, ue_pco, sizeof(ue_pco));
28
     }
29
 
30
     if (integrity_protected)
31
-        return test_nas_eps_security_encode(test_ue, &message);
32
+        pkbuf = test_nas_eps_security_encode(test_ue, &message);
33
     else
34
-        return ogs_nas_eps_plain_encode(&message);
35
+        pkbuf = ogs_nas_eps_plain_encode(&message);
36
+    ogs_assert(pkbuf);
37
+
38
+    if (extended_protocol_configuration_options->buffer)
39
+        ogs_free(extended_protocol_configuration_options->buffer);
40
+
41
+    return pkbuf;
42
 }
43
 
44
 ogs_pkbuf_t *testesm_build_pdn_disconnect_request(test_sess_t *sess)
45
@@ -139,6 +154,8 @@
46
         &esm_information_response->access_point_name;
47
     ogs_nas_protocol_configuration_options_t *protocol_configuration_options =
48
         &esm_information_response->protocol_configuration_options;
49
+    ogs_nas_extended_protocol_configuration_options_t *extended_protocol_configuration_options =
50
+        &esm_information_response->extended_protocol_configuration_options;
51
 
52
 #if 0
53
     uint8_t ue_pco29 =
54
@@ -191,9 +208,22 @@
55
         esm_information_response->presencemask |= OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
56
         protocol_configuration_options->length = sizeof(ue_pco);
57
         memcpy(protocol_configuration_options->buffer, ue_pco, sizeof(ue_pco));
58
+    } else if (sess->esm_information_param.epco) {
59
+        esm_information_response->presencemask |= OGS_NAS_EPS_ESM_INFORMATION_RESPONSE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
60
+        extended_protocol_configuration_options->length = sizeof(ue_pco);
61
+        extended_protocol_configuration_options->buffer =
62
+            ogs_calloc(sizeof(uint8_t), extended_protocol_configuration_options->length);
63
+        ogs_assert(extended_protocol_configuration_options->buffer);
64
+        memcpy(extended_protocol_configuration_options->buffer, ue_pco, sizeof(ue_pco));
65
     }
66
 
67
-    return test_nas_eps_security_encode(test_ue, &message);
68
+    pkbuf = test_nas_eps_security_encode(test_ue, &message);
69
+    ogs_assert(pkbuf);
70
+
71
+    if (extended_protocol_configuration_options->buffer)
72
+        ogs_free(extended_protocol_configuration_options->buffer);
73
+
74
+    return pkbuf;
75
 }
76
 
77
 ogs_pkbuf_t *testesm_build_activate_default_eps_bearer_context_accept(
78