Commit 953a3b93 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

update header files/polish the code

parent ec8c6d21
# REST API Server for Nsmf_PDUSession
## Overview
This API Server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
It uses the [Pistache](https://github.com/oktal/pistache) Framework.
## Files organization
The Pistache C++ REST server generator creates three folders:
- `api`: This folder contains the handlers for each method specified in the OpenAPI definition. Every handler extracts
the path and body parameters (if any) from the requests and tries to parse and possibly validate them.
Once this step is completed, the main API class calls the corresponding abstract method that should be implemented
by the developer (a basic implementation is provided under the `impl` folder)
- `impl`: As written above, the implementation folder contains, for each API, the corresponding implementation class,
which extends the main API class and implements the abstract methods.
Every method receives the path and body parameters as constant reference variables and a reference to the response
object, that should be filled with the right response and sent at the end of the method with the command:
response.send(returnCode, responseBody, [mimeType])
- `model`: This folder contains the corresponding class for every object schema found in the OpenAPI specification.
The main folder contains also a file with a main that can be used to start the server.
Of course, is you should customize this file based on your needs
## Installation
First of all, you need to download and install the libraries listed [here](#libraries-required).
Once the libraries are installed, in order to compile and run the server please follow the steps below:
```bash
mkdir build
cd build
cmake ..
make
```
Once compiled run the server:
```bash
cd build
./api-server
```
## Libraries required
- [pistache](http://pistache.io/quickstart)
- [JSON for Modern C++](https://github.com/nlohmann/json/#integration): Please download the `json.hpp` file and
put it under the model/nlohmann folder
## Namespaces
oai.smf.api
oai.smf.model
...@@ -495,6 +495,7 @@ typedef struct imsi_s imsi_t; ...@@ -495,6 +495,7 @@ typedef struct imsi_s imsi_t;
// 8.4 Cause // 8.4 Cause
enum cause_value_e { enum cause_value_e {
/* Request / Initial message */ /* Request / Initial message */
UNKNOWN_ERROR = -1,
LOCAL_DETACH = 2, LOCAL_DETACH = 2,
COMPLETE_DETACH = 3, COMPLETE_DETACH = 3,
RAT_CHANGE_3GPP_TO_NON_3GPP = 4, ///< RAT changed from 3GPP to Non-3GPP RAT_CHANGE_3GPP_TO_NON_3GPP = 4, ///< RAT changed from 3GPP to Non-3GPP
......
...@@ -100,29 +100,31 @@ static const std::vector<std::string> pdu_session_application_error_e2str = { ...@@ -100,29 +100,31 @@ static const std::vector<std::string> pdu_session_application_error_e2str = {
"NETWORK_FAILURE" "NETWORK_FAILURE"
}; };
enum n2_sm_info_type_e {
PDU_RES_SETUP_REQ = 1, //6.1.6.3.12 Enumeration: N2SmInfoType @3GPP TS 29.502 V16.0.0
PDU_RES_SETUP_RSP = 2, enum class n2_sm_info_type_e {
PDU_RES_SETUP_FAIL = 3, PDU_RES_SETUP_REQ = 1, //PDU Session Resource Setup Request Transfer
PDU_RES_REL_CMD = 4, PDU_RES_SETUP_RSP = 2, //PDU Session Resource Setup Response Transfer
PDU_RES_REL_RSP = 5, PDU_RES_SETUP_FAIL = 3, //PDU Session Resource Setup Unsuccessful Transfer
PDU_RES_MOD_REQ = 6, PDU_RES_REL_CMD = 4, //PDU Session Resource Release Command Transfer
PDU_RES_MOD_RSP = 7, PDU_RES_REL_RSP = 5, //PDU Session Resource Release Response Transfer
PDU_RES_MOD_FAIL = 8, PDU_RES_MOD_REQ = 6, //PDU Session Resource Modify Request Transfer
PDU_RES_NTY = 9, PDU_RES_MOD_RSP = 7, //PDU Session Resource Modify Response Transfer
PDU_RES_NTY_REL = 10, PDU_RES_MOD_FAIL = 8, //PDU Session Resource Modify Unsuccessful Transfer
PDU_RES_MOD_IND = 11, PDU_RES_NTY = 9, //PDU Session Resource Notify Transfer
PDU_RES_MOD_CFM = 12, PDU_RES_NTY_REL = 10, //PDU Session Resource Notify Released Transfer
PATH_SWITCH_REQ = 13, PDU_RES_MOD_IND = 11, //PDU Session Resource Modify Indication Transfer
PATH_SWITCH_SETUP_FAIL = 14, PDU_RES_MOD_CFM = 12, //PDU Session Resource Modify Confirm Transfer
PATH_SWITCH_REQ_ACK = 15, PATH_SWITCH_REQ = 13, //Path Switch Request Transfer
PATH_SWITCH_REQ_FAIL = 16, PATH_SWITCH_SETUP_FAIL = 14, //Path Switch Request Setup Failed Transfer
HANDOVER_REQUIRED = 17, PATH_SWITCH_REQ_ACK = 15, //Path Switch Request Acknowledge Transfer
HANDOVER_CMD = 18, PATH_SWITCH_REQ_FAIL = 16, //Path Switch Request Unsuccessful Transfer
HANDOVER_PREP_FAIL = 19, HANDOVER_REQUIRED = 17, //Handover Required Transfer
HANDOVER_REQ_ACK = 20, HANDOVER_CMD = 18, //Handover Command Transfer
HANDOVER_RES_ALLOC_FAIL = 21, HANDOVER_PREP_FAIL = 19, //Handover Preparation Unsuccessful Transfer
SECONDARY_RAT_USAGE = 22 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 = { static const std::vector<std::string> n2_sm_info_type_e2str = {
...@@ -151,5 +153,18 @@ static const std::vector<std::string> n2_sm_info_type_e2str = { ...@@ -151,5 +153,18 @@ static const std::vector<std::string> n2_sm_info_type_e2str = {
"SECONDARY_RAT_USAGE" "SECONDARY_RAT_USAGE"
}; };
enum class upCnx_state_e {
UPCNX_STATE_ACTIVATED = 0,
UPCNX_STATE_DEACTIVATED = 1,
UPCNX_STATE_ACTIVATING =2
};
static const std::vector<std::string> upCnx_state_e2str = {
"UPCNX_STATE_ACTIVATED",
"UPCNX_STATE_DEACTIVATED",
"UPCNX_STATE_ACTIVATING"
};
#endif #endif
...@@ -69,13 +69,15 @@ public: ...@@ -69,13 +69,15 @@ public:
class itti_n11_create_sm_context_response : public itti_n11_msg { class itti_n11_create_sm_context_response : public itti_n11_msg {
public: public:
itti_n11_create_sm_context_response(const task_id_t orig, const task_id_t dest, Pistache::Http::ResponseWriter& response): itti_n11_create_sm_context_response(const task_id_t orig, const task_id_t dest, Pistache::Http::ResponseWriter& response):
itti_n11_msg(N11_SESSION_CREATE_SM_CONTEXT_RESPONSE, orig, dest), http_response(response.clone()) {} itti_n11_msg(N11_SESSION_CREATE_SM_CONTEXT_RESPONSE, orig, dest), http_response(response.clone()), scid(0) {}
itti_n11_create_sm_context_response(const itti_n11_create_sm_context_response& i) : itti_n11_msg(i), res(i.res), http_response(i.http_response.clone()) {} itti_n11_create_sm_context_response(const itti_n11_create_sm_context_response& i) : itti_n11_msg(i), res(i.res), http_response(i.http_response.clone()), scid(i.scid) {}
itti_n11_create_sm_context_response(const itti_n11_create_sm_context_response& i, const task_id_t orig, const task_id_t dest) : itti_n11_create_sm_context_response(const itti_n11_create_sm_context_response& i, const task_id_t orig, const task_id_t dest) :
itti_n11_msg(i, orig, dest), res(i.res), http_response(i.http_response.clone()) {} itti_n11_msg(i, orig, dest), res(i.res), http_response(i.http_response.clone()), scid(i.scid) {}
const char* get_msg_name() {return "N11_SESSION_CREATE_SM_CONTEXT_RESPONSE";}; const char* get_msg_name() {return "N11_SESSION_CREATE_SM_CONTEXT_RESPONSE";};
smf::pdu_session_create_sm_context_response res; smf::pdu_session_create_sm_context_response res;
Pistache::Http::ResponseWriter http_response; Pistache::Http::ResponseWriter http_response;
void set_scid(scid_t id) {scid = id;};
scid_t scid; //SM Context ID
}; };
...@@ -109,4 +111,56 @@ public: ...@@ -109,4 +111,56 @@ public:
}; };
//-----------------------------------------------------------------------------
class itti_n11_modify_session_request_smf_requested : public itti_n11_msg {
public:
itti_n11_modify_session_request_smf_requested(const task_id_t orig, const task_id_t dest):
itti_n11_msg(N11_SESSION_MODIFICATION_REQUEST_SMF_REQUESTED, orig, dest) {}
itti_n11_modify_session_request_smf_requested(const itti_n11_modify_session_request_smf_requested& i) : itti_n11_msg(i), req(i.req) {}
itti_n11_modify_session_request_smf_requested(const itti_n11_modify_session_request_smf_requested& i, const task_id_t orig, const task_id_t dest) :
itti_n11_msg(i, orig, dest), req(i.req) {}
const char* get_msg_name() {return "N11_SESSION_MODIFICATION_REQUEST_SMF_REQUESTED";};
smf::pdu_session_create_sm_context_request req;
};
//-----------------------------------------------------------------------------
class itti_n11_update_pdu_session_status : public itti_n11_msg {
public:
itti_n11_update_pdu_session_status(const task_id_t orig, const task_id_t dest):
itti_n11_msg(N11_SESSION_UPDATE_PDU_SESSION_STATUS, orig, dest), scid(0), pdu_session_status(pdu_session_status_e::PDU_SESSION_INACTIVE) {}
itti_n11_update_pdu_session_status(const itti_n11_update_pdu_session_status& i) : itti_n11_msg(i), scid(i.scid), pdu_session_status(i.pdu_session_status) {}
itti_n11_update_pdu_session_status(const itti_n11_update_pdu_session_status& i, const task_id_t orig, const task_id_t dest) :
itti_n11_msg(i, orig, dest), scid(i.scid), pdu_session_status(i.pdu_session_status){}
const char* get_msg_name() {return "N11_SESSION_UPDATE_PDU_SESSION_STATUS";};
void set_scid(scid_t id) {scid = id;};
scid_t scid; //SM Context ID
pdu_session_status_e pdu_session_status;
void set_pdu_session_status(pdu_session_status_e status) {pdu_session_status = status;};
};
//-----------------------------------------------------------------------------
class itti_n11_n1n2_message_transfer_response_status : public itti_n11_msg {
public:
itti_n11_n1n2_message_transfer_response_status(const task_id_t orig, const task_id_t dest):
itti_n11_msg(N11_SESSION_N1N2_MESSAGE_TRANSFER_RESPONSE_STATUS, orig, dest), scid(0), response_code(0), msg_type(0) {}
itti_n11_n1n2_message_transfer_response_status(const itti_n11_n1n2_message_transfer_response_status& i) : itti_n11_msg(i), scid(i.scid), response_code(i.response_code), msg_type(i.msg_type) {}
itti_n11_n1n2_message_transfer_response_status(const itti_n11_n1n2_message_transfer_response_status& i, const task_id_t orig, const task_id_t dest) :
itti_n11_msg(i, orig, dest), scid(i.scid), response_code(i.response_code), msg_type(i.msg_type){}
const char* get_msg_name() {return "N11_SESSION_N1N2_MESSAGE_TRANSFER_RESPONSE_STATUS";};
void set_scid(scid_t id) {scid = id;};
void set_response_code(int16_t code) {response_code = code;};
void set_cause(std::string c) {cause = c;};
void set_msg_type(uint8_t type) {msg_type = type;};
scid_t scid; //SM Context ID
int16_t response_code;
std::string cause;
uint8_t msg_type;
};
#endif /* ITTI_MSG_N11_HPP_INCLUDED_ */ #endif /* ITTI_MSG_N11_HPP_INCLUDED_ */
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
class itti_n4_restore : public itti_msg { class itti_n4_restore : public itti_msg {
public: public:
itti_n4_restore(const task_id_t origin, const task_id_t destination): itti_n4_restore(const task_id_t origin, const task_id_t destination):
itti_msg(RESTORE_SX_SESSIONS, origin, destination), sessions() {} 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) : 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, const task_id_t orig, const task_id_t dest) : itti_n4_restore(i) {
origin = orig; origin = orig;
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*
* itti_msg_nx.hpp
*
* Created on:
* Author:
*/
#ifndef ITTI_MSG_NX_HPP_INCLUDED_
#define ITTI_MSG_NX_HPP_INCLUDED_
#include "itti_msg.hpp"
#include "smf_msg.hpp"
#include "pistache/http.h"
class itti_nx_msg : public itti_msg {
public:
itti_nx_msg(const itti_msg_type_t msg_type, const task_id_t orig, const task_id_t dest):
itti_msg(msg_type, orig, dest) {
}
itti_nx_msg(const itti_nx_msg& i) : itti_msg(i) {}
itti_nx_msg(const itti_nx_msg& i, const task_id_t orig, const task_id_t dest) :
itti_nx_msg(i)
{
origin = orig;
destination = dest;
}
};
//-----------------------------------------------------------------------------
class itti_nx_modify_pdu_session_request_network_requested : public itti_nx_msg {
public:
itti_nx_modify_pdu_session_request_network_requested(const task_id_t orig, const task_id_t dest):
itti_nx_msg(NX_SESSION_MODIFICATION_REQUEST_NETWORK_REQUESTED, orig, dest) {}
itti_nx_modify_pdu_session_request_network_requested(const itti_nx_modify_pdu_session_request_network_requested& i) : itti_nx_msg(i) {}
itti_nx_modify_pdu_session_request_network_requested(const itti_nx_modify_pdu_session_request_network_requested& i, const task_id_t orig, const task_id_t dest) :
itti_nx_msg(i, orig, dest){}
const char* get_msg_name() {return "NX_SESSION_MODIFICATION_REQUEST_NETWORK_REQUESTED";};
// smf::pdu_session_create_sm_context_request req;
};
#endif /* ITTI_MSG_NX_HPP_INCLUDED_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*
* itti_msg_s11.hpp
*
* Created on: Oct 6, 2018
* Author: lionel.gauthier@eurecom.fr
*/
#ifndef ITTI_MSG_S11_HPP_INCLUDED_
#define ITTI_MSG_S11_HPP_INCLUDED_
#include "3gpp_29.274.hpp"
#include "endpoint.hpp"
#include "itti_msg.hpp"
#include "msg_gtpv2c.hpp"
class itti_s11_msg : public itti_msg {
public:
itti_s11_msg(const itti_msg_type_t msg_type, const task_id_t origin, const task_id_t destination):
itti_msg(msg_type, origin, destination) {
l_endpoint = {};
r_endpoint = {};
teid = UNASSIGNED_TEID;
l_teid = UNASSIGNED_TEID;
gtpc_tx_id = 0;
}
itti_s11_msg(const itti_s11_msg& i) : itti_msg(i) {
l_endpoint = i.l_endpoint;
r_endpoint = i.r_endpoint;
teid = i.teid;
l_teid = i.l_teid;
gtpc_tx_id = i.gtpc_tx_id;
}
itti_s11_msg(const itti_s11_msg& i, const task_id_t orig, const task_id_t dest) : itti_s11_msg(i) {
origin = orig;
destination = dest;
}
endpoint l_endpoint;
endpoint r_endpoint;
teid_t teid; // remote teid
teid_t l_teid; // local teid
uint64_t gtpc_tx_id;
};
class itti_s11_remote_peer_not_responding : public itti_s11_msg {
public:
itti_s11_remote_peer_not_responding(const task_id_t orig, const task_id_t dest):
itti_s11_msg(S11_REMOTE_PEER_NOT_RESPONDING, orig, dest) {}
itti_s11_remote_peer_not_responding(const itti_s11_remote_peer_not_responding& i) : itti_s11_msg(i) {}
itti_s11_remote_peer_not_responding(const itti_s11_remote_peer_not_responding& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {}
const char* get_msg_name() {return "S11_REMOTE_PEER_NOT_RESPONDING";};
};
//-----------------------------------------------------------------------------
class itti_s11_create_session_request : public itti_s11_msg {
public:
itti_s11_create_session_request(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_CREATE_SESSION_REQUEST, origin, destination) { }
itti_s11_create_session_request(const itti_s11_create_session_request& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_create_session_request(const itti_s11_create_session_request& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_create_session_request).name();};
gtpv2c::gtpv2c_create_session_request gtp_ies;
};
//-----------------------------------------------------------------------------
/** @class itti_s11_create_session_response_t
* @brief Create Session Response
*
* The Create Session Response will be sent on S11 interface as
* part of these procedures:
* - E-UTRAN Initial Attach
* - UE requested PDN connectivity
* - Tracking Area Update procedure with SGW change
* - S1/X2-based handover with SGW change
*/
class itti_s11_create_session_response : public itti_s11_msg {
public:
itti_s11_create_session_response(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_CREATE_SESSION_RESPONSE, origin, destination) {
}
itti_s11_create_session_response(const itti_s11_create_session_response& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_create_session_response(const itti_s11_create_session_response& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_create_session_response).name();};
gtpv2c::gtpv2c_create_session_response gtp_ies;
};
//-----------------------------------------------------------------------------
/** @class itti_s11_create_bearer_request
* @brief Create Bearer Request
*
* The direction of this message shall be from PGW to SGW and from SGW to MME/S4-SGSN, and from PGW to ePDG
* The Create Bearer Request message shall be sent on the S5/S8 interface by the PGW to the SGW and on the S11
* interface by the SGW to the MME as part of the Dedicated Bearer Activation procedure.
* The message shall also be sent on the S5/S8 interface by the PGW to the SGW and on the S4 interface by the SGW to
* the SGSN as part of the Secondary PDP Context Activation procedure or the Network Requested Secondary PDP
* Context Activation procedure.
* The message shall also be sent on the S2b interface by the PGW to the ePDG as part of the Dedicated S2b bearer
* activation with GTP on S2b.
*/
class itti_s11_create_bearer_request : public itti_s11_msg {
public:
itti_s11_create_bearer_request(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_CREATE_BEARER_REQUEST, origin, destination) {
}
itti_s11_create_bearer_request(const itti_s11_create_bearer_request& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_create_bearer_request(const itti_s11_create_bearer_request& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_create_session_request).name();};
gtpv2c::gtpv2c_create_bearer_request gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_create_bearer_response
* @brief Create Bearer Response
*
* The Create Bearer Response message shall be sent on the S5/S8 interface by the SGW to the PGW, and on the S11
* interface by the MME to the SGW as part of the Dedicated Bearer Activation procedure.
* The message shall also be sent on the S5/S8 interface by the SGW to the PGW and on the S4 interface by the SGSN to
* the SGW as part of Secondary PDP Context Activation procedure or the Network Requested Secondary PDP Context
* Activation procedure.
* The message shall also be sent on the S2b interface by the ePDG to the PGW as part of the Dedicated S2b bearer
* activation with GTP on S2b.
* Possible Cause values are specified in Table 8.4-1. Message specific cause values are:
* - "Request accepted".
* - "Request accepted partially".
* - "Context not found".
* - "Semantic error in the TFT operation".
* - "Syntactic error in the TFT operation".
* - "Semantic errors in packet filter(s)".
* - "Syntactic errors in packet filter(s)".
* - "Service not supported".
* - "Unable to page UE".
* - "UE not responding".
* - "Unable to page UE due to Suspension".
* - "UE refuses".
* - "Denied in RAT".
* - "UE context without TFT already activated".
*/
class itti_s11_create_bearer_response : public itti_s11_msg {
public:
itti_s11_create_bearer_response(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_CREATE_BEARER_RESPONSE, origin, destination) {
}
itti_s11_create_bearer_response(const itti_s11_create_bearer_response& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_create_bearer_response(const itti_s11_create_bearer_response& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_create_bearer_response).name();};
gtpv2c::gtpv2c_create_bearer_response gtp_ies;
};
//-----------------------------------------------------------------------------
/** @class itti_s11_modify_bearer_request
* @brief Modify Bearer Request
*
* The Modify Bearer Request will be sent on S11 interface as
* part of these procedures:
* - E-UTRAN Tracking Area Update without SGW Change
* - UE triggered Service Request
* - S1-based Handover
* - E-UTRAN Initial Attach
* - UE requested PDN connectivity
* - X2-based handover without SGWrelocation
*/
class itti_s11_modify_bearer_request : public itti_s11_msg {
public:
itti_s11_modify_bearer_request(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_MODIFY_BEARER_REQUEST, origin, destination) {
}
itti_s11_modify_bearer_request(const itti_s11_modify_bearer_request& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_modify_bearer_request(const itti_s11_modify_bearer_request& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_modify_bearer_request).name();};
gtpv2c::gtpv2c_modify_bearer_request gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_modify_bearer_response
* @brief Modify Bearer Response
*
* The Modify Bearer Response will be sent on S11 interface as
* part of these procedures:
* - E-UTRAN Tracking Area Update without SGW Change
* - UE triggered Service Request
* - S1-based Handover
* - E-UTRAN Initial Attach
* - UE requested PDN connectivity
* - X2-based handover without SGWrelocation
*/
class itti_s11_modify_bearer_response : public itti_s11_msg {
public:
itti_s11_modify_bearer_response(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_MODIFY_BEARER_RESPONSE, origin, destination) {
}
itti_s11_modify_bearer_response(const itti_s11_modify_bearer_response& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_modify_bearer_response(const itti_s11_modify_bearer_response& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_modify_bearer_response).name();};
gtpv2c::gtpv2c_modify_bearer_response gtp_ies;
} ;
//-----------------------------------------------------------------------------
class itti_s11_delete_session_request : public itti_s11_msg {
public:
itti_s11_delete_session_request(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_DELETE_SESSION_REQUEST, origin, destination) {
}
itti_s11_delete_session_request(const itti_s11_delete_session_request& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_delete_session_request(const itti_s11_delete_session_request& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_delete_session_request).name();};
gtpv2c::gtpv2c_delete_session_request gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_delete_session_response
* @brief Delete Session Response
*
* The Delete Session Response will be sent on S11 interface as
* part of these procedures:
* - EUTRAN Initial Attach
* - UE, HSS or MME Initiated Detach
* - UE or MME Requested PDN Disconnection
* - Tracking Area Update with SGW Change
* - S1 Based Handover with SGW Change
* - X2 Based Handover with SGW Relocation
* - S1 Based handover cancel with SGW change
*/
class itti_s11_delete_session_response : public itti_s11_msg {
public:
itti_s11_delete_session_response(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_DELETE_SESSION_RESPONSE, origin, destination) {
}
itti_s11_delete_session_response(const itti_s11_delete_session_response& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_delete_session_response(const itti_s11_delete_session_response& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_delete_session_response).name();};
gtpv2c::gtpv2c_delete_session_response gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_release_access_bearers_request
* @brief Release AccessBearers Request
*
* The Release Access Bearers Request message shall sent on the S11 interface by
* the MME to the SGW as part of the S1 release procedure.
* The message shall also be sent on the S4 interface by the SGSN to the SGW as
* part of the procedures:
* - RAB release using S4
* - Iu Release using S4
* - READY to STANDBY transition within the network
*/
class itti_s11_release_access_bearers_request : public itti_s11_msg {
public:
itti_s11_release_access_bearers_request(const task_id_t origin, const task_id_t destination): itti_s11_msg(S11_RELEASE_ACCESS_BEARERS_REQUEST, origin, destination) {
}
itti_s11_release_access_bearers_request(const itti_s11_release_access_bearers_request& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_release_access_bearers_request(const itti_s11_release_access_bearers_request& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_release_access_bearers_request).name();};
gtpv2c::gtpv2c_release_access_bearers_request gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_release_access_bearers_response
* @brief Release AccessBearers Response
*
* The Release Access Bearers Response message is sent on the S11 interface by the SGW to the MME as part of the S1
* release procedure.
* The message shall also be sent on the S4 interface by the SGW to the SGSN as part of the procedures:
* - RAB release using S4
* - Iu Release using S4
* - READY to STANDBY transition within the network
* Possible Cause values are specified in Table 8.4-1. Message specific cause values are:
* - "Request accepted".
* - "Request accepted partially".
* - "Context not found
*/
class itti_s11_release_access_bearers_response : public itti_s11_msg {
public:
itti_s11_release_access_bearers_response(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_RELEASE_ACCESS_BEARERS_RESPONSE, origin, destination) {
}
itti_s11_release_access_bearers_response(const itti_s11_release_access_bearers_response& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_release_access_bearers_response(const itti_s11_release_access_bearers_response& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_release_access_bearers_response).name();};
gtpv2c::gtpv2c_release_access_bearers_response gtp_ies;
};
//-----------------------------------------------------------------------------
/** @class itti_s11_delete_bearer_command_t
* @brief Initiate Delete Bearer procedure
*
* A Delete Bearer Command message shall be sent on the S11 interface by the MME to the SGW and on the S5/S8
* interface by the SGW to the PGW as a part of the eNodeB requested bearer release or MME-Initiated Dedicated Bearer
* Deactivation procedure.
* The message shall also be sent on the S4 interface by the SGSN to the SGW and on the S5/S8 interface by the SGW to
* the PGW as part of the MS and SGSN Initiated Bearer Deactivation procedure using S4.
*/
class itti_s11_delete_bearer_command : public itti_s11_msg {
public:
itti_s11_delete_bearer_command(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_DELETE_BEARER_COMMAND, origin, destination) {
}
itti_s11_delete_bearer_command(const itti_s11_delete_bearer_command& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_delete_bearer_command(const itti_s11_delete_bearer_command& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_delete_bearer_command).name();};
gtpv2c::gtpv2c_delete_bearer_command gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_downlink_data_notification
* @brief Downlink Data Notification
*
* The Downlink Data Notification message is sent on the S11 interface by the SGW to the MME as part of the S1 paging procedure.
*/
class itti_s11_downlink_data_notification : public itti_s11_msg {
public:
itti_s11_downlink_data_notification(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_DOWNLINK_DATA_NOTIFICATION, origin, destination) {
}
itti_s11_downlink_data_notification(const itti_s11_downlink_data_notification& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_downlink_data_notification(const itti_s11_downlink_data_notification& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
itti_s11_downlink_data_notification(const gtpv2c::gtpv2c_downlink_data_notification& ies, const task_id_t orig, const task_id_t dest) :
itti_s11_downlink_data_notification(orig, dest) {
gtp_ies = ies;
}
const char* get_msg_name() {return typeid(itti_s11_downlink_data_notification).name();};
gtpv2c::gtpv2c_downlink_data_notification gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_downlink_data_notification_acknowledge
* @brief Downlink Data Notification Acknowledge
*
* The Downlink Data Notification Acknowledge message is sent on the S11 interface by the MME to the SGW as part of the S1 paging procedure.
*/
class itti_s11_downlink_data_notification_acknowledge : public itti_s11_msg {
public:
itti_s11_downlink_data_notification_acknowledge(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_DOWNLINK_DATA_NOTIFICATION_ACKNOWLEDGE, origin, destination) {
}
itti_s11_downlink_data_notification_acknowledge(const itti_s11_downlink_data_notification_acknowledge& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_downlink_data_notification_acknowledge(const itti_s11_downlink_data_notification_acknowledge& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_downlink_data_notification_acknowledge).name();};
gtpv2c::gtpv2c_downlink_data_notification_acknowledge gtp_ies;
} ;
//-----------------------------------------------------------------------------
/** @class itti_s11_downlink_data_notification_failure_indication
* @brief Downlink Data Notification Failure Indication
*
*/
class itti_s11_downlink_data_notification_failure_indication : public itti_s11_msg {
public:
itti_s11_downlink_data_notification_failure_indication(const task_id_t origin, const task_id_t destination):
itti_s11_msg(S11_DOWNLINK_DATA_NOTIFICATION_FAILURE_INDICATION, origin, destination) {
}
itti_s11_downlink_data_notification_failure_indication(const itti_s11_downlink_data_notification_failure_indication& i) : itti_s11_msg(i) {
gtp_ies = i.gtp_ies;
}
itti_s11_downlink_data_notification_failure_indication(const itti_s11_downlink_data_notification_failure_indication& i, const task_id_t orig, const task_id_t dest) :
itti_s11_msg(i, orig, dest) {
gtp_ies = i.gtp_ies;
}
const char* get_msg_name() {return typeid(itti_s11_downlink_data_notification_failure_indication).name();};
gtpv2c::gtpv2c_downlink_data_notification_failure_indication gtp_ies;
} ;
#endif /* ITTI_MSG_S11_HPP_INCLUDED_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FILE_3GPP_38_401_SEEN #ifndef FILE_3GPP_38_401_SEEN
#define FILE_3GPP_38_401_SEEN #define FILE_3GPP_38_401_SEEN
......
...@@ -38,9 +38,9 @@ typedef uint32_t sctp_assoc_id_t; ...@@ -38,9 +38,9 @@ typedef uint32_t sctp_assoc_id_t;
#define INVALID_RAN_UE_NGAP_ID_KEY 0xFFFFFFFFFFFFFFFF #define INVALID_RAN_UE_NGAP_ID_KEY 0xFFFFFFFFFFFFFFFF
#define RAN_UE_NGAP_ID_MASK 0x00FFFFFF #define RAN_UE_NGAP_ID_MASK 0x00FFFFFF
#define RAN_UE_NGAP_ID_FMT "0x%06"PRIX32 #define RAN_UE_NGAP_ID_FMT "0x%06" PRIX32
#define GNB_UE_NGAP_ID_FMT "0x%06"PRIX32 #define GNB_UE_NGAP_ID_FMT "0x%06" PRIX32
#define AMF_UE_NGAP_ID_FMT "0x%08"PRIX32 #define AMF_UE_NGAP_ID_FMT "0x%08" PRIX32
#define INVALID_AMF_UE_NGAP_ID 0x0 #define INVALID_AMF_UE_NGAP_ID 0x0
#define AMF_UE_NGAP_ID_MASK_ 0x0000FFFFFFFFFF #define AMF_UE_NGAP_ID_MASK_ 0x0000FFFFFFFFFF
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdint.h> #include <stdint.h>
#include "ngap_common.h" #include "ngap_common.h"
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef FILE_NGAP_COMMON_SEEN #ifndef FILE_NGAP_COMMON_SEEN
#define FILE_NGAP_COMMON_SEEN #define FILE_NGAP_COMMON_SEEN
......
...@@ -107,5 +107,55 @@ typedef struct pdu_session_type_s { ...@@ -107,5 +107,55 @@ typedef struct pdu_session_type_s {
const std::string& toString() const {return pdu_session_type_e2str.at(pdu_session_type);} const std::string& toString() const {return pdu_session_type_e2str.at(pdu_session_type);}
} pdu_session_type_t; } pdu_session_type_t;
//SMF + AMF + 3GPP TS 29.571 (Common data)
enum class http_response_codes_e {
HTTP_RESPONSE_CODE_OK = 200,
HTTP_RESPONSE_CODE_ACCEPTED = 202,
HTTP_RESPONSE_CODE_BAD_REQUEST = 400,
HTTP_RESPONSE_CODE_UNAUTHORIZED = 401,
HTTP_RESPONSE_CODE_FORBIDDEN = 403,
HTTP_RESPONSE_CODE_NOT_FOUND = 404,
HTTP_RESPONSE_CODE_METHOD_NOT_ALLOWED = 405,
HTTP_RESPONSE_CODE_REQUEST_TIMEOUT = 408,
HTTP_RESPONSE_CODE_406_NOT_ACCEPTED = 406,
HTTP_RESPONSE_CODE_CONFLICT = 409,
HTTP_RESPONSE_CODE_GONE = 410,
HTTP_RESPONSE_CODE_LENGTH_REQUIRED = 411,
HTTP_RESPONSE_CODE_PRECONDITION_FAILED = 412,
HTTP_RESPONSE_CODE_PAYLOAD_TOO_LARGE = 413,
HTTP_RESPONSE_CODE_URI_TOO_LONG = 414,
HTTP_RESPONSE_CODE_UNSUPPORTED_MEDIA_TYPE = 415,
HTTP_RESPONSE_CODE_TOO_MANY_REQUESTS = 429,
HTTP_RESPONSE_CODE_INTERNAL_SERVER_ERROR = 500,
HTTP_RESPONSE_CODE_NOT_IMPLEMENTED = 501,
HTTP_RESPONSE_CODE_SERVICE_UNAVAILABLE = 503,
HTTP_RESPONSE_CODE_GATEWAY_TIMEOUT = 504
};
//From 23.502
enum class session_management_procedures_type_e {
PDU_SESSION_ESTABLISHMENT_UE_REQUESTED = 0,
PDU_SESSION_MODIFICATION_UE_INITIATED = 1,
PDU_SESSION_MODIFICATION_SMF_REQUESTED = 2,
PDU_SESSION_MODIFICATION_AN_REQUESTED = 3,
PDU_SESSION_RELEASE_UE_REQUESTED = 4,
PDU_SESSION_RELEASE_NETWORK_REQUESTED = 5,
SERVICE_REQUEST_UE_TRIGGERED = 6,
SERVICE_REQUEST_NETWORK_TRIGGERED = 7
};
static const std::vector<std::string> session_management_procedures_type_e2str = {
"PDU_SESSION_ESTABLISHMENT_UE_REQUESTED",
"PDU_SESSION_MODIFICATION_UE_INITIATED",
"PDU_SESSION_MODIFICATION_SMF_REQUESTED",
"PDU_SESSION_MODIFICATION_AN_REQUESTED",
"PDU_SESSION_RELEASE_UE_REQUESTED",
"PDU_SESSION_RELEASE_NETWORK_REQUESTED",
"SERVICE_REQUEST_UE_TRIGGERED",
"SERVICE_REQUEST_NETWORK_TRIGGERED"
};
#endif #endif
...@@ -38,7 +38,6 @@ typedef enum { ...@@ -38,7 +38,6 @@ typedef enum {
TASK_GTPV2_C, TASK_GTPV2_C,
TASK_SMF_APP, TASK_SMF_APP,
TASK_SMF_N4, TASK_SMF_N4,
TASK_SPGWU_SX,
TASK_SMF_N10, TASK_SMF_N10,
TASK_SMF_N11, TASK_SMF_N11,
TASK_MAX, TASK_MAX,
...@@ -60,7 +59,7 @@ typedef enum { ...@@ -60,7 +59,7 @@ typedef enum {
ITTI_MSG_TYPE_NONE = -1, ITTI_MSG_TYPE_NONE = -1,
ITTI_MSG_TYPE_FIRST = 0, ITTI_MSG_TYPE_FIRST = 0,
ASYNC_SHELL_CMD = ITTI_MSG_TYPE_FIRST, ASYNC_SHELL_CMD = ITTI_MSG_TYPE_FIRST,
RESTORE_SX_SESSIONS, RESTORE_N4_SESSIONS,
S11_REMOTE_PEER_NOT_RESPONDING, S11_REMOTE_PEER_NOT_RESPONDING,
S11_CREATE_SESSION_REQUEST, S11_CREATE_SESSION_REQUEST,
S11_CREATE_SESSION_RESPONSE, S11_CREATE_SESSION_RESPONSE,
...@@ -112,6 +111,10 @@ typedef enum { ...@@ -112,6 +111,10 @@ typedef enum {
N11_SESSION_CREATE_SM_CONTEXT_RESPONSE, N11_SESSION_CREATE_SM_CONTEXT_RESPONSE,
N11_SESSION_UPDATE_SM_CONTEXT_REQUEST, N11_SESSION_UPDATE_SM_CONTEXT_REQUEST,
N11_SESSION_UPDATE_SM_CONTEXT_RESPONSE, N11_SESSION_UPDATE_SM_CONTEXT_RESPONSE,
N11_SESSION_MODIFICATION_REQUEST_SMF_REQUESTED,
N11_SESSION_UPDATE_PDU_SESSION_STATUS,
N11_SESSION_N1N2_MESSAGE_TRANSFER_RESPONSE_STATUS,
NX_SESSION_MODIFICATION_REQUEST_NETWORK_REQUESTED,
UDP_INIT, UDP_INIT,
UDP_DATA_REQ, UDP_DATA_REQ,
UDP_DATA_IND, UDP_DATA_IND,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
#ifndef _NAS_SM_ENCODE_TO_JSON_H_
#define _NAS_SM_ENCODE_TO_JSON_H_
int sm_encode_establishment_request(void);
int sm_encode_establishment_accept(void);
int sm_encode_establishment_reject(void);
int sm_encode_authentication_command(void);
int sm_encode_authentication_complete(void);
int sm_encode_authentication_result(void);
int sm_encode_modification_request(void);
int sm_encode_modification_reject(void);
int sm_encode_modification_command(void);
int sm_encode_modification_complete(void);
int sm_encode_modification_command_reject(void);
int sm_encode_release_request(void);
int sm_encode_release_reject(void);
int sm_encode_release_command(void);
int sm_encode_release_complete(void);
int sm_encode__5gsm_status_(void);
int sm_encode_all(void);
#endif
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