forked from acouzens/open5gs
Add only one 5GC scenario (call-flow)
This commit is contained in:
parent
20008b6a13
commit
dbee687a75
|
@ -28,8 +28,8 @@ amf:
|
|||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ EIA1, EIA2, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
integrity_order : [ NIA1, NIA2, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
|
|
|
@ -32,8 +32,8 @@ amf:
|
|||
- sst: 1
|
||||
sd: 112233
|
||||
security:
|
||||
integrity_order : [ EIA2, EIA1 ]
|
||||
ciphering_order : [ EEA2, EEA1, EEA0 ]
|
||||
integrity_order : [ NIA2, NIA1 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
|
|
|
@ -86,8 +86,8 @@ amf:
|
|||
s_nssai:
|
||||
- sst: 1
|
||||
security:
|
||||
integrity_order : [ EIA1, EIA2, EIA0 ]
|
||||
ciphering_order : [ EEA0, EEA1, EEA2 ]
|
||||
integrity_order : [ NIA1, NIA2, NIA0 ]
|
||||
ciphering_order : [ NEA0, NEA1, NEA2 ]
|
||||
network_name:
|
||||
full: Open5GS
|
||||
amf_name: open5gs-amf0
|
||||
|
|
|
@ -136,15 +136,16 @@ int ogs_asn_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ogs_ip_t *ip)
|
|||
memcpy(&ip->both.addr, bit_string->buf, OGS_IPV4_LEN);
|
||||
memcpy(&ip->both.addr6, bit_string->buf+OGS_IPV4_LEN, OGS_IPV6_LEN);
|
||||
ogs_debug(" IPv4[%s] IPv6[%s]",
|
||||
INET_NTOP(&ip->both.addr, buf), INET6_NTOP(&ip->both.addr6, buf2));
|
||||
OGS_INET_NTOP(&ip->both.addr, buf),
|
||||
OGS_INET6_NTOP(&ip->both.addr6, buf2));
|
||||
} else if (bit_string->size == OGS_IPV4_LEN) {
|
||||
ip->ipv4 = 1;
|
||||
memcpy(&ip->addr, bit_string->buf, OGS_IPV4_LEN);
|
||||
ogs_debug(" IPv4[%s]", INET_NTOP(&ip->addr, buf));
|
||||
ogs_debug(" IPv4[%s]", OGS_INET_NTOP(&ip->addr, buf));
|
||||
} else if (bit_string->size == OGS_IPV6_LEN) {
|
||||
ip->ipv6 = 1;
|
||||
memcpy(&ip->addr6, bit_string->buf, OGS_IPV6_LEN);
|
||||
ogs_debug(" IPv6[%s]", INET_NTOP(&ip->addr6, buf));
|
||||
ogs_debug(" IPv6[%s]", OGS_INET_NTOP(&ip->addr6, buf));
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
|
@ -165,17 +166,18 @@ int ogs_asn_ip_to_BIT_STRING(ogs_ip_t *ip, BIT_STRING_t *bit_string)
|
|||
memcpy(bit_string->buf, &ip->both.addr, OGS_IPV4_LEN);
|
||||
memcpy(bit_string->buf+OGS_IPV4_LEN, &ip->both.addr6, OGS_IPV6_LEN);
|
||||
ogs_debug(" IPv4[%s] IPv6[%s]",
|
||||
INET_NTOP(&ip->both.addr, buf), INET6_NTOP(&ip->both.addr6, buf2));
|
||||
OGS_INET_NTOP(&ip->both.addr, buf),
|
||||
OGS_INET6_NTOP(&ip->both.addr6, buf2));
|
||||
} else if (ip->ipv4) {
|
||||
bit_string->size = OGS_IPV4_LEN;
|
||||
bit_string->buf = CALLOC(bit_string->size, sizeof(uint8_t));
|
||||
memcpy(bit_string->buf, &ip->addr, OGS_IPV4_LEN);
|
||||
ogs_debug(" IPv4[%s]", INET_NTOP(&ip->addr, buf));
|
||||
ogs_debug(" IPv4[%s]", OGS_INET_NTOP(&ip->addr, buf));
|
||||
} else if (ip->ipv6) {
|
||||
bit_string->size = OGS_IPV6_LEN;
|
||||
bit_string->buf = CALLOC(bit_string->size, sizeof(uint8_t));
|
||||
memcpy(bit_string->buf, &ip->addr6, OGS_IPV6_LEN);
|
||||
ogs_debug(" IPv6[%s]", INET_NTOP(&ip->addr6, buf));
|
||||
ogs_debug(" IPv6[%s]", OGS_INET_NTOP(&ip->addr6, buf));
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
libasn1c_util_sources = files('''
|
||||
conv.c
|
||||
message.c
|
||||
'''.split())
|
||||
|
||||
libasn1c_util_inc = include_directories('.')
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "message.h"
|
||||
|
||||
ogs_pkbuf_t *ogs_asn_encode(const asn_TYPE_descriptor_t *td, void *sptr)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
ogs_assert(td);
|
||||
ogs_assert(sptr);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_pkbuf_put(pkbuf, OGS_MAX_SDU_LEN);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(td, NULL,
|
||||
sptr, pkbuf->data, OGS_MAX_SDU_LEN);
|
||||
ogs_asn_free(td, sptr);
|
||||
|
||||
if (enc_ret.encoded < 0) {
|
||||
ogs_error("Failed to encode ASN-PDU [%d]", (int)enc_ret.encoded);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_pkbuf_trim(pkbuf, (enc_ret.encoded >> 3));
|
||||
|
||||
return pkbuf;
|
||||
}
|
||||
|
||||
int ogs_asn_decode(const asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, size_t struct_size, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_dec_rval_t dec_ret = {0};
|
||||
|
||||
ogs_assert(td);
|
||||
ogs_assert(struct_ptr);
|
||||
ogs_assert(struct_size);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_assert(pkbuf->data);
|
||||
ogs_assert(pkbuf->len);
|
||||
|
||||
memset(struct_ptr, 0, struct_size);
|
||||
dec_ret = aper_decode(NULL, td, (void **)&struct_ptr,
|
||||
pkbuf->data, pkbuf->len, 0, 0);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
ogs_warn("Failed to decode ASN-PDU [code:%d,consumed:%d]",
|
||||
dec_ret.code, (int)dec_ret.consumed);
|
||||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
void ogs_asn_free(const asn_TYPE_descriptor_t *td, void *sptr)
|
||||
{
|
||||
ogs_assert(td);
|
||||
ogs_assert(sptr);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OGS_ASN_MESSAGE_H
|
||||
#define OGS_ASN_MESSAGE_H
|
||||
|
||||
#include "ogs-core.h"
|
||||
|
||||
#include "asn_internal.h"
|
||||
#include "constr_TYPE.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ogs_pkbuf_t *ogs_asn_encode(const asn_TYPE_descriptor_t *td, void *sptr);
|
||||
int ogs_asn_decode(const asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, size_t struct_size, ogs_pkbuf_t *pkbuf);
|
||||
void ogs_asn_free(const asn_TYPE_descriptor_t *td, void *sptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -64,14 +64,43 @@ void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id,
|
|||
return plmn_id;
|
||||
}
|
||||
|
||||
char *ogs_plmn_id_string(ogs_plmn_id_t *plmn_id)
|
||||
char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id)
|
||||
{
|
||||
ogs_assert(plmn_id);
|
||||
|
||||
return ogs_msprintf("5G:mnc%03d.mcc%03d.3gppnetwork.org",
|
||||
ogs_plmn_id_mnc(plmn_id), ogs_plmn_id_mcc(plmn_id));
|
||||
}
|
||||
|
||||
char *ogs_plmn_id_mcc_string(ogs_plmn_id_t *plmn_id)
|
||||
{
|
||||
ogs_assert(plmn_id);
|
||||
return ogs_msprintf("%03d", ogs_plmn_id_mcc(plmn_id));
|
||||
}
|
||||
|
||||
char *ogs_plmn_id_mnc_string(ogs_plmn_id_t *plmn_id)
|
||||
{
|
||||
ogs_assert(plmn_id);
|
||||
if (ogs_plmn_id_mnc_len(plmn_id) == 2)
|
||||
return ogs_msprintf("%02d", ogs_plmn_id_mnc(plmn_id));
|
||||
else
|
||||
return ogs_msprintf("%03d", ogs_plmn_id_mnc(plmn_id));
|
||||
}
|
||||
|
||||
char *ogs_plmn_id_to_string(ogs_plmn_id_t *plmn_id, char *buf)
|
||||
{
|
||||
ogs_assert(plmn_id);
|
||||
ogs_assert(buf);
|
||||
|
||||
if (ogs_plmn_id_mnc_len(plmn_id) == 2)
|
||||
ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%02d",
|
||||
ogs_plmn_id_mcc(plmn_id), ogs_plmn_id_mnc(plmn_id));
|
||||
else
|
||||
ogs_snprintf(buf, OGS_PLMNIDSTRLEN, "%03d%03d",
|
||||
ogs_plmn_id_mcc(plmn_id), ogs_plmn_id_mnc(plmn_id));
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
uint32_t ogs_amf_id_hexdump(ogs_amf_id_t *amf_id)
|
||||
{
|
||||
uint32_t hex;
|
||||
|
@ -142,6 +171,29 @@ ogs_amf_id_t *ogs_amf_id_build(ogs_amf_id_t *amf_id,
|
|||
return amf_id;
|
||||
}
|
||||
|
||||
char *ogs_s_nssai_sd_to_string(ogs_uint24_t sd)
|
||||
{
|
||||
if (sd.v != OGS_S_NSSAI_NO_SD_VALUE)
|
||||
return ogs_msprintf("%06x", sd.v);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_uint24_t ogs_s_nssai_sd_from_string(const char *hex)
|
||||
{
|
||||
ogs_uint24_t sd;
|
||||
char hexbuf[sizeof(ogs_uint24_t)];
|
||||
|
||||
sd.v = OGS_S_NSSAI_NO_SD_VALUE;
|
||||
if (hex == NULL)
|
||||
return sd;
|
||||
|
||||
OGS_HEX(hex, strlen(hex), hexbuf);
|
||||
memcpy(&sd, hexbuf, 3);
|
||||
|
||||
return ogs_be24toh(sd);
|
||||
}
|
||||
|
||||
char *ogs_supi_from_suci(char *suci)
|
||||
{
|
||||
#define MAX_SUCI_TOKEN 16
|
||||
|
@ -185,7 +237,24 @@ char *ogs_supi_from_suci(char *suci)
|
|||
return supi;
|
||||
}
|
||||
|
||||
char *ogs_ueid_from_supi(char *supi)
|
||||
char *ogs_supi_get_type(char *supi)
|
||||
{
|
||||
char *saveptr = NULL;
|
||||
char *p, *tmp;
|
||||
char *type = NULL;
|
||||
|
||||
ogs_assert(supi);
|
||||
tmp = ogs_strdup(supi);
|
||||
|
||||
p = strtok_r(tmp, "-", &saveptr);
|
||||
ogs_assert(p);
|
||||
type = ogs_strdup(p);
|
||||
|
||||
ogs_free(tmp);
|
||||
return type;
|
||||
}
|
||||
|
||||
char *ogs_supi_get_id(char *supi)
|
||||
{
|
||||
char *saveptr = NULL;
|
||||
char *p, *tmp;
|
||||
|
@ -360,3 +429,50 @@ int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list)
|
|||
|
||||
return OGS_OK;
|
||||
}
|
||||
|
||||
void ogs_sockaddr_to_ip(
|
||||
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_ip_t *ip)
|
||||
{
|
||||
ogs_assert(ip);
|
||||
ogs_assert(addr || addr6);
|
||||
|
||||
memset(ip, 0, sizeof(ogs_ip_t));
|
||||
|
||||
if (addr && addr6) {
|
||||
ip->ipv4 = 1;
|
||||
ip->ipv6 = 1;
|
||||
ip->len = OGS_IPV4V6_LEN;
|
||||
ip->both.addr = addr->sin.sin_addr.s_addr;
|
||||
memcpy(ip->both.addr6, addr6->sin6.sin6_addr.s6_addr, OGS_IPV6_LEN);
|
||||
} else if (addr) {
|
||||
ip->ipv4 = 1;
|
||||
ip->len = OGS_IPV4_LEN;
|
||||
ip->addr = addr->sin.sin_addr.s_addr;
|
||||
} else if (addr6) {
|
||||
ip->ipv6 = 1;
|
||||
ip->len = OGS_IPV6_LEN;
|
||||
memcpy(ip->addr6, addr6->sin6.sin6_addr.s6_addr, OGS_IPV6_LEN);
|
||||
} else
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
|
||||
char *ogs_ipv4_to_string(uint32_t addr)
|
||||
{
|
||||
char *buf = NULL;
|
||||
|
||||
buf = ogs_calloc(1, OGS_ADDRSTRLEN);
|
||||
ogs_assert(buf);
|
||||
|
||||
return (char*)OGS_INET_NTOP(&addr, buf);
|
||||
}
|
||||
|
||||
char *ogs_ipv6_to_string(uint8_t *addr6)
|
||||
{
|
||||
char *buf = NULL;
|
||||
ogs_assert(addr6);
|
||||
|
||||
buf = ogs_calloc(1, OGS_ADDRSTRLEN);
|
||||
ogs_assert(buf);
|
||||
|
||||
return (char *)OGS_INET6_NTOP(addr6, buf);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ extern "C" {
|
|||
#define OGS_MAX_NUM_OF_SESS 4 /* Num of APN(Session) per UE */
|
||||
#define OGS_MAX_NUM_OF_RULE 4 /* Num of Rule per Session */
|
||||
|
||||
/* Num of PacketFilter per Bearer(GTP) or QoS(NAS-5GS) */
|
||||
#define OGS_MAX_NUM_OF_PACKET_FILTER 16
|
||||
|
||||
#define OGS_MAX_SDU_LEN 8192
|
||||
#define OGS_PLMN_ID_LEN 3
|
||||
#define OGS_MAX_PLMN_ID_BCD_LEN 6
|
||||
|
@ -65,6 +68,11 @@ extern "C" {
|
|||
(((((x) % 10) << 4) & 0xf0) | (((x) / 10) & 0x0f))
|
||||
|
||||
#define OGS_NAS_PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED 0
|
||||
#define OGS_NAS_PDU_SESSION_IDENTITY_UNASSIGNED 0
|
||||
|
||||
#define OGS_ACCESS_TYPE_3GPP 1
|
||||
#define OGS_ACCESS_TYPE_NON_3GPP 2
|
||||
#define OGS_ACCESS_TYPE_BOTH_3GPP_AND_NON_3GPP 3
|
||||
|
||||
typedef struct ogs_uint24_s {
|
||||
uint32_t v:24;
|
||||
|
@ -127,7 +135,12 @@ uint16_t ogs_plmn_id_mnc_len(ogs_plmn_id_t *plmn_id);
|
|||
void *ogs_plmn_id_build(ogs_plmn_id_t *plmn_id,
|
||||
uint16_t mcc, uint16_t mnc, uint16_t mnc_len);
|
||||
|
||||
char *ogs_plmn_id_string(ogs_plmn_id_t *plmn_id);
|
||||
char *ogs_serving_network_name_from_plmn_id(ogs_plmn_id_t *plmn_id);
|
||||
char *ogs_plmn_id_mcc_string(ogs_plmn_id_t *plmn_id);
|
||||
char *ogs_plmn_id_mnc_string(ogs_plmn_id_t *plmn_id);
|
||||
|
||||
#define OGS_PLMNIDSTRLEN (sizeof(ogs_plmn_id_t)*2+1)
|
||||
char *ogs_plmn_id_to_string(ogs_plmn_id_t *plmn_id, char *buf);
|
||||
|
||||
/************************************
|
||||
* AMF_ID Structure */
|
||||
|
@ -154,7 +167,8 @@ ogs_amf_id_t *ogs_amf_id_build(ogs_amf_id_t *amf_id,
|
|||
/************************************
|
||||
* SUPI/SUCI */
|
||||
char *ogs_supi_from_suci(char *suci);
|
||||
char *ogs_ueid_from_supi(char *supi);
|
||||
char *ogs_supi_get_type(char *supi);
|
||||
char *ogs_supi_get_id(char *supi);
|
||||
|
||||
/************************************
|
||||
* TAI Structure */
|
||||
|
@ -181,13 +195,16 @@ typedef struct ogs_nr_cgi_s {
|
|||
|
||||
/************************************
|
||||
* S-NSSAI Structure */
|
||||
#define OGS_MAX_NUM_OF_S_NSSAI 8
|
||||
#define OGS_MAX_NUM_OF_S_NSSAI 16
|
||||
#define OGS_S_NSSAI_NO_SD_VALUE 0xffffff
|
||||
typedef struct ogs_s_nssai_s {
|
||||
uint8_t sst;
|
||||
ogs_uint24_t sd;
|
||||
} __attribute__ ((packed)) ogs_s_nssai_t;
|
||||
|
||||
char *ogs_s_nssai_sd_to_string(ogs_uint24_t sd);
|
||||
ogs_uint24_t ogs_s_nssai_sd_from_string(const char *hex);
|
||||
|
||||
/**************************************************
|
||||
* Common Structure
|
||||
* S1AP : 9.2.2.1 Transport Layer Address, See 36.414
|
||||
|
@ -211,6 +228,10 @@ ED3(uint8_t ipv4:1;,
|
|||
} ogs_ip_t;
|
||||
|
||||
int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list);
|
||||
void ogs_sockaddr_to_ip(
|
||||
ogs_sockaddr_t *addr, ogs_sockaddr_t *addr6, ogs_ip_t *ip);
|
||||
char *ogs_ipv4_to_string(uint32_t addr);
|
||||
char *ogs_ipv6_to_string(uint8_t *addr6);
|
||||
|
||||
/**************************************************
|
||||
* 8.14 PDN Address Allocation (PAA) */
|
||||
|
@ -220,14 +241,14 @@ int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list);
|
|||
typedef struct ogs_paa_s {
|
||||
ED2(uint8_t spare:5;,
|
||||
/* 8.34 PDN Type */
|
||||
#define OGS_GTP_PDN_TYPE_IPV4 1
|
||||
#define OGS_GTP_PDN_TYPE_IPV6 2
|
||||
#define OGS_GTP_PDN_TYPE_IPV4V6 3
|
||||
#define OGS_GTP_PDN_TYPE_NON_IP 4
|
||||
#define OGS_PFCP_PDN_TYPE_IPV4 OGS_GTP_PDN_TYPE_IPV4
|
||||
#define OGS_PFCP_PDN_TYPE_IPV6 OGS_GTP_PDN_TYPE_IPV6
|
||||
#define OGS_PFCP_PDN_TYPE_IPV4V6 OGS_GTP_PDN_TYPE_IPV4V6
|
||||
#define OGS_PFCP_PDN_TYPE_NONIP OGS_GTP_PDN_TYPE_NONIP
|
||||
#define OGS_GTP_PDN_TYPE_IPV4 OGS_PDU_SESSION_TYPE_IPV4
|
||||
#define OGS_GTP_PDN_TYPE_IPV6 OGS_PDU_SESSION_TYPE_IPV6
|
||||
#define OGS_GTP_PDN_TYPE_IPV4V6 OGS_PDU_SESSION_TYPE_IPV4V6
|
||||
#define OGS_GTP_PDN_TYPE_NON_IP OGS_PDU_SESSION_TYPE_NONIP
|
||||
#define OGS_PFCP_PDN_TYPE_IPV4 OGS_PDU_SESSION_TYPE_IPV4
|
||||
#define OGS_PFCP_PDN_TYPE_IPV6 OGS_PDU_SESSION_TYPE_IPV6
|
||||
#define OGS_PFCP_PDN_TYPE_IPV4V6 OGS_PDU_SESSION_TYPE_IPV4V6
|
||||
#define OGS_PFCP_PDN_TYPE_NONIP OGS_PDU_SESSION_TYPE_NONIP
|
||||
uint8_t pdn_type:3;)
|
||||
union {
|
||||
/* GTP_PDN_TYPE_IPV4 */
|
||||
|
@ -383,19 +404,33 @@ typedef struct ogs_pcc_rule_s {
|
|||
/**********************************
|
||||
* PDN Structure */
|
||||
typedef struct ogs_pdn_s {
|
||||
uint32_t context_identifier;
|
||||
char apn[OGS_MAX_APN_LEN+1];
|
||||
uint32_t context_identifier;
|
||||
char apn[OGS_MAX_APN_LEN+1];
|
||||
#define OGS_DIAM_PDN_TYPE_IPV4 0
|
||||
#define OGS_DIAM_PDN_TYPE_IPV6 1
|
||||
#define OGS_DIAM_PDN_TYPE_IPV4V6 2
|
||||
#define OGS_DIAM_PDN_TYPE_IPV4_OR_IPV6 3
|
||||
uint8_t pdn_type;
|
||||
#define OGS_PDU_SESSION_TYPE_IPV4 1
|
||||
#define OGS_PDU_SESSION_TYPE_IPV6 2
|
||||
#define OGS_PDU_SESSION_TYPE_IPV4V6 3
|
||||
#define OGS_PDU_SESSION_TYPE_UNSTRUCTURED 4
|
||||
#define OGS_PDU_SESSION_TYPE_ETHERNET 5
|
||||
uint8_t pdn_type;
|
||||
|
||||
ogs_qos_t qos;
|
||||
ogs_bitrate_t ambr; /* APN-AMBR */
|
||||
#define OGS_SSC_MODE_1 1
|
||||
#define OGS_SSC_MODE_2 2
|
||||
#define OGS_SSC_MODE_3 3
|
||||
uint8_t ssc_mode;
|
||||
|
||||
ogs_paa_t paa;
|
||||
ogs_ip_t pgw_ip;
|
||||
ogs_qos_t qos;
|
||||
ogs_bitrate_t ambr; /* APN-AMBR */
|
||||
|
||||
ogs_paa_t paa;
|
||||
struct {
|
||||
uint32_t addr;
|
||||
uint8_t addr6[OGS_IPV6_LEN];
|
||||
} ue_ip;
|
||||
ogs_ip_t pgw_ip;
|
||||
} ogs_pdn_t;
|
||||
|
||||
int ogs_fqdn_build(char *dst, char *src, int len);
|
||||
|
|
|
@ -70,6 +70,12 @@ extern "C" {
|
|||
#define OGS_GNUC_NORETURN
|
||||
#endif
|
||||
|
||||
#if __GNUC__ > 6
|
||||
#define OGS_GNUC_FALLTHROUGH __attribute__ ((fallthrough))
|
||||
#else
|
||||
#define OGS_GNUC_FALLTHROUGH
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define htole16(x) (x)
|
||||
#define htole32(x) (x)
|
||||
|
@ -147,9 +153,9 @@ extern "C" {
|
|||
#define OGS_PASTE(n1, n2) OGS_PASTE_HELPER(n1, n2)
|
||||
#define OGS_PASTE_HELPER(n1, n2) n1##n2
|
||||
|
||||
#define INET_NTOP(src, dst) \
|
||||
#define OGS_INET_NTOP(src, dst) \
|
||||
inet_ntop(AF_INET, (void *)(uintptr_t)(src), (dst), INET_ADDRSTRLEN)
|
||||
#define INET6_NTOP(src, dst) \
|
||||
#define OGS_INET6_NTOP(src, dst) \
|
||||
inet_ntop(AF_INET6, (void *)(src), (dst), INET6_ADDRSTRLEN)
|
||||
|
||||
#define ogs_max(x , y) (((x) > (y)) ? (x) : (y))
|
||||
|
|
|
@ -42,6 +42,7 @@ libcrypt_sources = files('''
|
|||
kasumi.c
|
||||
|
||||
ogs-kdf.c
|
||||
ogs-base64.c
|
||||
'''.split())
|
||||
|
||||
libcrypt_inc = include_directories('.')
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ogs-crypt.h"
|
||||
|
||||
/* aaaack but it's fast and const should make it shared text page. */
|
||||
static const unsigned char pr2six[256] =
|
||||
{
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
|
||||
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64,
|
||||
64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64,
|
||||
64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
|
||||
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64
|
||||
};
|
||||
|
||||
int ogs_base64_decode_len(const char *bufcoded)
|
||||
{
|
||||
int nbytesdecoded;
|
||||
register const unsigned char *bufin;
|
||||
register size_t nprbytes;
|
||||
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
while (pr2six[*(bufin++)] <= 63);
|
||||
|
||||
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
|
||||
nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
|
||||
|
||||
return nbytesdecoded + 1;
|
||||
}
|
||||
|
||||
int ogs_base64_decode(char *bufplain, const char *bufcoded)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = ogs_base64_decode_binary((unsigned char *) bufplain, bufcoded);
|
||||
bufplain[len] = '\0';
|
||||
return len;
|
||||
}
|
||||
|
||||
/* This is the same as ogs_base64_decode() except:
|
||||
* - no \0 is appended
|
||||
*/
|
||||
int ogs_base64_decode_binary(unsigned char *bufplain, const char *bufcoded)
|
||||
{
|
||||
int nbytesdecoded;
|
||||
register const unsigned char *bufin;
|
||||
register unsigned char *bufout;
|
||||
register size_t nprbytes;
|
||||
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
while (pr2six[*(bufin++)] <= 63);
|
||||
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
|
||||
nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
|
||||
|
||||
bufout = (unsigned char *) bufplain;
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
|
||||
while (nprbytes > 4) {
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
|
||||
bufin += 4;
|
||||
nprbytes -= 4;
|
||||
}
|
||||
|
||||
/* Note: (nprbytes == 1) would be an error, so just ignore that case */
|
||||
if (nprbytes > 1) {
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
|
||||
}
|
||||
if (nprbytes > 2) {
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
|
||||
}
|
||||
if (nprbytes > 3) {
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
|
||||
}
|
||||
|
||||
nbytesdecoded -= (4 - (int)nprbytes) & 3;
|
||||
return nbytesdecoded;
|
||||
}
|
||||
|
||||
static const char basis_64[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
int ogs_base64_encode_len(int len)
|
||||
{
|
||||
return ((len + 2) / 3 * 4) + 1;
|
||||
}
|
||||
|
||||
int ogs_base64_encode(char *encoded, const char *string, int len)
|
||||
{
|
||||
return ogs_base64_encode_binary(
|
||||
encoded, (const unsigned char *) string, len);
|
||||
}
|
||||
|
||||
/* This is the same as ogs_base64_encode() except on EBCDIC machines, where
|
||||
* the conversion of the input to ascii is left out.
|
||||
*/
|
||||
int ogs_base64_encode_binary(
|
||||
char *encoded, const unsigned char *string, int len)
|
||||
{
|
||||
int i;
|
||||
char *p;
|
||||
|
||||
p = encoded;
|
||||
for (i = 0; i < len - 2; i += 3) {
|
||||
*p++ = basis_64[(string[i] >> 2) & 0x3F];
|
||||
*p++ = basis_64[((string[i] & 0x3) << 4) |
|
||||
((int) (string[i + 1] & 0xF0) >> 4)];
|
||||
*p++ = basis_64[((string[i + 1] & 0xF) << 2) |
|
||||
((int) (string[i + 2] & 0xC0) >> 6)];
|
||||
*p++ = basis_64[string[i + 2] & 0x3F];
|
||||
}
|
||||
if (i < len) {
|
||||
*p++ = basis_64[(string[i] >> 2) & 0x3F];
|
||||
if (i == (len - 1)) {
|
||||
*p++ = basis_64[((string[i] & 0x3) << 4)];
|
||||
*p++ = '=';
|
||||
}
|
||||
else {
|
||||
*p++ = basis_64[((string[i] & 0x3) << 4) |
|
||||
((int) (string[i + 1] & 0xF0) >> 4)];
|
||||
*p++ = basis_64[((string[i + 1] & 0xF) << 2)];
|
||||
}
|
||||
*p++ = '=';
|
||||
}
|
||||
|
||||
*p++ = '\0';
|
||||
return (int)(p - encoded);
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
|
||||
*
|
||||
* This file is part of Open5GS.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined(OGS_CRYPT_INSIDE) && !defined(OGS_CRYPT_COMPILATION)
|
||||
#error "This header cannot be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef OGS_BASE64_H
|
||||
#define OGS_BASE64_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int ogs_base64_decode_len(const char *coded_src);
|
||||
int ogs_base64_decode(char *plain_dst, const char *coded_src);
|
||||
int ogs_base64_decode_binary(
|
||||
unsigned char *plain_dst, const char *coded_src);
|
||||
|
||||
int ogs_base64_encode_len(int len);
|
||||
int ogs_base64_encode(
|
||||
char *coded_dst, const char *plain_src, int len_plain_src);
|
||||
int ogs_base64_encode_binary(
|
||||
char *coded_dst, const unsigned char *plain_src, int len_plain_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OGS_BASE64_H */
|
|
@ -37,6 +37,7 @@
|
|||
#include "crypt/kasumi.h"
|
||||
|
||||
#include "crypt/ogs-kdf.h"
|
||||
#include "crypt/ogs-base64.h"
|
||||
|
||||
#undef OGS_CRYPT_INSIDE
|
||||
|
||||
|
|
|
@ -184,7 +184,6 @@ void ogs_kdf_kamf(char *supi, uint8_t *abba, uint8_t abba_len,
|
|||
uint8_t *kseaf, uint8_t *kamf)
|
||||
{
|
||||
kdf_param_t param;
|
||||
char *ueid = NULL;
|
||||
|
||||
ogs_assert(supi);
|
||||
ogs_assert(abba);
|
||||
|
@ -192,19 +191,17 @@ void ogs_kdf_kamf(char *supi, uint8_t *abba, uint8_t abba_len,
|
|||
ogs_assert(kseaf);
|
||||
ogs_assert(kamf);
|
||||
|
||||
ueid = ogs_ueid_from_supi(supi);
|
||||
ogs_assert(ueid);
|
||||
|
||||
memset(param, 0, sizeof(param));
|
||||
param[0].buf = (uint8_t *)ueid;
|
||||
param[0].len = strlen(ueid);
|
||||
param[0].buf = (uint8_t *)ogs_supi_get_id(supi);
|
||||
ogs_assert(param[0].buf);
|
||||
param[0].len = strlen((char *)param[0].buf);
|
||||
param[1].buf = abba;
|
||||
param[1].len = abba_len;
|
||||
|
||||
ogs_kdf_common(kseaf, OGS_SHA256_DIGEST_SIZE,
|
||||
FC_FOR_KAMF_DERIVATION, param, kamf);
|
||||
|
||||
ogs_free(ueid);
|
||||
ogs_free(param[0].buf);
|
||||
}
|
||||
|
||||
/* TS33.501 Annex A.8 : Algorithm key derivation functions */
|
||||
|
@ -241,8 +238,8 @@ void ogs_kdf_kgnb_and_kn3iwf(uint8_t *kamf, uint32_t ul_count,
|
|||
ul_count = htobe32(ul_count);
|
||||
param[0].buf = (uint8_t *)&ul_count;
|
||||
param[0].len = 4;
|
||||
param[0].buf = &access_type_distinguisher;
|
||||
param[0].len = 1;
|
||||
param[1].buf = &access_type_distinguisher;
|
||||
param[1].len = 1;
|
||||
|
||||
ogs_kdf_common(kamf, OGS_SHA256_DIGEST_SIZE,
|
||||
FC_FOR_KGNB_KN3IWF_DERIVATION, param, kgnb);
|
||||
|
|
|
@ -70,10 +70,6 @@ void ogs_kdf_kamf(char *supi, uint8_t *abba, uint8_t abba_len,
|
|||
void ogs_kdf_nas_5gs(uint8_t algorithm_type_distinguishers,
|
||||
uint8_t algorithm_identity, uint8_t *kamf, uint8_t *knas);
|
||||
|
||||
/* Access Type Distinguishers */
|
||||
#define OGS_KDF_ACCESS_TYPE_3GPP 0x01
|
||||
#define OGS_KDF_ACCESS_TYPE_NON_3GPP 0x02
|
||||
|
||||
/* TS33.501 Annex A.9 KgNB and Kn3iwf derivation function */
|
||||
void ogs_kdf_kgnb_and_kn3iwf(uint8_t *kamf, uint32_t ul_count,
|
||||
uint8_t access_type_distinguisher, uint8_t *kgnb);
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
|
||||
#include "ogs-dbi.h"
|
||||
|
||||
int ogs_dbi_auth_info(const char *id_type, const char *ue_id,
|
||||
ogs_dbi_auth_info_t *auth_info)
|
||||
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info)
|
||||
{
|
||||
int rv = OGS_OK;
|
||||
mongoc_cursor_t *cursor = NULL;
|
||||
|
@ -33,11 +32,18 @@ int ogs_dbi_auth_info(const char *id_type, const char *ue_id,
|
|||
char *utf8 = NULL;
|
||||
uint32_t length = 0;
|
||||
|
||||
ogs_assert(id_type);
|
||||
ogs_assert(ue_id);
|
||||
char *supi_type = NULL;
|
||||
char *supi_id = NULL;
|
||||
|
||||
ogs_assert(supi);
|
||||
ogs_assert(auth_info);
|
||||
|
||||
query = BCON_NEW(id_type, BCON_UTF8(ue_id));
|
||||
supi_type = ogs_supi_get_type(supi);
|
||||
ogs_assert(supi_type);
|
||||
supi_id = ogs_supi_get_id(supi);
|
||||
ogs_assert(supi_id);
|
||||
|
||||
query = BCON_NEW(supi_type, BCON_UTF8(supi_id));
|
||||
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5
|
||||
cursor = mongoc_collection_find_with_opts(
|
||||
ogs_mongoc()->collection.subscriber, query, NULL, NULL);
|
||||
|
@ -47,7 +53,7 @@ int ogs_dbi_auth_info(const char *id_type, const char *ue_id,
|
|||
#endif
|
||||
|
||||
if (!mongoc_cursor_next(cursor, &document)) {
|
||||
ogs_warn("Cannot find IMSI in DB : %s-%s", id_type, ue_id);
|
||||
ogs_warn("[%s] Cannot find IMSI in DB", supi);
|
||||
|
||||
rv = OGS_ERROR;
|
||||
goto out;
|
||||
|
@ -97,23 +103,30 @@ out:
|
|||
if (query) bson_destroy(query);
|
||||
if (cursor) mongoc_cursor_destroy(cursor);
|
||||
|
||||
ogs_free(supi_type);
|
||||
ogs_free(supi_id);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int ogs_dbi_update_sqn(const char *id_type, const char *ue_id, uint64_t sqn)
|
||||
int ogs_dbi_update_sqn(char *supi, uint64_t sqn)
|
||||
{
|
||||
int rv = OGS_OK;
|
||||
bson_t *query = NULL;
|
||||
bson_t *update = NULL;
|
||||
bson_error_t error;
|
||||
char printable_rand[OGS_KEYSTRLEN(OGS_RAND_LEN)];
|
||||
|
||||
ogs_assert(id_type);
|
||||
ogs_assert(ue_id);
|
||||
ogs_hex_to_ascii(rand,
|
||||
OGS_RAND_LEN, printable_rand, sizeof(printable_rand));
|
||||
char *supi_type = NULL;
|
||||
char *supi_id = NULL;
|
||||
|
||||
query = BCON_NEW(id_type, BCON_UTF8(ue_id));
|
||||
ogs_assert(supi);
|
||||
|
||||
supi_type = ogs_supi_get_type(supi);
|
||||
ogs_assert(supi_type);
|
||||
supi_id = ogs_supi_get_id(supi);
|
||||
ogs_assert(supi_id);
|
||||
|
||||
query = BCON_NEW(supi_type, BCON_UTF8(supi_id));
|
||||
update = BCON_NEW("$set",
|
||||
"{",
|
||||
"security.sqn", BCON_INT64(sqn),
|
||||
|
@ -129,10 +142,13 @@ int ogs_dbi_update_sqn(const char *id_type, const char *ue_id, uint64_t sqn)
|
|||
if (query) bson_destroy(query);
|
||||
if (update) bson_destroy(update);
|
||||
|
||||
ogs_free(supi_type);
|
||||
ogs_free(supi_id);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int ogs_dbi_increment_sqn(const char *id_type, const char *ue_id)
|
||||
int ogs_dbi_increment_sqn(char *supi)
|
||||
{
|
||||
int rv = OGS_OK;
|
||||
bson_t *query = NULL;
|
||||
|
@ -140,10 +156,17 @@ int ogs_dbi_increment_sqn(const char *id_type, const char *ue_id)
|
|||
bson_error_t error;
|
||||
uint64_t max_sqn = OGS_MAX_SQN;
|
||||
|
||||
ogs_assert(id_type);
|
||||
ogs_assert(ue_id);
|
||||
char *supi_type = NULL;
|
||||
char *supi_id = NULL;
|
||||
|
||||
query = BCON_NEW(id_type, BCON_UTF8(ue_id));
|
||||
ogs_assert(supi);
|
||||
|
||||
supi_type = ogs_supi_get_type(supi);
|
||||
ogs_assert(supi_type);
|
||||
supi_id = ogs_supi_get_id(supi);
|
||||
ogs_assert(supi_id);
|
||||
|
||||
query = BCON_NEW(supi_type, BCON_UTF8(supi_id));
|
||||
update = BCON_NEW("$inc",
|
||||
"{",
|
||||
"security.sqn", BCON_INT64(32),
|
||||
|
@ -173,10 +196,13 @@ out:
|
|||
if (query) bson_destroy(query);
|
||||
if (update) bson_destroy(update);
|
||||
|
||||
ogs_free(supi_type);
|
||||
ogs_free(supi_id);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
||||
int ogs_dbi_subscription_data(char *supi,
|
||||
ogs_dbi_subscription_data_t *subscription_data)
|
||||
{
|
||||
int rv = OGS_OK;
|
||||
|
@ -189,11 +215,18 @@ int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
|||
const char *utf8 = NULL;
|
||||
uint32_t length = 0;
|
||||
|
||||
ogs_assert(id_type);
|
||||
ogs_assert(ue_id);
|
||||
ogs_assert(subscription_data);
|
||||
char *supi_type = NULL;
|
||||
char *supi_id = NULL;
|
||||
|
||||
query = BCON_NEW(id_type, BCON_UTF8(ue_id));
|
||||
ogs_assert(subscription_data);
|
||||
ogs_assert(supi);
|
||||
|
||||
supi_type = ogs_supi_get_type(supi);
|
||||
ogs_assert(supi_type);
|
||||
supi_id = ogs_supi_get_id(supi);
|
||||
ogs_assert(supi_id);
|
||||
|
||||
query = BCON_NEW(supi_type, BCON_UTF8(supi_id));
|
||||
#if MONGOC_MAJOR_VERSION >= 1 && MONGOC_MINOR_VERSION >= 5
|
||||
cursor = mongoc_collection_find_with_opts(
|
||||
ogs_mongoc()->collection.subscriber, query, NULL, NULL);
|
||||
|
@ -203,7 +236,7 @@ int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
|||
#endif
|
||||
|
||||
if (!mongoc_cursor_next(cursor, &document)) {
|
||||
ogs_error("Cannot find IMSI in DB : %s-%s", id_type, ue_id);
|
||||
ogs_error("[%s] Cannot find IMSI in DB", supi);
|
||||
|
||||
rv = OGS_ERROR;
|
||||
goto out;
|
||||
|
@ -384,6 +417,7 @@ int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
|||
OGS_GTP_PDN_TYPE_IPV4;
|
||||
}
|
||||
pdn->paa.both.addr = ipsub.sub[0];
|
||||
pdn->ue_ip.addr = ipsub.sub[0];
|
||||
}
|
||||
} else if (!strcmp(child3_key, "addr6") &&
|
||||
BSON_ITER_HOLDS_UTF8(&child3_iter)) {
|
||||
|
@ -402,6 +436,8 @@ int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
|||
}
|
||||
memcpy(&(pdn->paa.both.addr6),
|
||||
ipsub.sub, OGS_IPV6_LEN);
|
||||
memcpy(pdn->ue_ip.addr6,
|
||||
ipsub.sub, OGS_IPV6_LEN);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -418,5 +454,8 @@ out:
|
|||
if (query) bson_destroy(query);
|
||||
if (cursor) mongoc_cursor_destroy(cursor);
|
||||
|
||||
ogs_free(supi_type);
|
||||
ogs_free(supi_id);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OGS_DBI_UE_ID_TYPE_IMSI "imsi"
|
||||
#define OGS_DBI_SUPI_TYPE_IMSI "imsi"
|
||||
|
||||
typedef struct ogs_dbi_subscription_data_s {
|
||||
#define OGS_DBI_ACCESS_RESTRICTION_UTRAN_NOT_ALLOWED (1)
|
||||
|
@ -66,12 +66,11 @@ typedef struct ogs_dbi_auth_info_s {
|
|||
uint64_t sqn;
|
||||
} ogs_dbi_auth_info_t;
|
||||
|
||||
int ogs_dbi_auth_info(const char *id_type, const char *ue_id,
|
||||
ogs_dbi_auth_info_t *auth_info);
|
||||
int ogs_dbi_update_sqn(const char *id_type, const char *ue_id, uint64_t sqn);
|
||||
int ogs_dbi_increment_sqn(const char *id_type, const char *ue_id);
|
||||
int ogs_dbi_auth_info(char *supi, ogs_dbi_auth_info_t *auth_info);
|
||||
int ogs_dbi_update_sqn(char *supi, uint64_t sqn);
|
||||
int ogs_dbi_increment_sqn(char *supi);
|
||||
|
||||
int ogs_dbi_subscription_data(const char *id_type, const char *ue_id,
|
||||
int ogs_dbi_subscription_data(char *supi,
|
||||
ogs_dbi_subscription_data_t *subscription_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
#define OGS_GTPV1_U_UDP_PORT 2152
|
||||
#define OGS_GTPV2_C_UDP_PORT 2123
|
||||
|
||||
/* Num of PacketFilter per Bearer */
|
||||
#define OGS_MAX_NUM_OF_PACKET_FILTER 16
|
||||
|
||||
#define OGS_GTP_INSIDE
|
||||
|
||||
#include "gtp/message.h"
|
||||
|
|
|
@ -51,14 +51,14 @@ void ogs_nas_5gs_imsi_to_bcd(
|
|||
p = ogs_slprintf(p, last, "%s", tmp);
|
||||
}
|
||||
|
||||
char *ogs_nas_5gs_ueid_from_mobile_identity(
|
||||
char *ogs_nas_5gs_suci_from_mobile_identity(
|
||||
ogs_nas_5gs_mobile_identity_t *mobile_identity)
|
||||
{
|
||||
ogs_nas_5gs_mobile_identity_imsi_t *mobile_identity_imsi = NULL;
|
||||
ogs_plmn_id_t plmn_id;
|
||||
char tmp[OGS_MAX_IMSI_BCD_LEN+1];
|
||||
char routing_indicator[5];
|
||||
char *ueid = NULL;
|
||||
char *suci = NULL;
|
||||
|
||||
ogs_assert(mobile_identity);
|
||||
|
||||
|
@ -66,18 +66,18 @@ char *ogs_nas_5gs_ueid_from_mobile_identity(
|
|||
(ogs_nas_5gs_mobile_identity_imsi_t *)mobile_identity->buffer;
|
||||
ogs_assert(mobile_identity_imsi);
|
||||
|
||||
ueid = ogs_msprintf("suci-%d-", mobile_identity_imsi->h.supi_format);
|
||||
ogs_assert(ueid);
|
||||
suci = ogs_msprintf("suci-%d-", mobile_identity_imsi->h.supi_format);
|
||||
ogs_assert(suci);
|
||||
|
||||
ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_imsi->nas_plmn_id);
|
||||
if (ogs_plmn_id_mnc_len(&plmn_id) == 2) {
|
||||
ueid = ogs_mstrcatf(ueid, "%03d-%02d-",
|
||||
suci = ogs_mstrcatf(suci, "%03d-%02d-",
|
||||
ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id));
|
||||
ogs_assert(ueid);
|
||||
ogs_assert(suci);
|
||||
} else {
|
||||
ueid = ogs_mstrcatf(ueid, "%03d-%03d-",
|
||||
suci = ogs_mstrcatf(suci, "%03d-%03d-",
|
||||
ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id));
|
||||
ogs_assert(ueid);
|
||||
ogs_assert(suci);
|
||||
}
|
||||
|
||||
memset(routing_indicator, 0, sizeof(routing_indicator));
|
||||
|
@ -101,11 +101,11 @@ char *ogs_nas_5gs_ueid_from_mobile_identity(
|
|||
ogs_buffer_to_bcd(mobile_identity_imsi->scheme_output,
|
||||
mobile_identity->length - 8, tmp);
|
||||
|
||||
ueid = ogs_mstrcatf(ueid, "%s-%d-%d-%s",
|
||||
suci = ogs_mstrcatf(suci, "%s-%d-%d-%s",
|
||||
routing_indicator,
|
||||
mobile_identity_imsi->protection_scheme_id,
|
||||
mobile_identity_imsi->home_network_pki_value,
|
||||
tmp);
|
||||
|
||||
return ueid;
|
||||
return suci;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ extern "C" {
|
|||
void ogs_nas_5gs_imsi_to_bcd(
|
||||
ogs_nas_5gs_mobile_identity_t *mobile_identity, char *bcd);
|
||||
|
||||
char *ogs_nas_5gs_ueid_from_mobile_identity(
|
||||
char *ogs_nas_5gs_suci_from_mobile_identity(
|
||||
ogs_nas_5gs_mobile_identity_t *mobile_identity);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2020-06-03 23:05:14.860106 by acetcom
|
||||
* Created on: 2020-06-15 13:46:04.075315 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -122,7 +122,7 @@ int ogs_nas_5gs_decode_dnn(ogs_nas_dnn_t *dnn, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
{
|
||||
char data_network_name[OGS_MAX_DNN_LEN];
|
||||
dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, dnn->length);
|
||||
dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, dnn->length);
|
||||
ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);
|
||||
}
|
||||
|
||||
|
@ -3035,6 +3035,9 @@ int ogs_nas_5gs_decode_session_ambr(ogs_nas_session_ambr_t *session_ambr, ogs_pk
|
|||
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
|
||||
memcpy(session_ambr, pkbuf->data - size, size);
|
||||
|
||||
session_ambr->downlink.bitrate = be16toh(source->downlink.bitrate);
|
||||
session_ambr->uplink.bitrate = be16toh(source->uplink.bitrate);
|
||||
|
||||
ogs_trace(" SESSION_AMBR - ");
|
||||
ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);
|
||||
|
||||
|
@ -3047,6 +3050,9 @@ int ogs_nas_5gs_encode_session_ambr(ogs_pkbuf_t *pkbuf, ogs_nas_session_ambr_t *
|
|||
ogs_nas_session_ambr_t target;
|
||||
|
||||
memcpy(&target, session_ambr, sizeof(ogs_nas_session_ambr_t));
|
||||
target.downlink.bitrate = htobe16(session_ambr->downlink.bitrate);
|
||||
target.uplink.bitrate = htobe16(session_ambr->uplink.bitrate);
|
||||
|
||||
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
|
||||
memcpy(pkbuf->data - size, &target, size);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2020-06-03 23:05:14.857252 by acetcom
|
||||
* Created on: 2020-06-15 13:46:04.070975 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*******************************************************************************
|
||||
* This file had been created by nas-message.py script v0.2.0
|
||||
* Please do not modify this file but regenerate it via script.
|
||||
* Created on: 2020-06-03 23:05:14.869400 by acetcom
|
||||
* Created on: 2020-06-15 13:46:04.086829 by acetcom
|
||||
* from 24501-g41.docx
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -578,14 +578,16 @@ typedef struct ogs_nas_5gs_configuration_update_command_s {
|
|||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_CIOT_SMALL_DATA_CONTAINER_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PAYLOAD_CONTAINER_TYPE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PAYLOAD_CONTAINER_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PDU_SESSION_STATUS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_RELEASE_ASSISTANCE_INDICATION_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_UPLINK_DATA_STATUS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_NAS_MESSAGE_CONTAINER_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PDU_SESSION_ID_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PDU_SESSION_STATUS_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_RELEASE_ASSISTANCE_INDICATION_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_UPLINK_DATA_STATUS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_NAS_MESSAGE_CONTAINER_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_CIOT_SMALL_DATA_CONTAINER_TYPE 0x6F
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PAYLOAD_CONTAINER_TYPE_TYPE 0x80
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PAYLOAD_CONTAINER_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PDU_SESSION_ID_TYPE 0x12
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_PDU_SESSION_STATUS_TYPE 0x50
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_RELEASE_ASSISTANCE_INDICATION_TYPE 0xF0
|
||||
#define OGS_NAS_5GS_CONFIGURATION_UPDATE_COMPLETE_UPLINK_DATA_STATUS_TYPE 0x40
|
||||
|
@ -817,15 +819,17 @@ typedef struct ogs_nas_5gs_notification_response_s {
|
|||
/*******************************************************
|
||||
* UL NAS TRANSPORT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_OLD_PDU_SESSION_ID_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_REQUEST_TYPE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_S_NSSAI_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_MA_PDU_SESSION_INFORMATION_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_RELEASE_ASSISTANCE_INDICATION_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_PDU_SESSION_ID_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_OLD_PDU_SESSION_ID_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_REQUEST_TYPE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_S_NSSAI_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_MA_PDU_SESSION_INFORMATION_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_RELEASE_ASSISTANCE_INDICATION_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_PDU_SESSION_ID_TYPE 0x12
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_OLD_PDU_SESSION_ID_TYPE 0x59
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_REQUEST_TYPE_TYPE 0x8
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_REQUEST_TYPE_TYPE 0x80
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_S_NSSAI_TYPE 0x22
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_TYPE 0x25
|
||||
#define OGS_NAS_5GS_UL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE 0x24
|
||||
|
@ -836,10 +840,10 @@ typedef struct ogs_nas_5gs_ul_nas_transport_s {
|
|||
/* Mandatory fields */
|
||||
ogs_nas_payload_container_type_t payload_container_type;
|
||||
ogs_nas_payload_container_t payload_container;
|
||||
ogs_nas_pdu_session_identity_2_t pdu_session_id;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_pdu_session_identity_2_t pdu_session_id;
|
||||
ogs_nas_pdu_session_identity_2_t old_pdu_session_id;
|
||||
ogs_nas_request_type_t request_type;
|
||||
ogs_nas_s_nssai_t s_nssai;
|
||||
|
@ -853,9 +857,11 @@ typedef struct ogs_nas_5gs_ul_nas_transport_s {
|
|||
/*******************************************************
|
||||
* DL NAS TRANSPORT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_5GMM_CAUSE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_PDU_SESSION_ID_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_5GMM_CAUSE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_PDU_SESSION_ID_TYPE 0x12
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_ADDITIONAL_INFORMATION_TYPE 0x24
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_5GMM_CAUSE_TYPE 0x58
|
||||
#define OGS_NAS_5GS_DL_NAS_TRANSPORT_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
|
@ -864,10 +870,10 @@ typedef struct ogs_nas_5gs_dl_nas_transport_s {
|
|||
/* Mandatory fields */
|
||||
ogs_nas_payload_container_type_t payload_container_type;
|
||||
ogs_nas_payload_container_t payload_container;
|
||||
ogs_nas_pdu_session_identity_2_t pdu_session_id;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_pdu_session_identity_2_t pdu_session_id;
|
||||
ogs_nas_additional_information_t additional_information;
|
||||
ogs_nas_5gmm_cause_t gmm_cause;
|
||||
ogs_nas_gprs_timer_3_t back_off_timer_value;
|
||||
|
@ -877,101 +883,30 @@ typedef struct ogs_nas_5gs_dl_nas_transport_s {
|
|||
/*******************************************************
|
||||
* PDU SESSION ESTABLISHMENT REQUEST
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_CIOT_SMALL_DATA_CONTAINER_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PAYLOAD_CONTAINER_TYPE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PAYLOAD_CONTAINER_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PDU_SESSION_STATUS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_RELEASE_ASSISTANCE_INDICATION_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_UPLINK_DATA_STATUS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_NAS_MESSAGE_CONTAINER_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_ADDITIONAL_INFORMATION_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_CIOT_SMALL_DATA_CONTAINER_TYPE 0x6F
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PAYLOAD_CONTAINER_TYPE_TYPE 0x80
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PAYLOAD_CONTAINER_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PDU_SESSION_STATUS_TYPE 0x50
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_RELEASE_ASSISTANCE_INDICATION_TYPE 0xF0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_UPLINK_DATA_STATUS_TYPE 0x40
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_NAS_MESSAGE_CONTAINER_TYPE 0x71
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_ADDITIONAL_INFORMATION_TYPE 0x24
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PDU_SESSION_TYPE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_SSC_MODE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_5GSM_CAPABILITY_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_ALWAYS_ON_PDU_SESSION_REQUESTED_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_SM_PDU_DN_REQUEST_CONTAINER_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_DS_TT_ETHERNET_PORT_MAC_ADDRESS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_UE_DS_TT_RESIDENCE_TIME_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PDU_SESSION_TYPE_TYPE 0x90
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_SSC_MODE_TYPE 0xA0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_5GSM_CAPABILITY_TYPE 0x28
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_TYPE 0x55
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_ALWAYS_ON_PDU_SESSION_REQUESTED_TYPE 0xB0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_SM_PDU_DN_REQUEST_CONTAINER_TYPE 0x39
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_DS_TT_ETHERNET_PORT_MAC_ADDRESS_TYPE 0x6E
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_UE_DS_TT_RESIDENCE_TIME_TYPE 0x6F
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_establishment_request_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_control_plane_service_type_t control_plane_service_type;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_ciot_small_data_container_t ciot_small_data_container;
|
||||
ogs_nas_payload_container_type_t payload_container_type;
|
||||
ogs_nas_payload_container_t payload_container;
|
||||
ogs_nas_pdu_session_identity_2_t pdu_session_id;
|
||||
ogs_nas_pdu_session_status_t pdu_session_status;
|
||||
ogs_nas_release_assistance_indication_t release_assistance_indication;
|
||||
ogs_nas_uplink_data_status_t uplink_data_status;
|
||||
ogs_nas_message_container_t nas_message_container;
|
||||
ogs_nas_additional_information_t additional_information;
|
||||
} ogs_nas_5gs_pdu_session_establishment_request_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION ESTABLISHMENT ACCEPT
|
||||
******************************************************/
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_establishment_accept_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_s_nssai_t s_nssai;
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
} ogs_nas_5gs_pdu_session_establishment_accept_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION ESTABLISHMENT REJECT
|
||||
******************************************************/
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_establishment_reject_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_s_nssai_t s_nssai;
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
} ogs_nas_5gs_pdu_session_establishment_reject_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION AUTHENTICATION COMMAND
|
||||
******************************************************/
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_command_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_s_nssai_t s_nssai;
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
} ogs_nas_5gs_pdu_session_authentication_command_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION AUTHENTICATION COMPLETE
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_PDU_SESSION_TYPE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_SSC_MODE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_5GSM_CAPABILITY_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_ALWAYS_ON_PDU_SESSION_REQUESTED_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_SM_PDU_DN_REQUEST_CONTAINER_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_DS_TT_ETHERNET_PORT_MAC_ADDRESS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_UE_DS_TT_RESIDENCE_TIME_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_PDU_SESSION_TYPE_TYPE 0x90
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_SSC_MODE_TYPE 0xA0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_5GSM_CAPABILITY_TYPE 0x28
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_TYPE 0x55
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_ALWAYS_ON_PDU_SESSION_REQUESTED_TYPE 0xB0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_SM_PDU_DN_REQUEST_CONTAINER_TYPE 0x39
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_DS_TT_ETHERNET_PORT_MAC_ADDRESS_TYPE 0x6E
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_UE_DS_TT_RESIDENCE_TIME_TYPE 0x6F
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_complete_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_integrity_protection_maximum_data_rate_t integrity_protection_maximum_data_rate;
|
||||
|
||||
|
@ -988,44 +923,44 @@ typedef struct ogs_nas_5gs_pdu_session_authentication_complete_s {
|
|||
ogs_nas_ds_tt_ethernet_port_mac_address_t ds_tt_ethernet_port_mac_address;
|
||||
ogs_nas_ue_ds_tt_residence_time_t ue_ds_tt_residence_time;
|
||||
ogs_nas_port_management_information_container_t port_management_information_container;
|
||||
} ogs_nas_5gs_pdu_session_authentication_complete_t;
|
||||
} ogs_nas_5gs_pdu_session_establishment_request_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION AUTHENTICATION RESULT
|
||||
* PDU SESSION ESTABLISHMENT ACCEPT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_PDU_ADDRESS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_RQ_TIMER_VALUE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_S_NSSAI_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_ALWAYS_ON_PDU_SESSION_INDICATION_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EAP_MESSAGE_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_DNN_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_5GSM_NETWORK_FEATURE_SUPPORT_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_SERVING_PLMN_RATE_CONTROL_PRESENT ((uint64_t)1<<11)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_ATSSS_CONTAINER_PRESENT ((uint64_t)1<<12)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_CONTROL_PLANE_ONLY_INDICATION_PRESENT ((uint64_t)1<<13)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<14)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_PDU_ADDRESS_TYPE 0x29
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_RQ_TIMER_VALUE_TYPE 0x56
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_S_NSSAI_TYPE 0x22
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_ALWAYS_ON_PDU_SESSION_INDICATION_TYPE 0x80
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_DNN_TYPE 0x25
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_5GSM_NETWORK_FEATURE_SUPPORT_TYPE 0x17
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_SERVING_PLMN_RATE_CONTROL_TYPE 0x18
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_ATSSS_CONTAINER_TYPE 0x77
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_CONTROL_PLANE_ONLY_INDICATION_TYPE 0xC0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_PDU_ADDRESS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_RQ_TIMER_VALUE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_S_NSSAI_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_ALWAYS_ON_PDU_SESSION_INDICATION_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_EAP_MESSAGE_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_DNN_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_5GSM_NETWORK_FEATURE_SUPPORT_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_SERVING_PLMN_RATE_CONTROL_PRESENT ((uint64_t)1<<11)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_ATSSS_CONTAINER_PRESENT ((uint64_t)1<<12)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_CONTROL_PLANE_ONLY_INDICATION_PRESENT ((uint64_t)1<<13)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<14)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_PDU_ADDRESS_TYPE 0x29
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_RQ_TIMER_VALUE_TYPE 0x56
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_S_NSSAI_TYPE 0x22
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_ALWAYS_ON_PDU_SESSION_INDICATION_TYPE 0x80
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_DNN_TYPE 0x25
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_5GSM_NETWORK_FEATURE_SUPPORT_TYPE 0x17
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_SERVING_PLMN_RATE_CONTROL_TYPE 0x18
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_ATSSS_CONTAINER_TYPE 0x77
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_CONTROL_PLANE_ONLY_INDICATION_TYPE 0xC0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_result_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_establishment_accept_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_pdu_session_type_t selected_pdu_session_type;
|
||||
ogs_nas_qos_rules_t authorized_qos_rules;
|
||||
|
@ -1048,26 +983,26 @@ typedef struct ogs_nas_5gs_pdu_session_authentication_result_s {
|
|||
ogs_nas_atsss_container_t atsss_container;
|
||||
ogs_nas_control_plane_only_indication_t control_plane_only_indication;
|
||||
ogs_nas_header_compression_configuration_t header_compression_configuration;
|
||||
} ogs_nas_5gs_pdu_session_authentication_result_t;
|
||||
} ogs_nas_5gs_pdu_session_establishment_accept_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION REQUEST
|
||||
* PDU SESSION ESTABLISHMENT REJECT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_ALLOWED_SSC_MODE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EAP_MESSAGE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_ALLOWED_SSC_MODE_TYPE 0xF0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_RE_ATTEMPT_INDICATOR_TYPE 0x1D
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_TYPE 0x61
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_ALLOWED_SSC_MODE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_EAP_MESSAGE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_ALLOWED_SSC_MODE_TYPE 0xF0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_RE_ATTEMPT_INDICATOR_TYPE 0x1D
|
||||
#define OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REJECT_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_TYPE 0x61
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_request_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_establishment_reject_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
|
@ -1079,85 +1014,85 @@ typedef struct ogs_nas_5gs_pdu_session_modification_request_s {
|
|||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
ogs_nas_re_attempt_indicator_t re_attempt_indicator;
|
||||
ogs_nas_5gsm_congestion_re_attempt_indicator_t gsm_congestion_re_attempt_indicator;
|
||||
} ogs_nas_5gs_pdu_session_modification_request_t;
|
||||
} ogs_nas_5gs_pdu_session_establishment_reject_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION REJECT
|
||||
* PDU SESSION AUTHENTICATION COMMAND
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_reject_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_command_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_modification_reject_t;
|
||||
} ogs_nas_5gs_pdu_session_authentication_command_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION COMMAND
|
||||
* PDU SESSION AUTHENTICATION COMPLETE
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_command_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_complete_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_modification_command_t;
|
||||
} ogs_nas_5gs_pdu_session_authentication_complete_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION COMPLETE
|
||||
* PDU SESSION AUTHENTICATION RESULT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EAP_MESSAGE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EAP_MESSAGE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_AUTHENTICATION_RESULT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_complete_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_authentication_result_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_modification_complete_t;
|
||||
} ogs_nas_5gs_pdu_session_authentication_result_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION COMMAND REJECT
|
||||
* PDU SESSION MODIFICATION REQUEST
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_5GSM_CAPABILITY_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_5GSM_CAUSE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_ALWAYS_ON_PDU_SESSION_REQUESTED_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_INTEGRITY_PROTECTION_MAXIMUM_DATA_RATE_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_REQUESTED_QOS_RULES_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_REQUESTED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_5GSM_CAPABILITY_TYPE 0x28
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_TYPE 0x55
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_ALWAYS_ON_PDU_SESSION_REQUESTED_TYPE 0xB0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_INTEGRITY_PROTECTION_MAXIMUM_DATA_RATE_TYPE 0x13
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_REQUESTED_QOS_RULES_TYPE 0x7A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_REQUESTED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CAPABILITY_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CAUSE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_ALWAYS_ON_PDU_SESSION_REQUESTED_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_INTEGRITY_PROTECTION_MAXIMUM_DATA_RATE_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_REQUESTED_QOS_RULES_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_REQUESTED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CAPABILITY_TYPE 0x28
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_MAXIMUM_NUMBER_OF_SUPPORTED_PACKET_FILTERS_TYPE 0x55
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_ALWAYS_ON_PDU_SESSION_REQUESTED_TYPE 0xB0
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_INTEGRITY_PROTECTION_MAXIMUM_DATA_RATE_TYPE 0x13
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_REQUESTED_QOS_RULES_TYPE 0x7A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_REQUESTED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REQUEST_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_command_reject_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_request_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
|
@ -1172,22 +1107,22 @@ typedef struct ogs_nas_5gs_pdu_session_modification_command_reject_s {
|
|||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
ogs_nas_port_management_information_container_t port_management_information_container;
|
||||
ogs_nas_header_compression_configuration_t header_compression_configuration;
|
||||
} ogs_nas_5gs_pdu_session_modification_command_reject_t;
|
||||
} ogs_nas_5gs_pdu_session_modification_request_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE REQUEST
|
||||
* PDU SESSION MODIFICATION REJECT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_RE_ATTEMPT_INDICATOR_TYPE 0x1D
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_TYPE 0x61
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_RE_ATTEMPT_INDICATOR_TYPE 0x1D
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_REJECT_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_TYPE 0x61
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_request_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_reject_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
|
@ -1197,38 +1132,38 @@ typedef struct ogs_nas_5gs_pdu_session_release_request_s {
|
|||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
ogs_nas_re_attempt_indicator_t re_attempt_indicator;
|
||||
ogs_nas_5gsm_congestion_re_attempt_indicator_t gsm_congestion_re_attempt_indicator;
|
||||
} ogs_nas_5gs_pdu_session_release_request_t;
|
||||
} ogs_nas_5gs_pdu_session_modification_reject_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE REJECT
|
||||
* PDU SESSION MODIFICATION COMMAND
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_SESSION_AMBR_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_RQ_TIMER_VALUE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_ALWAYS_ON_PDU_SESSION_INDICATION_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_AUTHORIZED_QOS_RULES_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_ATSSS_CONTAINER_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_SERVING_PLMN_RATE_CONTROL_PRESENT ((uint64_t)1<<11)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_SESSION_AMBR_TYPE 0x2A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_RQ_TIMER_VALUE_TYPE 0x56
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_ALWAYS_ON_PDU_SESSION_INDICATION_TYPE 0x80
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_AUTHORIZED_QOS_RULES_TYPE 0x7A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_ATSSS_CONTAINER_TYPE 0x77
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_SERVING_PLMN_RATE_CONTROL_TYPE 0x1E
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_SESSION_AMBR_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_RQ_TIMER_VALUE_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_ALWAYS_ON_PDU_SESSION_INDICATION_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_AUTHORIZED_QOS_RULES_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_MAPPED_EPS_BEARER_CONTEXTS_PRESENT ((uint64_t)1<<5)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_PRESENT ((uint64_t)1<<6)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<7)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_ATSSS_CONTAINER_PRESENT ((uint64_t)1<<8)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_HEADER_COMPRESSION_CONFIGURATION_PRESENT ((uint64_t)1<<9)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<10)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_SERVING_PLMN_RATE_CONTROL_PRESENT ((uint64_t)1<<11)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_SESSION_AMBR_TYPE 0x2A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_RQ_TIMER_VALUE_TYPE 0x56
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_ALWAYS_ON_PDU_SESSION_INDICATION_TYPE 0x80
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_AUTHORIZED_QOS_RULES_TYPE 0x7A
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_MAPPED_EPS_BEARER_CONTEXTS_TYPE 0x75
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_AUTHORIZED_QOS_FLOW_DESCRIPTIONS_TYPE 0x79
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_ATSSS_CONTAINER_TYPE 0x77
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_HEADER_COMPRESSION_CONFIGURATION_TYPE 0x66
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_SERVING_PLMN_RATE_CONTROL_TYPE 0x1E
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_reject_s {
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_command_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
|
@ -1244,38 +1179,116 @@ typedef struct ogs_nas_5gs_pdu_session_release_reject_s {
|
|||
ogs_nas_header_compression_configuration_t header_compression_configuration;
|
||||
ogs_nas_port_management_information_container_t port_management_information_container;
|
||||
ogs_nas_serving_plmn_rate_control_t serving_plmn_rate_control;
|
||||
} ogs_nas_5gs_pdu_session_modification_command_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION COMPLETE
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMPLETE_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_complete_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
ogs_nas_port_management_information_container_t port_management_information_container;
|
||||
} ogs_nas_5gs_pdu_session_modification_complete_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION MODIFICATION COMMAND REJECT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_MODIFICATION_COMMAND_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_modification_command_reject_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_modification_command_reject_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE REQUEST
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REQUEST_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_request_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_release_request_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE REJECT
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_REJECT_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_reject_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_release_reject_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE COMMAND
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_PORT_MANAGEMENT_INFORMATION_CONTAINER_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_BACK_OFF_TIMER_VALUE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_EAP_MESSAGE_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_PRESENT ((uint64_t)1<<2)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<3)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_ACCESS_TYPE_PRESENT ((uint64_t)1<<4)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_BACK_OFF_TIMER_VALUE_TYPE 0x37
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_EAP_MESSAGE_TYPE 0x78
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_5GSM_CONGESTION_RE_ATTEMPT_INDICATOR_TYPE 0x61
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_PORT_MANAGEMENT_INFORMATION_CONTAINER_TYPE 0x7C
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMMAND_ACCESS_TYPE_TYPE 0xD0
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_command_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_gprs_timer_3_t back_off_timer_value;
|
||||
ogs_nas_eap_message_t eap_message;
|
||||
ogs_nas_5gsm_congestion_re_attempt_indicator_t gsm_congestion_re_attempt_indicator;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
ogs_nas_port_management_information_container_t port_management_information_container;
|
||||
ogs_nas_access_type_t access_type;
|
||||
} ogs_nas_5gs_pdu_session_release_command_t;
|
||||
|
||||
|
||||
/*******************************************************
|
||||
* PDU SESSION RELEASE COMPLETE
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_PDU_SESSION_RELEASE_COMPLETE_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_pdu_session_release_complete_s {
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_pdu_session_release_complete_t;
|
||||
|
||||
|
@ -1283,17 +1296,10 @@ typedef struct ogs_nas_5gs_pdu_session_release_complete_s {
|
|||
/*******************************************************
|
||||
* 5GSM STATUS
|
||||
******************************************************/
|
||||
#define OGS_NAS_5GS_5GSM_STATUS_5GSM_CAUSE_PRESENT ((uint64_t)1<<0)
|
||||
#define OGS_NAS_5GS_5GSM_STATUS_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT ((uint64_t)1<<1)
|
||||
#define OGS_NAS_5GS_5GSM_STATUS_5GSM_CAUSE_TYPE 0x59
|
||||
#define OGS_NAS_5GS_5GSM_STATUS_EXTENDED_PROTOCOL_CONFIGURATION_OPTIONS_TYPE 0x7B
|
||||
|
||||
typedef struct ogs_nas_5gs_5gsm_status_s {
|
||||
|
||||
/* Optional fields */
|
||||
uint64_t presencemask;
|
||||
/* Mandatory fields */
|
||||
ogs_nas_5gsm_cause_t gsm_cause;
|
||||
ogs_nas_extended_protocol_configuration_options_t extended_protocol_configuration_options;
|
||||
} ogs_nas_5gs_5gsm_status_t;
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ ies.append({ "iei" : "", "value" : "Payload container type", "type" : "Payload c
|
|||
ies.append({ "iei" : "", "value" : "Payload container", "type" : "Payload container", "reference" : "9.11.3.39", "presence" : "M", "format" : "LV-E", "length" : "3-65537"})
|
||||
ies.append({ "iei" : "12", "value" : "PDU session ID", "type" : "PDU session identity 2", "reference" : "9.11.3.41", "presence" : "C", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "59", "value" : "Old PDU session ID", "type" : "PDU session identity 2", "reference" : "9.11.3.41", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "8", "value" : "Request type", "type" : "Request type", "reference" : "9.11.3.47", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "8-", "value" : "Request type", "type" : "Request type", "reference" : "9.11.3.47", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "22", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "O", "format" : "TLV", "length" : "3-10"})
|
||||
ies.append({ "iei" : "25", "value" : "DNN", "type" : "DNN", "reference" : "9.11.2.1B", "presence" : "O", "format" : "TLV", "length" : "3-102"})
|
||||
ies.append({ "iei" : "24", "value" : "Additional information", "type" : "Additional information", "reference" : "9.11.2.1", "presence" : "O", "format" : "TLV", "length" : "3-n"})
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "Control plane service type", "type" : "Control plane service type", "reference" : "9.11.3.18D", "presence" : "M", "format" : "V", "length" : "1/2"})
|
||||
ies.append({ "iei" : "6F", "value" : "CIoT small data container", "type" : "CIoT small data container", "reference" : "9.11.3.18B", "presence" : "O", "format" : "TLV", "length" : "4-257"})
|
||||
ies.append({ "iei" : "8-", "value" : "Payload container type", "type" : "Payload container type", "reference" : "9.11.3.40", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "7B", "value" : "Payload container", "type" : "Payload container", "reference" : "9.11.3.39", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "12", "value" : "PDU session ID", "type" : "PDU session identity 2", "reference" : "9.11.3.41", "presence" : "C", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "50", "value" : "PDU session status", "type" : "PDU session status", "reference" : "9.11.3.44", "presence" : "O", "format" : "TLV", "length" : "4-34"})
|
||||
ies.append({ "iei" : "F-", "value" : "Release assistance indication", "type" : "Release assistance indication", "reference" : "9.11.3.46A", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "40", "value" : "Uplink data status", "type" : "Uplink data status", "reference" : "9.11.3.57", "presence" : "O", "format" : "TLV", "length" : "4-34"})
|
||||
ies.append({ "iei" : "71", "value" : "NAS message container", "type" : "message container", "reference" : "9.11.3.33", "presence" : "O", "format" : "TLV-E", "length" : "4-n"})
|
||||
ies.append({ "iei" : "24", "value" : "Additional information", "type" : "Additional information", "reference" : "9.11.2.1", "presence" : "O", "format" : "TLV", "length" : "3-n"})
|
||||
ies.append({ "iei" : "", "value" : "Integrity protection maximum data rate", "type" : "Integrity protection maximum data rate", "reference" : "9.11.4.7", "presence" : "M", "format" : "V", "length" : "2"})
|
||||
ies.append({ "iei" : "9-", "value" : "PDU session type", "type" : "PDU session type", "reference" : "9.11.4.11", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "A-", "value" : "SSC mode", "type" : "SSC mode", "reference" : "9.11.4.16", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "28", "value" : "5GSM capability", "type" : "5GSM capability", "reference" : "9.11.4.1", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "55", "value" : "Maximum number of supported packet filters", "type" : "Maximum number of supported packet filters", "reference" : "9.11.4.9", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "B-", "value" : "Always-on PDU session requested", "type" : "Always-on PDU session requested", "reference" : "9.11.4.4", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "39", "value" : "SM PDU DN request container", "type" : "SM PDU DN request container", "reference" : "9.11.4.15", "presence" : "O", "format" : "TLV", "length" : "3-255"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
ies.append({ "iei" : "6E", "value" : "DS-TT Ethernet port MAC address", "type" : "DS-TT Ethernet port MAC address", "reference" : "9.11.4.25", "presence" : "O", "format" : "TLV", "length" : "8"})
|
||||
ies.append({ "iei" : "6F", "value" : "UE-DS-TT residence time", "type" : "UE-DS-TT residence time", "reference" : "9.11.4.26", "presence" : "O", "format" : "TLV", "length" : "10"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,20 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "M", "format" : "LV", "length" : "2-5"})
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "", "value" : "Selected PDU session type", "type" : "PDU session type", "reference" : "9.11.4.11", "presence" : "M", "format" : "V", "length" : "1/2"})
|
||||
ies.append({ "iei" : "", "value" : "Authorized QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "M", "format" : "LV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "", "value" : "Session AMBR", "type" : "Session-AMBR", "reference" : "9.11.4.14", "presence" : "M", "format" : "LV", "length" : "7"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "29", "value" : "PDU address", "type" : "PDU address", "reference" : "9.11.4.10", "presence" : "O", "format" : "TLV", "length" : "7, 11 or 15"})
|
||||
ies.append({ "iei" : "56", "value" : "RQ timer value", "type" : "GPRS timer", "reference" : "9.11.2.3", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "22", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "O", "format" : "TLV", "length" : "3-10"})
|
||||
ies.append({ "iei" : "8-", "value" : "Always-on PDU session indication", "type" : "Always-on PDU session indication", "reference" : "9.11.4.3", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "79", "value" : "Authorized QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "25", "value" : "DNN", "type" : "DNN", "reference" : "9.11.2.1B", "presence" : "O", "format" : "TLV", "length" : "3-102"})
|
||||
ies.append({ "iei" : "17", "value" : "5GSM network feature support", "type" : "5GSM network feature support", "reference" : "9.11.4.18", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "18", "value" : "Serving PLMN rate control", "type" : "Serving PLMN rate control", "reference" : "9.11.4.20", "presence" : "O", "format" : "TLV", "length" : "4"})
|
||||
ies.append({ "iei" : "77", "value" : "ATSSS container", "type" : "ATSSS container", "reference" : "9.11.4.22", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "C-", "value" : "Control plane only indication", "type" : "Control plane only indication", "reference" : "9.11.4.23", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "M", "format" : "LV", "length" : "2-5"})
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "F-", "value" : "Allowed SSC mode", "type" : "Allowed SSC mode", "reference" : "9.11.4.5", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "1D", "value" : "Re-attempt indicator", "type" : "Re-attempt indicator", "reference" : "9.11.4.17", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "61", "value" : "5GSM congestion re-attempt indicator", "type" : "5GSM congestion re-attempt indicator", "reference" : "9.11.4.21", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "M", "format" : "LV", "length" : "2-5"})
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "Integrity protection maximum data rate", "type" : "Integrity protection maximum data rate", "reference" : "9.11.4.7", "presence" : "M", "format" : "V", "length" : "2"})
|
||||
ies.append({ "iei" : "9-", "value" : "PDU session type", "type" : "PDU session type", "reference" : "9.11.4.11", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "A-", "value" : "SSC mode", "type" : "SSC mode", "reference" : "9.11.4.16", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "28", "value" : "5GSM capability", "type" : "5GSM capability", "reference" : "9.11.4.1", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "55", "value" : "Maximum number of supported packet filters", "type" : "Maximum number of supported packet filters", "reference" : "9.11.4.9", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "B-", "value" : "Always-on PDU session requested", "type" : "Always-on PDU session requested", "reference" : "9.11.4.4", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "39", "value" : "SM PDU DN request container", "type" : "SM PDU DN request container", "reference" : "9.11.4.15", "presence" : "O", "format" : "TLV", "length" : "3-255"})
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
ies.append({ "iei" : "6E", "value" : "DS-TT Ethernet port MAC address", "type" : "DS-TT Ethernet port MAC address", "reference" : "9.11.4.25", "presence" : "O", "format" : "TLV", "length" : "8"})
|
||||
ies.append({ "iei" : "6F", "value" : "UE-DS-TT residence time", "type" : "UE-DS-TT residence time", "reference" : "9.11.4.26", "presence" : "O", "format" : "TLV", "length" : "10"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "Selected PDU session type", "type" : "PDU session type", "reference" : "9.11.4.11", "presence" : "M", "format" : "V", "length" : "1/2"})
|
||||
ies.append({ "iei" : "", "value" : "Authorized QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "M", "format" : "LV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "", "value" : "Session AMBR", "type" : "Session-AMBR", "reference" : "9.11.4.14", "presence" : "M", "format" : "LV", "length" : "7"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "29", "value" : "PDU address", "type" : "PDU address", "reference" : "9.11.4.10", "presence" : "O", "format" : "TLV", "length" : "7, 11 or 15"})
|
||||
ies.append({ "iei" : "56", "value" : "RQ timer value", "type" : "GPRS timer", "reference" : "9.11.2.3", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "22", "value" : "S-NSSAI", "type" : "S-NSSAI", "reference" : "9.11.2.8", "presence" : "O", "format" : "TLV", "length" : "3-10"})
|
||||
ies.append({ "iei" : "8-", "value" : "Always-on PDU session indication", "type" : "Always-on PDU session indication", "reference" : "9.11.4.3", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "79", "value" : "Authorized QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "25", "value" : "DNN", "type" : "DNN", "reference" : "9.11.2.1B", "presence" : "O", "format" : "TLV", "length" : "3-102"})
|
||||
ies.append({ "iei" : "17", "value" : "5GSM network feature support", "type" : "5GSM network feature support", "reference" : "9.11.4.18", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "18", "value" : "Serving PLMN rate control", "type" : "Serving PLMN rate control", "reference" : "9.11.4.20", "presence" : "O", "format" : "TLV", "length" : "4"})
|
||||
ies.append({ "iei" : "77", "value" : "ATSSS container", "type" : "ATSSS container", "reference" : "9.11.4.22", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "C-", "value" : "Control plane only indication", "type" : "Control plane only indication", "reference" : "9.11.4.23", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "F-", "value" : "Allowed SSC mode", "type" : "Allowed SSC mode", "reference" : "9.11.4.5", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "28", "value" : "5GSM capability", "type" : "5GSM capability", "reference" : "9.11.4.1", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "55", "value" : "Maximum number of supported packet filters", "type" : "Maximum number of supported packet filters", "reference" : "9.11.4.9", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "B-", "value" : "Always-on PDU session requested", "type" : "Always-on PDU session requested", "reference" : "9.11.4.4", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "13", "value" : "Integrity protection maximum data rate", "type" : "Integrity protection maximum data rate", "reference" : "9.11.4.7", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "7A", "value" : "Requested QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "79", "value" : "Requested QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "1D", "value" : "Re-attempt indicator", "type" : "Re-attempt indicator", "reference" : "9.11.4.17", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "61", "value" : "5GSM congestion re-attempt indicator", "type" : "5GSM congestion re-attempt indicator", "reference" : "9.11.4.21", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "1D", "value" : "Re-attempt indicator", "type" : "Re-attempt indicator", "reference" : "9.11.4.17", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "61", "value" : "5GSM congestion re-attempt indicator", "type" : "5GSM congestion re-attempt indicator", "reference" : "9.11.4.21", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "M", "format" : "LV-E", "length" : "6-1502"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "2A", "value" : "Session AMBR", "type" : "Session-AMBR", "reference" : "9.11.4.14", "presence" : "O", "format" : "TLV", "length" : "8"})
|
||||
ies.append({ "iei" : "56", "value" : "RQ timer value", "type" : "GPRS timer", "reference" : "9.11.2.3", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "8-", "value" : "Always-on PDU session indication", "type" : "Always-on PDU session indication", "reference" : "9.11.4.3", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "7A", "value" : "Authorized QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "79", "value" : "Authorized QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "77", "value" : "ATSSS container", "type" : "ATSSS container", "reference" : "9.11.4.22", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "1E", "value" : "Serving PLMN rate control", "type" : "Serving PLMN rate control", "reference" : "9.11.4.20", "presence" : "O", "format" : "TLV", "length" : "4"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,13 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "28", "value" : "5GSM capability", "type" : "5GSM capability", "reference" : "9.11.4.1", "presence" : "O", "format" : "TLV", "length" : "3-15"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "55", "value" : "Maximum number of supported packet filters", "type" : "Maximum number of supported packet filters", "reference" : "9.11.4.9", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "B-", "value" : "Always-on PDU session requested", "type" : "Always-on PDU session requested", "reference" : "9.11.4.4", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "13", "value" : "Integrity protection maximum data rate", "type" : "Integrity protection maximum data rate", "reference" : "9.11.4.7", "presence" : "O", "format" : "TV", "length" : "3"})
|
||||
ies.append({ "iei" : "7A", "value" : "Requested QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "79", "value" : "Requested QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "1D", "value" : "Re-attempt indicator", "type" : "Re-attempt indicator", "reference" : "9.11.4.17", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "61", "value" : "5GSM congestion re-attempt indicator", "type" : "5GSM congestion re-attempt indicator", "reference" : "9.11.4.21", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "2A", "value" : "Session AMBR", "type" : "Session-AMBR", "reference" : "9.11.4.14", "presence" : "O", "format" : "TLV", "length" : "8"})
|
||||
ies.append({ "iei" : "56", "value" : "RQ timer value", "type" : "GPRS timer", "reference" : "9.11.2.3", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "8-", "value" : "Always-on PDU session indication", "type" : "Always-on PDU session indication", "reference" : "9.11.4.3", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
ies.append({ "iei" : "7A", "value" : "Authorized QoS rules", "type" : "QoS rules", "reference" : "9.11.4.13", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "75", "value" : "Mapped EPS bearer contexts", "type" : "Mapped EPS bearer contexts", "reference" : "9.11.4.8", "presence" : "O", "format" : "TLV-E", "length" : "7-65538"})
|
||||
ies.append({ "iei" : "79", "value" : "Authorized QoS flow descriptions", "type" : "QoS flow descriptions", "reference" : "9.11.4.12", "presence" : "O", "format" : "TLV-E", "length" : "6-65538"})
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "77", "value" : "ATSSS container", "type" : "ATSSS container", "reference" : "9.11.4.22", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "66", "value" : "Header compression configuration", "type" : "Header compression configuration", "reference" : "9.11.4.24", "presence" : "O", "format" : "TLV", "length" : "5-257"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "1E", "value" : "Serving PLMN rate control", "type" : "Serving PLMN rate control", "reference" : "9.11.4.20", "presence" : "O", "format" : "TLV", "length" : "4"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "37", "value" : "Back-off timer value", "type" : "GPRS timer 3", "reference" : "9.11.2.5", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "78", "value" : "EAP message", "type" : "EAP message", "reference" : "9.11.2.2", "presence" : "O", "format" : "TLV-E", "length" : "7-1503"})
|
||||
ies.append({ "iei" : "61", "value" : "5GSM congestion re-attempt indicator", "type" : "5GSM congestion re-attempt indicator", "reference" : "9.11.4.21", "presence" : "O", "format" : "TLV", "length" : "3"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "7C", "value" : "Port management information container", "type" : "Port management information container", "reference" : "9.11.4.27", "presence" : "O", "format" : "TLV-E", "length" : "3-65538"})
|
||||
ies.append({ "iei" : "D-", "value" : "Access type", "type" : "Access type", "reference" : "9.11.2.1A", "presence" : "O", "format" : "TV", "length" : "1"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
ies = []
|
||||
ies.append({ "iei" : "59", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "O", "format" : "TV", "length" : "2"})
|
||||
ies.append({ "iei" : "7B", "value" : "Extended protocol configuration options", "type" : "Extended protocol configuration options", "reference" : "9.11.4.6", "presence" : "O", "format" : "TLV-E", "length" : "4-65538"})
|
||||
ies.append({ "iei" : "", "value" : "5GSM cause", "type" : "5GSM cause", "reference" : "9.11.4.2", "presence" : "M", "format" : "V", "length" : "1"})
|
||||
msg_list[key]["ies"] = ies
|
||||
|
|
|
@ -123,6 +123,10 @@ def get_cells(cells):
|
|||
format = cells[4].text.encode('ascii', 'ignore')
|
||||
length = cells[5].text.encode('ascii', 'ignore')
|
||||
|
||||
# Spec errata - workaround
|
||||
if (type == "Request type" and value == "Request type"):
|
||||
iei = "8-"
|
||||
|
||||
return { "iei" : iei, "value" : value, "type" : type, "reference" : reference, "presence" : presence, "format" : format, "length" : length }
|
||||
|
||||
def write_cells_to_file(name, cells):
|
||||
|
@ -236,22 +240,22 @@ msg_list["SECURITY MODE COMPLETE"]["table"] = 25
|
|||
msg_list["SECURITY MODE REJECT"]["table"] = 26
|
||||
msg_list["5GMM STATUS"]["table"] = 28
|
||||
|
||||
msg_list["PDU SESSION ESTABLISHMENT REQUEST"]["table"] = 29
|
||||
msg_list["PDU SESSION ESTABLISHMENT ACCEPT"]["table"] = 30
|
||||
msg_list["PDU SESSION ESTABLISHMENT REJECT"]["table"] = 31
|
||||
msg_list["PDU SESSION AUTHENTICATION COMMAND"]["table"] = 32
|
||||
msg_list["PDU SESSION AUTHENTICATION COMPLETE"]["table"] = 33
|
||||
msg_list["PDU SESSION AUTHENTICATION RESULT"]["table"] = 34
|
||||
msg_list["PDU SESSION MODIFICATION REQUEST"]["table"] = 35
|
||||
msg_list["PDU SESSION MODIFICATION REJECT"]["table"] = 36
|
||||
msg_list["PDU SESSION MODIFICATION COMMAND"]["table"] = 37
|
||||
msg_list["PDU SESSION MODIFICATION COMPLETE"]["table"] = 38
|
||||
msg_list["PDU SESSION MODIFICATION COMMAND REJECT"]["table"] = 39
|
||||
msg_list["PDU SESSION RELEASE REQUEST"]["table"] = 40
|
||||
msg_list["PDU SESSION RELEASE REJECT"]["table"] = 41
|
||||
msg_list["PDU SESSION RELEASE COMMAND"]["table"] = 42
|
||||
msg_list["PDU SESSION RELEASE COMPLETE"]["table"] = 43
|
||||
msg_list["5GSM STATUS"]["table"] = 44
|
||||
msg_list["PDU SESSION ESTABLISHMENT REQUEST"]["table"] = 33
|
||||
msg_list["PDU SESSION ESTABLISHMENT ACCEPT"]["table"] = 34
|
||||
msg_list["PDU SESSION ESTABLISHMENT REJECT"]["table"] = 35
|
||||
msg_list["PDU SESSION AUTHENTICATION COMMAND"]["table"] = 36
|
||||
msg_list["PDU SESSION AUTHENTICATION COMPLETE"]["table"] = 37
|
||||
msg_list["PDU SESSION AUTHENTICATION RESULT"]["table"] = 38
|
||||
msg_list["PDU SESSION MODIFICATION REQUEST"]["table"] = 39
|
||||
msg_list["PDU SESSION MODIFICATION REJECT"]["table"] = 40
|
||||
msg_list["PDU SESSION MODIFICATION COMMAND"]["table"] = 41
|
||||
msg_list["PDU SESSION MODIFICATION COMPLETE"]["table"] = 42
|
||||
msg_list["PDU SESSION MODIFICATION COMMAND REJECT"]["table"] = 43
|
||||
msg_list["PDU SESSION RELEASE REQUEST"]["table"] = 44
|
||||
msg_list["PDU SESSION RELEASE REJECT"]["table"] = 45
|
||||
msg_list["PDU SESSION RELEASE COMMAND"]["table"] = 46
|
||||
msg_list["PDU SESSION RELEASE COMPLETE"]["table"] = 47
|
||||
msg_list["5GSM STATUS"]["table"] = 48
|
||||
|
||||
for key in msg_list.keys():
|
||||
if "table" not in msg_list[key].keys():
|
||||
|
@ -388,8 +392,6 @@ for (k, v) in sorted_type_list:
|
|||
f.write(" uint16_t size = sizeof(ogs_nas_%s_t);\n\n" % v_lower(k))
|
||||
f.write(" ogs_assert(ogs_pkbuf_pull(pkbuf, size));\n")
|
||||
f.write(" memcpy(%s, pkbuf->data - size, size);\n\n" % get_value(k))
|
||||
if "decode" in type_list[k]:
|
||||
f.write("%s" % type_list[k]["decode"])
|
||||
f.write(" ogs_trace(\" %s - \");\n" % v_upper(k))
|
||||
f.write(" ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);\n\n");
|
||||
f.write(" return size;\n")
|
||||
|
@ -549,10 +551,10 @@ for (k, v) in sorted_msg_list:
|
|||
f.write(" * %s\n" % k)
|
||||
f.write(" ******************************************************/")
|
||||
|
||||
for i, ie in enumerate([ies for ies in msg_list[k]["ies"] if ies["presence"] == "O"]):
|
||||
for i, ie in enumerate([ies for ies in msg_list[k]["ies"] if ies["presence"] != "M"]):
|
||||
f.write("\n#define OGS_NAS_5GS_%s_%s_PRESENT ((uint64_t)1<<%d)" % (v_upper(k), v_upper(ie["value"]), i))
|
||||
|
||||
for i, ie in enumerate([ies for ies in msg_list[k]["ies"] if ies["presence"] == "O"]):
|
||||
for i, ie in enumerate([ies for ies in msg_list[k]["ies"] if ies["presence"] != "M"]):
|
||||
f.write("\n#define OGS_NAS_5GS_%s_%s_TYPE 0x%s" % (v_upper(k), v_upper(ie["value"]), re.sub('-', '0', ie["iei"])))
|
||||
|
||||
f.write("\n\ntypedef struct ogs_nas_5gs_%s_s {\n" % v_lower(k))
|
||||
|
@ -564,7 +566,7 @@ for (k, v) in sorted_msg_list:
|
|||
f.write(" /* Mandatory fields */\n")
|
||||
mandatory_fields = True;
|
||||
|
||||
if ie["presence"] == "O" and optional_fields is False:
|
||||
if ie["presence"] != "M" and optional_fields is False:
|
||||
f.write("\n /* Optional fields */\n")
|
||||
f.write(" uint64_t presencemask;\n");
|
||||
optional_fields = True;
|
||||
|
@ -664,7 +666,7 @@ for (k, v) in sorted_msg_list:
|
|||
f.write(" decoded += size;\n\n")
|
||||
|
||||
optional_fields = False;
|
||||
for ie in [ies for ies in msg_list[k]["ies"] if ies["presence"] == "O"]:
|
||||
for ie in [ies for ies in msg_list[k]["ies"] if ies["presence"] != "M"]:
|
||||
if optional_fields is False:
|
||||
f.write(""" while (pkbuf->len > 0) {
|
||||
uint8_t *buffer = pkbuf->data;
|
||||
|
@ -679,15 +681,18 @@ for (k, v) in sorted_msg_list:
|
|||
optional_fields = True;
|
||||
|
||||
f.write(" case OGS_NAS_5GS_%s_%s_TYPE:\n" % (v_upper(k), v_upper(ie["value"])))
|
||||
if (ie["format"] == "TV" or ie["format"] == "T") and ie["length"] == "1":
|
||||
f.write(" decoded--;\n")
|
||||
f.write(" ogs_assert(ogs_pkbuf_push(pkbuf, 1));\n")
|
||||
f.write(" size = ogs_nas_5gs_decode_%s(&%s->%s, pkbuf);\n" % (v_lower(ie["type"]), get_value(k), get_value(ie["value"])))
|
||||
f.write(" ogs_assert(size >= 0);\n")
|
||||
f.write(" %s->presencemask |= OGS_NAS_5GS_%s_%s_PRESENT;\n" % (get_value(k), v_upper(k), v_upper(ie["value"])))
|
||||
f.write(" decoded += size;\n")
|
||||
f.write(" break;\n")
|
||||
|
||||
if [ies for ies in msg_list[k]["ies"] if ies["presence"] == "O"]:
|
||||
if [ies for ies in msg_list[k]["ies"] if ies["presence"] != "M"]:
|
||||
f.write(""" default:
|
||||
ogs_warn("Unknown type(0x%x) or not implemented\\n", type);
|
||||
ogs_error("Unknown type(0x%x) or not implemented\\n", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -816,7 +821,7 @@ for (k, v) in sorted_msg_list:
|
|||
f.write(" ogs_assert(size >= 0);\n")
|
||||
f.write(" encoded += size;\n\n")
|
||||
|
||||
for ie in [ies for ies in msg_list[k]["ies"] if ies["presence"] == "O"]:
|
||||
for ie in [ies for ies in msg_list[k]["ies"] if ies["presence"] != "M"]:
|
||||
f.write(" if (%s->presencemask & OGS_NAS_5GS_%s_%s_PRESENT) {\n" % (get_value(k), v_upper(k), v_upper(ie["value"])))
|
||||
if ie["length"] == "1" and ie["format"] == "TV":
|
||||
f.write(" %s->%s.type = (OGS_NAS_5GS_%s_%s_TYPE >> 4);\n\n" % (get_value(k), get_value(ie["value"]), v_upper(k), v_upper(ie["value"])))
|
||||
|
|
|
@ -29,10 +29,18 @@ type_list["Header compression configuration"]["encode"] = \
|
|||
type_list["DNN"]["decode"] = \
|
||||
" {\n" \
|
||||
" char data_network_name[OGS_MAX_DNN_LEN];\n" \
|
||||
" dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, dnn->length);\n" \
|
||||
" dnn->length = ogs_fqdn_parse(data_network_name, dnn->value, dnn->length);\n" \
|
||||
" ogs_cpystrn(dnn->value, data_network_name, ogs_min(dnn->length, OGS_MAX_DNN_LEN) + 1);\n" \
|
||||
" }\n\n"
|
||||
|
||||
type_list["DNN"]["encode"] = \
|
||||
" target.length = ogs_fqdn_build(target.value, dnn->value, dnn->length);\n" \
|
||||
" size = target.length + sizeof(target.length);\n\n"
|
||||
|
||||
type_list["Session-AMBR"]["decode"] = \
|
||||
" session_ambr->downlink.bitrate = be16toh(source->downlink.bitrate);\n" \
|
||||
" session_ambr->uplink.bitrate = be16toh(source->uplink.bitrate);\n\n"
|
||||
|
||||
type_list["Session-AMBR"]["encode"] = \
|
||||
" target.downlink.bitrate = htobe16(session_ambr->downlink.bitrate);\n" \
|
||||
" target.uplink.bitrate = htobe16(session_ambr->uplink.bitrate);\n\n"
|
||||
|
|
|
@ -52,7 +52,7 @@ void ogs_nas_5gs_tai_list_build(
|
|||
target0.tai[i].tac[j] = ogs_htobe24(source0->tai[i].tac[j]);
|
||||
}
|
||||
|
||||
size = (1 + 3 + 2 * source0->tai[i].num);
|
||||
size = (1 + 3 + 3 * source0->tai[i].num);
|
||||
if ((target->length + size) > OGS_NAS_5GS_MAX_TAI_LIST_LEN) {
|
||||
ogs_warn("Overflow: Ignore remained TAI LIST(length:%d, size:%d)",
|
||||
target->length, size);
|
||||
|
@ -73,7 +73,7 @@ void ogs_nas_5gs_tai_list_build(
|
|||
ogs_assert(source2->num < OGS_MAX_NUM_OF_TAI);
|
||||
target2.num = source2->num - 1;
|
||||
|
||||
size = (1 + (3 + 2) * source2->num);
|
||||
size = (1 + (3 + 3) * source2->num);
|
||||
if ((target->length + size) > OGS_NAS_5GS_MAX_TAI_LIST_LEN) {
|
||||
ogs_warn("Overflow: Ignore remained TAI LIST(length:%d, size:%d)",
|
||||
target->length, size);
|
||||
|
@ -90,3 +90,197 @@ void ogs_nas_5gs_tai_list_build(
|
|||
target->length += size;
|
||||
}
|
||||
}
|
||||
|
||||
void ogs_nas_bitrate_from_uint64(ogs_nas_bitrate_t *nas, uint64_t bitrate)
|
||||
{
|
||||
ogs_assert(nas);
|
||||
ogs_assert(bitrate);
|
||||
|
||||
bitrate >>= 10; /* bps to Kbps */
|
||||
|
||||
for (nas->unit = OGS_NAS_BR_UNIT_1K;
|
||||
nas->unit < OGS_NAS_BR_UNIT_256P; nas->unit++) {
|
||||
if ((bitrate >> 2) == 0) {
|
||||
break;
|
||||
}
|
||||
bitrate >>= 2;
|
||||
}
|
||||
nas->bitrate = bitrate;
|
||||
}
|
||||
|
||||
void ogs_nas_build_qos_rules(ogs_nas_qos_rules_t *rules,
|
||||
ogs_nas_qos_rule_t *rule, int num_of_rule)
|
||||
{
|
||||
int i, j;
|
||||
char *buffer;
|
||||
uint16_t length;
|
||||
ogs_nas_qos_rule_t target;
|
||||
|
||||
ogs_assert(rules);
|
||||
ogs_assert(rule);
|
||||
ogs_assert(num_of_rule);
|
||||
|
||||
buffer = ogs_calloc(1, OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
ogs_assert(buffer);
|
||||
length = 0;
|
||||
|
||||
for (i = 0; i < num_of_rule; i++) {
|
||||
memcpy(&target, rule + i, sizeof(ogs_nas_qos_rule_t));
|
||||
|
||||
ogs_assert(length + sizeof(target.identifier) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.identifier, sizeof(target.identifier));
|
||||
length += sizeof(target.identifier);
|
||||
|
||||
ogs_assert(length + sizeof(target.length) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
target.length = htobe16(target.length);
|
||||
memcpy(buffer + length, &target.length, sizeof(target.length));
|
||||
length += sizeof(target.length);
|
||||
|
||||
ogs_assert(length + sizeof(target.flags) <= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.flags, sizeof(target.flags));
|
||||
length += sizeof(target.flags);
|
||||
|
||||
for (j = 0; j < target.num_of_packet_filter; j++) {
|
||||
ogs_assert(length + sizeof(target.pf[j].flags) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.pf[j].flags,
|
||||
sizeof(target.pf[j].flags));
|
||||
length += sizeof(target.pf[j].flags);
|
||||
|
||||
ogs_assert(length + sizeof(target.pf[j].length) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.pf[j].length,
|
||||
sizeof(target.pf[j].length));
|
||||
length += sizeof(target.pf[j].length);
|
||||
|
||||
for (j = 0; j < target.pf[j].num_of_component; j++) {
|
||||
ogs_assert(length + sizeof(target.pf[j].component[j].type) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].type,
|
||||
sizeof(target.pf[j].component[j].type));
|
||||
length += sizeof(target.pf[j].component[j].type);
|
||||
switch(target.pf[j].component[j].type) {
|
||||
case OGS_PACKET_FILTER_MATCH_ALL:
|
||||
break;
|
||||
case OGS_PACKET_FILTER_PROTOCOL_IDENTIFIER_NEXT_HEADER_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].proto) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].proto,
|
||||
sizeof(target.pf[j].component[j].proto));
|
||||
length += sizeof(target.pf[j].component[j].proto);
|
||||
break;
|
||||
case OGS_PACKET_FILTER_IPV4_REMOTE_ADDRESS_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV4_LOCAL_ADDRESS_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv4.addr)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv4.addr,
|
||||
sizeof(target.pf[j].component[j].ipv4.addr));
|
||||
length += sizeof(target.pf[j].component[j].ipv4.addr);
|
||||
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv4.mask)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv4.mask,
|
||||
sizeof(target.pf[j].component[j].ipv4.mask));
|
||||
length += sizeof(target.pf[j].component[j].ipv4.mask);
|
||||
break;
|
||||
case OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_PREFIX_LENGTH_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_PREFIX_LENGTH_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv6.addr)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv6.addr,
|
||||
sizeof(target.pf[j].component[j].ipv6.addr));
|
||||
length += sizeof(target.pf[j].component[j].ipv6.addr);
|
||||
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv6.prefixlen)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv6.prefixlen,
|
||||
sizeof(target.pf[j].component[j].ipv6.prefixlen));
|
||||
length += sizeof(target.pf[j].component[j].ipv6.prefixlen);
|
||||
break;
|
||||
case OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_TYPE:
|
||||
case OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv6_mask.addr)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv6_mask.addr,
|
||||
sizeof(target.pf[j].component[j].ipv6_mask.addr));
|
||||
length += sizeof(target.pf[j].component[j].ipv6_mask.addr);
|
||||
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].ipv6_mask.mask)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].ipv6_mask.mask,
|
||||
sizeof(target.pf[j].component[j].ipv6_mask.mask));
|
||||
length += sizeof(target.pf[j].component[j].ipv6_mask.mask);
|
||||
break;
|
||||
case OGS_PACKET_FILTER_SINGLE_LOCAL_PORT_TYPE:
|
||||
case OGS_PACKET_FILTER_SINGLE_REMOTE_PORT_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].port.low)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
target.pf[j].component[j].port.low =
|
||||
htobe16(target.pf[j].component[j].port.low);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].port.low,
|
||||
sizeof(target.pf[j].component[j].port.low));
|
||||
length += sizeof(target.pf[j].component[j].port.low);
|
||||
break;
|
||||
case OGS_PACKET_FILTER_LOCAL_PORT_RANGE_TYPE:
|
||||
case OGS_PACKET_FILTER_REMOTE_PORT_RANGE_TYPE:
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].port.low)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
target.pf[j].component[j].port.low =
|
||||
htobe16(target.pf[j].component[j].port.low);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].port.low,
|
||||
sizeof(target.pf[j].component[j].port.low));
|
||||
length += sizeof(target.pf[j].component[j].port.low);
|
||||
|
||||
ogs_assert(length +
|
||||
sizeof(target.pf[j].component[j].port.high)
|
||||
<= OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
target.pf[j].component[j].port.high =
|
||||
htobe16(target.pf[j].component[j].port.high);
|
||||
memcpy(buffer + length,
|
||||
&target.pf[j].component[j].port.high,
|
||||
sizeof(target.pf[j].component[j].port.high));
|
||||
length += sizeof(target.pf[j].component[j].port.high);
|
||||
break;
|
||||
default:
|
||||
ogs_fatal("Unknown Packet Filter Type(%d)",
|
||||
target.pf[j].component[j].type);
|
||||
ogs_assert_if_reached();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ogs_assert(length + sizeof(target.precedence) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.precedence, sizeof(target.precedence));
|
||||
length += sizeof(target.precedence);
|
||||
ogs_assert(length + sizeof(target.flow.flags) <=
|
||||
OGS_NAS_MAX_QOS_RULES_LEN);
|
||||
memcpy(buffer + length, &target.flow.flags, sizeof(target.precedence));
|
||||
length += sizeof(target.flow.flags);
|
||||
}
|
||||
|
||||
rules->buffer = buffer;
|
||||
rules->length = length;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ typedef struct ogs_nas_dnn_s {
|
|||
* O TLV-E 7-1503 */
|
||||
typedef struct ogs_nas_eap_message_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_eap_message_t;
|
||||
|
||||
/* 9.11.2.8.1 S-NSSAI
|
||||
|
@ -58,8 +58,8 @@ typedef struct ogs_nas_eap_message_s {
|
|||
#define OGS_NAS_S_NSSAI_SST_SD_AND_MAPPED_HPLMN_SST_LEN 5
|
||||
typedef struct ogs_nas_s_nssai_s {
|
||||
uint8_t length;
|
||||
ogs_s_nssai_t s_nssai;
|
||||
ogs_s_nssai_t mapped_s_nssai;
|
||||
uint8_t sst;
|
||||
ogs_uint24_t sd;
|
||||
} __attribute__ ((packed)) ogs_nas_s_nssai_t;
|
||||
|
||||
/* 9.11.3.1 5GMM capability
|
||||
|
@ -146,7 +146,7 @@ ED4(uint8_t spare1:1;,
|
|||
#define OGS_NAS_5GS_SUPI_FORMAT_IMSI 0
|
||||
#define OGS_NAS_5GS_SUPI_FORMAT_NETWORK_SPECIFIC_IDENTIFIER 1
|
||||
uint8_t supi_format:3;,
|
||||
uint8_t spare:1;,
|
||||
uint8_t odd_even:1;,
|
||||
uint8_t type:3;)
|
||||
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_header_t;
|
||||
typedef struct ogs_nas_5gs_mobile_identity_imsi_s {
|
||||
|
@ -177,7 +177,7 @@ typedef struct ogs_nas_5gs_mobile_identity_s_tmsi_s {
|
|||
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_s_tmsi_t;
|
||||
typedef struct ogs_nas_5gs_mobile_identity_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_5gs_mobile_identity_t;
|
||||
|
||||
/* 9.11.3.5 5GS network feature support
|
||||
|
@ -197,9 +197,6 @@ ED3(uint8_t spare:6;,
|
|||
|
||||
/* 9.11.3.6 5GS registration result
|
||||
* O TLV 3-5 */
|
||||
#define OGS_NAS_5GS_REGISTRATION_TYPE_3GPP_ACCESS 0
|
||||
#define OGS_NAS_5GS_REGISTRATION_TYPE_NON_3GPP_ACCESS 1
|
||||
#define OGS_NAS_5GS_REGISTRATION_TYPE_3GPP_AND_NON_3GPP_ACCESS 2
|
||||
typedef struct ogs_nas_5gs_registration_result_s {
|
||||
uint8_t length;
|
||||
ED3(uint8_t spare:4;,
|
||||
|
@ -214,9 +211,14 @@ ED3(uint8_t spare:4;,
|
|||
#define OGS_NAS_5GS_REGISTRATION_TYPE_PERIODIC_UPDATING 3
|
||||
#define OGS_NAS_5GS_REGISTRATION_TYPE_EMERGENCY 4
|
||||
typedef struct ogs_nas_5gs_registration_type_s {
|
||||
ED3(uint8_t type:4;,
|
||||
uint8_t follow_on_request:1;,
|
||||
uint8_t value:3;)
|
||||
union {
|
||||
struct {
|
||||
ED3(uint8_t type:4;,
|
||||
uint8_t follow_on_request:1;,
|
||||
uint8_t value:3;)
|
||||
};
|
||||
uint8_t data;
|
||||
};
|
||||
} ogs_nas_5gs_registration_type_t;
|
||||
|
||||
/* 9.11.3.8 5GS tracking area identity
|
||||
|
@ -292,10 +294,9 @@ typedef struct ogs_nas_abba_s {
|
|||
|
||||
/* 9.11.3.11 Access Type
|
||||
* M V 1/2 */
|
||||
#define OGS_NAS_NOTIFICATION_ACCESS_TYPE_3GPP 1
|
||||
#define OGS_NAS_NOTIFICATION_ACCESS_TYPE_NON_3GPP 2
|
||||
typedef struct ogs_nas_access_type_s {
|
||||
ED2(uint8_t spare:5;,
|
||||
ED3(uint8_t type:4;,
|
||||
uint8_t spare:1;,
|
||||
uint8_t value:3;)
|
||||
} __attribute__ ((packed)) ogs_nas_access_type_t;
|
||||
|
||||
|
@ -351,7 +352,7 @@ ED4(uint8_t type:4;,
|
|||
* O TLV-E 3-n */
|
||||
typedef struct ogs_nas_cag_information_list_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_cag_information_list_t;
|
||||
|
||||
/* 9.11.3.18B CIoT small data container
|
||||
|
@ -369,11 +370,13 @@ ED3(uint8_t data_type:3;,
|
|||
* O TLV-E x-n */
|
||||
typedef struct ogs_nas_ciphering_key_data_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_ciphering_key_data_t;
|
||||
|
||||
/* 9.11.3.18D Control plane service type
|
||||
* M V 1/2 */
|
||||
#define OGS_NAS_5GS_CONTROL_PLANE_SERVICE_TYPE_MO 0
|
||||
#define OGS_NAS_5GS_CONTROL_PLANE_SERVICE_TYPE_MT 1
|
||||
typedef struct ogs_nas_control_plane_service_type_s {
|
||||
ED3(uint8_t type:4;,
|
||||
uint8_t spare:1;,
|
||||
|
@ -393,7 +396,7 @@ ED4(uint8_t type:4;,
|
|||
* O TLV-E 4-n */
|
||||
typedef struct ogs_nas_eps_nas_message_container_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_eps_nas_message_container_t;
|
||||
|
||||
/* 9.11.3.25 EPS NAS security algorithms
|
||||
|
@ -404,14 +407,14 @@ typedef ogs_nas_security_algorithms_t ogs_nas_eps_nas_security_algorithms_t;
|
|||
* O TLV-E 3-811 */
|
||||
typedef struct ogs_nas_ladn_indication_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_ladn_indication_t;
|
||||
|
||||
/* 9.11.3.30 LADN information
|
||||
* O TLV-E 12-1715 */
|
||||
typedef struct ogs_nas_ladn_information_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_ladn_information_t;
|
||||
|
||||
/* 9.11.3.31 MICO indication
|
||||
|
@ -431,17 +434,17 @@ ED2(uint8_t type:4;,
|
|||
|
||||
/* 9.11.3.31B Mapped NSSAI
|
||||
* O TLV 3-42 */
|
||||
#define OGS_NAX_MAX_NUM_OF_MAPPED_S_NSSAI 10
|
||||
#define OGS_NAS_MAX_MAPPED_NSSAI_LEN 40
|
||||
typedef struct ogs_nas_mapped_nssai_s {
|
||||
uint8_t length;
|
||||
ogs_s_nssai_t s_nssai[OGS_NAX_MAX_NUM_OF_MAPPED_S_NSSAI];
|
||||
char buffer[OGS_NAS_MAX_MAPPED_NSSAI_LEN];
|
||||
} ogs_nas_mapped_nssai_t;
|
||||
|
||||
/* 9.11.3.33 message container
|
||||
* O TLV-E 4-n */
|
||||
typedef struct ogs_nas_message_container_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} __attribute__ ((packed)) ogs_nas_message_container_t;
|
||||
|
||||
/* 9.11.3.36 Network slicing indication
|
||||
|
@ -455,10 +458,10 @@ ED4(uint8_t type:4;,
|
|||
|
||||
/* 9.11.3.37 NSSAI
|
||||
* O TLV 4-72 */
|
||||
#define OGS_NAS_MAX_NUM_OF_S_NSSAI 18
|
||||
#define OGS_NAS_MAX_NSSAI_LEN 70
|
||||
typedef struct ogs_nas_nssai_s {
|
||||
uint8_t length;
|
||||
ogs_s_nssai_t s_nssai[OGS_NAS_MAX_NUM_OF_S_NSSAI];
|
||||
char buffer[OGS_NAS_MAX_NSSAI_LEN];
|
||||
} __attribute__ ((packed)) ogs_nas_nssai_t;
|
||||
|
||||
/* 9.11.3.37A NSSAI inclusion mode
|
||||
|
@ -477,18 +480,25 @@ ED3(uint8_t type:4;,
|
|||
* O TLV-E 3-n */
|
||||
typedef struct ogs_nas_operator_defined_access_category_definitions_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_operator_defined_access_category_definitions_t;
|
||||
|
||||
/* 9.11.3.39 Payload container
|
||||
* O TLV-E 4-65535 */
|
||||
typedef struct ogs_nas_payload_container_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_payload_container_t;
|
||||
|
||||
/* 9.11.3.40 Payload container type
|
||||
* O TV 1 */
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION 1
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_SMS 2
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_LPP 3
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_SOR 4
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_UE_POLICY 5
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_UE_PARAMETER_UPDATE 6
|
||||
#define OGS_NAS_PAYLOAD_CONTAINER_MULTIPLE 7
|
||||
typedef struct ogs_nas_payload_container_type_s {
|
||||
ED2(uint8_t type:4;,
|
||||
uint8_t value:4;)
|
||||
|
@ -496,10 +506,7 @@ ED2(uint8_t type:4;,
|
|||
|
||||
/* 9.11.3.41 PDU session identity 2
|
||||
* C TV 2 */
|
||||
typedef struct ogs_nas_pdu_session_identity_2_s {
|
||||
uint8_t type;
|
||||
uint8_t value;
|
||||
} __attribute__ ((packed)) ogs_nas_pdu_session_identity_2_t;
|
||||
typedef uint8_t ogs_nas_pdu_session_identity_2_t;
|
||||
|
||||
/* 9.11.3.42 PDU session reactivation result
|
||||
* O TLV 4-34 */
|
||||
|
@ -509,7 +516,7 @@ typedef ogs_nas_allowed_pdu_session_status_t ogs_nas_pdu_session_reactivation_re
|
|||
* O TLV-E 5-515 */
|
||||
typedef struct ogs_nas_pdu_session_reactivation_result_error_cause_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_pdu_session_reactivation_result_error_cause_t;
|
||||
|
||||
/* 9.11.3.44 PDU session status
|
||||
|
@ -518,13 +525,10 @@ typedef ogs_nas_allowed_pdu_session_status_t ogs_nas_pdu_session_status_t;
|
|||
|
||||
/* 9.11.3.46 Rejected NSSAI
|
||||
* O TLV 4-42 */
|
||||
#define OGS_NAS_MAX_REJECTED_NSSAI_LEN 40
|
||||
typedef struct ogs_nas_rejected_nssai_s {
|
||||
uint8_t length;
|
||||
struct {
|
||||
ED2(uint8_t len:4;,
|
||||
uint8_t value:4;)
|
||||
ogs_s_nssai_t s_nssai;
|
||||
} rejected[OGS_MAX_NUM_OF_S_NSSAI];
|
||||
char buffer[OGS_NAS_MAX_REJECTED_NSSAI_LEN];
|
||||
} ogs_nas_rejected_nssai_t;
|
||||
|
||||
/* 9.11.3.49 Service area list
|
||||
|
@ -561,7 +565,7 @@ ED2(uint8_t type:4;,
|
|||
* O TLV-E 20-n */
|
||||
typedef struct ogs_nas_sor_transparent_container_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_sor_transparent_container_t;
|
||||
|
||||
/* 9.11.3.48 S1 UE network capability
|
||||
|
@ -664,7 +668,7 @@ ED3(uint8_t spare:6;,
|
|||
#define OGS_5GSM_CAUSE_INVALID_MANDATORY_INFORMATION 96
|
||||
#define OGS_5GSM_CAUSE_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED 97
|
||||
#define OGS_5GSM_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 98
|
||||
#define OGS_5GSM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT IMPLEMENTED 99
|
||||
#define OGS_5GSM_CAUSE_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED 99
|
||||
#define OGS_5GSM_CAUSE_CONDITIONAL_IE_ERROR 100
|
||||
#define OGS_5GSM_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_THE_PROTOCOL_STATE 101
|
||||
#define OGS_5GSM_CAUSE_PROTOCOL_ERROR_UNSPECIFIED 111
|
||||
|
@ -715,7 +719,7 @@ typedef struct ogs_nas_integrity_protection_maximum_data_rate_s {
|
|||
* O TLV-E 7-65535 */
|
||||
typedef struct ogs_nas_mapped_eps_bearer_contexts_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} __attribute__ ((packed)) ogs_nas_mapped_eps_bearer_contexts_t;
|
||||
|
||||
/* 9.11.4.9 Maximum number of supported packet filters
|
||||
|
@ -726,34 +730,8 @@ ED2(uint8_t max2:3;,
|
|||
uint8_t spare:5;)
|
||||
} __attribute__ ((packed)) ogs_nas_maximum_number_of_supported_packet_filters_t;
|
||||
|
||||
/* 9.11.4.10 PDU address
|
||||
* O TLV 7, 11 or 15 */
|
||||
#define OGS_NAS_PDU_ADDRESS_TYPE_IPV4 1
|
||||
#define OGS_NAS_PDU_ADDRESS_TYPE_IPV6 2
|
||||
#define OGS_NAS_PDU_ADDRESS_TYPE_IPV4V6 3
|
||||
typedef struct ogs_nas_pdu_address_s {
|
||||
uint8_t length;
|
||||
ED2(uint8_t reserved:5;,
|
||||
uint8_t type:3;)
|
||||
union {
|
||||
uint32_t addr;
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
};
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
uint32_t addr;
|
||||
} both;
|
||||
};
|
||||
} __attribute__ ((packed)) ogs_nas_pdu_address_t;
|
||||
|
||||
/* 9.11.4.11 PDU session type
|
||||
* O TV 1 */
|
||||
#define OGS_NAS_PDU_SESSION_TYPE_IPV4 1
|
||||
#define OGS_NAS_PDU_SESSION_TYPE_IPV6 2
|
||||
#define OGS_NAS_PDU_SESSION_TYPE_IPV4V6 3
|
||||
#define OGS_NAS_PDU_SESSION_TYPE_UNSTRUCTURED 4
|
||||
#define OGS_NAS_PDU_SESSION_TYPE_ETHERNET 5
|
||||
typedef struct ogs_nas_pdu_session_type_s {
|
||||
ED3(uint8_t type:4;,
|
||||
uint8_t spare:1;,
|
||||
|
@ -764,15 +742,102 @@ ED3(uint8_t type:4;,
|
|||
* O TLV-E 6-65535 */
|
||||
typedef struct ogs_nas_qos_flow_descriptions_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_qos_flow_descriptions_t;
|
||||
|
||||
/* 9.11.4.13 QoS rules
|
||||
* M LV-E 6-65535 */
|
||||
#define OGS_NAS_MAX_NUM_OF_QOS_RULE 8
|
||||
#define OGS_NAS_MAX_NUM_OF_PACKET_FILTER_COMPONENT 16
|
||||
typedef struct ogs_nas_qos_rule_s {
|
||||
uint8_t identifier;
|
||||
uint16_t length;
|
||||
union {
|
||||
struct {
|
||||
#define OGS_NAS_QOS_CODE_CREATE_NEW_QOS_RULE 1
|
||||
#define OGS_NAS_QOS_CODE_DELETE_EXISTING_QOS_RULE 2
|
||||
#define OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_AND_ADD_PACKET_FILTERS 3
|
||||
#define OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_AND_REPLACE_PACKET_FILTERS 4
|
||||
#define OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_AND_DELETE_PACKET_FILTERS 5
|
||||
#define OGS_NAS_QOS_CODE_MODIFY_EXISTING_QOS_RULE_WITHOUT_MODIFYING_PACKET_FILTERS 6
|
||||
ED3(uint8_t code:3;,
|
||||
uint8_t DQR_bit:1;,
|
||||
uint8_t num_of_packet_filter:4;)
|
||||
};
|
||||
uint8_t flags;
|
||||
};
|
||||
struct {
|
||||
union {
|
||||
struct {
|
||||
ED3(uint8_t spare:2;,
|
||||
#define OGS_NAS_QOS_DIRECTION_DOWNLINK 1
|
||||
#define OGS_NAS_QOS_DIRECTION_UPLINK 2
|
||||
#define OGS_NAS_QOS_DIRECTION_BIDIRECTIONAL 3
|
||||
uint8_t direction:2;,
|
||||
uint8_t pf_identifier:4;)
|
||||
};
|
||||
uint8_t flags;
|
||||
};
|
||||
uint8_t length;
|
||||
#define OGS_PACKET_FILTER_MATCH_ALL 1
|
||||
#define OGS_PACKET_FILTER_PROTOCOL_IDENTIFIER_NEXT_HEADER_TYPE 48
|
||||
#define OGS_PACKET_FILTER_IPV4_REMOTE_ADDRESS_TYPE 16
|
||||
#define OGS_PACKET_FILTER_IPV4_LOCAL_ADDRESS_TYPE 17
|
||||
#define OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_TYPE 32
|
||||
#define OGS_PACKET_FILTER_IPV6_REMOTE_ADDRESS_PREFIX_LENGTH_TYPE 33
|
||||
#define OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_TYPE 34
|
||||
#define OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_PREFIX_LENGTH_TYPE 35
|
||||
#define OGS_PACKET_FILTER_SINGLE_LOCAL_PORT_TYPE 64
|
||||
#define OGS_PACKET_FILTER_LOCAL_PORT_RANGE_TYPE 65
|
||||
#define OGS_PACKET_FILTER_SINGLE_REMOTE_PORT_TYPE 80
|
||||
#define OGS_PACKET_FILTER_REMOTE_PORT_RANGE_TYPE 81
|
||||
#define OGS_PACKET_FILTER_SECURITY_PARAMETER_INDEX_TYPE 96
|
||||
#define OGS_PACKET_FILTER_TOS_TRAFFIC_CLASS_TYPE 112
|
||||
#define OGS_PACKET_FILTER_FLOW_LABEL_TYPE 128
|
||||
struct {
|
||||
uint8_t type;
|
||||
union {
|
||||
uint8_t proto;
|
||||
struct {
|
||||
uint32_t addr;
|
||||
uint32_t mask;
|
||||
} ipv4;
|
||||
struct {
|
||||
uint32_t addr[4];
|
||||
uint8_t prefixlen;
|
||||
} ipv6;
|
||||
struct {
|
||||
uint32_t addr[4];
|
||||
uint32_t mask[4];
|
||||
} ipv6_mask;
|
||||
struct {
|
||||
uint16_t low;
|
||||
uint16_t high;
|
||||
} port;
|
||||
};
|
||||
} component[OGS_NAS_MAX_NUM_OF_PACKET_FILTER_COMPONENT];
|
||||
uint8_t num_of_component;
|
||||
} pf[OGS_MAX_NUM_OF_PACKET_FILTER];
|
||||
|
||||
uint8_t precedence;
|
||||
union {
|
||||
struct {
|
||||
ED3(uint8_t spare:1;,
|
||||
uint8_t segregation:1;,
|
||||
uint8_t identifier:4;)
|
||||
};
|
||||
uint8_t flags;
|
||||
} flow;
|
||||
} ogs_nas_qos_rule_t;
|
||||
|
||||
#define OGS_NAS_MAX_QOS_RULES_LEN 65535
|
||||
typedef struct ogs_nas_qos_rules_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
} ogs_nas_qos_rules_t;
|
||||
uint16_t length;
|
||||
void *buffer;
|
||||
} __attribute__ ((packed)) ogs_nas_qos_rules_t;
|
||||
|
||||
void ogs_nas_build_qos_rules(ogs_nas_qos_rules_t *rules,
|
||||
ogs_nas_qos_rule_t *rule, int num_of_rule);
|
||||
|
||||
/* 9.11.4.14 Session-AMBR
|
||||
* M LV 7 */
|
||||
|
@ -801,16 +866,18 @@ typedef struct ogs_nas_qos_rules_s {
|
|||
#define OGS_NAS_BR_UNIT_16P 23
|
||||
#define OGS_NAS_BR_UNIT_64P 24
|
||||
#define OGS_NAS_BR_UNIT_256P 25
|
||||
typedef struct ogs_nas_bitrate_s {
|
||||
uint8_t unit;
|
||||
uint16_t bitrate;
|
||||
} __attribute__ ((packed)) ogs_nas_bitrate_t;
|
||||
|
||||
void ogs_nas_bitrate_from_uint64(
|
||||
ogs_nas_bitrate_t *nas_bitrate, uint64_t bitrate);
|
||||
|
||||
typedef struct ogs_nas_session_ambr_s {
|
||||
uint8_t length;
|
||||
struct {
|
||||
uint8_t unit;
|
||||
uint16_t br;
|
||||
} dl;
|
||||
struct {
|
||||
uint8_t unit;
|
||||
uint16_t br;
|
||||
} ul;
|
||||
ogs_nas_bitrate_t downlink;
|
||||
ogs_nas_bitrate_t uplink;
|
||||
} __attribute__ ((packed)) ogs_nas_session_ambr_t;
|
||||
|
||||
/* 9.11.4.15 SM PDU DN request container
|
||||
|
@ -847,7 +914,7 @@ ED2(uint8_t spare:7;,
|
|||
* O TLV-E 3-65535 */
|
||||
typedef struct ogs_nas_atsss_container_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_atsss_container_t;
|
||||
|
||||
/* 9.9.4.25 Release assistance indication
|
||||
|
@ -892,7 +959,7 @@ typedef struct ogs_nas_ue_ds_tt_residence_time_s {
|
|||
* O TLV-E 4-65535 */
|
||||
typedef struct ogs_nas_port_management_information_container_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_port_management_information_container_t;
|
||||
|
||||
/* 9.11.3.72 N5GC indication
|
||||
|
|
|
@ -333,7 +333,8 @@ ED2(uint8_t unit:3;,
|
|||
* O TLV 3 */
|
||||
typedef struct ogs_nas_gprs_timer_2_s {
|
||||
uint8_t length;
|
||||
uint8_t gprs_timer_2_value;
|
||||
ED2(uint8_t unit:3;,
|
||||
uint8_t value:5;)
|
||||
} __attribute__ ((packed)) ogs_nas_gprs_timer_2_t;
|
||||
|
||||
/* 9.9.3.16B GPRS timer 3
|
||||
|
@ -351,7 +352,7 @@ typedef struct ogs_nas_gprs_timer_2_s {
|
|||
typedef struct ogs_nas_gprs_timer_3_s {
|
||||
uint8_t length;
|
||||
ED2(uint8_t unit:3;,
|
||||
uint8_t timer_value:5;)
|
||||
uint8_t value:5;)
|
||||
} __attribute__ ((packed)) ogs_nas_gprs_timer_3_t;
|
||||
|
||||
/* 9.9.3.18 IMEISV request
|
||||
|
@ -363,7 +364,7 @@ ED3(uint8_t type:4;,
|
|||
uint8_t spare:1;,
|
||||
#define OGS_NAS_IMEISV_NOT_REQUESTED 0
|
||||
#define OGS_NAS_IMEISV_REQUESTED 1
|
||||
uint8_t imeisv_request_value:3;)
|
||||
uint8_t value:3;)
|
||||
} __attribute__ ((packed)) ogs_nas_imeisv_request_t;
|
||||
|
||||
/* 9.9.3.21 NAS key set identifier
|
||||
|
@ -697,7 +698,7 @@ typedef struct ogs_nas_emergency_number_list_s {
|
|||
* O TLV-E 7-65535 */
|
||||
typedef struct ogs_nas_extended_emergency_number_list_s {
|
||||
uint8_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_extended_emergency_number_list_t;
|
||||
|
||||
/* 9.9.3.46 Extended DRX parameters
|
||||
|
@ -748,6 +749,29 @@ void eps_qos_build(ogs_nas_eps_quality_of_service_t *eps_qos,
|
|||
uint8_t qci,
|
||||
uint64_t dl_mbr, uint64_t ul_mbr, uint64_t dl_gbr, uint64_t ul_gbr);
|
||||
|
||||
/* 9.9.4.9 PDN address
|
||||
* M LV 6-14 */
|
||||
/* 9.11.4.10 PDU address
|
||||
* O TLV 7, 11 or 15 */
|
||||
#define OGS_NAS_PDU_ADDRESS_IPV4_LEN 5
|
||||
#define OGS_NAS_PDU_ADDRESS_IPV6_LEN 9
|
||||
#define OGS_NAS_PDU_ADDRESS_IPV4V6_LEN 13
|
||||
typedef struct ogs_nas_pdu_address_s {
|
||||
uint8_t length;
|
||||
ED2(uint8_t reserved:5;,
|
||||
uint8_t pdn_type:3;)
|
||||
union {
|
||||
uint32_t addr;
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
};
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
uint32_t addr;
|
||||
} both;
|
||||
};
|
||||
} __attribute__ ((packed)) ogs_nas_pdu_address_t;
|
||||
|
||||
/* 9.9.4.14 Request type
|
||||
* M V 1/2
|
||||
* See subclause 10.5.6.17 in 3GPP TS 24.008 [13].
|
||||
|
@ -830,7 +854,7 @@ ED3(uint8_t type:4;,
|
|||
* O TLV-E 4-65538 */
|
||||
typedef struct ogs_nas_extended_protocol_configuration_options_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} __attribute__ ((packed)) ogs_nas_extended_protocol_configuration_options_t;
|
||||
|
||||
/* 9.9.4.28 Serving PLMN rate control
|
||||
|
|
|
@ -293,7 +293,7 @@ ED4(uint8_t tsc:1;,
|
|||
* M LV-E 5-n */
|
||||
typedef struct ogs_nas_esm_message_container_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_esm_message_container_t;
|
||||
|
||||
/* 9.9.3.17 Identity type 2
|
||||
|
@ -526,7 +526,7 @@ typedef uint8_t ogs_nas_generic_message_container_type_t;
|
|||
* M LV-E 3-n */
|
||||
typedef struct ogs_nas_generic_message_container_s {
|
||||
uint16_t length;
|
||||
uint8_t *buffer;
|
||||
void *buffer;
|
||||
} ogs_nas_generic_message_container_t;
|
||||
|
||||
/* 9.9.3.44 Voice domain preference and UE's usage setting
|
||||
|
@ -663,24 +663,7 @@ ED3(uint8_t type:4;,
|
|||
|
||||
/* 9.9.4.9 PDN address
|
||||
* M LV 6-14 */
|
||||
#define OGS_NAS_PDN_ADDRESS_IPV4_LEN 5
|
||||
#define OGS_NAS_PDN_ADDRESS_IPV6_LEN 9
|
||||
#define OGS_NAS_PDN_ADDRESS_IPV4V6_LEN 13
|
||||
typedef struct ogs_nas_pdn_address_s {
|
||||
uint8_t length;
|
||||
ED2(uint8_t reserved:5;,
|
||||
uint8_t pdn_type:3;)
|
||||
union {
|
||||
uint32_t addr;
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
};
|
||||
struct {
|
||||
uint8_t addr6[OGS_IPV6_LEN>>1]; /* Interface Identifer Only */
|
||||
uint32_t addr;
|
||||
} both;
|
||||
};
|
||||
} __attribute__ ((packed)) ogs_nas_pdn_address_t;
|
||||
typedef ogs_nas_pdu_address_t ogs_nas_pdn_address_t;
|
||||
|
||||
/* 9.9.4.11 Protocol configuration options
|
||||
* See subclause 10.5.6.3 in 3GPP TS 24.008 [13].
|
||||
|
|
|
@ -21,9 +21,8 @@
|
|||
|
||||
int __ogs_ngap_domain;
|
||||
|
||||
ogs_pkbuf_t *ogs_ngap_encode(ogs_ngap_message_t *message)
|
||||
ogs_pkbuf_t *nga_ngap_encode(ogs_ngap_message_t *message)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
ogs_assert(message);
|
||||
|
@ -31,41 +30,30 @@ ogs_pkbuf_t *ogs_ngap_encode(ogs_ngap_message_t *message)
|
|||
if (ogs_log_get_domain_level(OGS_LOG_DOMAIN) >= OGS_LOG_TRACE)
|
||||
asn_fprint(stdout, &asn_DEF_NGAP_NGAP_PDU, message);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_pkbuf_put(pkbuf, OGS_MAX_SDU_LEN);
|
||||
pkbuf = ogs_asn_encode(&asn_DEF_NGAP_NGAP_PDU, message);
|
||||
ogs_asn_free(&asn_DEF_NGAP_NGAP_PDU, message);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_NGAP_NGAP_PDU, NULL,
|
||||
message, pkbuf->data, OGS_MAX_SDU_LEN);
|
||||
ogs_ngap_free(message);
|
||||
|
||||
if (enc_ret.encoded < 0) {
|
||||
ogs_error("Failed to encode NGAP-PDU[%d]", (int)enc_ret.encoded);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
if (pkbuf == NULL) {
|
||||
ogs_error("Failed to encode NGAP-PDU");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_pkbuf_trim(pkbuf, (enc_ret.encoded >> 3));
|
||||
|
||||
return pkbuf;
|
||||
}
|
||||
|
||||
int ogs_ngap_decode(ogs_ngap_message_t *message, ogs_pkbuf_t *pkbuf)
|
||||
int nga_ngap_decode(ogs_ngap_message_t *message, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_dec_rval_t dec_ret = {0};
|
||||
|
||||
int rv;
|
||||
ogs_assert(message);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_assert(pkbuf->data);
|
||||
ogs_assert(pkbuf->len);
|
||||
|
||||
memset((void *)message, 0, sizeof(ogs_ngap_message_t));
|
||||
dec_ret = aper_decode(NULL, &asn_DEF_NGAP_NGAP_PDU, (void **)&message,
|
||||
pkbuf->data, pkbuf->len, 0, 0);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
ogs_warn("Failed to decode NGAP-PDU[code:%d,consumed:%d]",
|
||||
dec_ret.code, (int)dec_ret.consumed);
|
||||
return OGS_ERROR;
|
||||
rv = ogs_asn_decode(&asn_DEF_NGAP_NGAP_PDU,
|
||||
message, sizeof(ogs_ngap_message_t), pkbuf);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_warn("Failed to decode NGAP-PDU");
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (ogs_log_get_domain_level(OGS_LOG_DOMAIN) >= OGS_LOG_TRACE)
|
||||
|
@ -74,11 +62,8 @@ int ogs_ngap_decode(ogs_ngap_message_t *message, ogs_pkbuf_t *pkbuf)
|
|||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_ngap_free(ogs_ngap_message_t *message)
|
||||
void nga_ngap_free(ogs_ngap_message_t *message)
|
||||
{
|
||||
ogs_assert(message);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_NGAP_PDU, message);
|
||||
|
||||
return OGS_OK;
|
||||
ogs_asn_free(&asn_DEF_NGAP_NGAP_PDU, message);
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@ extern "C" {
|
|||
|
||||
typedef struct NGAP_NGAP_PDU ogs_ngap_message_t;
|
||||
|
||||
int ogs_ngap_decode(ogs_ngap_message_t *message, ogs_pkbuf_t *pkbuf);
|
||||
ogs_pkbuf_t *ogs_ngap_encode(ogs_ngap_message_t *message);
|
||||
int ogs_ngap_free(ogs_ngap_message_t *message);
|
||||
int nga_ngap_decode(ogs_ngap_message_t *message, ogs_pkbuf_t *pkbuf);
|
||||
ogs_pkbuf_t *nga_ngap_encode(ogs_ngap_message_t *message);
|
||||
void nga_ngap_free(ogs_ngap_message_t *message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -630,6 +630,7 @@
|
|||
#include "NGAP_XnTNLConfigurationInfo.h"
|
||||
|
||||
#include "asn1c/util/conv.h"
|
||||
#include "asn1c/util/message.h"
|
||||
|
||||
#define OGS_NGAP_INSIDE
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ int __ogs_s1ap_domain;
|
|||
|
||||
ogs_pkbuf_t *ogs_s1ap_encode(ogs_s1ap_message_t *message)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
|
||||
ogs_assert(message);
|
||||
|
@ -31,41 +30,30 @@ ogs_pkbuf_t *ogs_s1ap_encode(ogs_s1ap_message_t *message)
|
|||
if (ogs_log_get_domain_level(OGS_LOG_DOMAIN) >= OGS_LOG_TRACE)
|
||||
asn_fprint(stdout, &asn_DEF_S1AP_S1AP_PDU, message);
|
||||
|
||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_pkbuf_put(pkbuf, OGS_MAX_SDU_LEN);
|
||||
pkbuf = ogs_asn_encode(&asn_DEF_S1AP_S1AP_PDU, message);
|
||||
ogs_asn_free(&asn_DEF_S1AP_S1AP_PDU, message);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_S1AP_PDU, NULL,
|
||||
message, pkbuf->data, OGS_MAX_SDU_LEN);
|
||||
ogs_s1ap_free(message);
|
||||
|
||||
if (enc_ret.encoded < 0) {
|
||||
ogs_error("Failed to encode S1AP-PDU[%d]", (int)enc_ret.encoded);
|
||||
ogs_pkbuf_free(pkbuf);
|
||||
if (pkbuf == NULL) {
|
||||
ogs_error("Failed to encode S1AP-PDU");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_pkbuf_trim(pkbuf, (enc_ret.encoded >> 3));
|
||||
|
||||
return pkbuf;
|
||||
}
|
||||
|
||||
int ogs_s1ap_decode(ogs_s1ap_message_t *message, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_dec_rval_t dec_ret = {0};
|
||||
|
||||
int rv;
|
||||
ogs_assert(message);
|
||||
ogs_assert(pkbuf);
|
||||
ogs_assert(pkbuf->data);
|
||||
ogs_assert(pkbuf->len);
|
||||
|
||||
memset((void *)message, 0, sizeof(ogs_s1ap_message_t));
|
||||
dec_ret = aper_decode(NULL, &asn_DEF_S1AP_S1AP_PDU, (void **)&message,
|
||||
pkbuf->data, pkbuf->len, 0, 0);
|
||||
|
||||
if (dec_ret.code != RC_OK) {
|
||||
ogs_warn("Failed to decode S1AP-PDU[code:%d,consumed:%d]",
|
||||
dec_ret.code, (int)dec_ret.consumed);
|
||||
return OGS_ERROR;
|
||||
rv = ogs_asn_decode(&asn_DEF_S1AP_S1AP_PDU,
|
||||
message, sizeof(ogs_s1ap_message_t), pkbuf);
|
||||
if (rv != OGS_OK) {
|
||||
ogs_warn("Failed to decode S1AP-PDU");
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (ogs_log_get_domain_level(OGS_LOG_DOMAIN) >= OGS_LOG_TRACE)
|
||||
|
@ -74,11 +62,8 @@ int ogs_s1ap_decode(ogs_s1ap_message_t *message, ogs_pkbuf_t *pkbuf)
|
|||
return OGS_OK;
|
||||
}
|
||||
|
||||
int ogs_s1ap_free(ogs_s1ap_message_t *message)
|
||||
void ogs_s1ap_free(ogs_s1ap_message_t *message)
|
||||
{
|
||||
ogs_assert(message);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_S1AP_PDU, message);
|
||||
|
||||
return OGS_OK;
|
||||
ogs_asn_free(&asn_DEF_S1AP_S1AP_PDU, message);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ typedef struct S1AP_S1AP_PDU ogs_s1ap_message_t;
|
|||
|
||||
int ogs_s1ap_decode(ogs_s1ap_message_t *message, ogs_pkbuf_t *pkbuf);
|
||||
ogs_pkbuf_t *ogs_s1ap_encode(ogs_s1ap_message_t *message);
|
||||
int ogs_s1ap_free(ogs_s1ap_message_t *message);
|
||||
void ogs_s1ap_free(ogs_s1ap_message_t *message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -542,6 +542,7 @@
|
|||
#include "S1AP_asn_constant.h"
|
||||
|
||||
#include "asn1c/util/conv.h"
|
||||
#include "asn1c/util/message.h"
|
||||
|
||||
#define OGS_S1AP_INSIDE
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "ogs-app.h"
|
||||
#include "ogs-sbi.h"
|
||||
|
||||
#include "sbi-private.h"
|
||||
#include "curl/curl.h"
|
||||
|
||||
typedef struct sockinfo_s {
|
||||
|
@ -49,6 +48,7 @@ typedef struct connection_s {
|
|||
|
||||
ogs_timer_t *timer;
|
||||
CURL *easy;
|
||||
|
||||
char error[CURL_ERROR_SIZE];
|
||||
|
||||
ogs_sbi_client_t *client;
|
||||
|
@ -183,18 +183,18 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
|||
}
|
||||
}
|
||||
|
||||
static char *add_params_to_url(CURL *easy, char *url, ogs_hash_t *params)
|
||||
static char *add_params_to_uri(CURL *easy, char *uri, ogs_hash_t *params)
|
||||
{
|
||||
ogs_hash_index_t *hi;
|
||||
int has_params = 0;
|
||||
const char *fp = "?", *np = "&";
|
||||
|
||||
ogs_assert(easy);
|
||||
ogs_assert(url);
|
||||
ogs_assert(uri);
|
||||
ogs_assert(params);
|
||||
ogs_assert(ogs_hash_count(params));
|
||||
|
||||
has_params = (strchr(url, '?') != NULL);
|
||||
has_params = (strchr(uri, '?') != NULL);
|
||||
|
||||
for (hi = ogs_hash_first(params); hi; hi = ogs_hash_next(hi)) {
|
||||
const char *key = NULL;
|
||||
|
@ -213,17 +213,17 @@ static char *add_params_to_url(CURL *easy, char *url, ogs_hash_t *params)
|
|||
ogs_assert(val_esc);
|
||||
|
||||
if (!has_params) {
|
||||
url = ogs_mstrcatf(url, "%s%s=%s", fp, key_esc, val_esc);
|
||||
uri = ogs_mstrcatf(uri, "%s%s=%s", fp, key_esc, val_esc);
|
||||
has_params = 1;
|
||||
} else {
|
||||
url = ogs_mstrcatf(url, "%s%s=%s", np, key_esc, val_esc);
|
||||
uri = ogs_mstrcatf(uri, "%s%s=%s", np, key_esc, val_esc);
|
||||
}
|
||||
|
||||
curl_free(val_esc);
|
||||
curl_free(key_esc);
|
||||
}
|
||||
|
||||
return url;
|
||||
return uri;
|
||||
}
|
||||
|
||||
static connection_t *connection_add(ogs_sbi_client_t *client,
|
||||
|
@ -277,21 +277,24 @@ static connection_t *connection_add(ogs_sbi_client_t *client,
|
|||
strcmp(request->h.method, OGS_SBI_HTTP_METHOD_DELETE) == 0 ||
|
||||
strcmp(request->h.method, OGS_SBI_HTTP_METHOD_POST) == 0) {
|
||||
|
||||
curl_easy_setopt(conn->easy, CURLOPT_CUSTOMREQUEST, request->h.method);
|
||||
curl_easy_setopt(conn->easy,
|
||||
CURLOPT_CUSTOMREQUEST, request->h.method);
|
||||
if (request->http.content) {
|
||||
curl_easy_setopt(conn->easy, CURLOPT_POSTFIELDS,
|
||||
request->http.content);
|
||||
curl_easy_setopt(conn->easy,
|
||||
CURLOPT_POSTFIELDS, request->http.content);
|
||||
curl_easy_setopt(conn->easy,
|
||||
CURLOPT_POSTFIELDSIZE, request->http.content_length);
|
||||
}
|
||||
}
|
||||
|
||||
curl_easy_setopt(conn->easy, CURLOPT_HTTPHEADER, conn->header_list);
|
||||
|
||||
if (ogs_hash_count(request->http.params)) {
|
||||
request->h.url = add_params_to_url(conn->easy,
|
||||
request->h.url, request->http.params);
|
||||
request->h.uri = add_params_to_uri(conn->easy,
|
||||
request->h.uri, request->http.params);
|
||||
}
|
||||
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, request->h.url);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_URL, request->h.uri);
|
||||
|
||||
curl_easy_setopt(conn->easy, CURLOPT_PRIVATE, conn);
|
||||
curl_easy_setopt(conn->easy, CURLOPT_WRITEFUNCTION, write_cb);
|
||||
|
@ -413,9 +416,9 @@ static void check_multi_info(ogs_sbi_client_t *client)
|
|||
response->h.method = ogs_strdup(conn->method);
|
||||
|
||||
/* remove https://localhost:8000 */
|
||||
response->h.url = ogs_strdup(url);
|
||||
response->h.uri = ogs_strdup(url);
|
||||
|
||||
response->http.content = ogs_strdup(conn->memory);
|
||||
response->http.content = ogs_memdup(conn->memory, conn->size);
|
||||
response->http.content_length = conn->size;
|
||||
|
||||
if (content_type)
|
||||
|
@ -452,13 +455,53 @@ void ogs_sbi_client_send_request(
|
|||
ogs_assert(client);
|
||||
ogs_assert(request);
|
||||
|
||||
if (request->h.url == NULL) {
|
||||
request->h.url = ogs_sbi_client_uri(client, &request->h);
|
||||
if (request->h.uri == NULL) {
|
||||
request->h.uri = ogs_sbi_client_uri(client, &request->h);
|
||||
}
|
||||
|
||||
conn = connection_add(client, request, data);
|
||||
ogs_assert(conn);
|
||||
ogs_sbi_request_free(request);
|
||||
}
|
||||
|
||||
void ogs_sbi_client_send_request_to_nf_instance(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
ogs_sbi_request_t *request, void *data)
|
||||
{
|
||||
ogs_sbi_client_t *client = NULL;
|
||||
|
||||
ogs_assert(request);
|
||||
ogs_assert(nf_instance);
|
||||
|
||||
if (request->h.uri == NULL) {
|
||||
client = ogs_sbi_client_find_by_service_name(nf_instance,
|
||||
request->h.service.name, request->h.api.version);
|
||||
if (!client) {
|
||||
ogs_error("[%s] Cannot find client [%s:%s]",
|
||||
nf_instance->id,
|
||||
request->h.service.name, request->h.api.version);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ogs_sockaddr_t *addr = NULL;
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
||||
addr = ogs_sbi_getaddr_from_uri(request->h.uri);
|
||||
if (!addr) {
|
||||
ogs_error("[%s] Invalid confirmation URL [%s]",
|
||||
nf_instance->id, request->h.uri);
|
||||
return;
|
||||
}
|
||||
client = ogs_sbi_client_find(addr);
|
||||
if (!client) {
|
||||
ogs_error("[%s] Cannot find client [%s:%d]", nf_instance->id,
|
||||
OGS_ADDR(addr, buf), OGS_PORT(addr));
|
||||
ogs_freeaddrinfo(addr);
|
||||
return;
|
||||
}
|
||||
ogs_freeaddrinfo(addr);
|
||||
}
|
||||
|
||||
ogs_sbi_client_send_request(client, request, data);
|
||||
}
|
||||
|
||||
static size_t write_cb(void *contents, size_t size, size_t nmemb, void *data)
|
||||
|
@ -492,8 +535,17 @@ static size_t header_cb(void *ptr, size_t size, size_t nmemb, void *data)
|
|||
conn = data;
|
||||
ogs_assert(conn);
|
||||
|
||||
if (strncmp(ptr, OGS_SBI_LOCATION, strlen(OGS_SBI_LOCATION)) == 0)
|
||||
conn->location = ogs_strdup((char *)ptr + strlen(OGS_SBI_LOCATION) + 2);
|
||||
if (strncmp(ptr, OGS_SBI_LOCATION, strlen(OGS_SBI_LOCATION)) == 0) {
|
||||
/* ptr : "Location: http://xxx/xxx/xxx\r\n"
|
||||
We need to truncate "Location" + ": " + "\r\n" in 'ptr' string */
|
||||
int len = strlen(ptr) - strlen(OGS_SBI_LOCATION) - 2 - 2;
|
||||
if (len) {
|
||||
/* Only copy http://xxx/xxx/xxx" from 'ptr' string */
|
||||
conn->location = ogs_memdup(
|
||||
(char *)ptr + strlen(OGS_SBI_LOCATION) + 2, len+1);
|
||||
conn->location[len] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (nmemb*size);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ typedef struct ogs_sbi_client_s {
|
|||
unsigned int reference_count; /* reference count for memory free */
|
||||
} ogs_sbi_client_t;
|
||||
|
||||
typedef struct ogs_sbi_nf_instance_s ogs_sbi_nf_instance_t;
|
||||
|
||||
void ogs_sbi_client_init(int num_of_sockinfo_pool, int num_of_connection_pool);
|
||||
void ogs_sbi_client_final(void);
|
||||
|
||||
|
@ -66,6 +68,9 @@ ogs_sbi_client_t *ogs_sbi_client_find(ogs_sockaddr_t *addr);
|
|||
|
||||
void ogs_sbi_client_send_request(
|
||||
ogs_sbi_client_t *client, ogs_sbi_request_t *request, void *data);
|
||||
void ogs_sbi_client_send_request_to_nf_instance(
|
||||
ogs_sbi_nf_instance_t *nf_instance,
|
||||
ogs_sbi_request_t *request, void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -907,23 +907,28 @@ bool ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance)
|
|||
}
|
||||
|
||||
ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
|
||||
ogs_sbi_nf_instance_t *nf_instance, char *name)
|
||||
ogs_sbi_nf_instance_t *nf_instance, char *name, char *version)
|
||||
{
|
||||
ogs_sbi_nf_service_t *nf_service = NULL;
|
||||
int i;
|
||||
|
||||
ogs_assert(nf_instance);
|
||||
ogs_assert(name);
|
||||
ogs_assert(version);
|
||||
|
||||
ogs_list_for_each(&nf_instance->nf_service_list, nf_service) {
|
||||
ogs_assert(nf_service->name);
|
||||
if (strcmp(nf_service->name, name) == 0)
|
||||
break;
|
||||
if (strcmp(nf_service->name, name) == 0) {
|
||||
for (i = 0; i < nf_service->num_of_version; i++) {
|
||||
if (strcmp(nf_service->versions[i].in_uri, version) == 0) {
|
||||
return nf_service->client;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nf_service)
|
||||
return nf_service->client;
|
||||
else
|
||||
return nf_instance->client;
|
||||
ogs_error("[Fallback] Cannot find NF service[%s:%s]", name, version);
|
||||
return nf_instance->client;
|
||||
}
|
||||
|
||||
ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_nf_type(
|
||||
|
@ -939,6 +944,21 @@ ogs_sbi_nf_instance_t *ogs_sbi_nf_instance_find_by_nf_type(
|
|||
return nf_instance;
|
||||
}
|
||||
|
||||
void ogs_sbi_object_free(ogs_sbi_object_t *sbi_object)
|
||||
{
|
||||
int i;
|
||||
|
||||
ogs_assert(sbi_object);
|
||||
|
||||
for (i = 0; i < OGS_SBI_MAX_NF_TYPE; i++) {
|
||||
if (sbi_object->nf_types[i].nf_instance)
|
||||
ogs_sbi_nf_instance_remove(sbi_object->nf_types[i].nf_instance);
|
||||
}
|
||||
|
||||
if (sbi_object->request)
|
||||
ogs_sbi_request_free(sbi_object->request);
|
||||
}
|
||||
|
||||
ogs_sbi_subscription_t *ogs_sbi_subscription_add(void)
|
||||
{
|
||||
ogs_sbi_subscription_t *subscription = NULL;
|
||||
|
|
|
@ -104,6 +104,23 @@ typedef struct ogs_sbi_nf_types_s {
|
|||
ogs_sbi_nf_instance_t *nf_instance;
|
||||
} ogs_sbi_nf_types_t[OGS_SBI_MAX_NF_TYPE];
|
||||
|
||||
typedef struct ogs_sbi_object_s {
|
||||
ogs_lnode_t lnode;
|
||||
|
||||
struct {
|
||||
ogs_timer_t *timer;
|
||||
ogs_time_t duration;
|
||||
} client_wait;
|
||||
|
||||
OpenAPI_nf_type_e nf_type;
|
||||
ogs_sbi_request_t *request;
|
||||
|
||||
ogs_sbi_nf_types_t nf_types;
|
||||
|
||||
ogs_sbi_session_t *session;
|
||||
void *nf_state_registered;
|
||||
} ogs_sbi_object_t;
|
||||
|
||||
typedef struct ogs_sbi_nf_service_s {
|
||||
ogs_lnode_t lnode;
|
||||
|
||||
|
@ -152,6 +169,20 @@ typedef struct ogs_sbi_subscription_s {
|
|||
void *client; /* only used in SERVER */
|
||||
} ogs_sbi_subscription_t;
|
||||
|
||||
typedef struct ogs_sbi_discover_s {
|
||||
OpenAPI_nf_type_e nf_type;
|
||||
|
||||
char *uri;
|
||||
struct {
|
||||
char *name;
|
||||
} service;
|
||||
struct {
|
||||
char *version;
|
||||
} api;
|
||||
|
||||
ogs_sbi_request_t *request;
|
||||
} ogs_sbi_discover_t;
|
||||
|
||||
void ogs_sbi_context_init(ogs_pollset_t *pollset, ogs_timer_mgr_t *timer_mgr);
|
||||
void ogs_sbi_context_final(void);
|
||||
ogs_sbi_context_t *ogs_sbi_self(void);
|
||||
|
@ -181,12 +212,14 @@ ogs_sbi_nf_service_t *ogs_sbi_nf_service_build_default(
|
|||
ogs_sbi_nf_instance_t *nf_instance, char *name);
|
||||
|
||||
ogs_sbi_client_t *ogs_sbi_client_find_by_service_name(
|
||||
ogs_sbi_nf_instance_t *nf_instance, char *name);
|
||||
ogs_sbi_nf_instance_t *nf_instance, char *name, char *version);
|
||||
|
||||
bool ogs_sbi_client_associate(ogs_sbi_nf_instance_t *nf_instance);
|
||||
bool ogs_sbi_nf_types_associate(
|
||||
ogs_sbi_nf_types_t nf_types, OpenAPI_nf_type_e nf_type, void *state);
|
||||
|
||||
void ogs_sbi_object_free(ogs_sbi_object_t *sbi_object);
|
||||
|
||||
ogs_sbi_subscription_t *ogs_sbi_subscription_add(void);
|
||||
void ogs_sbi_subscription_set_id(
|
||||
ogs_sbi_subscription_t *subscription, char *id);
|
||||
|
|
|
@ -0,0 +1,309 @@
|
|||
/* Based on node-formidable by Felix Geisendorfer
|
||||
* Igor Afonov - afonov@gmail.com - 2012
|
||||
* MIT License - http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
#include "ogs-core.h"
|
||||
#include "multipart_parser.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
static void multipart_log(const char * format, ...)
|
||||
{
|
||||
#ifdef DEBUG_MULTIPART
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
fprintf(stderr, "[HTTP_MULTIPART_PARSER] %s:%d: ", __FILE__, __LINE__);
|
||||
vfprintf(stderr, format, args);
|
||||
fprintf(stderr, "\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
#define NOTIFY_CB(FOR) \
|
||||
do { \
|
||||
if (p->settings->on_##FOR) { \
|
||||
if (p->settings->on_##FOR(p) != 0) { \
|
||||
return i; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define EMIT_DATA_CB(FOR, ptr, len) \
|
||||
do { \
|
||||
if (p->settings->on_##FOR) { \
|
||||
if (p->settings->on_##FOR(p, ptr, len) != 0) { \
|
||||
return i; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define LF 10
|
||||
#define CR 13
|
||||
|
||||
struct multipart_parser {
|
||||
void * data;
|
||||
|
||||
size_t index;
|
||||
size_t boundary_length;
|
||||
|
||||
unsigned char state;
|
||||
|
||||
const multipart_parser_settings* settings;
|
||||
|
||||
char* lookbehind;
|
||||
char multipart_boundary[1];
|
||||
};
|
||||
|
||||
enum state {
|
||||
s_uninitialized = 1,
|
||||
s_start,
|
||||
s_start_boundary,
|
||||
s_header_field_start,
|
||||
s_header_field,
|
||||
s_headers_almost_done,
|
||||
s_header_value_start,
|
||||
s_header_value,
|
||||
s_header_value_almost_done,
|
||||
s_part_data_start,
|
||||
s_part_data,
|
||||
s_part_data_almost_boundary,
|
||||
s_part_data_boundary,
|
||||
s_part_data_almost_end,
|
||||
s_part_data_end,
|
||||
s_part_data_final_hyphen,
|
||||
s_end
|
||||
};
|
||||
|
||||
multipart_parser* multipart_parser_init
|
||||
(const char *boundary, const multipart_parser_settings* settings) {
|
||||
|
||||
multipart_parser* p = malloc(sizeof(multipart_parser) +
|
||||
strlen(boundary) +
|
||||
strlen(boundary) + 9);
|
||||
|
||||
strcpy(p->multipart_boundary, boundary);
|
||||
p->boundary_length = strlen(boundary);
|
||||
|
||||
p->lookbehind = (p->multipart_boundary + p->boundary_length + 1);
|
||||
|
||||
p->index = 0;
|
||||
p->state = s_start;
|
||||
p->settings = settings;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void multipart_parser_free(multipart_parser* p) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
void multipart_parser_set_data(multipart_parser *p, void *data) {
|
||||
p->data = data;
|
||||
}
|
||||
|
||||
void *multipart_parser_get_data(multipart_parser *p) {
|
||||
return p->data;
|
||||
}
|
||||
|
||||
size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len) {
|
||||
size_t i = 0;
|
||||
size_t mark = 0;
|
||||
char c, cl;
|
||||
int is_last = 0;
|
||||
|
||||
while(i < len) {
|
||||
c = buf[i];
|
||||
is_last = (i == (len - 1));
|
||||
switch (p->state) {
|
||||
case s_start:
|
||||
multipart_log("s_start");
|
||||
p->index = 0;
|
||||
p->state = s_start_boundary;
|
||||
|
||||
/* fallthrough */
|
||||
OGS_GNUC_FALLTHROUGH;
|
||||
case s_start_boundary:
|
||||
multipart_log("s_start_boundary");
|
||||
if (p->index == p->boundary_length) {
|
||||
if (c != CR) {
|
||||
return i;
|
||||
}
|
||||
p->index++;
|
||||
break;
|
||||
} else if (p->index == (p->boundary_length + 1)) {
|
||||
if (c != LF) {
|
||||
return i;
|
||||
}
|
||||
p->index = 0;
|
||||
NOTIFY_CB(part_data_begin);
|
||||
p->state = s_header_field_start;
|
||||
break;
|
||||
}
|
||||
if (c != p->multipart_boundary[p->index]) {
|
||||
return i;
|
||||
}
|
||||
p->index++;
|
||||
break;
|
||||
|
||||
case s_header_field_start:
|
||||
multipart_log("s_header_field_start");
|
||||
mark = i;
|
||||
p->state = s_header_field;
|
||||
|
||||
/* fallthrough */
|
||||
OGS_GNUC_FALLTHROUGH;
|
||||
case s_header_field:
|
||||
multipart_log("s_header_field");
|
||||
if (c == CR) {
|
||||
p->state = s_headers_almost_done;
|
||||
break;
|
||||
}
|
||||
|
||||
if (c == ':') {
|
||||
EMIT_DATA_CB(header_field, buf + mark, i - mark);
|
||||
p->state = s_header_value_start;
|
||||
break;
|
||||
}
|
||||
|
||||
cl = tolower(c);
|
||||
if ((c != '-') && (cl < 'a' || cl > 'z')) {
|
||||
multipart_log("invalid character in header name");
|
||||
return i;
|
||||
}
|
||||
if (is_last)
|
||||
EMIT_DATA_CB(header_field, buf + mark, (i - mark) + 1);
|
||||
break;
|
||||
|
||||
case s_headers_almost_done:
|
||||
multipart_log("s_headers_almost_done");
|
||||
if (c != LF) {
|
||||
return i;
|
||||
}
|
||||
|
||||
p->state = s_part_data_start;
|
||||
break;
|
||||
|
||||
case s_header_value_start:
|
||||
multipart_log("s_header_value_start");
|
||||
if (c == ' ') {
|
||||
break;
|
||||
}
|
||||
|
||||
mark = i;
|
||||
p->state = s_header_value;
|
||||
|
||||
/* fallthrough */
|
||||
OGS_GNUC_FALLTHROUGH;
|
||||
case s_header_value:
|
||||
multipart_log("s_header_value");
|
||||
if (c == CR) {
|
||||
EMIT_DATA_CB(header_value, buf + mark, i - mark);
|
||||
p->state = s_header_value_almost_done;
|
||||
break;
|
||||
}
|
||||
if (is_last)
|
||||
EMIT_DATA_CB(header_value, buf + mark, (i - mark) + 1);
|
||||
break;
|
||||
|
||||
case s_header_value_almost_done:
|
||||
multipart_log("s_header_value_almost_done");
|
||||
if (c != LF) {
|
||||
return i;
|
||||
}
|
||||
p->state = s_header_field_start;
|
||||
break;
|
||||
|
||||
case s_part_data_start:
|
||||
multipart_log("s_part_data_start");
|
||||
NOTIFY_CB(headers_complete);
|
||||
mark = i;
|
||||
p->state = s_part_data;
|
||||
|
||||
/* fallthrough */
|
||||
OGS_GNUC_FALLTHROUGH;
|
||||
case s_part_data:
|
||||
multipart_log("s_part_data");
|
||||
if (c == CR) {
|
||||
EMIT_DATA_CB(part_data, buf + mark, i - mark);
|
||||
mark = i;
|
||||
p->state = s_part_data_almost_boundary;
|
||||
p->lookbehind[0] = CR;
|
||||
break;
|
||||
}
|
||||
if (is_last)
|
||||
EMIT_DATA_CB(part_data, buf + mark, (i - mark) + 1);
|
||||
break;
|
||||
|
||||
case s_part_data_almost_boundary:
|
||||
multipart_log("s_part_data_almost_boundary");
|
||||
if (c == LF) {
|
||||
p->state = s_part_data_boundary;
|
||||
p->lookbehind[1] = LF;
|
||||
p->index = 0;
|
||||
break;
|
||||
}
|
||||
EMIT_DATA_CB(part_data, p->lookbehind, 1);
|
||||
p->state = s_part_data;
|
||||
mark = i --;
|
||||
break;
|
||||
|
||||
case s_part_data_boundary:
|
||||
multipart_log("s_part_data_boundary");
|
||||
if (p->multipart_boundary[p->index] != c) {
|
||||
EMIT_DATA_CB(part_data, p->lookbehind, 2 + p->index);
|
||||
p->state = s_part_data;
|
||||
mark = i --;
|
||||
break;
|
||||
}
|
||||
p->lookbehind[2 + p->index] = c;
|
||||
if ((++ p->index) == p->boundary_length) {
|
||||
NOTIFY_CB(part_data_end);
|
||||
p->state = s_part_data_almost_end;
|
||||
}
|
||||
break;
|
||||
|
||||
case s_part_data_almost_end:
|
||||
multipart_log("s_part_data_almost_end");
|
||||
if (c == '-') {
|
||||
p->state = s_part_data_final_hyphen;
|
||||
break;
|
||||
}
|
||||
if (c == CR) {
|
||||
p->state = s_part_data_end;
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
||||
case s_part_data_final_hyphen:
|
||||
multipart_log("s_part_data_final_hyphen");
|
||||
if (c == '-') {
|
||||
NOTIFY_CB(body_end);
|
||||
p->state = s_end;
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
||||
case s_part_data_end:
|
||||
multipart_log("s_part_data_end");
|
||||
if (c == LF) {
|
||||
p->state = s_header_field_start;
|
||||
NOTIFY_CB(part_data_begin);
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
|
||||
case s_end:
|
||||
multipart_log("s_end: %02X", (int) c);
|
||||
break;
|
||||
|
||||
default:
|
||||
multipart_log("Multipart parser unrecoverable error");
|
||||
return 0;
|
||||
}
|
||||
++ i;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/* Based on node-formidable by Felix Geisendorfer
|
||||
* Igor Afonov - afonov@gmail.com - 2012
|
||||
* MIT License - http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
#ifndef _multipart_parser_h
|
||||
#define _multipart_parser_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct multipart_parser multipart_parser;
|
||||
typedef struct multipart_parser_settings multipart_parser_settings;
|
||||
typedef struct multipart_parser_state multipart_parser_state;
|
||||
|
||||
typedef int (*multipart_data_cb) (multipart_parser*, const char *at, size_t length);
|
||||
typedef int (*multipart_notify_cb) (multipart_parser*);
|
||||
|
||||
struct multipart_parser_settings {
|
||||
multipart_data_cb on_header_field;
|
||||
multipart_data_cb on_header_value;
|
||||
multipart_data_cb on_part_data;
|
||||
|
||||
multipart_notify_cb on_part_data_begin;
|
||||
multipart_notify_cb on_headers_complete;
|
||||
multipart_notify_cb on_part_data_end;
|
||||
multipart_notify_cb on_body_end;
|
||||
};
|
||||
|
||||
multipart_parser* multipart_parser_init
|
||||
(const char *boundary, const multipart_parser_settings* settings);
|
||||
|
||||
void multipart_parser_free(multipart_parser* p);
|
||||
|
||||
size_t multipart_parser_execute(multipart_parser* p, const char *buf, size_t len);
|
||||
|
||||
void multipart_parser_set_data(multipart_parser* p, void* data);
|
||||
void * multipart_parser_get_data(multipart_parser* p);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -18,21 +18,20 @@
|
|||
*/
|
||||
|
||||
#include "ogs-sbi.h"
|
||||
|
||||
#include "sbi-private.h"
|
||||
#include "yuarel.h"
|
||||
|
||||
static char *ogs_uridup(bool https, ogs_sockaddr_t *addr, ogs_sbi_header_t *h)
|
||||
{
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
char url[OGS_HUGE_LEN];
|
||||
char uri[OGS_HUGE_LEN];
|
||||
char *p, *last;
|
||||
int i;
|
||||
|
||||
ogs_assert(addr);
|
||||
ogs_assert(h);
|
||||
|
||||
p = url;
|
||||
last = url + OGS_HUGE_LEN;
|
||||
p = uri;
|
||||
last = uri + OGS_HUGE_LEN;
|
||||
|
||||
/* HTTP scheme is selected based on TLS information */
|
||||
if (https == true)
|
||||
|
@ -63,7 +62,7 @@ static char *ogs_uridup(bool https, ogs_sockaddr_t *addr, ogs_sbi_header_t *h)
|
|||
h->resource.component[i]; i++)
|
||||
p = ogs_slprintf(p, last, "/%s", h->resource.component[i]);
|
||||
|
||||
return ogs_strdup(url);
|
||||
return ogs_strdup(uri);
|
||||
}
|
||||
|
||||
char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h)
|
||||
|
@ -125,11 +124,11 @@ static char *url_decode(const char *str)
|
|||
}
|
||||
}
|
||||
|
||||
char *ogs_sbi_parse_url(char *url, const char *delim, char **saveptr)
|
||||
char *ogs_sbi_parse_uri(char *uri, const char *delim, char **saveptr)
|
||||
{
|
||||
char *item = NULL;
|
||||
|
||||
item = url_decode(strtok_r(url, delim, saveptr));
|
||||
item = url_decode(strtok_r(uri, delim, saveptr));
|
||||
if (!item) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -189,3 +188,45 @@ ogs_sockaddr_t *ogs_sbi_getaddr_from_uri(char *uri)
|
|||
ogs_free(p);
|
||||
return addr;
|
||||
}
|
||||
|
||||
char *ogs_sbi_bitrate_to_string(uint64_t bitrate, int unit)
|
||||
{
|
||||
if (unit == OGS_SBI_BITRATE_KBPS) {
|
||||
return ogs_msprintf("%lld Kbps",
|
||||
(long long)bitrate / 1024);
|
||||
} else if (unit == OGS_SBI_BITRATE_MBPS) {
|
||||
return ogs_msprintf("%lld Mbps",
|
||||
(long long)bitrate / 1024 / 1024);
|
||||
} else if (unit == OGS_SBI_BITRATE_GBPS) {
|
||||
return ogs_msprintf("%lld Gbps",
|
||||
(long long)bitrate / 1024 / 1024 / 1024);
|
||||
} else if (unit == OGS_SBI_BITRATE_TBPS) {
|
||||
return ogs_msprintf("%lld Tbps",
|
||||
(long long)bitrate / 1024 / 1024 / 1024 / 1024);
|
||||
}
|
||||
|
||||
return ogs_msprintf("%lld bps", (long long)bitrate);
|
||||
}
|
||||
|
||||
uint64_t ogs_sbi_bitrate_from_string(char *str)
|
||||
{
|
||||
char *unit = NULL;
|
||||
uint64_t bitrate = 0;
|
||||
ogs_assert(str);
|
||||
|
||||
unit = strrchr(str, ' ');
|
||||
bitrate = atoll(str);
|
||||
|
||||
SWITCH(unit+1)
|
||||
CASE("Kbps")
|
||||
return bitrate * 1024;
|
||||
CASE("Mbps")
|
||||
return bitrate * 1024 * 1024;
|
||||
CASE("Gbps")
|
||||
return bitrate * 1024 * 1024 * 1024;
|
||||
CASE("Tbps")
|
||||
return bitrate * 1024 * 1024 * 1024 * 1024;
|
||||
DEFAULT
|
||||
END
|
||||
return bitrate;
|
||||
}
|
||||
|
|
|
@ -35,9 +35,17 @@ typedef struct ogs_sbi_header_s ogs_sbi_header_t;
|
|||
char *ogs_sbi_server_uri(ogs_sbi_server_t *server, ogs_sbi_header_t *h);
|
||||
char *ogs_sbi_client_uri(ogs_sbi_client_t *client, ogs_sbi_header_t *h);
|
||||
|
||||
char *ogs_sbi_parse_url(char *url, const char *delim, char **saveptr);
|
||||
char *ogs_sbi_parse_uri(char *uri, const char *delim, char **saveptr);
|
||||
ogs_sockaddr_t *ogs_sbi_getaddr_from_uri(char *uri);
|
||||
|
||||
#define OGS_SBI_BITRATE_BPS 0
|
||||
#define OGS_SBI_BITRATE_KBPS 1
|
||||
#define OGS_SBI_BITRATE_MBPS 2
|
||||
#define OGS_SBI_BITRATE_GBPS 3
|
||||
#define OGS_SBI_BITRATE_TBPS 4
|
||||
char *ogs_sbi_bitrate_to_string(uint64_t bitrate, int unit);
|
||||
uint64_t ogs_sbi_bitrate_from_string(char *str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
subdir('openapi')
|
||||
|
||||
libsbi_sources = files('''
|
||||
contrib/multipart_parser.c
|
||||
custom/links.c
|
||||
|
||||
yuarel.c
|
||||
|
@ -47,6 +48,7 @@ libsbi = library('ogssbi',
|
|||
c_args : sbi_cc_flags,
|
||||
include_directories : [libsbi_inc, libinc],
|
||||
dependencies : [libcore_dep,
|
||||
libcrypt_dep,
|
||||
libapp_dep,
|
||||
libsbi_openapi_dep,
|
||||
libgnutls_dep,
|
||||
|
@ -58,6 +60,7 @@ libsbi_dep = declare_dependency(
|
|||
link_with : libsbi,
|
||||
include_directories : [libsbi_inc, libinc],
|
||||
dependencies : [libcore_dep,
|
||||
libcrypt_dep,
|
||||
libapp_dep,
|
||||
libsbi_openapi_dep,
|
||||
libgnutls_dep,
|
||||
|
|
1609
lib/sbi/message.c
1609
lib/sbi/message.c
File diff suppressed because it is too large
Load Diff
|
@ -75,8 +75,10 @@ extern "C" {
|
|||
#define OGS_SBI_HTTP_METHOD_PUT "PUT"
|
||||
#define OGS_SBI_HTTP_METHOD_OPTIONS "OPTIONS"
|
||||
|
||||
#define OGS_SBI_API_VERSION "v1"
|
||||
#define OGS_SBI_API_FULL_VERSION "1.0.0"
|
||||
#define OGS_SBI_API_V1 "v1"
|
||||
#define OGS_SBI_API_V1_0_0 "1.0.0"
|
||||
#define OGS_SBI_API_V2 "v2"
|
||||
#define OGS_SBI_API_V2_0_0 "2.0.0"
|
||||
|
||||
#define OGS_SBI_SERVICE_NAME_NNRF_NFM "nnrf-nfm"
|
||||
#define OGS_SBI_SERVICE_NAME_NNRF_DISC "nnrf-disc"
|
||||
|
@ -91,11 +93,18 @@ extern "C" {
|
|||
#define OGS_SBI_RESOURCE_NAME_EAP_SESSION "eap-session"
|
||||
|
||||
#define OGS_SBI_SERVICE_NAME_NUDM_SDM "nudm-sdm"
|
||||
#define OGS_SBI_SERVICE_NAME_NUDM_UECM "nudm-uecm"
|
||||
#define OGS_SBI_RESOURCE_NAME_AM_DATA "am-data"
|
||||
#define OGS_SBI_RESOURCE_NAME_SM_DATA "sm-data"
|
||||
#define OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA "smf-select-data"
|
||||
#define OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA "ue-context-in-smf-data"
|
||||
#define OGS_SBI_SERVICE_NAME_NUDM_UEAU "nudm-ueau"
|
||||
#define OGS_SBI_RESOURCE_NAME_SECURITY_INFORMATION "security-information"
|
||||
#define OGS_SBI_RESOURCE_NAME_GENERATE_AUTH_DATA "generate-auth-data"
|
||||
#define OGS_SBI_RESOURCE_NAME_AUTH_EVENTS "auth-events"
|
||||
#define OGS_SBI_SERVICE_NAME_NUDM_UECM "nudm-uecm"
|
||||
#define OGS_SBI_RESOURCE_NAME_REGISTRATIONS "registrations"
|
||||
#define OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS "amf-3gpp-access"
|
||||
#define OGS_SBI_RESOURCE_NAME_DEREG_NOTIFY "dereg-notify"
|
||||
|
||||
#define OGS_SBI_SERVICE_NAME_NUDR_DR "nudr-dr"
|
||||
#define OGS_SBI_RESOURCE_NAME_SUBSCRIPTION_DATA "subscription-data"
|
||||
|
@ -103,31 +112,66 @@ extern "C" {
|
|||
#define OGS_SBI_RESOURCE_NAME_AUTHENTICATION_SUBSCRIPTION \
|
||||
"authentication-subscription"
|
||||
#define OGS_SBI_RESOURCE_NAME_AUTHENTICATION_STATUS "authentication-status"
|
||||
#define OGS_SBI_RESOURCE_NAME_CONTEXT_DATA "context-data"
|
||||
#define OGS_SBI_RESOURCE_NAME_PROVISIONED_DATA "provisioned-data"
|
||||
|
||||
#define OGS_SBI_SERVICE_NAME_NSMF_PDUSESSION "nsmf-pdusession"
|
||||
#define OGS_SBI_RESOURCE_NAME_SM_CONTEXTS "sm-contexts"
|
||||
#define OGS_SBI_SERVICE_NAME_NSMF_EVENT_EXPOSURE "nsmf-event-exposure"
|
||||
#define OGS_SBI_RESOURCE_NAME_MODIFY "modify"
|
||||
#define OGS_SBI_RESOURCE_NAME_RELEASE "release"
|
||||
|
||||
#define OGS_SBI_SERVICE_NAME_NAMF_COMM "namf-comm"
|
||||
#define OGS_SBI_SERVICE_NAME_NAMF_CALLBACK "namf-callback"
|
||||
#define OGS_SBI_RESOURCE_NAME_UE_CONTEXTS "ue-contexts"
|
||||
#define OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES "n1-n2-messages"
|
||||
#define OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS "sm-context-status"
|
||||
|
||||
#define OGS_SBI_PARAM_NF_TYPE "nf-type"
|
||||
#define OGS_SBI_PARAM_TARGET_NF_TYPE "target-nf-type"
|
||||
#define OGS_SBI_PARAM_REQUESTER_NF_TYPE "requester-nf-type"
|
||||
#define OGS_SBI_PARAM_LIMIT "limit"
|
||||
#define OGS_SBI_PARAM_DNN "dnn"
|
||||
#define OGS_SBI_PARAM_PLMN_ID "plmn-id"
|
||||
#define OGS_SBI_PARAM_S_NSSAI "single-nssai"
|
||||
|
||||
#define OGS_SBI_ACCEPT "Accept"
|
||||
#define OGS_SBI_ACCEPT_ENCODING "Accept-Encoding"
|
||||
#define OGS_SBI_CONTENT_TYPE "Content-Type"
|
||||
#define OGS_SBI_LOCATION "Location"
|
||||
#define OGS_SBI_CONTENT_JSON_TYPE "application/json"
|
||||
#define OGS_SBI_CONTENT_PROBLEM_TYPE "application/problem+json"
|
||||
#define OGS_SBI_CONTENT_PATCH_TYPE \
|
||||
"application/json-patch+json"
|
||||
#define OGS_SBI_CONTENT_3GPPHAL_TYPE "application/3gppHal+json"
|
||||
#define OGS_SBI_APPLICATION_TYPE "application"
|
||||
#define OGS_SBI_APPLICATION_JSON_TYPE "json"
|
||||
#define OGS_SBI_APPLICATION_PROBLEM_TYPE "problem+json"
|
||||
#define OGS_SBI_APPLICATION_PATCH_TYPE "json-patch+json"
|
||||
#define OGS_SBI_APPLICATION_3GPPHAL_TYPE "3gppHal+json"
|
||||
#define OGS_SBI_APPLICATION_5GNAS_TYPE "vnd.3gpp.5gnas"
|
||||
#define OGS_SBI_APPLICATION_NGAP_TYPE "vnd.3gpp.ngap"
|
||||
|
||||
typedef struct ogs_sbi_request_s ogs_sbi_request_t;
|
||||
typedef struct ogs_sbi_response_s ogs_sbi_response_t;
|
||||
#define OGS_SBI_CONTENT_JSON_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_JSON_TYPE
|
||||
#define OGS_SBI_CONTENT_PROBLEM_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_PROBLEM_TYPE
|
||||
#define OGS_SBI_CONTENT_PATCH_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_PATCH_TYPE
|
||||
#define OGS_SBI_CONTENT_3GPPHAL_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_3GPPHAL_TYPE
|
||||
#define OGS_SBI_CONTENT_5GNAS_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_5GNAS_TYPE
|
||||
#define OGS_SBI_CONTENT_NGAP_TYPE \
|
||||
OGS_SBI_APPLICATION_TYPE "/" OGS_SBI_APPLICATION_NGAP_TYPE
|
||||
|
||||
#define OGS_SBI_MULTIPART_TYPE "multipart"
|
||||
#define OGS_SBI_MULTIPART_RELATED_TYPE "related"
|
||||
#define OGS_SBI_CONTENT_MULTIPART_TYPE \
|
||||
OGS_SBI_MULTIPART_TYPE "/" OGS_SBI_MULTIPART_RELATED_TYPE
|
||||
|
||||
#define OGS_SBI_CONTENT_ID "Content-Id"
|
||||
#define OGS_SBI_CONTENT_5GNAS_SM_ID "5gnas-sm"
|
||||
#define OGS_SBI_CONTENT_NGAP_SM_ID "ngap-sm"
|
||||
|
||||
typedef struct ogs_sbi_header_s {
|
||||
char *method;
|
||||
char *url;
|
||||
char *uri;
|
||||
|
||||
struct {
|
||||
char *name;
|
||||
|
@ -144,6 +188,13 @@ typedef struct ogs_sbi_header_s {
|
|||
|
||||
} ogs_sbi_header_t;
|
||||
|
||||
typedef struct ogs_sbi_part_s {
|
||||
char *content_id;
|
||||
char *content_type;
|
||||
|
||||
ogs_pkbuf_t *pkbuf;
|
||||
} ogs_sbi_part_t;
|
||||
|
||||
typedef struct ogs_sbi_message_s {
|
||||
ogs_sbi_header_t h;
|
||||
|
||||
|
@ -160,6 +211,11 @@ typedef struct ogs_sbi_message_s {
|
|||
OpenAPI_nf_type_e requester_nf_type;
|
||||
OpenAPI_nf_type_e nf_type;
|
||||
int limit;
|
||||
char *dnn;
|
||||
bool plmn_id_presence;
|
||||
ogs_plmn_id_t plmn_id;
|
||||
bool s_nssai_presence;
|
||||
ogs_s_nssai_t s_nssai;
|
||||
} param;
|
||||
|
||||
int res_status;
|
||||
|
@ -179,10 +235,58 @@ typedef struct ogs_sbi_message_s {
|
|||
OpenAPI_confirmation_data_t *ConfirmationData;
|
||||
OpenAPI_confirmation_data_response_t *ConfirmationDataResponse;
|
||||
OpenAPI_auth_event_t *AuthEvent;
|
||||
OpenAPI_amf3_gpp_access_registration_t *Amf3GppAccessRegistration;
|
||||
OpenAPI_access_and_mobility_subscription_data_t
|
||||
*AccessAndMobilitySubscriptionData;
|
||||
OpenAPI_smf_selection_subscription_data_t *SmfSelectionSubscriptionData;
|
||||
OpenAPI_ue_context_in_smf_data_t *UeContextInSmfData;
|
||||
OpenAPI_sm_context_create_data_t *SmContextCreateData;
|
||||
OpenAPI_sm_context_created_data_t *SmContextCreatedData;
|
||||
OpenAPI_sm_context_create_error_t *SmContextCreateError;
|
||||
OpenAPI_sm_context_update_data_t *SmContextUpdateData;
|
||||
OpenAPI_sm_context_updated_data_t *SmContextUpdatedData;
|
||||
OpenAPI_sm_context_update_error_t *SmContextUpdateError;
|
||||
OpenAPI_sm_context_release_data_t *SmContextReleaseData;
|
||||
OpenAPI_sm_context_released_data_t *SmContextReleasedData;
|
||||
OpenAPI_session_management_subscription_data_t *
|
||||
SessionManagementSubscriptionData;
|
||||
OpenAPI_n1_n2_message_transfer_req_data_t *N1N2MessageTransferReqData;
|
||||
OpenAPI_n1_n2_message_transfer_rsp_data_t *N1N2MessageTransferRspData;
|
||||
|
||||
ogs_sbi_links_t *links;
|
||||
|
||||
#define OGS_SBI_MAX_NUM_OF_PART 8
|
||||
int num_of_part;
|
||||
ogs_sbi_part_t part[OGS_SBI_MAX_NUM_OF_PART];
|
||||
} ogs_sbi_message_t;
|
||||
|
||||
typedef struct ogs_sbi_http_message_s {
|
||||
ogs_hash_t *params;
|
||||
ogs_hash_t *headers;
|
||||
|
||||
char *content;
|
||||
size_t content_length;
|
||||
|
||||
int num_of_part;
|
||||
ogs_sbi_part_t part[OGS_SBI_MAX_NUM_OF_PART];
|
||||
} ogs_sbi_http_message_t;
|
||||
|
||||
typedef struct ogs_sbi_request_s {
|
||||
ogs_sbi_header_t h;
|
||||
ogs_sbi_http_message_t http;
|
||||
|
||||
/* Used in microhttpd */
|
||||
bool suspended;
|
||||
ogs_poll_t *poll;
|
||||
} ogs_sbi_request_t;
|
||||
|
||||
typedef struct ogs_sbi_response_s {
|
||||
ogs_sbi_header_t h;
|
||||
ogs_sbi_http_message_t http;
|
||||
|
||||
int status;
|
||||
} ogs_sbi_response_t;
|
||||
|
||||
void ogs_sbi_message_init(int num_of_request_pool, int num_of_response_pool);
|
||||
void ogs_sbi_message_final(void);
|
||||
|
||||
|
@ -204,6 +308,13 @@ int ogs_sbi_parse_response(
|
|||
void ogs_sbi_header_set(ogs_hash_t *ht, const void *key, const void *val);
|
||||
void *ogs_sbi_header_get(ogs_hash_t *ht, const void *key);
|
||||
|
||||
ogs_pkbuf_t *ogs_sbi_find_part_by_content_id(
|
||||
ogs_sbi_message_t *message, char *content_id);
|
||||
|
||||
int ogs_sbi_parse_header(
|
||||
ogs_sbi_message_t *message, ogs_sbi_header_t *header);
|
||||
void ogs_sbi_header_free(ogs_sbi_header_t *h);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -229,7 +229,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_register(
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_PUT;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES;
|
||||
message.h.resource.component[1] = ogs_sbi_self()->nf_instance_id;
|
||||
|
@ -264,7 +264,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_update(ogs_sbi_nf_instance_t *nf_instance)
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_PATCH;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES;
|
||||
message.h.resource.component[1] = ogs_sbi_self()->nf_instance_id;
|
||||
|
@ -301,7 +301,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_de_register(
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES;
|
||||
message.h.resource.component[1] = nf_instance->id;
|
||||
|
@ -328,7 +328,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
|
||||
|
||||
|
@ -340,7 +340,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
|
|||
|
||||
memset(&header, 0, sizeof(header));
|
||||
header.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
header.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
header.api.version = (char *)OGS_SBI_API_V1;
|
||||
header.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NF_STATUS_NOTIFY;
|
||||
SubscriptionData->nf_status_notification_uri =
|
||||
|
@ -372,7 +372,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_unsubscribe(
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_DELETE;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_NFM;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_SUBSCRIPTIONS;
|
||||
message.h.resource.component[1] = subscription->id;
|
||||
|
@ -395,7 +395,7 @@ ogs_sbi_request_t *ogs_nnrf_disc_build_discover(
|
|||
memset(&message, 0, sizeof(message));
|
||||
message.h.method = (char *)OGS_SBI_HTTP_METHOD_GET;
|
||||
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NNRF_DISC;
|
||||
message.h.api.version = (char *)OGS_SBI_API_VERSION;
|
||||
message.h.api.version = (char *)OGS_SBI_API_V1;
|
||||
message.h.resource.component[0] =
|
||||
(char *)OGS_SBI_RESOURCE_NAME_NF_INSTANCES;
|
||||
|
||||
|
|
|
@ -43,6 +43,21 @@
|
|||
#include "model/confirmation_data.h"
|
||||
#include "model/confirmation_data_response.h"
|
||||
#include "model/auth_event.h"
|
||||
#include "model/amf3_gpp_access_registration.h"
|
||||
#include "model/access_and_mobility_subscription_data.h"
|
||||
#include "model/smf_selection_subscription_data.h"
|
||||
#include "model/ue_context_in_smf_data.h"
|
||||
#include "model/sm_context_create_data.h"
|
||||
#include "model/sm_context_created_data.h"
|
||||
#include "model/sm_context_create_error.h"
|
||||
#include "model/sm_context_update_data.h"
|
||||
#include "model/sm_context_updated_data.h"
|
||||
#include "model/sm_context_update_error.h"
|
||||
#include "model/sm_context_release_data.h"
|
||||
#include "model/sm_context_released_data.h"
|
||||
#include "model/session_management_subscription_data.h"
|
||||
#include "model/n1_n2_message_transfer_req_data.h"
|
||||
#include "model/n1_n2_message_transfer_rsp_data.h"
|
||||
|
||||
#include "custom/links.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ api/**
|
|||
include/apiClient.h
|
||||
|
||||
src/apiClient.c
|
||||
src/binary.c
|
||||
|
||||
unit-test/**
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
OpenAPI_map_t *OpenAPI_map_create(char *key, void *value)
|
||||
{
|
||||
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
|
||||
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
|
||||
OpenAPI_map->key = key;
|
||||
OpenAPI_map->value = value;
|
||||
return OpenAPI_map;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len)
|
||||
{
|
||||
binary_t* ret = malloc(sizeof(struct binary_t));
|
||||
OpenAPI_binary_t* ret = malloc(sizeof(OpenAPI_binary_t));
|
||||
|
||||
ret->len=len;
|
||||
ret->data = malloc(len);
|
||||
|
@ -35,7 +35,7 @@ char *OpenAPI_base64encode(const void *b64_encode_this,
|
|||
(*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail.
|
||||
return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct).
|
||||
#else // OPENSSL
|
||||
#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
|
||||
//#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
|
||||
return NULL;
|
||||
#endif // OPENSSL
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ char *OpenAPI_base64decode(const void *b64_decode_this,
|
|||
*decoded_bytes = decoded_byte_index;
|
||||
return base64_decoded; //Returns base-64 decoded data with trailing null terminator.
|
||||
#else // OPENSSL
|
||||
#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
|
||||
//#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
|
||||
return NULL;
|
||||
#endif // OPENSSL
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef struct OpenAPI_binary_s {
|
||||
uint8_t* data;
|
||||
unsigned int len;
|
||||
char* data;
|
||||
int len;
|
||||
} OpenAPI_binary_t;
|
||||
|
||||
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);
|
||||
|
|
|
@ -236,12 +236,7 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}
|
|||
{{/isBoolean}}
|
||||
{{/required}}
|
||||
{{^required}}
|
||||
{{#isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}} >= 0) {
|
||||
{{/isBoolean}}
|
||||
{{^isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
{{/isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
{{/required}}
|
||||
{{^isContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
|
@ -522,7 +517,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
|
|||
}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(struct binary_t));
|
||||
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(OpenAPI_binary_t));
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if (!cJSON_IsString({{{name}}})) {
|
||||
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
|
||||
|
@ -789,5 +784,39 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
|
|||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_{{classname}}_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_{{classname}}_free(dst);
|
||||
dst = OpenAPI_{{classname}}_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/model}}{{/models}}
|
||||
|
|
|
@ -171,6 +171,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
|
|||
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}});
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON);
|
||||
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}});
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src);
|
||||
{{/isEnum}}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -8,8 +8,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef struct OpenAPI_binary_s {
|
||||
uint8_t* data;
|
||||
unsigned int len;
|
||||
char* data;
|
||||
int len;
|
||||
} OpenAPI_binary_t;
|
||||
|
||||
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
libsbi_openapi_sources = files('''
|
||||
src/list.c
|
||||
src/apiKey.c
|
||||
src/binary.c
|
||||
external/cJSON.c
|
||||
model/object.c
|
||||
model/access_type.c
|
||||
|
@ -463,6 +464,185 @@ libsbi_openapi_sources = files('''
|
|||
model/usage_threshold.c
|
||||
model/v2x_rat_type.c
|
||||
|
||||
model/additional_qos_flow_info.c
|
||||
model/apn_rate_status.c
|
||||
model/cause.c
|
||||
model/cn_assisted_ran_para.c
|
||||
model/ddn_failure_subs.c
|
||||
model/dnai_information.c
|
||||
model/dnn_selection_mode.c
|
||||
model/dynamic5_qi.c
|
||||
model/ebi_arp_mapping.c
|
||||
model/eps_bearer_info.c
|
||||
model/eps_interworking_indication.c
|
||||
model/eps_pdn_cnx_info.c
|
||||
model/exemption_ind.c
|
||||
model/gbr_qos_flow_information.c
|
||||
model/ho_state.c
|
||||
model/hsmf_update_data.c
|
||||
model/hsmf_update_error.c
|
||||
model/hsmf_updated_data.c
|
||||
model/indirect_data_forwarding_tunnel_info.c
|
||||
model/inline_object.c
|
||||
model/inline_object_1.c
|
||||
model/inline_object_2.c
|
||||
model/inline_object_3.c
|
||||
model/inline_object_4.c
|
||||
model/ma_release_indication.c
|
||||
model/max_integrity_protected_data_rate.c
|
||||
model/mme_capabilities.c
|
||||
model/mo_exception_data_flag.c
|
||||
model/mo_exp_data_counter.c
|
||||
model/n2_sm_info_type.c
|
||||
model/n4_information.c
|
||||
model/n4_message_type.c
|
||||
model/ng_ap_cause.c
|
||||
model/ng_ran_target_id.c
|
||||
model/non_dynamic5_qi.c
|
||||
model/notification_cause.c
|
||||
model/notification_control.c
|
||||
model/partial_record_method.c
|
||||
model/pdu_session_create_data.c
|
||||
model/pdu_session_create_error.c
|
||||
model/pdu_session_created_data.c
|
||||
model/pdu_session_notify_item.c
|
||||
model/psa_indication.c
|
||||
model/psa_information.c
|
||||
model/qos_flow_access_type.c
|
||||
model/qos_flow_add_modify_request_item.c
|
||||
model/qos_flow_item.c
|
||||
model/qos_flow_notify_item.c
|
||||
model/qos_flow_profile.c
|
||||
model/qos_flow_release_request_item.c
|
||||
model/qos_flow_setup_item.c
|
||||
model/qos_flow_usage_report.c
|
||||
model/qos_resource_type.c
|
||||
model/ref_to_binary_data.c
|
||||
model/reflective_qo_s_attribute.c
|
||||
model/release_data.c
|
||||
model/released_data.c
|
||||
model/request_indication.c
|
||||
model/request_type.c
|
||||
model/resource_status.c
|
||||
model/roaming_charging_profile.c
|
||||
model/secondary_rat_usage_info.c
|
||||
model/secondary_rat_usage_report.c
|
||||
model/send_mo_data_req_data.c
|
||||
model/sm_context.c
|
||||
model/sm_context_create_data.c
|
||||
model/sm_context_create_error.c
|
||||
model/sm_context_created_data.c
|
||||
model/sm_context_release_data.c
|
||||
model/sm_context_released_data.c
|
||||
model/sm_context_retrieve_data.c
|
||||
model/sm_context_retrieved_data.c
|
||||
model/sm_context_status_notification.c
|
||||
model/sm_context_type.c
|
||||
model/sm_context_update_data.c
|
||||
model/sm_context_update_error.c
|
||||
model/sm_context_updated_data.c
|
||||
model/small_data_rate_status.c
|
||||
model/status_info.c
|
||||
model/status_notification.c
|
||||
model/transfer_mo_data_req_data.c
|
||||
model/transfer_mt_data_add_info.c
|
||||
model/transfer_mt_data_error.c
|
||||
model/transfer_mt_data_req_data.c
|
||||
model/trigger.c
|
||||
model/trigger_category.c
|
||||
model/trigger_type.c
|
||||
model/tunnel_info.c
|
||||
model/ulcl_bp_information.c
|
||||
model/unavailable_access_indication.c
|
||||
model/up_cnx_state.c
|
||||
model/volume_timed_report.c
|
||||
model/vplmn_qos.c
|
||||
model/vsmf_update_data.c
|
||||
model/vsmf_update_error.c
|
||||
model/vsmf_updated_data.c
|
||||
|
||||
model/allowed_nssai.c
|
||||
model/allowed_snssai.c
|
||||
model/amf_event.c
|
||||
model/amf_event_area.c
|
||||
model/amf_event_mode.c
|
||||
model/amf_event_subscription.c
|
||||
model/amf_event_trigger.c
|
||||
model/amf_event_type.c
|
||||
model/amf_status_change_notification.c
|
||||
model/amf_status_change_subscription_data.c
|
||||
model/amf_status_info.c
|
||||
model/area_of_validity.c
|
||||
model/assign_ebi_data.c
|
||||
model/assign_ebi_error.c
|
||||
model/assign_ebi_failed.c
|
||||
model/assigned_ebi_data.c
|
||||
model/ciphering_algorithm.c
|
||||
model/configured_snssai.c
|
||||
model/expected_ue_behavior.c
|
||||
model/integrity_algorithm.c
|
||||
model/key_amf.c
|
||||
model/key_amf_type.c
|
||||
model/ladn_info.c
|
||||
model/location_filter.c
|
||||
model/mm_context.c
|
||||
model/n1_message_container.c
|
||||
model/n1_message_notification.c
|
||||
model/n1_n2_message_transfer_cause.c
|
||||
model/n1_n2_message_transfer_error.c
|
||||
model/n1_n2_message_transfer_req_data.c
|
||||
model/n1_n2_message_transfer_rsp_data.c
|
||||
model/n1_n2_msg_txfr_err_detail.c
|
||||
model/n1_n2_msg_txfr_failure_notification.c
|
||||
model/n2_info_container.c
|
||||
model/n2_info_content.c
|
||||
model/n2_info_notification_rsp_data.c
|
||||
model/n2_info_notify_reason.c
|
||||
model/n2_information_notification.c
|
||||
model/n2_information_transfer_error.c
|
||||
model/n2_information_transfer_req_data.c
|
||||
model/n2_information_transfer_result.c
|
||||
model/n2_information_transfer_rsp_data.c
|
||||
model/n2_ran_information.c
|
||||
model/n2_sm_information.c
|
||||
model/nas_security_mode.c
|
||||
model/ng_ksi.c
|
||||
model/ngap_ie_type.c
|
||||
model/non_ue_n2_info_subscription_create_data.c
|
||||
model/non_ue_n2_info_subscription_created_data.c
|
||||
model/nrppa_information.c
|
||||
model/nsi_information.c
|
||||
model/nssai_mapping.c
|
||||
model/pdu_session_context.c
|
||||
model/policy_req_trigger.c
|
||||
model/pws_error_data.c
|
||||
model/pws_information.c
|
||||
model/pws_response_data.c
|
||||
model/rat_selector.c
|
||||
model/registration_context_container.c
|
||||
model/sbi_binding_level.c
|
||||
model/sc_type.c
|
||||
model/seaf_data.c
|
||||
model/small_data_rate_status_info.c
|
||||
model/smf_change_indication.c
|
||||
model/smf_change_info.c
|
||||
model/status_change.c
|
||||
model/traffic_descriptor.c
|
||||
model/transfer_reason.c
|
||||
model/ue_context.c
|
||||
model/ue_context_create_data.c
|
||||
model/ue_context_create_error.c
|
||||
model/ue_context_created_data.c
|
||||
model/ue_context_release.c
|
||||
model/ue_context_transfer_req_data.c
|
||||
model/ue_context_transfer_rsp_data.c
|
||||
model/ue_context_transfer_status.c
|
||||
model/ue_n1_n2_info_subscription_create_data.c
|
||||
model/ue_n1_n2_info_subscription_created_data.c
|
||||
model/ue_reg_status_update_req_data.c
|
||||
model/ue_reg_status_update_rsp_data.c
|
||||
model/v2x_context.c
|
||||
|
||||
'''.split())
|
||||
|
||||
libsbi_openapi_inc = include_directories('.')
|
||||
|
|
|
@ -16,7 +16,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
char *conn_states_ts,
|
||||
OpenAPI_ue_reachability_t *reachability_status,
|
||||
char *reachability_status_ts,
|
||||
OpenAPI_sms_support_t *sms_over_nas_status,
|
||||
OpenAPI_sms_support_e sms_over_nas_status,
|
||||
char *sms_over_nas_status_ts,
|
||||
int roaming_status,
|
||||
char *roaming_status_ts,
|
||||
|
@ -75,14 +75,10 @@ void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *a
|
|||
ogs_free(access_and_mobility_data->conn_states_ts);
|
||||
OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status);
|
||||
ogs_free(access_and_mobility_data->reachability_status_ts);
|
||||
OpenAPI_sms_support_free(access_and_mobility_data->sms_over_nas_status);
|
||||
ogs_free(access_and_mobility_data->sms_over_nas_status_ts);
|
||||
ogs_free(access_and_mobility_data->roaming_status_ts);
|
||||
OpenAPI_plmn_id_free(access_and_mobility_data->current_plmn);
|
||||
ogs_free(access_and_mobility_data->current_plmn_ts);
|
||||
OpenAPI_list_for_each(access_and_mobility_data->rat_type, node) {
|
||||
OpenAPI_rat_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_data->rat_type);
|
||||
ogs_free(access_and_mobility_data->rat_types_ts);
|
||||
ogs_free(access_and_mobility_data);
|
||||
|
@ -214,13 +210,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
|
|||
}
|
||||
|
||||
if (access_and_mobility_data->sms_over_nas_status) {
|
||||
cJSON *sms_over_nas_status_local_JSON = OpenAPI_sms_support_convertToJSON(access_and_mobility_data->sms_over_nas_status);
|
||||
if (sms_over_nas_status_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "smsOverNasStatus", sms_over_nas_status_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
if (cJSON_AddStringToObject(item, "smsOverNasStatus", OpenAPI_sms_support_ToString(access_and_mobility_data->sms_over_nas_status)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]");
|
||||
goto end;
|
||||
}
|
||||
|
@ -233,7 +223,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_data->roaming_status >= 0) {
|
||||
if (access_and_mobility_data->roaming_status) {
|
||||
if (cJSON_AddBoolToObject(item, "roamingStatus", access_and_mobility_data->roaming_status) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status]");
|
||||
goto end;
|
||||
|
@ -268,21 +258,16 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
|
|||
}
|
||||
|
||||
if (access_and_mobility_data->rat_type) {
|
||||
cJSON *rat_typeList = cJSON_AddArrayToObject(item, "ratType");
|
||||
if (rat_typeList == NULL) {
|
||||
cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType");
|
||||
if (rat_type == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *rat_type_node;
|
||||
if (access_and_mobility_data->rat_type) {
|
||||
OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) {
|
||||
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_type_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(rat_typeList, itemLocal);
|
||||
OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) {
|
||||
if (cJSON_AddStringToObject(rat_type, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)rat_type_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -428,9 +413,13 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
|
||||
cJSON *sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus");
|
||||
|
||||
OpenAPI_sms_support_t *sms_over_nas_status_local_nonprim = NULL;
|
||||
OpenAPI_sms_support_e sms_over_nas_statusVariable;
|
||||
if (sms_over_nas_status) {
|
||||
sms_over_nas_status_local_nonprim = OpenAPI_sms_support_parseFromJSON(sms_over_nas_status);
|
||||
if (!cJSON_IsString(sms_over_nas_status)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status]");
|
||||
goto end;
|
||||
}
|
||||
sms_over_nas_statusVariable = OpenAPI_sms_support_FromString(sms_over_nas_status->valuestring);
|
||||
}
|
||||
|
||||
cJSON *sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs");
|
||||
|
@ -489,13 +478,12 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
rat_typeList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(rat_type_local_nonprimitive, rat_type ) {
|
||||
if (!cJSON_IsObject(rat_type_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(rat_type_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_rat_type_t *rat_typeItem = OpenAPI_rat_type_parseFromJSON(rat_type_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(rat_typeList, rat_typeItem);
|
||||
OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,7 +508,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
conn_states_ts ? ogs_strdup(conn_states_ts->valuestring) : NULL,
|
||||
reachability_status ? reachability_status_local_nonprim : NULL,
|
||||
reachability_status_ts ? ogs_strdup(reachability_status_ts->valuestring) : NULL,
|
||||
sms_over_nas_status ? sms_over_nas_status_local_nonprim : NULL,
|
||||
sms_over_nas_status ? sms_over_nas_statusVariable : 0,
|
||||
sms_over_nas_status_ts ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL,
|
||||
roaming_status ? roaming_status->valueint : 0,
|
||||
roaming_status_ts ? ogs_strdup(roaming_status_ts->valuestring) : NULL,
|
||||
|
@ -535,3 +523,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_copy(OpenAPI_access_and_mobility_data_t *dst, OpenAPI_access_and_mobility_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_access_and_mobility_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_and_mobility_data_free(dst);
|
||||
dst = OpenAPI_access_and_mobility_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef struct OpenAPI_access_and_mobility_data_s {
|
|||
char *conn_states_ts;
|
||||
struct OpenAPI_ue_reachability_s *reachability_status;
|
||||
char *reachability_status_ts;
|
||||
struct OpenAPI_sms_support_s *sms_over_nas_status;
|
||||
OpenAPI_sms_support_e sms_over_nas_status;
|
||||
char *sms_over_nas_status_ts;
|
||||
int roaming_status;
|
||||
char *roaming_status_ts;
|
||||
|
@ -60,7 +60,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
char *conn_states_ts,
|
||||
OpenAPI_ue_reachability_t *reachability_status,
|
||||
char *reachability_status_ts,
|
||||
OpenAPI_sms_support_t *sms_over_nas_status,
|
||||
OpenAPI_sms_support_e sms_over_nas_status,
|
||||
char *sms_over_nas_status_ts,
|
||||
int roaming_status,
|
||||
char *roaming_status_ts,
|
||||
|
@ -72,6 +72,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
|
||||
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON);
|
||||
cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
|
||||
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_copy(OpenAPI_access_and_mobility_data_t *dst, OpenAPI_access_and_mobility_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -142,9 +142,6 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_list_free(access_and_mobility_subscription_data->shared_vn_group_data_ids);
|
||||
OpenAPI_ambr_rm_free(access_and_mobility_subscription_data->subscribed_ue_ambr);
|
||||
OpenAPI_nssai_free(access_and_mobility_subscription_data->nssai);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, node) {
|
||||
OpenAPI_rat_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->rat_restrictions);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) {
|
||||
OpenAPI_area_free(node->data);
|
||||
|
@ -182,13 +179,7 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_maximum_latency_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->maximum_latency_list);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, node) {
|
||||
OpenAPI_rat_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, node) {
|
||||
OpenAPI_rat_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) {
|
||||
OpenAPI_edrx_parameters_free(node->data);
|
||||
|
@ -317,21 +308,16 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->rat_restrictions) {
|
||||
cJSON *rat_restrictionsList = cJSON_AddArrayToObject(item, "ratRestrictions");
|
||||
if (rat_restrictionsList == NULL) {
|
||||
cJSON *rat_restrictions = cJSON_AddArrayToObject(item, "ratRestrictions");
|
||||
if (rat_restrictions == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *rat_restrictions_node;
|
||||
if (access_and_mobility_subscription_data->rat_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) {
|
||||
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_restrictions_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(rat_restrictionsList, itemLocal);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) {
|
||||
if (cJSON_AddStringToObject(rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)rat_restrictions_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -410,14 +396,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->mps_priority >= 0) {
|
||||
if (access_and_mobility_subscription_data->mps_priority) {
|
||||
if (cJSON_AddBoolToObject(item, "mpsPriority", access_and_mobility_subscription_data->mps_priority) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mps_priority]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->mcs_priority >= 0) {
|
||||
if (access_and_mobility_subscription_data->mcs_priority) {
|
||||
if (cJSON_AddBoolToObject(item, "mcsPriority", access_and_mobility_subscription_data->mcs_priority) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mcs_priority]");
|
||||
goto end;
|
||||
|
@ -451,14 +437,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->sor_info_expect_ind >= 0) {
|
||||
if (access_and_mobility_subscription_data->sor_info_expect_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "sorInfoExpectInd", access_and_mobility_subscription_data->sor_info_expect_ind) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_info_expect_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->soraf_retrieval >= 0) {
|
||||
if (access_and_mobility_subscription_data->soraf_retrieval) {
|
||||
if (cJSON_AddBoolToObject(item, "sorafRetrieval", access_and_mobility_subscription_data->soraf_retrieval) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [soraf_retrieval]");
|
||||
goto end;
|
||||
|
@ -493,7 +479,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->mico_allowed >= 0) {
|
||||
if (access_and_mobility_subscription_data->mico_allowed) {
|
||||
if (cJSON_AddBoolToObject(item, "micoAllowed", access_and_mobility_subscription_data->mico_allowed) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mico_allowed]");
|
||||
goto end;
|
||||
|
@ -599,7 +585,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->nssai_inclusion_allowed >= 0) {
|
||||
if (access_and_mobility_subscription_data->nssai_inclusion_allowed) {
|
||||
if (cJSON_AddBoolToObject(item, "nssaiInclusionAllowed", access_and_mobility_subscription_data->nssai_inclusion_allowed) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nssai_inclusion_allowed]");
|
||||
goto end;
|
||||
|
@ -693,41 +679,31 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->primary_rat_restrictions) {
|
||||
cJSON *primary_rat_restrictionsList = cJSON_AddArrayToObject(item, "primaryRatRestrictions");
|
||||
if (primary_rat_restrictionsList == NULL) {
|
||||
cJSON *primary_rat_restrictions = cJSON_AddArrayToObject(item, "primaryRatRestrictions");
|
||||
if (primary_rat_restrictions == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *primary_rat_restrictions_node;
|
||||
if (access_and_mobility_subscription_data->primary_rat_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) {
|
||||
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(primary_rat_restrictions_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(primary_rat_restrictionsList, itemLocal);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) {
|
||||
if (cJSON_AddStringToObject(primary_rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)primary_rat_restrictions_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->secondary_rat_restrictions) {
|
||||
cJSON *secondary_rat_restrictionsList = cJSON_AddArrayToObject(item, "secondaryRatRestrictions");
|
||||
if (secondary_rat_restrictionsList == NULL) {
|
||||
cJSON *secondary_rat_restrictions = cJSON_AddArrayToObject(item, "secondaryRatRestrictions");
|
||||
if (secondary_rat_restrictions == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *secondary_rat_restrictions_node;
|
||||
if (access_and_mobility_subscription_data->secondary_rat_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) {
|
||||
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(secondary_rat_restrictions_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(secondary_rat_restrictionsList, itemLocal);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) {
|
||||
if (cJSON_AddStringToObject(secondary_rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)secondary_rat_restrictions_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -772,7 +748,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->iab_operation_allowed >= 0) {
|
||||
if (access_and_mobility_subscription_data->iab_operation_allowed) {
|
||||
if (cJSON_AddBoolToObject(item, "iabOperationAllowed", access_and_mobility_subscription_data->iab_operation_allowed) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [iab_operation_allowed]");
|
||||
goto end;
|
||||
|
@ -942,13 +918,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
rat_restrictionsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(rat_restrictions_local_nonprimitive, rat_restrictions ) {
|
||||
if (!cJSON_IsObject(rat_restrictions_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(rat_restrictions_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_rat_type_t *rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(rat_restrictions_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(rat_restrictionsList, rat_restrictionsItem);
|
||||
OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1326,13 +1301,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
primary_rat_restrictionsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(primary_rat_restrictions_local_nonprimitive, primary_rat_restrictions ) {
|
||||
if (!cJSON_IsObject(primary_rat_restrictions_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(primary_rat_restrictions_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_rat_type_t *primary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(primary_rat_restrictions_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(primary_rat_restrictionsList, primary_rat_restrictionsItem);
|
||||
OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1349,13 +1323,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
secondary_rat_restrictionsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(secondary_rat_restrictions_local_nonprimitive, secondary_rat_restrictions ) {
|
||||
if (!cJSON_IsObject(secondary_rat_restrictions_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(secondary_rat_restrictions_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_rat_type_t *secondary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(secondary_rat_restrictions_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(secondary_rat_restrictionsList, secondary_rat_restrictionsItem);
|
||||
OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1503,3 +1476,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_copy(OpenAPI_access_and_mobility_subscription_data_t *dst, OpenAPI_access_and_mobility_subscription_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_access_and_mobility_subscription_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_and_mobility_subscription_data_free(dst);
|
||||
dst = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,6 +146,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON);
|
||||
cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_copy(OpenAPI_access_and_mobility_subscription_data_t *dst, OpenAPI_access_and_mobility_subscription_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,3 +49,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_right_status_t *OpenAPI_access_right_status_copy(OpenAPI_access_right_status_t *dst, OpenAPI_access_right_status_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_access_right_status_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_access_right_status_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_right_status_free(dst);
|
||||
dst = OpenAPI_access_right_status_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ OpenAPI_access_right_status_t *OpenAPI_access_right_status_create(
|
|||
void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status);
|
||||
OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON);
|
||||
cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status);
|
||||
OpenAPI_access_right_status_t *OpenAPI_access_right_status_copy(OpenAPI_access_right_status_t *dst, OpenAPI_access_right_status_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,3 +49,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_tech_t *OpenAPI_access_tech_copy(OpenAPI_access_tech_t *dst, OpenAPI_access_tech_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_access_tech_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_access_tech_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_access_tech_free(dst);
|
||||
dst = OpenAPI_access_tech_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ OpenAPI_access_tech_t *OpenAPI_access_tech_create(
|
|||
void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech);
|
||||
OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON);
|
||||
cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech);
|
||||
OpenAPI_access_tech_t *OpenAPI_access_tech_copy(OpenAPI_access_tech_t *dst, OpenAPI_access_tech_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -134,3 +134,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_copy(OpenAPI_acknowledge_info_t *dst, OpenAPI_acknowledge_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_acknowledge_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acknowledge_info_free(dst);
|
||||
dst = OpenAPI_acknowledge_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
|
|||
void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info);
|
||||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON);
|
||||
cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info);
|
||||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_copy(OpenAPI_acknowledge_info_t *dst, OpenAPI_acknowledge_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -109,3 +109,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acs_info_t *OpenAPI_acs_info_copy(OpenAPI_acs_info_t *dst, OpenAPI_acs_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_acs_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_acs_info_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acs_info_free(dst);
|
||||
dst = OpenAPI_acs_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create(
|
|||
void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info);
|
||||
OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON);
|
||||
cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info);
|
||||
OpenAPI_acs_info_t *OpenAPI_acs_info_copy(OpenAPI_acs_info_t *dst, OpenAPI_acs_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -109,3 +109,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_copy(OpenAPI_acs_info_rm_t *dst, OpenAPI_acs_info_rm_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_acs_info_rm_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_acs_info_rm_free(dst);
|
||||
dst = OpenAPI_acs_info_rm_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create(
|
|||
void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm);
|
||||
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON);
|
||||
cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm);
|
||||
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_copy(OpenAPI_acs_info_rm_t *dst, OpenAPI_acs_info_rm_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "additional_qos_flow_info.h"
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
|
||||
)
|
||||
{
|
||||
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_qos_flow_info_t));
|
||||
if (!additional_qos_flow_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return additional_qos_flow_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
|
||||
{
|
||||
if (NULL == additional_qos_flow_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(additional_qos_flow_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (additional_qos_flow_info == NULL) {
|
||||
ogs_error("OpenAPI_additional_qos_flow_info_convertToJSON() failed [AdditionalQosFlowInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON)
|
||||
{
|
||||
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = NULL;
|
||||
additional_qos_flow_info_local_var = OpenAPI_additional_qos_flow_info_create (
|
||||
);
|
||||
|
||||
return additional_qos_flow_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_qos_flow_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_qos_flow_info_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_qos_flow_info_free(dst);
|
||||
dst = OpenAPI_additional_qos_flow_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* additional_qos_flow_info.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_additional_qos_flow_info_H_
|
||||
#define _OpenAPI_additional_qos_flow_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "null_value.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_additional_qos_flow_info_s OpenAPI_additional_qos_flow_info_t;
|
||||
typedef struct OpenAPI_additional_qos_flow_info_s {
|
||||
} OpenAPI_additional_qos_flow_info_t;
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
|
||||
);
|
||||
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON);
|
||||
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_additional_qos_flow_info_H_ */
|
||||
|
|
@ -36,7 +36,7 @@ cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_da
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (additional_snssai_data->required_authn_authz >= 0) {
|
||||
if (additional_snssai_data->required_authn_authz) {
|
||||
if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data->required_authn_authz) == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [required_authn_authz]");
|
||||
goto end;
|
||||
|
@ -68,3 +68,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_copy(OpenAPI_additional_snssai_data_t *dst, OpenAPI_additional_snssai_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_snssai_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_snssai_data_free(dst);
|
||||
dst = OpenAPI_additional_snssai_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
|
|||
void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data);
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON);
|
||||
cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data);
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_copy(OpenAPI_additional_snssai_data_t *dst, OpenAPI_additional_snssai_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -49,3 +49,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_af_event_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_af_event_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_event_free(dst);
|
||||
dst = OpenAPI_af_event_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ OpenAPI_af_event_t *OpenAPI_af_event_create(
|
|||
void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event);
|
||||
OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON);
|
||||
cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event);
|
||||
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -190,3 +190,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_copy(OpenAPI_af_event_exposure_data_t *dst, OpenAPI_af_event_exposure_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_af_event_exposure_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_event_exposure_data_free(dst);
|
||||
dst = OpenAPI_af_event_exposure_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create(
|
|||
void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);
|
||||
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON);
|
||||
cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);
|
||||
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_copy(OpenAPI_af_event_exposure_data_t *dst, OpenAPI_af_event_exposure_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -164,3 +164,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_external_t *OpenAPI_af_external_copy(OpenAPI_af_external_t *dst, OpenAPI_af_external_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_af_external_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_af_external_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_external_free(dst);
|
||||
dst = OpenAPI_af_external_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ OpenAPI_af_external_t *OpenAPI_af_external_create(
|
|||
void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external);
|
||||
OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON);
|
||||
cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external);
|
||||
OpenAPI_af_external_t *OpenAPI_af_external_copy(OpenAPI_af_external_t *dst, OpenAPI_af_external_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue