Commit ad0ea94c authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

correct format src/common

parent 2128f40f
......@@ -20,11 +20,11 @@
*/
/*! \file 3gpp_23.003.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_23_003_SEEN
#define FILE_3GPP_23_003_SEEN
......@@ -32,12 +32,12 @@
#include <stdint.h>
typedef struct plmn_s {
uint8_t mcc_digit2:4;
uint8_t mcc_digit1:4;
uint8_t mcc_digit3:4;
uint8_t mnc_digit3:4;
uint8_t mnc_digit2:4;
uint8_t mnc_digit1:4;
uint8_t mcc_digit2 :4;
uint8_t mcc_digit1 :4;
uint8_t mcc_digit3 :4;
uint8_t mnc_digit3 :4;
uint8_t mnc_digit2 :4;
uint8_t mnc_digit1 :4;
} plmn_t;
#define INVALID_TAC_0000 (uint16_t)0x0000
......@@ -47,80 +47,72 @@ typedef struct plmn_s {
#define INVALID_TMSI UINT32_MAX /*!< \brief The network shall not allocate a TMSI with all 32 bits equal to 1
(this is because the TMSI must be stored in the SIM, and the SIM uses 4 octets with all bits
equal to 1 to indicate that no valid TMSI is available). */
typedef uint16_t tac_t;
typedef uint16_t tac_t;
typedef struct tai_s {
plmn_t plmn; /*!< \brief <MCC> + <MNC> */
tac_t tac; /*!< \brief Tracking Area Code */
plmn_t plmn; /*!< \brief <MCC> + <MNC> */
tac_t tac; /*!< \brief Tracking Area Code */
} tai_t;
typedef struct eci_s {
uint32_t gnb_id:20;
uint32_t cell_id:8;
uint32_t empty:4;
uint32_t gnb_id :20;
uint32_t cell_id :8;
uint32_t empty :4;
} ci_t;
typedef struct cgi_s {
plmn_t plmn;
ci_t cell_identity; //28 bits
plmn_t plmn;
ci_t cell_identity; //28 bits
} cgi_t;
typedef struct nr_tai_s /*5G ADD it*/
typedef struct nr_tai_s /*5G ADD it*/
{
plmn_t plmn;
uint32_t tac:24;
}nr_tai_t;
plmn_t plmn;
uint32_t tac :24;
} nr_tai_t;
typedef struct nr_cell_identity_s /*5G ADD it */
{
uint32_t gnb_id;
uint8_t cell_id:4;
}nr_cell_identity_t;
typedef struct nr_cgi_s /*5G ADD it */
{
plmn_t plmn;
nr_cell_identity_t cell_identity;
}nr_cgi_t;
typedef struct fiveG_s_tmsi_s /*5G ADD it */
{
uint16_t amf_set_id:10;
uint8_t amf_pointer:6;
uint32_t fiveG_s_tmsi; //32
}fiveG_s_tmsi_t;
typedef struct fiveG_s_gua_s /*5G ADD it */
{
plmn_t plmn;
uint8_t region_id;
uint16_t amf_set_id:10;
uint8_t amf_pointer:6;
}fiveG_s_gua_t;
typedef struct amf_set_id_s /*5G ADD it*/
uint32_t gnb_id;
uint8_t cell_id :4;
} nr_cell_identity_t;
typedef struct nr_cgi_s /*5G ADD it */
{
uint16_t amf_set_id:10;
}amf_set_id_t;
plmn_t plmn;
nr_cell_identity_t cell_identity;
} nr_cgi_t;
typedef struct fiveG_s_tmsi_s /*5G ADD it */
{
uint16_t amf_set_id :10;
uint8_t amf_pointer :6;
uint32_t fiveG_s_tmsi; //32
} fiveG_s_tmsi_t;
typedef struct allowed_nssai /*5G ADD it*/
typedef struct fiveG_s_gua_s /*5G ADD it */
{
uint8_t sST;
uint32_t sD:24;
}allowed_nssai;
plmn_t plmn;
uint8_t region_id;
uint16_t amf_set_id :10;
uint8_t amf_pointer :6;
typedef struct allowed_nssai_s /*5G ADD it*/
} fiveG_s_gua_t;
typedef struct amf_set_id_s /*5G ADD it*/
{
allowed_nssai *s_nssai;
uint32_t count;
}allowed_nssai_t;
uint16_t amf_set_id :10;
} amf_set_id_t;
typedef struct allowed_nssai /*5G ADD it*/
{
uint8_t sST;
uint32_t sD :24;
} allowed_nssai;
typedef struct allowed_nssai_s /*5G ADD it*/
{
allowed_nssai *s_nssai;
uint32_t count;
} allowed_nssai_t;
#endif
......@@ -20,11 +20,11 @@
*/
/*! \file 3gpp_24.008.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_24_008_SEEN
#define FILE_3GPP_24_008_SEEN
......@@ -124,22 +124,21 @@
#define PCO_CI_IM_CN_SUBSYSTEM_SIGNALING_FLAG (0x0002)
typedef struct pco_protocol_or_container_id_s {
uint16_t protocol_id;
uint8_t length_of_protocol_id_contents;
uint16_t protocol_id;
uint8_t length_of_protocol_id_contents;
std::string protocol_id_contents;
} pco_protocol_or_container_id_t;
typedef struct protocol_configuration_options_s {
uint8_t ext:1;
uint8_t spare:4;
uint8_t configuration_protocol:3;
uint8_t num_protocol_or_container_id;
uint8_t ext :1;
uint8_t spare :4;
uint8_t configuration_protocol :3;
uint8_t num_protocol_or_container_id;
// arbitrary value, can be greater than defined (250/3)
# define PCO_UNSPEC_MAXIMUM_PROTOCOL_ID_OR_CONTAINER_ID 8
pco_protocol_or_container_id_t protocol_or_container_ids[PCO_UNSPEC_MAXIMUM_PROTOCOL_ID_OR_CONTAINER_ID];
} protocol_configuration_options_t;
//------------------------------------------------------------------------------
// 10.5.6.11 Packet Flow Identifier
//------------------------------------------------------------------------------
......@@ -246,7 +245,8 @@ typedef struct packet_filter_contents_s {
* and "no TFT operation" shall be empty.
* ---------------------------------------------------------------
*/
typedef struct {} no_packet_filter_t;
typedef struct {
} no_packet_filter_t;
typedef no_packet_filter_t delete_existing_tft_t;
typedef no_packet_filter_t no_tft_operation_t;
......@@ -257,7 +257,7 @@ typedef no_packet_filter_t no_tft_operation_t;
* ------------------------------------------------------------------
*/
#define TRAFFIC_FLOW_TEMPLATE_PACKET_IDENTIFIER_MAX 16
typedef struct packet_filter_identifier_s{
typedef struct packet_filter_identifier_s {
uint8_t identifier;
} packet_filter_identifier_t;
......@@ -271,15 +271,15 @@ typedef packet_filter_identifier_t delete_packet_filter_t;
*/
#define TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX 4
typedef struct packet_filter_s {
uint8_t spare:2;
uint8_t spare :2;
#define TRAFFIC_FLOW_TEMPLATE_PRE_REL7_TFT_FILTER 0b00
#define TRAFFIC_FLOW_TEMPLATE_DOWNLINK_ONLY 0b01
#define TRAFFIC_FLOW_TEMPLATE_UPLINK_ONLY 0b10
#define TRAFFIC_FLOW_TEMPLATE_BIDIRECTIONAL 0b11
uint8_t direction:2;
uint8_t identifier:4;
uint8_t eval_precedence;
uint8_t length;
uint8_t direction :2;
uint8_t identifier :4;
uint8_t eval_precedence;
uint8_t length;
packet_filter_contents_t packetfiltercontents;
} packet_filter_t;
......@@ -290,29 +290,28 @@ typedef packet_filter_t replace_packet_filter_t;
* Packet filter list
* ------------------
*/
typedef union {
create_new_tft_t createnewtft[TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX];
add_packet_filter_t addpacketfilter[TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX];
typedef union {
create_new_tft_t createnewtft[TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX];
add_packet_filter_t addpacketfilter[TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX];
replace_packet_filter_t replacepacketfilter[TRAFFIC_FLOW_TEMPLATE_NB_PACKET_FILTERS_MAX];
delete_packet_filter_t deletepacketfilter[TRAFFIC_FLOW_TEMPLATE_PACKET_IDENTIFIER_MAX];
delete_existing_tft_t deleteexistingtft;
no_tft_operation_t notftoperation;
delete_packet_filter_t deletepacketfilter[TRAFFIC_FLOW_TEMPLATE_PACKET_IDENTIFIER_MAX];
delete_existing_tft_t deleteexistingtft;
no_tft_operation_t notftoperation;
} packet_filter_list_t;
typedef struct parameter_s{
typedef struct parameter_s {
#define PARAMETER_IDENTIFIER_AUTHORIZATION_TOKEN 0x01 // Authorization Token
#define PARAMETER_IDENTIFIER_FLOW_IDENTIFIER 0x02 // Flow Identifier
#define PARAMETER_IDENTIFIER_PACKET_FILTER_IDENTIFIER 0x03 // Packet Filter Identifier
uint8_t parameteridentifier;
uint8_t length;
std::string contents;
uint8_t parameteridentifier;
uint8_t length;
std::string contents;
} parameter_t;
typedef struct parameters_list_s{
uint8_t num_parameters;
typedef struct parameters_list_s {
uint8_t num_parameters;
#define TRAFFIC_FLOW_TEMPLATE_NB_PARAMETERS_MAX 16 // TODO or may use []
parameter_t parameter[TRAFFIC_FLOW_TEMPLATE_NB_PARAMETERS_MAX];
parameter_t parameter[TRAFFIC_FLOW_TEMPLATE_NB_PARAMETERS_MAX];
} parameters_list_t;
typedef struct traffic_flow_template_s {
......@@ -324,15 +323,15 @@ typedef struct traffic_flow_template_s {
#define TRAFFIC_FLOW_TEMPLATE_OPCODE_DELETE_PACKET_FILTERS_FROM_EXISTING_TFT 0b101
#define TRAFFIC_FLOW_TEMPLATE_OPCODE_NO_TFT_OPERATION 0b110
#define TRAFFIC_FLOW_TEMPLATE_OPCODE_RESERVED 0b111
uint8_t tftoperationcode:3;
uint8_t tftoperationcode :3;
#define TRAFFIC_FLOW_TEMPLATE_PARAMETER_LIST_IS_NOT_INCLUDED 0
#define TRAFFIC_FLOW_TEMPLATE_PARAMETER_LIST_IS_INCLUDED 1
uint8_t ebit:1;
uint8_t numberofpacketfilters:4;
uint8_t ebit :1;
uint8_t numberofpacketfilters :4;
packet_filter_list_t packetfilterlist;
parameters_list_t parameterslist; // The parameters list contains a variable number of parameters that may be
// transferred. If the parameters list is included, the E bit is set to 1; otherwise, the E bit
// is set to 0.
parameters_list_t parameterslist; // The parameters list contains a variable number of parameters that may be
// transferred. If the parameters list is included, the E bit is set to 1; otherwise, the E bit
// is set to 0.
} traffic_flow_template_t;
#define TFT_ENCODE_IEI_TRUE true
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,11 +20,11 @@
*/
/*! \file 3gpp_29.281.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_29_281_SEEN
#define FILE_3GPP_29_281_SEEN
......@@ -41,97 +41,113 @@
namespace gtpv1u {
struct gtpu_exception : public std::exception {
gtpu_exception() throw() {
gtpu_exception() throw () {
cause = 0;
phrase.assign("GTPV1-U Exception unknown cause");
}
gtpu_exception(int acause) throw() {
gtpu_exception(int acause) throw () {
cause = acause;
phrase = fmt::format("GTPV1-U Exception cause {}", cause);
}
const char * what () const throw () {
return phrase.c_str();
}
public:
int cause;
std::string phrase;
const char* what() const throw () {
return phrase.c_str();
}
public:
int cause;
std::string phrase;
};
struct gtpu_msg_bad_length_exception : public gtpu_exception {
public:
gtpu_msg_bad_length_exception(const uint8_t msg_type, const uint16_t msg_size) throw() {
public:
gtpu_msg_bad_length_exception(const uint8_t msg_type, const uint16_t msg_size) throw () {
phrase = fmt::format("GTPV1-U msg {} Bad Length {} Exception", msg_type, msg_size);
}
gtpu_msg_bad_length_exception(std::string& aphrase) throw() {
gtpu_msg_bad_length_exception(std::string &aphrase) throw () {
phrase = aphrase;
}
virtual ~gtpu_msg_bad_length_exception() throw(){}
virtual ~gtpu_msg_bad_length_exception() throw () {
}
};
struct gtpu_msg_unimplemented_ie_exception : public gtpu_exception {
public:
gtpu_msg_unimplemented_ie_exception(const uint8_t msg_type, const uint8_t ie_type, const uint8_t instance = 0) throw() {
public:
gtpu_msg_unimplemented_ie_exception(const uint8_t msg_type, const uint8_t ie_type, const uint8_t instance = 0) throw () {
phrase = fmt::format("GTPV1-U msg {} Unimplemented {} IE Instance {} Exception", msg_type, ie_type, instance);
}
gtpu_msg_unimplemented_ie_exception(std::string& aphrase) throw() {
gtpu_msg_unimplemented_ie_exception(std::string &aphrase) throw () {
phrase = aphrase;
}
virtual ~gtpu_msg_unimplemented_ie_exception() throw(){}
virtual ~gtpu_msg_unimplemented_ie_exception() throw () {
}
};
struct gtpu_msg_illegal_ie_exception : public gtpu_exception {
public:
gtpu_msg_illegal_ie_exception(const uint8_t msg_type, const uint8_t ie_type) throw() {
public:
gtpu_msg_illegal_ie_exception(const uint8_t msg_type, const uint8_t ie_type) throw () {
phrase = fmt::format("GTPV1-U msg {} Illegal {} Exception", msg_type, ie_type);
}
gtpu_msg_illegal_ie_exception(std::string& aphrase) throw() {
gtpu_msg_illegal_ie_exception(std::string &aphrase) throw () {
phrase = aphrase;
}
virtual ~gtpu_msg_illegal_ie_exception() throw(){}
virtual ~gtpu_msg_illegal_ie_exception() throw () {
}
};
struct gtpu_ie_exception : public gtpu_exception {
public:
gtpu_ie_exception(uint8_t ie_type) throw() {
public:
gtpu_ie_exception(uint8_t ie_type) throw () {
phrase = fmt::format("GTPV1-U IE {} Exception", ie_type);
}
gtpu_ie_exception(std::string& aphrase) throw() {
gtpu_ie_exception(std::string &aphrase) throw () {
phrase = aphrase;
}
virtual ~gtpu_ie_exception() throw(){}
virtual ~gtpu_ie_exception() throw () {
}
};
struct gtpu_ie_unimplemented_exception : public gtpu_ie_exception {
public:
gtpu_ie_unimplemented_exception(uint8_t ie_type) throw() : gtpu_ie_exception(ie_type) {
public:
gtpu_ie_unimplemented_exception(uint8_t ie_type) throw ()
:
gtpu_ie_exception(ie_type) {
phrase = fmt::format("GTPV1-U IE {} Unimplemented Exception", ie_type);
}
virtual ~gtpu_ie_unimplemented_exception() throw(){}
virtual ~gtpu_ie_unimplemented_exception() throw () {
}
};
struct gtpu_tlv_exception : public gtpu_ie_exception {
public:
gtpu_tlv_exception(uint8_t ie_type) throw() : gtpu_ie_exception(ie_type) {
public:
gtpu_tlv_exception(uint8_t ie_type) throw ()
:
gtpu_ie_exception(ie_type) {
phrase = fmt::format("GTPV1-U IE TLV {} Exception", ie_type);
}
virtual ~gtpu_tlv_exception() throw(){}
virtual ~gtpu_tlv_exception() throw () {
}
};
struct gtpu_tlv_bad_length_exception : public gtpu_tlv_exception {
public:
gtpu_tlv_bad_length_exception(uint8_t ie_type, uint16_t ie_length) throw() : gtpu_tlv_exception(ie_type){
public:
gtpu_tlv_bad_length_exception(uint8_t ie_type, uint16_t ie_length) throw ()
:
gtpu_tlv_exception(ie_type) {
phrase = fmt::format("GTPV1-U IE TLV {} Bad Length {} Exception", ie_type);
}
virtual ~gtpu_tlv_bad_length_exception() throw(){}
virtual ~gtpu_tlv_bad_length_exception() throw () {
}
};
struct gtpu_ie_value_exception : public gtpu_ie_exception {
public:
gtpu_ie_value_exception(uint8_t ie_type, const char* field) throw() : gtpu_ie_exception(ie_type){
public:
gtpu_ie_value_exception(uint8_t ie_type, const char *field) throw ()
:
gtpu_ie_exception(ie_type) {
phrase = fmt::format("GTPV1-U IE {} Bad Value of {} Exception", ie_type, field);
}
virtual ~gtpu_ie_value_exception() throw(){}
virtual ~gtpu_ie_value_exception() throw () {
}
};
#define GTPU_IE_RECOVERY 14
......@@ -147,26 +163,26 @@ public:
#define GTPU_END_MARKER (254)
#define GTPU_G_PDU (255)
} // namespace
} // namespace
// 8.2 Recovery
// 8.2 Recovery
// 8.3 Tunnel Endpoint Identifier Data I
typedef struct tunnel_endpoint_identifier_data_i_s {
uint32_t tunnel_endpoint_identifier_data_i;
uint32_t tunnel_endpoint_identifier_data_i;
} tunnel_endpoint_identifier_data_i_t;
// 8.4 GTP-U Peer Address
typedef struct gtp_u_peer_address_s {
// may use variant if can stay with C++17
struct in_addr ipv4_address;
struct in6_addr ipv6_address;
struct in_addr ipv4_address;
struct in6_addr ipv6_address;
bool is_v4;
} gtp_u_peer_address_t;
// 8.5 Extension Header Type List
typedef struct extension_header_type_list_s {
uint8_t length;
uint8_t length;
std::vector<uint8_t> extension_types_list;
} extension_header_type_list_t;
......
......@@ -19,11 +19,9 @@
* contact@openairinterface.org
*/
#ifndef FILE_3GPP_29_502_SMF_SEEN
#define FILE_3GPP_29_502_SMF_SEEN
enum pdu_session_application_error_e {
PDU_SESSION_APPLICATION_ERROR_N1_SM_ERROR = 1,
PDU_SESSION_APPLICATION_ERROR_SNSSAI_DENIED = 2,
......@@ -61,102 +59,100 @@ enum pdu_session_application_error_e {
PDU_SESSION_APPLICATION_ERROR_NETWORK_FAILURE = 34
};
static const std::vector<std::string> pdu_session_application_error_e2str = {
"UNKNOWN ERROR",
"N1_SM_ERROR",
"SNSSAI_DENIED",
"DNN_DENIED",
"PDUTYPE_DENIED",
"SSC_DENIED",
"SUBSCRIPTION_DENIED",
"DNN_NOT_SUPPORTED",
"PDUTYPE_NOT_SUPPORTED",
"SSC_NOT_SUPPORTED",
"HOME_ROUTED_ROAMING_REQUIRED",
"OUT_OF_LADN_SERVICE_AREA",
"N2_SM_ERROR",
"PRIORITIZED_SERVICES_ONLY",
"PDU_SESSION_ANCHOR_CHANGE",
"TARGET_MME_CAPABILITY",
"NO_EPS_5GS_CONTINUITY",
"UNABLE_TO_PAGE_UE",
"UE_NOT_RESPONDING",
"REJECTED_BY_UE",
"REJECTED_DUE_VPLMN_POLICY",
"HO_TAU_IN_PROGRESS",
"INTEGRITY_PROTECTED_MDR_NOT_ACCEPTABLE",
"EBI_EXHAUSTED",
"EBI_REJECTED_LOCAL_POLICY",
"EBI_REJECTED_NO_N26",
"DEFAULT_EPS_BEARER_INACTIVE",
"HANDOVER_RESOURCE_ALLOCATION_FAILURE",
"CONTEXT_NOT_FOUND",
"INSUFFICIENT_RESOURCES_SLICE",
"INSUFFICIENT_RESOURCES_SLICE_DNN",
"DNN_CONGESTION",
"S_NSSAI_CONGESTION",
"PEER_NOT_RESPONDING",
"NETWORK_FAILURE"
"UNKNOWN ERROR",
"N1_SM_ERROR",
"SNSSAI_DENIED",
"DNN_DENIED",
"PDUTYPE_DENIED",
"SSC_DENIED",
"SUBSCRIPTION_DENIED",
"DNN_NOT_SUPPORTED",
"PDUTYPE_NOT_SUPPORTED",
"SSC_NOT_SUPPORTED",
"HOME_ROUTED_ROAMING_REQUIRED",
"OUT_OF_LADN_SERVICE_AREA",
"N2_SM_ERROR",
"PRIORITIZED_SERVICES_ONLY",
"PDU_SESSION_ANCHOR_CHANGE",
"TARGET_MME_CAPABILITY",
"NO_EPS_5GS_CONTINUITY",
"UNABLE_TO_PAGE_UE",
"UE_NOT_RESPONDING",
"REJECTED_BY_UE",
"REJECTED_DUE_VPLMN_POLICY",
"HO_TAU_IN_PROGRESS",
"INTEGRITY_PROTECTED_MDR_NOT_ACCEPTABLE",
"EBI_EXHAUSTED",
"EBI_REJECTED_LOCAL_POLICY",
"EBI_REJECTED_NO_N26",
"DEFAULT_EPS_BEARER_INACTIVE",
"HANDOVER_RESOURCE_ALLOCATION_FAILURE",
"CONTEXT_NOT_FOUND",
"INSUFFICIENT_RESOURCES_SLICE",
"INSUFFICIENT_RESOURCES_SLICE_DNN",
"DNN_CONGESTION",
"S_NSSAI_CONGESTION",
"PEER_NOT_RESPONDING",
"NETWORK_FAILURE"
};
//6.1.6.3.12 Enumeration: N2SmInfoType @3GPP TS 29.502 V16.0.0
enum class n2_sm_info_type_e {
PDU_RES_SETUP_REQ = 1, //PDU Session Resource Setup Request Transfer
PDU_RES_SETUP_RSP = 2, //PDU Session Resource Setup Response Transfer
PDU_RES_SETUP_FAIL = 3, //PDU Session Resource Setup Unsuccessful Transfer
PDU_RES_REL_CMD = 4, //PDU Session Resource Release Command Transfer
PDU_RES_REL_RSP = 5, //PDU Session Resource Release Response Transfer
PDU_RES_MOD_REQ = 6, //PDU Session Resource Modify Request Transfer
PDU_RES_MOD_RSP = 7, //PDU Session Resource Modify Response Transfer
PDU_RES_MOD_FAIL = 8, //PDU Session Resource Modify Unsuccessful Transfer
PDU_RES_NTY = 9, //PDU Session Resource Notify Transfer
PDU_RES_NTY_REL = 10, //PDU Session Resource Notify Released Transfer
PDU_RES_MOD_IND = 11, //PDU Session Resource Modify Indication Transfer
PDU_RES_MOD_CFM = 12, //PDU Session Resource Modify Confirm Transfer
PATH_SWITCH_REQ = 13, //Path Switch Request Transfer
PATH_SWITCH_SETUP_FAIL = 14, //Path Switch Request Setup Failed Transfer
PATH_SWITCH_REQ_ACK = 15, //Path Switch Request Acknowledge Transfer
PATH_SWITCH_REQ_FAIL = 16, //Path Switch Request Unsuccessful Transfer
HANDOVER_REQUIRED = 17, //Handover Required Transfer
HANDOVER_CMD = 18, //Handover Command Transfer
HANDOVER_PREP_FAIL = 19, //Handover Preparation Unsuccessful Transfer
HANDOVER_REQ_ACK = 20, //Handover Request Acknowledge Transfer
HANDOVER_RES_ALLOC_FAIL = 21, //Handover Resource Allocation Unsuccessful Transfer
SECONDARY_RAT_USAGE = 22 //Secondary RAT Data Usage Report Transfer
PDU_RES_SETUP_RSP = 2, //PDU Session Resource Setup Response Transfer
PDU_RES_SETUP_FAIL = 3, //PDU Session Resource Setup Unsuccessful Transfer
PDU_RES_REL_CMD = 4, //PDU Session Resource Release Command Transfer
PDU_RES_REL_RSP = 5, //PDU Session Resource Release Response Transfer
PDU_RES_MOD_REQ = 6, //PDU Session Resource Modify Request Transfer
PDU_RES_MOD_RSP = 7, //PDU Session Resource Modify Response Transfer
PDU_RES_MOD_FAIL = 8, //PDU Session Resource Modify Unsuccessful Transfer
PDU_RES_NTY = 9, //PDU Session Resource Notify Transfer
PDU_RES_NTY_REL = 10, //PDU Session Resource Notify Released Transfer
PDU_RES_MOD_IND = 11, //PDU Session Resource Modify Indication Transfer
PDU_RES_MOD_CFM = 12, //PDU Session Resource Modify Confirm Transfer
PATH_SWITCH_REQ = 13, //Path Switch Request Transfer
PATH_SWITCH_SETUP_FAIL = 14, //Path Switch Request Setup Failed Transfer
PATH_SWITCH_REQ_ACK = 15, //Path Switch Request Acknowledge Transfer
PATH_SWITCH_REQ_FAIL = 16, //Path Switch Request Unsuccessful Transfer
HANDOVER_REQUIRED = 17, //Handover Required Transfer
HANDOVER_CMD = 18, //Handover Command Transfer
HANDOVER_PREP_FAIL = 19, //Handover Preparation Unsuccessful Transfer
HANDOVER_REQ_ACK = 20, //Handover Request Acknowledge Transfer
HANDOVER_RES_ALLOC_FAIL = 21, //Handover Resource Allocation Unsuccessful Transfer
SECONDARY_RAT_USAGE = 22 //Secondary RAT Data Usage Report Transfer
};
static const std::vector<std::string> n2_sm_info_type_e2str = {
"UNKNOWN_TYPE",
"PDU_RES_SETUP_REQ",
"PDU_RES_SETUP_RSP",
"PDU_RES_SETUP_FAIL",
"PDU_RES_REL_CMD",
"PDU_RES_REL_RSP",
"PDU_RES_MOD_REQ",
"PDU_RES_MOD_RSP",
"PDU_RES_MOD_FAIL",
"PDU_RES_NTY",
"PDU_RES_NTY_REL",
"PDU_RES_MOD_IND",
"PDU_RES_MOD_CFM",
"PATH_SWITCH_REQ",
"PATH_SWITCH_SETUP_FAIL",
"PATH_SWITCH_REQ_ACK",
"PATH_SWITCH_REQ_FAIL",
"HANDOVER_REQUIRED",
"HANDOVER_CMD",
"HANDOVER_PREP_FAIL",
"HANDOVER_REQ_ACK",
"HANDOVER_RES_ALLOC_FAIL",
"SECONDARY_RAT_USAGE"
"UNKNOWN_TYPE",
"PDU_RES_SETUP_REQ",
"PDU_RES_SETUP_RSP",
"PDU_RES_SETUP_FAIL",
"PDU_RES_REL_CMD",
"PDU_RES_REL_RSP",
"PDU_RES_MOD_REQ",
"PDU_RES_MOD_RSP",
"PDU_RES_MOD_FAIL",
"PDU_RES_NTY",
"PDU_RES_NTY_REL",
"PDU_RES_MOD_IND",
"PDU_RES_MOD_CFM",
"PATH_SWITCH_REQ",
"PATH_SWITCH_SETUP_FAIL",
"PATH_SWITCH_REQ_ACK",
"PATH_SWITCH_REQ_FAIL",
"HANDOVER_REQUIRED",
"HANDOVER_CMD",
"HANDOVER_PREP_FAIL",
"HANDOVER_REQ_ACK",
"HANDOVER_RES_ALLOC_FAIL",
"SECONDARY_RAT_USAGE"
};
enum class upCnx_state_e {
UPCNX_STATE_ACTIVATED = 0,
UPCNX_STATE_DEACTIVATED = 1,
UPCNX_STATE_ACTIVATING =2
UPCNX_STATE_DEACTIVATED = 1,
UPCNX_STATE_ACTIVATING =2
};
static const std::vector<std::string> upCnx_state_e2str = {
......@@ -165,6 +161,4 @@ static const std::vector<std::string> upCnx_state_e2str = {
"UPCNX_STATE_ACTIVATING"
};
#endif
......@@ -19,7 +19,6 @@
* contact@openairinterface.org
*/
#ifndef FILE_3GPP_29_503_SMF_SEEN
#define FILE_3GPP_29_503_SMF_SEEN
......@@ -31,33 +30,40 @@ enum ssc_mode_e {
SSC_MODE_2 = 2,
SSC_MODE_3 = 3,
};
static const std::vector<std::string> ssc_mode_e2str = {"Error", "SSC_MODE_1", "SSC_MODE_2", "SSC_MODE_3"};
static const std::vector<std::string> ssc_mode_e2str = { "Error", "SSC_MODE_1", "SSC_MODE_2", "SSC_MODE_3" };
typedef struct ssc_mode_s {
uint8_t ssc_mode;
ssc_mode_s() : ssc_mode(SSC_MODE_1) {}
ssc_mode_s(ssc_mode_e mode) : ssc_mode(mode) {}
ssc_mode_s(const struct ssc_mode_s& p) : ssc_mode(p.ssc_mode) {}
ssc_mode_s()
:
ssc_mode(SSC_MODE_1) {
}
ssc_mode_s(ssc_mode_e mode)
:
ssc_mode(mode) {
}
ssc_mode_s(const struct ssc_mode_s &p)
:
ssc_mode(p.ssc_mode) {
}
} ssc_mode_t;
typedef struct pdu_session_types_s {
pdu_session_type_t default_session_type;
std::vector<pdu_session_type_t> allowed_session_types;
pdu_session_type_t default_session_type;
std::vector<pdu_session_type_t> allowed_session_types;
} pdu_session_types_t;
typedef struct ssc_modes_s {
ssc_mode_t default_ssc_mode;
std::vector<ssc_mode_t> allowed_ssc_modes;
ssc_mode_t default_ssc_mode;
std::vector<ssc_mode_t> allowed_ssc_modes;
} ssc_modes_t;
typedef struct dnn_configuration_s {
pdu_session_types_t pdu_session_types;
ssc_modes_t ssc_modes;
session_ambr_t session_ambr;
subscribed_default_qos_t _5g_qos_profile;
//staticIpAddresses
pdu_session_types_t pdu_session_types;
ssc_modes_t ssc_modes;
session_ambr_t session_ambr;
subscribed_default_qos_t _5g_qos_profile;
//staticIpAddresses
} dnn_configuration_t;
#endif
......@@ -19,44 +19,40 @@
* contact@openairinterface.org
*/
#ifndef FILE_3GPP_29_571_SEEN
#define FILE_3GPP_29_571_SEEN
typedef struct session_ambr_s {
std::string uplink;
std::string downlink;
std::string uplink;
std::string downlink;
} session_ambr_t;
enum preemtion_capability_e {
NOT_PREEMPT = 1,
MAY_PREEMPT = 2
NOT_PREEMPT = 1,
MAY_PREEMPT = 2
};
static const std::vector<std::string> preemtion_capability_e2str = {"Error", "NOT_PREEMPT", "MAY_PREEMPT"};
static const std::vector<std::string> preemtion_capability_e2str = { "Error", "NOT_PREEMPT", "MAY_PREEMPT" };
//see section 5.5.4.1@TS 29.571
typedef struct arp_5gc_s {
uint8_t priority_level;// (integer 1-15)
std::string preempt_cap;
std::string preempt_vuln; //NOT_PREEMPTABLE, PREEMPTABLE
uint8_t priority_level; // (integer 1-15)
std::string preempt_cap;
std::string preempt_vuln; //NOT_PREEMPTABLE, PREEMPTABLE
} arp_5gc_t;
//see section 5.4.4.1@TS 29.571
typedef struct subscribed_default_qos_s{
uint8_t _5qi;
arp_5gc_t arp;
uint8_t priority_level;//1-127
typedef struct subscribed_default_qos_s {
uint8_t _5qi;
arp_5gc_t arp;
uint8_t priority_level; //1-127
} subscribed_default_qos_t;
enum reflective_qos_attribute_e{
enum reflective_qos_attribute_e {
RQOS = 1,
NO_RQOS = 2
};
static const std::vector<std::string> reflective_qos_attribute_e2str = {"ERROR", "RQOS", "NO_RQOS"};
static const std::vector<std::string> reflective_qos_attribute_e2str = { "ERROR", "RQOS", "NO_RQOS" };
#endif
......@@ -20,18 +20,18 @@
*/
/*! \file 3gpp_commons.h
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\brief
\author Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_3GPP_COMMONS_SEEN
#define FILE_3GPP_COMMONS_SEEN
#include <stdint.h>
// 8.2 Recovery
// 8.2 Recovery
typedef struct recovery_s {
uint8_t restart_counter;
} recovery_t;
......
......@@ -20,11 +20,11 @@
*/
/*! \file common_defs.h
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
\brief
\author Sebastien ROUX, Lionel Gauthier
\company Eurecom
\email: lionel.gauthier@eurecom.fr
*/
#ifndef FILE_COMMON_DEFS_SEEN
#define FILE_COMMON_DEFS_SEEN
......@@ -38,24 +38,24 @@
typedef enum {
/* Fatal errors - received message should not be processed */
TLV_MAC_MISMATCH = -14,
TLV_BUFFER_NULL = -13,
TLV_BUFFER_TOO_SHORT = -12,
TLV_PROTOCOL_NOT_SUPPORTED = -11,
TLV_WRONG_MESSAGE_TYPE = -10,
TLV_OCTET_STRING_TOO_LONG_FOR_IEI = -9,
TLV_MAC_MISMATCH = -14,
TLV_BUFFER_NULL = -13,
TLV_BUFFER_TOO_SHORT = -12,
TLV_PROTOCOL_NOT_SUPPORTED = -11,
TLV_WRONG_MESSAGE_TYPE = -10,
TLV_OCTET_STRING_TOO_LONG_FOR_IEI = -9,
TLV_VALUE_DOESNT_MATCH = -4,
TLV_MANDATORY_FIELD_NOT_PRESENT = -3,
TLV_UNEXPECTED_IEI = -2,
TLV_VALUE_DOESNT_MATCH = -4,
TLV_MANDATORY_FIELD_NOT_PRESENT = -3,
TLV_UNEXPECTED_IEI = -2,
// RETURNerror = -1,
// RETURNok = 0,
TLV_ERROR_OK = RETURNok,
TLV_ERROR_OK = RETURNok,
/* Defines error code limit below which received message should be discarded
* because it cannot be further processed */
TLV_FATAL_ERROR = TLV_VALUE_DOESNT_MATCH
TLV_FATAL_ERROR = TLV_VALUE_DOESNT_MATCH
} error_code_e;
//------------------------------------------------------------------------------
......@@ -101,8 +101,6 @@ typedef enum {
*(uint32_t*)(buffer) = htonl(value); \
size += sizeof(uint32_t)
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
......@@ -140,9 +138,6 @@ typedef enum {
&& ((((__const uint32_t *) (a))[2] & (((__const uint32_t *) (m))[2])) == (((__const uint32_t *) (b))[2] & (((__const uint32_t *) (m))[2]))) \
&& ((((__const uint32_t *) (a))[3] & (((__const uint32_t *) (m))[3])) == (((__const uint32_t *) (b))[3] & (((__const uint32_t *) (m))[3]))))
////////////
#define IPV4_STR_ADDR_TO_INADDR(AdDr_StR,InAdDr,MeSsAgE ) do {\
if ( inet_aton(AdDr_StR, &InAdDr ) <= 0 ) {\
......@@ -150,7 +145,6 @@ typedef enum {
}\
} while (0)
#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -34,11 +34,11 @@
#include <set>
class itti_n4_restore : public itti_msg {
public:
itti_n4_restore(const task_id_t origin, const task_id_t destination):
public:
itti_n4_restore(const task_id_t origin, const task_id_t destination):
itti_msg(RESTORE_N4_SESSIONS, origin, destination), sessions() {}
itti_n4_restore(const itti_n4_restore& i) : itti_msg(i), sessions(i.sessions) {}
itti_n4_restore(const itti_n4_restore& i, const task_id_t orig, const task_id_t dest) : itti_n4_restore(i) {
itti_n4_restore(const itti_n4_restore& i) : itti_msg(i), sessions(i.sessions) {}
itti_n4_restore(const itti_n4_restore& i, const task_id_t orig, const task_id_t dest) : itti_n4_restore(i) {
origin = orig;
destination = dest;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment