Projects
osmocom:nightly
open5gs
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 548
View file
open5gs_2.7.0.16.77281.202312202026.dsc
Deleted
@@ -1,39 +0,0 @@ -Format: 3.0 (native) -Source: open5gs -Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg -Architecture: any -Version: 2.7.0.16.77281.202312202026 -Maintainer: Harald Welte <laforge@gnumonks.org> -Uploaders: Sukchan Lee <acetcom@gmail.com> -Homepage: https://open5gs.org -Standards-Version: 4.3.0 -Vcs-Browser: https://github.com/open5gs/open5gs -Vcs-Git: git://github.com/open5gs/open5gs -Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev -Package-List: - open5gs deb net optional arch=any - open5gs-amf deb net optional arch=any - open5gs-ausf deb net optional arch=any - open5gs-bsf deb net optional arch=any - open5gs-common deb net optional arch=any - open5gs-dbg deb net optional arch=any - open5gs-hss deb net optional arch=any - open5gs-mme deb net optional arch=any - open5gs-nrf deb net optional arch=any - open5gs-nssf deb net optional arch=any - open5gs-pcf deb net optional arch=any - open5gs-pcrf deb net optional arch=any - open5gs-scp deb net optional arch=any - open5gs-sepp deb net optional arch=any - open5gs-sgwc deb net optional arch=any - open5gs-sgwu deb net optional arch=any - open5gs-smf deb net optional arch=any - open5gs-udm deb net optional arch=any - open5gs-udr deb net optional arch=any - open5gs-upf deb net optional arch=any -Checksums-Sha1: - 99c344244c959c487aae0c759e260cef2840c43b 14460392 open5gs_2.7.0.16.77281.202312202026.tar.xz -Checksums-Sha256: - 5fa02f42e8a97e2e59d549ec855db6b7af812edc65f3d1c345ae56952863bc42 14460392 open5gs_2.7.0.16.77281.202312202026.tar.xz -Files: - 94312605329ab14326e404a727b58c76 14460392 open5gs_2.7.0.16.77281.202312202026.tar.xz
View file
open5gs_2.7.0.20.2390a.202312212026.dsc
Added
@@ -0,0 +1,39 @@ +Format: 3.0 (native) +Source: open5gs +Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg +Architecture: any +Version: 2.7.0.20.2390a.202312212026 +Maintainer: Harald Welte <laforge@gnumonks.org> +Uploaders: Sukchan Lee <acetcom@gmail.com> +Homepage: https://open5gs.org +Standards-Version: 4.3.0 +Vcs-Browser: https://github.com/open5gs/open5gs +Vcs-Git: git://github.com/open5gs/open5gs +Build-Depends: debhelper (>= 11), git, pkg-config, meson (>= 0.43.0), cmake, flex, bison, libgnutls28-dev, libgcrypt-dev, libssl-dev, libidn11-dev, libmongoc-dev, libbson-dev, libsctp-dev, libyaml-dev, libmicrohttpd-dev, libcurl4-gnutls-dev, libnghttp2-dev, libtins-dev, libtalloc-dev +Package-List: + open5gs deb net optional arch=any + open5gs-amf deb net optional arch=any + open5gs-ausf deb net optional arch=any + open5gs-bsf deb net optional arch=any + open5gs-common deb net optional arch=any + open5gs-dbg deb net optional arch=any + open5gs-hss deb net optional arch=any + open5gs-mme deb net optional arch=any + open5gs-nrf deb net optional arch=any + open5gs-nssf deb net optional arch=any + open5gs-pcf deb net optional arch=any + open5gs-pcrf deb net optional arch=any + open5gs-scp deb net optional arch=any + open5gs-sepp deb net optional arch=any + open5gs-sgwc deb net optional arch=any + open5gs-sgwu deb net optional arch=any + open5gs-smf deb net optional arch=any + open5gs-udm deb net optional arch=any + open5gs-udr deb net optional arch=any + open5gs-upf deb net optional arch=any +Checksums-Sha1: + c4385e9312d96b20db57e9b433fb5ae457d52697 14464488 open5gs_2.7.0.20.2390a.202312212026.tar.xz +Checksums-Sha256: + fabfa4e0ca163aeb18b92a1930de1733c03924f7e54bc00b5a0f67414b9a50d8 14464488 open5gs_2.7.0.20.2390a.202312212026.tar.xz +Files: + 1d2aac6900a3811f49cdfcd765f8da95 14464488 open5gs_2.7.0.20.2390a.202312212026.tar.xz
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/.tarball-version -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.7.0.16-77281.202312202026 +2.7.0.20-2390a.202312212026
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/debian/changelog -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.7.0.16.77281.202312202026) unstable; urgency=medium +open5gs (2.7.0.20.2390a.202312212026) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 20 Dec 2023 20:27:33 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Thu, 21 Dec 2023 20:27:34 +0000 open5gs (2.7.0) unstable; urgency=medium
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/app/ogs-init.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/app/ogs-init.c
Changed
@@ -197,7 +197,7 @@ break; case YAML_SCANNER_ERROR: if (parser.context) - ogs_error("Scanner error - %s at line %zu, column %zu" + ogs_error("Scanner error - %s at line %zu, column %zu " "%s at line %zu, column %zu", parser.context, parser.context_mark.line+1, parser.context_mark.column+1, @@ -210,7 +210,7 @@ break; case YAML_PARSER_ERROR: if (parser.context) - ogs_error("Parser error - %s at line %zu, column %zu" + ogs_error("Parser error - %s at line %zu, column %zu " "%s at line %zu, column %zu", parser.context, parser.context_mark.line+1, parser.context_mark.column+1,
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/crypt/ogs-kdf.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/crypt/ogs-kdf.c
Changed
@@ -34,6 +34,9 @@ #define FC_FOR_KENB_DERIVATION 0x11 #define FC_FOR_NH_ENB_DERIVATION 0x12 #define FC_FOR_EPS_ALGORITHM_KEY_DERIVATION 0x15 +#define FC_FOR_CK_IK_DERIVATION_HANDOVER 0x16 +#define FC_FOR_NAS_TOKEN_DERIVATION 0x17 +#define FC_FOR_CK_IK_DERIVATION_IDLE_MOBILITY 0x1B typedef struct kdf_param_s { const uint8_t *buf; @@ -379,6 +382,56 @@ memcpy(knas, output+16, 16); } +/* TS33.401 Annex A.8: KASME to CK', IK' derivation at handover */ +void ogs_kdf_ck_ik_handover( + uint32_t dl_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik) +{ + kdf_param_t param; + uint8_t outputOGS_SHA256_DIGEST_SIZE; + + memset(param, 0, sizeof(param)); + param0.buf = (uint8_t *)&dl_count; + param0.len = 4; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_CK_IK_DERIVATION_HANDOVER, param, output); + memcpy(ck, output, 16); + memcpy(ik, output+16, 16); +} + +/* TS33.401 Annex A.9: NAS token derivation for inter-RAT mobility */ +void ogs_kdf_nas_token( + uint32_t ul_count, const uint8_t *kasme, uint8_t *nas_token) +{ + kdf_param_t param; + uint8_t outputOGS_SHA256_DIGEST_SIZE; + + memset(param, 0, sizeof(param)); + param0.buf = (uint8_t *)&ul_count; + param0.len = 4; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_NAS_TOKEN_DERIVATION, param, output); + memcpy(nas_token, output, 2); +} + +/* TS33.401 Annex A.13: KASME to CK', IK' derivation at idle mobility */ +void ogs_kdf_ck_ik_idle_mobility( + uint32_t ul_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik) +{ + kdf_param_t param; + uint8_t outputOGS_SHA256_DIGEST_SIZE; + + memset(param, 0, sizeof(param)); + param0.buf = (uint8_t *)&ul_count; + param0.len = 4; + + ogs_kdf_common(kasme, OGS_SHA256_DIGEST_SIZE, + FC_FOR_CK_IK_DERIVATION_IDLE_MOBILITY, param, output); + memcpy(ck, output, 16); + memcpy(ik, output+16, 16); +} + /* * TS33.401 Annex I Hash Functions * Use the KDF given in TS33.220
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/crypt/ogs-kdf.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/crypt/ogs-kdf.h
Changed
@@ -101,6 +101,18 @@ void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers, uint8_t algorithm_identity, const uint8_t *kasme, uint8_t *knas); +/* TS33.401 Annex A.8: KASME to CK', IK' derivation at handover */ +void ogs_kdf_ck_ik_handover( + uint32_t dl_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik); + +/* TS33.401 Annex A.9: NAS token derivation for inter-RAT mobility */ +void ogs_kdf_nas_token( + uint32_t ul_count, const uint8_t *kasme, uint8_t *nas_token); + +/* TS33.401 Annex A.13: KASME to CK', IK' derivation at idle mobility */ +void ogs_kdf_ck_ik_idle_mobility( + uint32_t ul_count, const uint8_t *kasme, uint8_t *ck, uint8_t *ik); + /* * TS33.401 Annex I Hash Functions * Use the KDF given in TS33.220
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/gtp/v1/conv.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/gtp/v1/conv.c
Changed
@@ -104,6 +104,34 @@ return OGS_OK; } +int ogs_gtp1_pdu_session_type_to_eua_ietf_type(uint8_t session_type) +{ + switch (session_type) { + case OGS_PDU_SESSION_TYPE_IPV4: + return OGS_PDP_EUA_IETF_IPV4; + case OGS_PDU_SESSION_TYPE_IPV6: + return OGS_PDP_EUA_IETF_IPV6; + case OGS_PDU_SESSION_TYPE_IPV4V6: + return OGS_PDP_EUA_IETF_IPV4V6; + default: + return OGS_ERROR; + } +} + +int ogs_gtp1_eua_ietf_type_to_pdu_session_type(uint8_t eua_ietf_type) +{ + switch (eua_ietf_type) { + case OGS_PDP_EUA_IETF_IPV4: + return OGS_PDU_SESSION_TYPE_IPV4; + case OGS_PDP_EUA_IETF_IPV6: + return OGS_PDU_SESSION_TYPE_IPV6; + case OGS_PDP_EUA_IETF_IPV4V6: + return OGS_PDU_SESSION_TYPE_IPV4V6; + default: + return OGS_ERROR; + } +} + int ogs_gtp1_eua_to_ip(const ogs_eua_t *eua, uint16_t eua_len, ogs_ip_t *ip, uint8_t *pdu_session_type) {
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/gtp/v1/conv.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/gtp/v1/conv.h
Changed
@@ -35,6 +35,9 @@ int ogs_gtp1_gsn_addr_to_ip(const ogs_gtp1_gsn_addr_t *gsnaddr, uint16_t gsnaddr_len, ogs_ip_t *ip); +int ogs_gtp1_pdu_session_type_to_eua_ietf_type(uint8_t session_type); +int ogs_gtp1_eua_ietf_type_to_pdu_session_type(uint8_t eua_ietf_type); + int ogs_gtp1_eua_to_ip(const ogs_eua_t *eua, uint16_t eua_len, ogs_ip_t *ip, uint8_t *pdu_session_type);
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/gtp/v1/types.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/gtp/v1/types.c
Changed
@@ -398,3 +398,318 @@ octet->len = 6; return octet->len; } + +/* 7.7.28 MM Context */ +/* TODO: UMTS support, see Figure 41 and Figure 42. */ +int ogs_gtp1_build_mm_context(ogs_gtp1_tlv_mm_context_t *octet, + const ogs_gtp1_mm_context_decoded_t *decoded, uint8_t *data, int data_len) +{ + uint8_t *ptr = data; + unsigned int i; + uint16_t *len_ptr; + uint16_t val16; + + ogs_assert(octet); + ogs_assert(data); + ogs_assert((size_t)data_len >= 1); + + octet->data = data; + +#define CHECK_SPACE_ERR(bytes) \ + if ((ptr - data) + (bytes) > data_len) \ + return OGS_ERROR + CHECK_SPACE_ERR(1); + *ptr++ = (decoded->gupii & 0x01) << 7 | + (decoded->ugipai & 0x01) << 6 | + (decoded->used_gprs_protection_algo & 0x07) << 3 | + (decoded->ksi & 0x07); + + CHECK_SPACE_ERR(1); + *ptr++ = (decoded->sec_mode & 0x03) << 6 | + (decoded->num_vectors & 0x07) << 3 | + (decoded->sec_mode == OGS_GTP1_SEC_MODE_USED_CIPHER_VALUE_UMTS_KEY_AND_QUINTUPLETS ? + decoded->used_cipher & 0x07 : 0x07); + + CHECK_SPACE_ERR(sizeof(decoded->ck)); + memcpy(ptr, &decoded->ck0, sizeof(decoded->ck)); + ptr += sizeof(decoded->ck); + + CHECK_SPACE_ERR(sizeof(decoded->ik)); + memcpy(ptr, &decoded->ik0, sizeof(decoded->ik)); + ptr += sizeof(decoded->ik); + + /* Quintuplet Length */ + CHECK_SPACE_ERR(2); + len_ptr = (uint16_t *)ptr; /* will be filled later */ + ptr += 2; + + for (i = 0; i < decoded->num_vectors; i++) { + CHECK_SPACE_ERR(sizeof(decoded->auth_quintuplets0)); + + memcpy(ptr, &decoded->auth_quintupletsi.rand, sizeof(decoded->auth_quintupletsi.rand)); + ptr += sizeof(decoded->auth_quintupletsi.rand); + + *ptr++ = decoded->auth_quintupletsi.xres_len; + memcpy(ptr, &decoded->auth_quintupletsi.xres0, decoded->auth_quintupletsi.xres_len); + ptr += decoded->auth_quintupletsi.xres_len; + + memcpy(ptr, &decoded->auth_quintupletsi.ck, sizeof(decoded->auth_quintupletsi.ck)); + ptr += sizeof(decoded->auth_quintupletsi.ck); + memcpy(ptr, &decoded->auth_quintupletsi.ik, sizeof(decoded->auth_quintupletsi.ik)); + ptr += sizeof(decoded->auth_quintupletsi.ik); + + *ptr++ = decoded->auth_quintupletsi.autn_len; + memcpy(ptr, &decoded->auth_quintupletsi.autn0, decoded->auth_quintupletsi.autn_len); + ptr += decoded->auth_quintupletsi.autn_len; + } + + *len_ptr = htobe16(ptr - (((uint8_t *)len_ptr) + 2)); + + CHECK_SPACE_ERR(sizeof(decoded->drx_param)); + memcpy(ptr, &decoded->drx_param, sizeof(decoded->drx_param)); + ptr += sizeof(decoded->drx_param); + + if (decoded->ms_network_capability_len != 0) { + /* MS Network Capability Length */ + CHECK_SPACE_ERR(1 + decoded->ms_network_capability_len); + *ptr++ = decoded->ms_network_capability_len; + memcpy(ptr, &decoded->ms_network_capability, decoded->ms_network_capability_len); + ptr += decoded->ms_network_capability_len; + } else { + CHECK_SPACE_ERR(1); + *ptr++ = 0; + } + + if (decoded->imeisv_len != 0) { + /* Container Len */ + CHECK_SPACE_ERR(2); + val16 = htobe16(2 + decoded->imeisv_len); + memcpy(ptr, &val16, 2); + ptr += 2; + + /* Container (Mobile Identity IMEISV), TS 29.060 Table 47A */ + CHECK_SPACE_ERR(2 + decoded->imeisv_len); + *ptr++ = 0x23; + *ptr++ = decoded->imeisv_len; /* Length of mobile identity contents */ + memcpy(ptr, &decoded->imeisv0, decoded->imeisv_len); + ptr += decoded->imeisv_len; + } else { + /* Container Len */ + CHECK_SPACE_ERR(2); + *ptr++ = 0; + *ptr++ = 0; + } + + if (decoded->nrsrna) { + CHECK_SPACE_ERR(2); + *ptr++ = 1; + *ptr++ = 0x01; + } + + octet->len = (ptr - data); + return OGS_OK; +#undef CHECK_SPACE_ERR +} + +/* The format of EUA in PDP Context is not exactly the same for the entire EUA, + * hence a separate function is required to encode the value part of the address, + * instead of using regular ogs_gtp1_ip_to_eua(). */ +static int enc_pdp_ctx_as_eua(uint8_t pdu_session_type, const ogs_ip_t *ip, + uint8_t *data, int data_len) +{ + switch (pdu_session_type) + { + case OGS_PDU_SESSION_TYPE_IPV4: + if (!ip->ipv4) { + ogs_error("EUA type IPv4 but no IPv4 address available"); + return OGS_ERROR; + } + if (data_len < OGS_IPV4_LEN) + return OGS_ERROR; + memcpy(data, &ip->addr, OGS_IPV4_LEN); + return OGS_IPV4_LEN; + case OGS_PDU_SESSION_TYPE_IPV6: + if (!ip->ipv6) { + ogs_error("EUA type IPv4 but no IPv6 address available"); + return OGS_ERROR; + } + if (data_len < OGS_IPV6_LEN) + return OGS_ERROR; + memcpy(data, ip->addr6, OGS_IPV6_LEN); + return OGS_IPV6_LEN; + case OGS_PDU_SESSION_TYPE_IPV4V6: + if (ip->ipv4 && ip->ipv6) { + if (data_len < OGS_IPV4_LEN + OGS_IPV6_LEN) + return OGS_ERROR; + memcpy(data, &ip->addr, OGS_IPV4_LEN); + memcpy(data + OGS_IPV4_LEN, ip->addr6, OGS_IPV6_LEN); + return OGS_IPV4_LEN + OGS_IPV6_LEN; + } else if (ip->ipv4) { + if (data_len < OGS_IPV4_LEN) + return OGS_ERROR; + memcpy(data, &ip->addr, OGS_IPV4_LEN); + return OGS_IPV4_LEN; + } else if (ip->ipv6) { + if (data_len < OGS_IPV6_LEN) + return OGS_ERROR; + memcpy(data, ip->addr6, OGS_IPV6_LEN); + return OGS_IPV6_LEN; + } else { + ogs_error("EUA type IPv4 but no IPv4 nor IPv6 address available"); + return OGS_ERROR; + } + break; + default: + ogs_error("Unexpected session type"); + return OGS_ERROR; + } + return OGS_OK; +} + +/* TS 29.060 7.7.29 PDP Context */ +int ogs_gtp1_build_pdp_context(ogs_tlv_octet_t *octet, + const ogs_gtp1_pdp_context_decoded_t *decoded, uint8_t *data, int data_len) +{ + uint8_t *ptr = data; + uint16_t val16; + uint32_t val32; + int rv; + ogs_tlv_octet_t qos_sub_tlv_unused; + + ogs_assert(octet); + ogs_assert(data); + ogs_assert((size_t)data_len >= 1); + + octet->data = data; + +#define CHECK_SPACE_ERR(bytes) \ + if ((ptr - data) + (bytes) > data_len) \ + return OGS_ERROR + + CHECK_SPACE_ERR(1); + *ptr++ = (decoded->ea << 7) | (decoded->vaa << 6) | + (decoded->asi << 5)| (decoded->order << 4) | + (decoded->nsapi & 0x0f); + + CHECK_SPACE_ERR(1); + *ptr++ = (decoded->sapi & 0x0f); +
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/gtp/v1/types.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/gtp/v1/types.h
Changed
@@ -300,4 +300,112 @@ int16_t ogs_gtp1_build_qos_profile(ogs_tlv_octet_t *octet, const ogs_gtp1_qos_profile_decoded_t *decoded, void *data, int data_len); +/* 7.7.7 Authentication Triplet. FIXME: Not used in MME Gn scenario? */ +# if 0 +struct ogs_gtp1_auth_triplet_s { + uint8_t rand16; + uint8_t sres4; + uint8_t kc8; +} __attribute__ ((packed)) ogs_gtp1_auth_triplet_t; +#endif + +/* 7.7.35 Authentication Quintuplet */ +typedef struct ogs_gtp1_auth_quintuplet_s { + uint8_t randOGS_RAND_LEN; + uint8_t xres_len; + uint8_t xresOGS_MAX_RES_LEN; + uint8_t ck128/8; + uint8_t ik128/8; + uint8_t autn_len; + uint8_t autnOGS_AUTN_LEN; +} ogs_gtp1_auth_quintuplet_t; + +/* TS 24.008 10.5.5.6 DRX parameter (value part only) */ +typedef struct ogs_gtp1_drx_param_val_s { + uint8_t split_pg_cycle_code; /* 0 = equivalent to no DRX */ + ED3(uint8_t cn_drx_cycle_len_coeff:4;, + uint8_t split_on_ccch:1;, + uint8_t non_drx_timer:3;) +} __attribute__ ((packed)) ogs_gtp1_drx_param_val_t; + + + +/* 7.7.28 MM Context (Figure 41) */ +/* Table 47: Security Mode Values */ +#define OGS_GTP1_SEC_MODE_GSM_KEY_AND_TRIPLETS 1 +#define OGS_GTP1_SEC_MODE_GSM_KEY_AND_QUINTUPLETS 3 +#define OGS_GTP1_SEC_MODE_UMTS_KEY_AND_QUINTUPLETS 2 +#define OGS_GTP1_SEC_MODE_USED_CIPHER_VALUE_UMTS_KEY_AND_QUINTUPLETS 0 +/* Table 47B: Used GPRS integrity protection algorithm Values */ +#define OGS_GTP1_USED_GPRS_IP_NO_IP 0 +#define OGS_GTP1_USED_GPRS_IP_GIA4 4 +#define OGS_GTP1_USED_GPRS_IP_GIA5 5 +typedef struct ogs_gtp1_mm_context_decoded_s { + uint8_t gupii:1; + uint8_t ugipai:1; + uint8_t used_gprs_protection_algo:3; /* OGS_GTP1_USED_GPRS_IP */ + uint8_t ksi:3; + uint8_t sec_mode:2; /* OGS_GTP1_SEC_MODE_* */ + uint8_t num_vectors:3; + uint8_t used_cipher:3; /* 0..7 -> GEA/... */ + uint8_t ckOGS_SHA256_DIGEST_SIZE/2; + uint8_t ikOGS_SHA256_DIGEST_SIZE/2; + ogs_gtp1_auth_quintuplet_t auth_quintuplets5; + ogs_gtp1_drx_param_val_t drx_param; + uint8_t ms_network_capability_len; + uint8_t ms_network_capability6; /* ogs_nas_ms_network_capability_t */ + uint8_t imeisv_len; + uint8_t imeisv10; /* ogs_nas_mobile_identity_imeisv_t */ + uint8_t nrsrna; +} ogs_gtp1_mm_context_decoded_t; + +int ogs_gtp1_build_mm_context(ogs_gtp1_tlv_mm_context_t *octet, + const ogs_gtp1_mm_context_decoded_t *decoded, uint8_t *data, int data_len); + +/* Extended End User Address. Not explicitly defined in a table: */ +#define OGS_GTP1_PDPCTX_EXT_EUA_NO 0 +#define OGS_GTP1_PDPCTX_EXT_EUA_YES 1 + +/* 7.7.29 Table 48 Reordering Required Values */ +#define OGS_GTP1_PDPCTX_REORDERING_REQUIRED_NO 0 +#define OGS_GTP1_PDPCTX_REORDERING_REQUIRED_YES 1 + +/* 7.7.29 Table 49 VPLMN Address Allowed Values */ +#define OGS_GTP1_PDPCTX_VLPMN_ADDR_ALLOWED_NO 0 +#define OGS_GTP1_PDPCTX_VLPMN_ADDR_ALLOWED_YES 1 + +/* 7.7.29 Table 49A Activity Status Indicator Value */ +#define OGS_GTP1_PDPCTX_ACTIVITY_STATUS_IND_YES 0 +#define OGS_GTP1_PDPCTX_ACTIVITY_STATUS_IND_NO 1 + +/* 7.7.29 PDP Context */ +typedef struct ogs_gtp1_pdp_context_decoded_s { + uint8_t ea:1; /* OGS_GTP1_PDPCTX_EXT_EUA_* */ + uint8_t vaa:1; /* OGS_GTP1_PDPCTX_VLPMN_ADDR_ALLOWED_* */ + uint8_t asi:1; /* OGS_GTP1_PDPCTX_ACTIVITY_STATUS_IND_* */ + uint8_t order:1; /* OGS_GTP1_PDPCTX_REORDERING_REQUIRED_* */ + uint8_t nsapi:4; + uint8_t sapi:4; + ogs_gtp1_qos_profile_decoded_t qos_sub; + ogs_gtp1_qos_profile_decoded_t qos_req; + ogs_gtp1_qos_profile_decoded_t qos_neg; + uint16_t snd; + uint16_t snu; + uint8_t send_npdu_nr; + uint8_t receive_npdu_nr; + uint32_t ul_teic; + uint32_t ul_teid; + uint8_t pdp_ctx_id; + uint8_t pdp_type_org; + uint8_t pdp_type_num2; + ogs_ip_t pdp_address2; + ogs_ip_t ggsn_address_c; + ogs_ip_t ggsn_address_u; + char apnOGS_MAX_APN_LEN+1; + uint16_t trans_id:12; +} ogs_gtp1_pdp_context_decoded_t; + +int ogs_gtp1_build_pdp_context(ogs_gtp1_tlv_pdp_context_t *octet, + const ogs_gtp1_pdp_context_decoded_t *decoded, uint8_t *data, int data_len); + #endif /* OGS_GTP1_TYPES_H */
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/gtp/xact.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/gtp/xact.c
Changed
@@ -859,11 +859,11 @@ } } - ogs_debug("%d Cannot find xact type %u from GTPv1 peer %s:%d", - xid, type, OGS_ADDR(&gnode->addr, buf), OGS_PORT(&gnode->addr)); - - if (!new) + if (!new) { + ogs_debug("%d Cannot find xact type %u from GTPv1 peer %s:%d", + xid, type, OGS_ADDR(&gnode->addr, buf), OGS_PORT(&gnode->addr)); new = ogs_gtp_xact_remote_create(gnode, 1, sqn); + } ogs_assert(new); ogs_debug("%d %s Receive peer %s:%d", @@ -947,12 +947,11 @@ } } - ogs_debug("%d Cannot find xact type %u from GTPv2 peer %s:%d", - xid, type, - OGS_ADDR(&gnode->addr, buf), OGS_PORT(&gnode->addr)); - - if (!new) + if (!new) { + ogs_debug("%d Cannot find xact type %u from GTPv2 peer %s:%d", + xid, type, OGS_ADDR(&gnode->addr, buf), OGS_PORT(&gnode->addr)); new = ogs_gtp_xact_remote_create(gnode, 2, sqn); + } ogs_assert(new); ogs_debug("%d %s Receive peer %s:%d", @@ -1013,6 +1012,7 @@ case OGS_GTP1_NOTE_MS_GPRS_PRESENT_RESPONSE_TYPE: case OGS_GTP1_IDENTIFICATION_RESPONSE_TYPE: case OGS_GTP1_SGSN_CONTEXT_RESPONSE_TYPE: + case OGS_GTP1_SGSN_CONTEXT_ACKNOWLEDGE_TYPE: case OGS_GTP1_FORWARD_RELOCATION_RESPONSE_TYPE: case OGS_GTP1_RELOCATION_CANCEL_RESPONSE_TYPE: case OGS_GTP1_UE_REGISTRATION_QUERY_RESPONSE_TYPE:
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/lib/pfcp/xact.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/lib/pfcp/xact.c
Changed
@@ -717,11 +717,11 @@ } } - ogs_debug("%d Cannot find new type %u from PFCP peer %s:%d", - xid, type, OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); - - if (!new) + if (!new) { + ogs_debug("%d Cannot find new type %u from PFCP peer %s:%d", + xid, type, OGS_ADDR(&node->addr, buf), OGS_PORT(&node->addr)); new = ogs_pfcp_xact_remote_create(node, sqn); + } ogs_assert(new); ogs_debug("%d %s Receive peer %s:%d",
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-context.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-context.h
Changed
@@ -421,6 +421,11 @@ char a_msisdn_bcdOGS_MAX_MSISDN_BCD_LEN+1; mme_p_tmsi_t p_tmsi; + struct { + uint32_t sgsn_gn_teid; + ogs_ip_t sgsn_gn_ip; + ogs_ip_t sgsn_gn_ip_alt; + } gn; struct { mme_m_tmsi_t *m_tmsi;
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gn-build.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gn-build.c
Changed
@@ -21,6 +21,262 @@ #include "mme-gn-build.h" +static int sess_fill_mm_context_decoded(mme_sess_t *sess, ogs_gtp1_mm_context_decoded_t *mmctx_dec) +{ + mme_ue_t *mme_ue = sess->mme_ue; + mme_bearer_t *bearer = NULL; + *mmctx_dec = (ogs_gtp1_mm_context_decoded_t) { + .gupii = 1, /* Integrity Protection not required */ + .ugipai = 1, /* Ignore "Used GPRS integrity protection algorithm" field" */ + .ksi = mme_ue->nas_eps.ksi, + .sec_mode = OGS_GTP1_SEC_MODE_UMTS_KEY_AND_QUINTUPLETS, + .num_vectors = 0, /* TODO: figure out how to fill the quintuplets */ + .drx_param = { + .split_pg_cycle_code = 0, /* equivalent to no DRX */ + .cn_drx_cycle_len_coeff = 0, + .split_on_ccch = 0, + .non_drx_timer = 0, + }, + .nrsrna = 0, + }; + + //TODO: derive cK Ki from mme_ue->kasme + ogs_kdf_ck_ik_idle_mobility(mme_ue->ul_count.i32, mme_ue->kasme, &mmctx_dec->ck0, &mmctx_dec->ik0); + + mmctx_dec->imeisv_len = sizeof(mme_ue->nas_mobile_identity_imeisv); + memcpy(&mmctx_dec->imeisv0, &mme_ue->nas_mobile_identity_imeisv, sizeof(mme_ue->nas_mobile_identity_imeisv)); + + mmctx_dec->ms_network_capability_len = mme_ue->ms_network_capability.length; + memcpy(&mmctx_dec->ms_network_capability0, ((uint8_t*)&mme_ue->ms_network_capability)+1, sizeof(mme_ue->ms_network_capability) - 1); + + ogs_list_for_each(&sess->bearer_list, bearer) { + + /* FIXME: only 1 PDP Context supported in the message so far. */ + break; + } + + return OGS_OK; +} + +/* 3GPP TS 23.401 Annex E */ +static void build_qos_profile_from_session(ogs_gtp1_qos_profile_decoded_t *qos_pdec, + const mme_sess_t *sess, const mme_bearer_t *bearer) +{ + const mme_ue_t *mme_ue = sess->mme_ue; + const ogs_session_t *session = sess->session; + /* FIXME: Initialize with defaults: */ + memset(qos_pdec, 0, sizeof(*qos_pdec)); + + qos_pdec->qos_profile.arp = session->qos.arp.priority_level; + + /* 3GPP TS 23.401 Annex E table Table E.3 */ + /* Also take into account table 7 in 3GPP TS 23.107 9.1.2.2 */ + switch (session->qos.index) { /* QCI */ + case 1: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_CONVERSATIONAL; + qos_pdec->qos_profile.data.source_statistics_descriptor = OGS_GTP1_QOS_SRC_STATS_DESC_SPEECH; + qos_pdec->dec_transfer_delay = 150; + qos_pdec->qos_profile.data.delay_class = 1; + break; + case 2: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_CONVERSATIONAL; + qos_pdec->qos_profile.data.source_statistics_descriptor = OGS_GTP1_QOS_SRC_STATS_DESC_UNKNOWN; + qos_pdec->dec_transfer_delay = 150; + qos_pdec->qos_profile.data.delay_class = 1; + break; + case 3: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_CONVERSATIONAL; + qos_pdec->qos_profile.data.source_statistics_descriptor = OGS_GTP1_QOS_SRC_STATS_DESC_UNKNOWN; + qos_pdec->dec_transfer_delay = 80; + qos_pdec->qos_profile.data.delay_class = 1; + break; + case 4: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_STREAMING; + qos_pdec->qos_profile.data.source_statistics_descriptor = OGS_GTP1_QOS_SRC_STATS_DESC_UNKNOWN; + qos_pdec->qos_profile.data.sdu_error_ratio = 5; /* 10^-5*/ + qos_pdec->qos_profile.data.delay_class = 1; + break; + case 5: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_INTERACTIVE; + qos_pdec->qos_profile.data.traffic_handling_priority = 1; + qos_pdec->qos_profile.data.signalling_indication = 1; + qos_pdec->qos_profile.data.delay_class = qos_pdec->qos_profile.data.traffic_handling_priority; + break; + case 6: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_INTERACTIVE; + qos_pdec->qos_profile.data.traffic_handling_priority = 1; + qos_pdec->qos_profile.data.delay_class = qos_pdec->qos_profile.data.traffic_handling_priority; + break; + case 7: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_INTERACTIVE; + qos_pdec->qos_profile.data.traffic_handling_priority = 2; + qos_pdec->qos_profile.data.delay_class = qos_pdec->qos_profile.data.traffic_handling_priority; + break; + case 8: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_INTERACTIVE; + qos_pdec->qos_profile.data.traffic_handling_priority = 3; + qos_pdec->qos_profile.data.delay_class = qos_pdec->qos_profile.data.traffic_handling_priority; + break; + case 9: + default: + qos_pdec->qos_profile.data.traffic_class = OGS_GTP1_QOS_TRAFFIC_CLASS_BACKGROUND; + qos_pdec->qos_profile.data.delay_class = 4; + break; + } + + qos_pdec->data_octet6_to_13_present = true; + qos_pdec->data_octet14_present = true; + qos_pdec->dec_mbr_kbps_dl = mme_ue->ambr.downlink / 1000; + qos_pdec->dec_mbr_kbps_ul = mme_ue->ambr.uplink / 1000; + qos_pdec->dec_gbr_kbps_dl = bearer->qos.gbr.downlink / 1000; + qos_pdec->dec_gbr_kbps_ul = bearer->qos.gbr.uplink / 1000; +} + +static int sess_fill_pdp_context_decoded(mme_sess_t *sess, ogs_gtp1_pdp_context_decoded_t *pdpctx_dec) +{ + mme_bearer_t *bearer = NULL; + + *pdpctx_dec = (ogs_gtp1_pdp_context_decoded_t){ + .ea = OGS_GTP1_PDPCTX_EXT_EUA_NO, + .vaa = OGS_GTP1_PDPCTX_VLPMN_ADDR_ALLOWED_YES, + .asi = OGS_GTP1_PDPCTX_ACTIVITY_STATUS_IND_NO, + .order = OGS_GTP1_PDPCTX_REORDERING_REQUIRED_NO, + .ul_teic = sess->pgw_s5c_teid, + }; + + pdpctx_dec->ggsn_address_c = sess->pgw_s5c_ip; + pdpctx_dec->pdp_type_org = OGS_PDP_EUA_ORG_IETF; + pdpctx_dec->pdp_type_num0 = sess->session->session_type; + pdpctx_dec->pdp_address0 = sess->session->ue_ip; + ogs_cpystrn(pdpctx_dec->apn, sess->session->name, sizeof(pdpctx_dec->apn)); + pdpctx_dec->trans_id = sess->pti; + + ogs_list_for_each(&sess->bearer_list, bearer) { + pdpctx_dec->nsapi = bearer->ebi; + pdpctx_dec->sapi = 3; /* FIXME. Using 3 = default for now. Maybe use 0 = UNASSIGNED ?*/ + build_qos_profile_from_session(&pdpctx_dec->qos_sub, sess, bearer); + //FIXME: sort out where to get each one: + memcpy(&pdpctx_dec->qos_req, &pdpctx_dec->qos_sub, sizeof(pdpctx_dec->qos_sub)); + memcpy(&pdpctx_dec->qos_neg, &pdpctx_dec->qos_sub, sizeof(pdpctx_dec->qos_sub)); + pdpctx_dec->snd = 0; /* FIXME. */ + pdpctx_dec->snu = 0; /* FIXME. */ + pdpctx_dec->send_npdu_nr = 0; /* FIXME. */ + pdpctx_dec->receive_npdu_nr = 0; /* FIXME. */ + pdpctx_dec->ul_teid = bearer->pgw_s5u_teid; + pdpctx_dec->pdp_ctx_id = 0; /* FIXME. */ + pdpctx_dec->ggsn_address_u = bearer->pgw_s5u_ip; + /* TODO: session->qos and bearer->qos to fill something in pdpctx_dec. */ + + /* FIXME: only 1 PDP Context supported in the message so far. */ + break; + } + + return OGS_OK; +} + +/* 3GPP TS 29.060 7.5.4 SGSN Context Response */ +ogs_pkbuf_t *mme_gn_build_sgsn_context_response( + mme_ue_t *mme_ue, uint8_t cause) +{ + ogs_gtp1_message_t gtp1_message; + ogs_gtp1_sgsn_context_response_t *rsp = NULL; + mme_sess_t *sess = NULL; + ogs_gtp1_gsn_addr_t mme_gnc_gsnaddr; + int gsn_len; + int rv; + ogs_gtp1_mm_context_decoded_t mmctx_dec; + uint8_t mmctx_dec_buf512; + ogs_gtp1_pdp_context_decoded_t pdpctx_dec; + uint8_t pdpctx_dec_buf1024; + + ogs_debug("Gn build SGSN Context Response"); + + rsp = >p1_message.sgsn_context_response; + memset(>p1_message, 0, sizeof(ogs_gtp1_message_t)); + gtp1_message.h.type = OGS_GTP1_SGSN_CONTEXT_RESPONSE_TYPE; + + /* 3GPP TS 29.060 7.7.1 Cause, Mandatory */ + rsp->cause.presence = 1; + rsp->cause.u8 = cause; + + /* 3GPP TS 29.060 7.7.2 IMSI, Conditional */ + rsp->imsi.presence = !!mme_ue; + if (rsp->imsi.presence) { + rsp->imsi.data = mme_ue->imsi; + rsp->imsi.len = mme_ue->imsi_len; + } + + if (cause != OGS_GTP1_CAUSE_REQUEST_ACCEPTED) + goto build_ret; + + ogs_assert(mme_ue); + + /* FIXME: Reuse S11 TEID as local Gn interface for now */ + rsp->tunnel_endpoint_identifier_control_plane.presence = 1; + rsp->tunnel_endpoint_identifier_control_plane.u32 = mme_ue->mme_s11_teid; + + ogs_list_for_each(&mme_ue->sess_list, sess) { + if (!MME_HAVE_SGW_S1U_PATH(sess))
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gn-build.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gn-build.h
Changed
@@ -30,6 +30,9 @@ } #endif +ogs_pkbuf_t *mme_gn_build_sgsn_context_response( + mme_ue_t *mme_ue, uint8_t cause); + ogs_pkbuf_t *mme_gn_build_ran_information_relay( uint8_t type, const uint8_t *buf, size_t len, const ogs_nas_rai_t *rai, uint16_t cell_id);
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gn-handler.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gn-handler.c
Changed
@@ -68,6 +68,117 @@ return OGS_OK; } +/* 3GPP TS 23.003 2.8.2.2 Mapping from RAI and P-TMSI to GUT */ +static void rai_ptmsi_to_guti(const ogs_nas_rai_t *rai, mme_p_tmsi_t ptmsi, uint32_t ptmsi_sig, ogs_nas_eps_guti_t *nas_guti) +{ + uint16_t lac = be16toh(rai->lai.lac);; + nas_guti->nas_plmn_id =rai->lai.nas_plmn_id; + nas_guti->mme_gid = lac; + nas_guti->mme_code = rai->rac; + nas_guti->m_tmsi = 0xC0000000 | (ptmsi & 0x3f000000) | (ptmsi_sig & 0x00ff0000) | (ptmsi & 0x0000ffff); +} + +/* TS 29.060 7.5.3 SGSN Context Request */ +void mme_gn_handle_sgsn_context_request( + ogs_gtp_xact_t *xact, ogs_gtp1_sgsn_context_request_t *req) +{ + ogs_nas_eps_guti_t nas_guti; + ogs_nas_rai_t *rai; + mme_ue_t *mme_ue = NULL; + int rv; + + ogs_debug("Gn Rx SGSN Context Request"); + + if (!req->routeing_area_identity.presence) { + ogs_warn("Gn Rx SGSN Context Request with no RAI!"); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_MISSING, xact); + return; + } + if (req->routeing_area_identity.len != sizeof(*rai)) { + ogs_warn("Gn Rx SGSN Context Request RAI wrong size %u vs exp %zu!", + req->routeing_area_identity.len, sizeof(*rai)); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_INCORRECT, xact); + return; + } + if (!req->tunnel_endpoint_identifier_control_plane.presence) { + ogs_warn("Gn Rx SGSN Context Request with no Tunnel Endpoint Identifier Control Plane!"); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_MISSING, xact); + return; + } + if (!req->sgsn_address_for_control_plane.presence) { + ogs_warn("Gn Rx SGSN Context Request with no SGSN Address for Control Plane!"); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_MISSING, xact); + return; + } + if (!req->imsi.presence && + !req->temporary_logical_link_identifier.presence && + !req->packet_tmsi.presence) { + ogs_warn("Gn Rx SGSN Context Request with no IMSI/TLLI/P-TMSI!"); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_MISSING, xact); + return; + } + + if (req->ms_validated.presence && + (req->ms_validated.u8 & 0x01) /* 1=> "Yes" */ + && !req->imsi.presence) { + ogs_warn("Gn Rx SGSN Context Request with 'MS Validated' but no IMSI!"); + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_MANDATORY_IE_MISSING, xact); + return; + } + + rai = req->routeing_area_identity.data; + + if (req->imsi.presence) { + mme_ue = mme_ue_find_by_imsi(req->imsi.data, req->imsi.len); + } else if (req->packet_tmsi.presence) { /* P-TMSI */ + if (!req->p_tmsi_signature.presence) { + ogs_warn("Gn Rx SGSN Context Request with 'P-TMSI' but no P-TMSI Signature! Assuming value 0."); + req->p_tmsi_signature.u24 = 0; + } + rai_ptmsi_to_guti(rai, req->packet_tmsi.u32, req->p_tmsi_signature.u24, &nas_guti); + mme_ue = mme_ue_find_by_guti(&nas_guti); + } else if (req->temporary_logical_link_identifier.presence) { + if (!req->p_tmsi_signature.presence) { + ogs_warn("Gn Rx SGSN Context Request with 'TLLI' but no P-TMSI Signature! Assuming value 0."); + req->p_tmsi_signature.u24 = 0; + } + /* TS 29.060 7.5.3 "The TLLI/P-TMSI and RAI is a foreign TLLI/P-TMSI and an RAI in the old SGSN." + * A foregin TLLI is "tlli = (p_tmsi & 0x3fffffff) | 0x80000000", and since we only use 0x3fffffff + * bits of P-TMSI to derive the GUTI, it's totally fine passing the TLLI as P-TMSI. */ + rai_ptmsi_to_guti(rai, req->temporary_logical_link_identifier.u32, req->p_tmsi_signature.u24, &nas_guti); + mme_ue = mme_ue_find_by_guti(&nas_guti); + } + + if (!mme_ue) { + mme_gtp1_send_sgsn_context_response(NULL, OGS_GTP1_CAUSE_IMSI_IMEI_NOT_KNOWN, xact); + return; + } + + mme_ue->gn.sgsn_gn_teid = req->tunnel_endpoint_identifier_control_plane.u32; + + rv = ogs_gtp1_gsn_addr_to_ip(req->sgsn_address_for_control_plane.data, + req->sgsn_address_for_control_plane.len, + &mme_ue->gn.sgsn_gn_ip); + ogs_assert(rv == OGS_OK); + + if (req->alternative_sgsn_address_for_control_plane.presence) { + rv = ogs_gtp1_gsn_addr_to_ip(req->alternative_sgsn_address_for_control_plane.data, + req->alternative_sgsn_address_for_control_plane.len, + &mme_ue->gn.sgsn_gn_ip_alt); + ogs_assert(rv == OGS_OK); + } + + mme_gtp1_send_sgsn_context_response(mme_ue, OGS_GTP1_CAUSE_REQUEST_ACCEPTED, xact); +} + +/* TS 29.060 7.5.5 SGSN Context Acknowledge */ +void mme_gn_handle_sgsn_context_acknowledge( + ogs_gtp_xact_t *xact, ogs_gtp1_sgsn_context_acknowledge_t *req) +{ + /* FIXME: find out what to do here, 3GPP TS 23.401 D.3.5 + * Probably release the Session on the SGW (without releasing in the PGW) */ +} + /* TS 29.060 7.5.14.1 */ void mme_gn_handle_ran_information_relay( ogs_gtp_xact_t *xact, ogs_gtp1_ran_information_relay_t *req)
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gn-handler.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gn-handler.h
Changed
@@ -32,6 +32,12 @@ void mme_gn_handle_echo_response( ogs_gtp_xact_t *xact, ogs_gtp1_echo_response_t *req); +void mme_gn_handle_sgsn_context_request( + ogs_gtp_xact_t *xact, ogs_gtp1_sgsn_context_request_t *req); + +void mme_gn_handle_sgsn_context_acknowledge( + ogs_gtp_xact_t *xact, ogs_gtp1_sgsn_context_acknowledge_t *req); + void mme_gn_handle_ran_information_relay( ogs_gtp_xact_t *xact, ogs_gtp1_ran_information_relay_t *req);
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gtp-path.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gtp-path.c
Changed
@@ -758,6 +758,36 @@ return rv; } +int mme_gtp1_send_sgsn_context_response( + mme_ue_t *mme_ue, uint8_t cause, ogs_gtp_xact_t *xact) +{ + int rv; + ogs_gtp1_header_t h; + ogs_pkbuf_t *pkbuf = NULL; + + memset(&h, 0, sizeof(ogs_gtp1_header_t)); + h.type = OGS_GTP1_SGSN_CONTEXT_RESPONSE_TYPE; + h.teid = mme_ue ? mme_ue->gn.sgsn_gn_teid : 0; + + pkbuf = mme_gn_build_sgsn_context_response(mme_ue, cause); + if (!pkbuf) { + ogs_error("mme_gn_build_sgsn_context_response() failed"); + return OGS_ERROR; + } + /* FIXME: Reuse S11 TEID as local Gn interface for now */ + xact->local_teid = mme_ue ? mme_ue->mme_s11_teid : 0; + + rv = ogs_gtp1_xact_update_tx(xact, &h, pkbuf); + if (rv != OGS_OK) { + ogs_error("ogs_gtp1_xact_update_tx() failed"); + return OGS_ERROR; + } + + rv = ogs_gtp_xact_commit(xact); + ogs_expect(rv == OGS_OK); + + return rv; +} int mme_gtp1_send_ran_information_relay( mme_sgsn_t *sgsn, const uint8_t *buf, size_t len,
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-gtp-path.h -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-gtp-path.h
Changed
@@ -55,6 +55,9 @@ int mme_gtp_send_bearer_resource_command( mme_bearer_t *bearer, ogs_nas_eps_message_t *nas_message); +int mme_gtp1_send_sgsn_context_response( + mme_ue_t *mme_ue, uint8_t cause, ogs_gtp_xact_t *xact); + int mme_gtp1_send_ran_information_relay( mme_sgsn_t *sgsn, const uint8_t *buf, size_t len, const ogs_nas_rai_t *rai, uint16_t cell_id);
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-s6a-handler.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-s6a-handler.c
Changed
@@ -33,7 +33,7 @@ static uint8_t emm_cause_from_diameter( const uint32_t *dia_err, const uint32_t *dia_exp_err); -static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue, +static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue, ogs_slice_data_t *slice_data); uint8_t mme_s6a_handle_aia( @@ -299,7 +299,7 @@ } } -static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue, +static uint8_t mme_ue_session_from_slice_data(mme_ue_t *mme_ue, ogs_slice_data_t *slice_data) { int i;
View file
open5gs_2.7.0.16.77281.202312202026.tar.xz/src/mme/mme-sm.c -> open5gs_2.7.0.20.2390a.202312212026.tar.xz/src/mme/mme-sm.c
Changed
@@ -662,6 +662,12 @@ case OGS_GTP1_ECHO_RESPONSE_TYPE: mme_gn_handle_echo_response(xact, >p1_message.echo_response); break; + case OGS_GTP1_SGSN_CONTEXT_REQUEST_TYPE: + mme_gn_handle_sgsn_context_request(xact, >p1_message.sgsn_context_request); + break; + case OGS_GTP1_SGSN_CONTEXT_ACKNOWLEDGE_TYPE: + mme_gn_handle_sgsn_context_acknowledge(xact, >p1_message.sgsn_context_acknowledge); + break; case OGS_GTP1_RAN_INFORMATION_RELAY_TYPE: mme_gn_handle_ran_information_relay(xact, >p1_message.ran_information_relay); break;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.