Changes of Revision 202

open5gs_2.5.5.81.92ef.202301130004.dsc -> open5gs_2.5.5.82.5128.202301140007.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.5.5.81.92ef.202301130004
6
+Version: 2.5.5.82.5128.202301140007
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
- 67ff72629b246b0623f59c2c250550ddde5cb3b6 13606100 open5gs_2.5.5.81.92ef.202301130004.tar.xz
15
+ 31b7f41ba714d31993b4b9c0f2a123da4a9d230d 13607396 open5gs_2.5.5.82.5128.202301140007.tar.xz
16
 Checksums-Sha256:
17
- aa18bce020de423244dedd80f66e8366c4f7efdb127c6bc8de81ed008d9b8456 13606100 open5gs_2.5.5.81.92ef.202301130004.tar.xz
18
+ 29c1169890d3d776aac6e9a42402722f346cf1087e65a48183f279e451a5d2eb 13607396 open5gs_2.5.5.82.5128.202301140007.tar.xz
19
 Files:
20
- da35dd2495d47d529a38304f5fa00889 13606100 open5gs_2.5.5.81.92ef.202301130004.tar.xz
21
+ 6c97176f4a830c82bbe4457d8c4acb98 13607396 open5gs_2.5.5.82.5128.202301140007.tar.xz
22
open5gs_2.5.5.81.92ef.202301130004.tar.xz/.tarball-version -> open5gs_2.5.5.82.5128.202301140007.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-2.5.5.81-92ef.202301130004
3
+2.5.5.82-5128.202301140007
4
open5gs_2.5.5.81.92ef.202301130004.tar.xz/debian/changelog -> open5gs_2.5.5.82.5128.202301140007.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-open5gs (2.5.5.81.92ef.202301130004) unstable; urgency=medium
3
+open5gs (2.5.5.82.5128.202301140007) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom nightly feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Fri, 13 Jan 2023 00:06:45 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Sat, 14 Jan 2023 00:09:28 +0000
9
 
10
 open5gs (2.5.6) unstable; urgency=medium
11
 
12
open5gs_2.5.5.81.92ef.202301130004.tar.xz/lib/pfcp/types.c -> open5gs_2.5.5.82.5128.202301140007.tar.xz/lib/pfcp/types.c Changed
63
 
1
@@ -686,3 +686,61 @@
2
 
3
     return size;
4
 }
5
+
6
+int16_t ogs_pfcp_build_user_id(
7
+        ogs_tlv_octet_t *octet, ogs_pfcp_user_id_t *user_id,
8
+        void *data, int data_len)
9
+{
10
+    ogs_pfcp_user_id_t target;
11
+    int16_t size = 0;
12
+
13
+    ogs_assert(user_id);
14
+    ogs_assert(octet);
15
+    ogs_assert(data);
16
+    ogs_assert(data_len);
17
+
18
+    octet->data = data;
19
+    memcpy(&target, user_id, sizeof(ogs_pfcp_user_id_t));
20
+
21
+    ogs_assert(size + sizeof(target.flags) <= data_len);
22
+    memcpy((unsigned char *)octet->data + size,
23
+            &target.flags, sizeof(target.flags));
24
+    size += sizeof(target.flags);
25
+
26
+    if (target.imsif) {
27
+        ogs_assert(size + sizeof(target.imsi_len) <= data_len);
28
+        memcpy((unsigned char *)octet->data + size,
29
+                &target.imsi_len, sizeof(target.imsi_len));
30
+        size += sizeof(target.imsi_len);
31
+
32
+        ogs_assert(size + user_id->imsi_len <= data_len);
33
+        memcpy((char *)octet->data + size, user_id->imsi, user_id->imsi_len);
34
+        size += user_id->imsi_len;
35
+    }
36
+    if (target.imeif) {
37
+        ogs_assert(size + sizeof(target.imeisv_len) <= data_len);
38
+        memcpy((unsigned char *)octet->data + size,
39
+                &target.imeisv_len, sizeof(target.imeisv_len));
40
+        size += sizeof(target.imeisv_len);
41
+
42
+        ogs_assert(size + user_id->imeisv_len <= data_len);
43
+        memcpy((char *)octet->data + size,
44
+                user_id->imeisv, user_id->imeisv_len);
45
+        size += user_id->imeisv_len;
46
+    }
47
+    if (target.msisdnf) {
48
+        ogs_assert(size + sizeof(target.msisdn_len) <= data_len);
49
+        memcpy((unsigned char *)octet->data + size,
50
+                &target.msisdn_len, sizeof(target.msisdn_len));
51
+        size += sizeof(target.msisdn_len);
52
+
53
+        ogs_assert(size + user_id->msisdn_len <= data_len);
54
+        memcpy((char *)octet->data + size,
55
+                user_id->msisdn, user_id->msisdn_len);
56
+        size += user_id->msisdn_len;
57
+    }
58
+
59
+    octet->len = size;
60
+
61
+    return octet->len;
62
+}
63
open5gs_2.5.5.81.92ef.202301130004.tar.xz/lib/pfcp/types.h -> open5gs_2.5.5.82.5128.202301140007.tar.xz/lib/pfcp/types.h Changed
117
 
1
@@ -1400,6 +1400,115 @@
2
 int16_t ogs_pfcp_parse_volume_measurement(
3
         ogs_pfcp_volume_measurement_t *volume, ogs_tlv_octet_t *octet);
4
 
5
+/*
6
+ * 8.2.101 User ID
7
+ *
8
+ * The User ID IE type shall be encoded as shown in Figure 8.2.101-1.
9
+ *
10
+ * The following flags are coded within Octet 5:
11
+ *
12
+ * -Bit 1 – IMSIF: If this bit is set to "1",
13
+ *  then the Length of IMSI and IMSI fields shall be present,
14
+ *  otherwise these fields shall not be present.
15
+ * -Bit 2 – IMEIF: If this bit is set to "1",
16
+ *  then the Length of IMEI and IMEI fields shall be present,
17
+ *  otherwise these fields shall not be present.
18
+ * -Bit 3 – MSISDNF: If this bit is set to "1",
19
+ *  then the Length of MSISDN and MSISDN fields shall be present,
20
+ *  otherwise these fields shall not be present.
21
+ * -Bit 4 – NAIF: If this bit is set to "1",
22
+ *  then the Length of NAI and NAI fields shall be present,
23
+ *  otherwise these fields shall not be present.
24
+ * -Bit 5 – SUPIF: If this bit is set to "1",
25
+ *  then the Length of SUPI and SUPI fields shall be present,
26
+ *  otherwise these fields shall not be present.
27
+ * -Bit 6 – GPSIF: If this bit is set to "1",
28
+ *  then the Length of GPSI and GPSI fields shall be present,
29
+ *  otherwise these fields shall not be present.
30
+ * -Bit 7 – PEIF: If this bit is set to "1",
31
+ *  then the Length of PEI and PEI fields shall be present,
32
+ *  otherwise these fields shall not be present.
33
+ * - Bit 8: Spare, for future use and set to "0".
34
+ *
35
+ * One or more flags may be set to "1".
36
+ *
37
+ * For 5GS User Identities:
38
+ * -The SUPI field shall only be used for carrying a Global Cable Identifier
39
+ *  (GCI) or a Global Line Identifier (GLI). The IMSI and NAI, if received
40
+ *  by the SMF in the SUPI, shall be included in the IMSI and NAI field respectively.
41
+ * -The GPSI field shall only be used for carrying an External Identifier.
42
+ *  The MSISDN, if received by the SMF in the SUPI, shall be included
43
+ *  in the MSISDN field.
44
+ * -The PEI field shall only be used for carrying an MAC address or
45
+ *  an Extended Unique Identifier. The IMEI, if received by the SMF in the PEI,
46
+ *  shall be included in the IMEI field.
47
+ *
48
+ * The coding of IMSI field, from octets 7 to 'a' shall be encoded
49
+ * as the octets 5 to n+4 of the IMSI IE type
50
+ * specified in clause 8.3 of 3GPP TS 29.274 9.
51
+ *
52
+ * The coding of IMEI field, in octets 'b+1' to 'c' shall be encoded
53
+ * as the octets 5 to n+4 of the MEI IE type
54
+ * specified in clause 8.10 of 3GPP TS 29.274 9.
55
+ *
56
+ * The coding of MSISDN field, in octets 'd+1' to 'e' shall be encoded
57
+ * as the octets 5 to n+4 of the MSISDN IE type
58
+ * specified in clause 8.11 of 3GPP TS 29.274 9.
59
+ *
60
+ * The coding of the SUPI field, in octets 'h+1' to 'i' shall be encoded
61
+ * as the Supi data type specified in clause 5.3.2 of 3GPP TS 29.571 61.
62
+ *
63
+ * The coding of the GPSI field, in octets 'j+1' to 'k' shall be encoded
64
+ * as the Gpsi data type specified in clause 5.3.2 of 3GPP TS 29.571 61.
65
+ *
66
+ * The coding of the PEI field, in octets 'l+1' to 'm' shall be encoded
67
+ * as the Pei data type specified in clause 5.3.2 of 3GPP TS 29.571 61.
68
+ *
69
+ * The NAI field, in octets 'f+1' to 'g' shall be encoded as an Octet String
70
+ * (see IETF RFC 4282 36).
71
+ */
72
+typedef struct ogs_pfcp_user_id_flags_s {
73
+    union {
74
+        struct {
75
+ED8(uint8_t spare:1;,
76
+    uint8_t peif:1;,
77
+    uint8_t gpsif:1;,
78
+    uint8_t supif:1;,
79
+    uint8_t naif:1;,
80
+    uint8_t msisdnf:1;,
81
+    uint8_t imeif:1;,
82
+    uint8_t imsif:1;)
83
+        };
84
+    uint8_t flags;
85
+    };
86
+} ogs_pfcp_user_id_flags_t;
87
+
88
+typedef struct ogs_pfcp_user_id_s {
89
+    union {
90
+        struct {
91
+ED8(uint8_t spare:1;,
92
+    uint8_t peif:1;,
93
+    uint8_t gpsif:1;,
94
+    uint8_t supif:1;,
95
+    uint8_t naif:1;,
96
+    uint8_t msisdnf:1;,
97
+    uint8_t imeif:1;,
98
+    uint8_t imsif:1;)
99
+        };
100
+    uint8_t flags;
101
+    };
102
+
103
+    uint8_t imsi_len;
104
+    uint8_t imsiOGS_MAX_IMSI_LEN;
105
+    uint8_t imeisv_len;
106
+    uint8_t imeisvOGS_MAX_IMEISV_LEN;
107
+    uint8_t msisdn_len;
108
+    uint8_t msisdnOGS_MAX_MSISDN_LEN;
109
+} ogs_pfcp_user_id_t;
110
+
111
+int16_t ogs_pfcp_build_user_id(
112
+        ogs_tlv_octet_t *octet, ogs_pfcp_user_id_t *user_id,
113
+        void *data, int data_len);
114
 
115
 #ifdef __cplusplus
116
 }
117
open5gs_2.5.5.81.92ef.202301130004.tar.xz/lib/proto/types.h -> open5gs_2.5.5.82.5128.202301140007.tar.xz/lib/proto/types.h Changed
9
 
1
@@ -188,6 +188,7 @@
2
  * SUPI/GPSI                       */
3
 #define OGS_ID_SUPI_TYPE_IMSI "imsi"
4
 #define OGS_ID_GPSI_TYPE_MSISDN "msisdn"
5
+#define OGS_ID_SUPI_TYPE_IMEISV "imeisv"
6
 char *ogs_id_get_type(char *str);
7
 char *ogs_id_get_value(char *str);
8
 
9
open5gs_2.5.5.81.92ef.202301130004.tar.xz/src/amf/nudm-handler.c -> open5gs_2.5.5.82.5128.202301140007.tar.xz/src/amf/nudm-handler.c Changed
33
 
1
@@ -57,21 +57,18 @@
2
                         char *gpsi = NULL;
3
 
4
                         gpsi = ogs_id_get_type(node->data);
5
-                        ogs_assert(gpsi);
6
+                        if (gpsi) {
7
+                            if (strncmp(gpsi, OGS_ID_GPSI_TYPE_MSISDN,
8
+                                    strlen(OGS_ID_GPSI_TYPE_MSISDN)) == 0) {
9
+                                amf_ue->msisdnamf_ue->num_of_msisdn =
10
+                                    ogs_id_get_value(node->data);
11
+                                ogs_assert(amf_ue->
12
+                                        msisdnamf_ue->num_of_msisdn);
13
 
14
-                        if (strncmp(gpsi, OGS_ID_GPSI_TYPE_MSISDN,
15
-                                    strlen(OGS_ID_GPSI_TYPE_MSISDN)) != 0) {
16
-                            ogs_error("Unknown GPSI Type %s", gpsi);
17
-
18
-                        } else {
19
-                            amf_ue->msisdnamf_ue->num_of_msisdn =
20
-                                ogs_id_get_value(node->data);
21
-                            ogs_assert(amf_ue->msisdnamf_ue->num_of_msisdn);
22
-
23
-                            amf_ue->num_of_msisdn++;
24
+                                amf_ue->num_of_msisdn++;
25
+                            }
26
+                            ogs_free(gpsi);
27
                         }
28
-
29
-                        ogs_free(gpsi);
30
                     }
31
                 }
32
             }
33
open5gs_2.5.5.81.92ef.202301130004.tar.xz/src/smf/n4-build.c -> open5gs_2.5.5.82.5128.202301140007.tar.xz/src/smf/n4-build.c Changed
66
 
1
@@ -35,10 +35,17 @@
2
 
3
     ogs_pfcp_node_id_t node_id;
4
     ogs_pfcp_f_seid_t f_seid;
5
+    char apn_dnnOGS_MAX_DNN_LEN+1;
6
     int len;
7
 
8
+    smf_ue_t *smf_ue = NULL;
9
+    ogs_pfcp_user_id_t user_id;
10
+    char user_id_bufsizeof(ogs_pfcp_user_id_t);
11
+
12
     ogs_debug("Session Establishment Request");
13
     ogs_assert(sess);
14
+    smf_ue = sess->smf_ue;
15
+    ogs_assert(smf_ue);
16
 
17
     req = &pfcp_message.pfcp_session_establishment_request;
18
     memset(&pfcp_message, 0, sizeof(ogs_pfcp_message_t));
19
@@ -102,6 +109,46 @@
20
     req->pdn_type.presence = 1;
21
     req->pdn_type.u8 = sess->session.session_type;
22
 
23
+    /* User ID */
24
+    memset(&user_id, 0, sizeof(ogs_pfcp_user_id_t));
25
+    if (smf_ue->imsi_len) {
26
+        user_id.imsif = 1;
27
+        user_id.imsi_len = smf_ue->imsi_len;
28
+        ogs_assert(smf_ue->imsi_len <= OGS_MAX_IMSI_LEN);
29
+        memcpy(user_id.imsi, smf_ue->imsi, smf_ue->imsi_len);
30
+    }
31
+    if (smf_ue->imeisv_len) {
32
+        user_id.imeif = 1;
33
+        user_id.imeisv_len = smf_ue->imeisv_len;
34
+        ogs_assert(smf_ue->imeisv_len <= OGS_MAX_IMEISV_LEN);
35
+        memcpy(user_id.imeisv, smf_ue->imeisv, smf_ue->imeisv_len);
36
+    }
37
+    if (smf_ue->msisdn_len) {
38
+        user_id.msisdnf = 1;
39
+        user_id.msisdn_len = smf_ue->msisdn_len;
40
+        ogs_assert(smf_ue->msisdn_len <= OGS_MAX_MSISDN_LEN);
41
+        memcpy(user_id.msisdn, smf_ue->msisdn, smf_ue->msisdn_len);
42
+    }
43
+
44
+    if (user_id.flags) {
45
+        ogs_pfcp_build_user_id(
46
+            &req->user_id, &user_id, user_id_buf, sizeof(user_id_buf));
47
+        req->user_id.presence = 1;
48
+    }
49
+
50
+    /* APN/DNN */
51
+    len = ogs_fqdn_build(apn_dnn, sess->session.name, strlen(sess->session.name));
52
+    req->apn_dnn.presence = 1;
53
+    req->apn_dnn.len = len;
54
+    req->apn_dnn.data = apn_dnn;
55
+
56
+    /* S-NSSAI */
57
+    if (!sess->epc) {
58
+        req->s_nssai.presence = 1;
59
+        req->s_nssai.len = 4;
60
+        req->s_nssai.data = &sess->s_nssai;
61
+    }
62
+
63
     pfcp_message.h.type = type;
64
     pkbuf = ogs_pfcp_build_msg(&pfcp_message);
65
 
66
open5gs_2.5.5.81.92ef.202301130004.tar.xz/src/smf/nsmf-handler.c -> open5gs_2.5.5.82.5128.202301140007.tar.xz/src/smf/nsmf-handler.c Changed
70
 
1
@@ -28,6 +28,7 @@
2
 {
3
     bool rc;
4
     smf_ue_t *smf_ue = NULL;
5
+    char *type = NULL;
6
 
7
     ogs_nas_5gsm_header_t *gsm_header = NULL;
8
     ogs_pkbuf_t *n1smbuf = NULL;
9
@@ -164,6 +165,60 @@
10
         return false;
11
     }
12
 
13
+    if (SmContextCreateData->supi) {
14
+        type = ogs_id_get_type(SmContextCreateData->supi);
15
+        if (type) {
16
+            if (strncmp(type, OGS_ID_SUPI_TYPE_IMSI,
17
+                        strlen(OGS_ID_SUPI_TYPE_IMSI)) == 0) {
18
+                char *imsi_bcd = ogs_id_get_value(SmContextCreateData->supi);
19
+
20
+                ogs_cpystrn(smf_ue->imsi_bcd, imsi_bcd,
21
+                        ogs_min(strlen(imsi_bcd), OGS_MAX_IMSI_BCD_LEN)+1);
22
+                ogs_bcd_to_buffer(smf_ue->imsi_bcd,
23
+                        smf_ue->imsi, &smf_ue->imsi_len);
24
+
25
+                ogs_free(imsi_bcd);
26
+            }
27
+            ogs_free(type);
28
+        }
29
+    }
30
+
31
+    if (SmContextCreateData->pei) {
32
+        type = ogs_id_get_type(SmContextCreateData->pei);
33
+        if (type) {
34
+            if (strncmp(type, OGS_ID_SUPI_TYPE_IMEISV,
35
+                        strlen(OGS_ID_SUPI_TYPE_IMEISV)) == 0) {
36
+                char *imeisv_bcd = ogs_id_get_value(SmContextCreateData->pei);
37
+
38
+                ogs_cpystrn(smf_ue->imeisv_bcd, imeisv_bcd,
39
+                        ogs_min(strlen(imeisv_bcd), OGS_MAX_IMEISV_BCD_LEN)+1);
40
+                ogs_bcd_to_buffer(smf_ue->imeisv_bcd,
41
+                        smf_ue->imeisv, &smf_ue->imeisv_len);
42
+
43
+                ogs_free(imeisv_bcd);
44
+            }
45
+            ogs_free(type);
46
+        }
47
+    }
48
+
49
+    if (SmContextCreateData->gpsi) {
50
+        type = ogs_id_get_type(SmContextCreateData->gpsi);
51
+        if (type) {
52
+            if (strncmp(type, OGS_ID_GPSI_TYPE_MSISDN,
53
+                        strlen(OGS_ID_GPSI_TYPE_MSISDN)) == 0) {
54
+                char *msisdn_bcd = ogs_id_get_value(SmContextCreateData->gpsi);
55
+
56
+                ogs_cpystrn(smf_ue->msisdn_bcd, msisdn_bcd,
57
+                        ogs_min(strlen(msisdn_bcd), OGS_MAX_MSISDN_BCD_LEN)+1);
58
+                ogs_bcd_to_buffer(smf_ue->msisdn_bcd,
59
+                        smf_ue->msisdn, &smf_ue->msisdn_len);
60
+
61
+                ogs_free(msisdn_bcd);
62
+            }
63
+            ogs_free(type);
64
+        }
65
+    }
66
+
67
     ogs_sbi_parse_plmn_id_nid(&sess->plmn_id, servingNetwork);
68
 
69
     sess->sbi_rat_type = SmContextCreateData->rat_type;
70