Commit fa3d392f authored by Raymond Knopp's avatar Raymond Knopp

Remote UE Report updated EBI

parent 96f969df
......@@ -52,7 +52,7 @@ int decode_pkmf_address(
if ((ielen + 2) != decoded) {
decoded = ielen + 1 + (iei > 0 ? 1 : 0) /* Size of header for this IE */ ;
//OAILOG_TRACE (LOG_NAS_EMM, "PKMFAddress then decoded=%u\n", decoded);
}
return decoded;
}
......
......@@ -48,7 +48,7 @@ typedef struct remote_ue_context_s {
#define EVEN_IDENTITY 0
#define ODD_IDENTITY 1
uint8_t oddevenindic:1;
uint8_t flags_present;
uint8_t flags_present;
imsi_identity_t *imsi_identity;
}remote_ue_context_t;
......
......@@ -168,7 +168,7 @@ int esm_proc_dedicated_eps_bearer_context_request(nas_user_t *user, int ebi, int
default_ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, FALSE, qos, tft);
if (default_ebi != ESM_EBI_UNASSIGNED) {
/* Dedicated EPS bearer contextx successfully created */
/* Dedicated EPS bearer context successfully created */
rc = RETURNok;
} else {
/* No resource available */
......
......@@ -130,7 +130,7 @@ int esm_proc_default_eps_bearer_context_request(nas_user_t *user, int pid, int e
ebi = esm_ebr_context_create(esm_data, user->ueid, pid, ebi, TRUE, qos, NULL);
if (ebi != ESM_EBI_UNASSIGNED) {
/* Default EPS bearer contextx successfully created */
/* Default EPS bearer context successfully created */
default_eps_bearer_context_data->ebi = ebi;
rc = RETURNok;
} else {
......
......@@ -148,17 +148,19 @@ int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int is_to_define,
if (!is_to_define) {
LOG_TRACE(INFO, "ESM-PROC - Undefine PDN connection (cid=%d)", cid);
/* Delete the PDN connection entry */
int pti = _pdn_connectivity_delete(esm_data, pid);
if (pti != ESM_PT_UNASSIGNED) {
/* Release the procedure transaction data */
rc = esm_pt_release(esm_pt_data, pti);
/* Release the procedure transaction data */
rc = esm_pt_release(esm_pt_data, pti);
}
LOG_FUNC_RETURN(rc);
} else if (pti != NULL) {
LOG_TRACE(INFO, "ESM-PROC - Assign new procedure transaction identity ""(cid=%d)", cid);
/* Assign new procedure transaction identity */
*pti = esm_pt_assign(esm_pt_data);
......@@ -923,14 +925,21 @@ static int _pdn_connectivity_delete(esm_data_t *esm_data, int pid)
} else if (esm_data->pdn[pid].data == NULL) {
LOG_TRACE(ERROR,
"ESM-PROC - PDN connection has not been allocated");
} else if (esm_data->pdn[pid].is_active) {
LOG_TRACE(ERROR, "ESM-PROC - PDN connection is active");
} else {
/* Update the identity of the procedure transaction assigned to
* the PDN connection */
}
//else if (esm_data->pdn[pid].is_active) {
// LOG_TRACE(ERROR, "ESM-PROC - PDN connection is active");
//}
/* Update the identity of the procedure transaction assigned to
* the PDN connection */
else if (esm_data->pdn[pid].is_active) {
LOG_TRACE(ERROR, "ESM-PROC - PDN connection is active");
}
esm_data->pdn[pid].data->pti = pti;
return (RETURNok);
}
}
return (RETURNerror);
......
......@@ -43,7 +43,7 @@ Description
#include "esm_proc.h"
#include "commonDef.h"
#include "nas_log.h"
#include "esm_ebr.h"
#include "esmData.h"
#include "esm_cause.h"
#include "esm_pt.h"
......@@ -68,38 +68,41 @@ Description
* Internal data handled by the PDN connectivity procedure in the UE
* --------------------------------------------------------------------------
*/
//int _pdn_connectivity_delete(esm_data_t *esm_data, int pid);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
//int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti);
int esm_proc_remote_ue_report(nas_user_t *user,int cid, unsigned int *pti)
int esm_proc_remote_ue_report(nas_user_t *user,int cid, int ebi, unsigned int *pti)
{
LOG_FUNC_IN;
int rc = RETURNerror;
int pid;
//int pid = cid - 1;
//int pid ;
int pid = cid - 1;
esm_data_t *esm_data = user-> esm_data;
esm_pt_data_t *esm_pt_data = user-> esm_pt_data;
if (pti != NULL)
{
LOG_TRACE(INFO, "ESM-PROC - Assign new procedure transaction identity ""(cid=%d)", cid);
/* Assign new procedure transaction identity */
*pti = esm_pt_assign(esm_pt_data);
if (pti != NULL) {
if (*pti == ESM_PT_UNASSIGNED) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to assign new procedure transaction identity");
LOG_FUNC_RETURN (RETURNerror);
}
//static int _pdn_connectivity_set_pti(esm_data_t *esm_data, int pid, int pti);
LOG_TRACE(INFO, "ESM-PROC - Assign new procedure transaction identity ""(cid=%d)", cid);
/* Update the PDN connection data */
/* Assign new procedure transaction identity */
*pti = esm_pt_assign(esm_pt_data);
if (*pti == ESM_PT_UNASSIGNED) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to assign new procedure transaction identity");
LOG_FUNC_RETURN (RETURNerror);
}
/* Update the PDN connection data */
rc = _pdn_connectivity_set_pti(esm_data, pid, *pti);
//ebi = esm_ebr_assign(user->esm_ebr_data, ebi, pid+1, FALSE);
rc = _pdn_connectivity_set_pti(esm_data, pid, *pti);
if (rc != RETURNok) {
LOG_TRACE(WARNING, "ESM-PROC - Failed to update PDN connection");
}
......@@ -107,9 +110,6 @@ int esm_proc_remote_ue_report(nas_user_t *user,int cid, unsigned int *pti)
LOG_FUNC_RETURN(rc);
}
/****************************************************************************
** **
** Name: esm_proc_remote_ue_report_low_layer **
......@@ -159,3 +159,49 @@ int esm_proc_remote_ue_report_low_layer(nas_user_t *user, int is_standalone, int
}
LOG_FUNC_RETURN(rc);
}
/****************************************************************************
** **
** Name: esm_proc_remote_ue_report_response **
** **
** Description: Initiates Remote UE Report response procedure **
** **
** **
** 3GPP TS 24.301, section 6.5.1.2 **
** Network send this message to UE indicating the completion of
** remote ue report procedure. **
** **
** **
** Inputs: is_standalone: Indicates whether the Remote UE Report **
** procedure is initiated as part of the at- **
** tach procedure **
** pti: Procedure transaction identity **
** msg: Encoded Remote UE Report response message **
** to be sent **
** sent_by_ue: Not used - Always TRUE **
** Others: None **
** **
** Outputs: None **
** Return: RETURNok, RETURNerror **
** Others: None **
** **
***************************************************************************/
int esm_proc_remote_ue_report_response(nas_user_t *user, int pti)
{
LOG_FUNC_IN;
esm_pt_data_t *esm_pt_data = user->esm_pt_data;
int rc = RETURNerror;
LOG_TRACE(INFO, "ESM-PROC - Remote UE report response");
/* Get the procedure transaction identity assigned to the PDN connection
* entry which is still pending in the inactive state */
rc = esm_pt_set_status(esm_pt_data, pti, ESM_PT_INACTIVE);
if (pti != ESM_PT_UNASSIGNED) {
/* Release the procedure transaction identity */
rc = esm_pt_release(esm_pt_data, pti);
}
LOG_FUNC_RETURN(rc);
}
......@@ -685,6 +685,74 @@ int esm_recv_deactivate_eps_bearer_context_request(nas_user_t *user, int pti, in
}
/****************************************************************************
** **
** Name: esm_recv_remote_ue_report_response() **
** **
** Description: Processes Remote UE Report Response message **
** **
** Inputs: pti: Procedure transaction identity **
** ebi: EPS bearer identity **
** msg: The received ESM message **
** Others: None **
** **
** Outputs: None **
** Return: ESM cause code whenever the processing of **
** the ESM message fails **
** Others: None **
** **
***************************************************************************/
int esm_recv_remote_ue_report_response(nas_user_t *user, int pti, int ebi,
const remote_ue_report_response_msg *msg)
{
LOG_FUNC_IN;
int esm_cause;
int rc= RETURNok;
LOG_TRACE(INFO, "ESM-SAP - Received Remote UE report response message "
"(pti=%d, ebi=%d, cause=%d)", pti, ebi);
/*
* Procedure transaction identity checking
*/
if ( (pti == ESM_PT_UNASSIGNED) || esm_pt_is_reserved(pti) ) {
/* 3GPP TS 24.301, section 7.3.1, case a
* Reserved or unassigned PTI value
*/
LOG_TRACE(WARNING, "ESM-SAP - Invalid PTI value (pti=%d)", pti);
LOG_FUNC_RETURN (ESM_CAUSE_INVALID_PTI_VALUE);
} else if ( esm_pt_is_not_in_use(user->esm_pt_data, pti) ) {
/* 3GPP TS 24.301, section 7.3.1, case a
* Assigned value that does not match any PTI in use
*/
LOG_TRACE(WARNING, "ESM-SAP - PTI mismatch (pti=%d)", pti);
LOG_FUNC_RETURN (ESM_CAUSE_PTI_MISMATCH);
}
/*
* EPS bearer identity checking
*/
else if ( (ebi != ESM_EBI_UNASSIGNED) || esm_ebr_is_reserved(user->esm_ebr_data, ebi) ) {
/* 3GPP TS 24.301, section 7.3.2, case a
* Assigned or reserved EPS bearer identity value */
LOG_TRACE(WARNING, "ESM-SAP - Invalid EPS bearer identity (ebi=%d)",
ebi);
LOG_FUNC_RETURN (ESM_CAUSE_INVALID_EPS_BEARER_IDENTITY);
}
/*
* Message processing
*/
/* Get the ESM cause */
//esm_cause = msg->esmcause;
if (rc != RETURNerror) {
/* Execute the EPS bearer context deactivation procedure */
rc = esm_proc_remote_ue_report_response(user,pti);
}
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
......
......@@ -53,6 +53,7 @@ Description Defines functions executed at the ESM Service Access
#include "ActivateDedicatedEpsBearerContextRequest.h"
#include "ModifyEpsBearerContextRequest.h"
#include "DeactivateEpsBearerContextRequest.h"
#include "RemoteUEReportResponse.h"
#include "EsmInformationRequest.h"
......@@ -108,5 +109,11 @@ int esm_recv_activate_dedicated_eps_bearer_context_request(nas_user_t *user, int
int esm_recv_deactivate_eps_bearer_context_request(nas_user_t *user, int pti, int ebi,
const deactivate_eps_bearer_context_request_msg *msg);
/*
* Messages related to Remote UE Report procedure
* ---------------------------------------
*/
int esm_recv_remote_ue_report_response(nas_user_t *user, int pti, int ebi,
const remote_ue_report_response_msg *msg);
#endif /* __ESM_RECV_H__*/
......@@ -160,22 +160,23 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
esm_sap_primitive2str(primitive - ESM_START - 1), primitive);
switch (primitive) {
case ESM_REMOTE_UE_REPORT_REQ:
//case ESM_REMOTE_UE_REPORT:
{
esm_remote_ue_report_t *remote_ue_report = &msg->data.remote_ue_report;
unsigned int pti;
int cid;
/* Assign new procedure transaction identity */
rc = esm_proc_remote_ue_report(user, cid, &pti);
esm_remote_ue_report_t *remote_ue_report = &msg->data.remote_ue_report;
unsigned int pti;
#warning "TODO hardcoded EBI value 5, to read in esm_ebr_data if works"
int ebi = 5;
rc = _esm_sap_send(user, REMOTE_UE_REPORT,
/* Assign new procedure transaction identity */
rc = esm_proc_remote_ue_report(user, remote_ue_report->cid, ebi, &pti);
rc = _esm_sap_send(user, REMOTE_UE_REPORT,
msg->is_standalone,
pti, EPS_BEARER_IDENTITY_UNASSIGNED,
pti, ebi,
&msg->data, &msg->send);
}
}
break;
case ESM_PDN_CONNECTIVITY_REQ:
......@@ -224,7 +225,8 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
esm_pdn_connectivity_t *pdn_connect = &msg->data.pdn_connect;
if ( msg->is_standalone && pdn_connect->is_defined ) {
/* Undefine the specified PDN context */
/* Undefine the specified PDN context */
rc = esm_proc_pdn_connectivity(user, pdn_connect->cid, FALSE,
pdn_connect->pdn_type, NULL,
pdn_connect->is_emergency, NULL);
......@@ -783,7 +785,8 @@ static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone,
*/
const esm_remote_ue_report_t *msg = &data->remote_ue_report; // test message
//esm_msg.header.message_type = REMOTE_UE_REPORT;
rc = esm_send_remote_ue_report(ebi, &esm_msg.remote_ue_report);
rc = esm_send_remote_ue_report(pti,ebi, &esm_msg.remote_ue_report);
/* Setup callback function used to send Remote UE Report
* message onto the network */
esm_procedure = esm_proc_remote_ue_report_low_layer;
......
......@@ -144,7 +144,8 @@ typedef struct esm_eps_bearer_context_deactivate_s {
*/
typedef struct esm_remote_ue_report_s {
int pkmfaddress;
} esm_remote_ue_report_t;
int cid;
} esm_remote_ue_report_t;
/*
* ------------------------------
......
......@@ -474,7 +474,7 @@ int esm_send_deactivate_eps_bearer_context_accept(int ebi,
** Others: None **
** **
***************************************************************************/
int esm_send_remote_ue_report(int ebi,
int esm_send_remote_ue_report(int pti, int ebi,
remote_ue_report_msg *msg)
{
LOG_FUNC_IN;
......@@ -483,7 +483,7 @@ int esm_send_remote_ue_report(int ebi,
msg->protocoldiscriminator = EPS_SESSION_MANAGEMENT_MESSAGE;
msg->epsbeareridentity = ebi;
msg->messagetype = REMOTE_UE_REPORT;
msg->proceduretransactionidentity = PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED;
msg->proceduretransactionidentity = pti;
/* Optional IEs */
//msg->pkmfaddress ;
//{
......
......@@ -116,7 +116,7 @@ int esm_send_activate_dedicated_eps_bearer_context_reject(int ebi,
int esm_send_deactivate_eps_bearer_context_accept(int ebi,
deactivate_eps_bearer_context_accept_msg *msg);
int esm_send_remote_ue_report(int ebi,
int esm_send_remote_ue_report(int pti, int ebi,
remote_ue_report_msg *msg);
......
......@@ -122,9 +122,12 @@ int esm_proc_status(nas_user_t *user, int is_standalone, int pti, OctetString *m
* REMOTE UE REPORT procedure
* --------------------------------------------------------------------------
*/
int esm_proc_remote_ue_report(nas_user_t *user,int cid, unsigned int *pti);
int esm_proc_remote_ue_report(nas_user_t *user,int cid, int ebi, unsigned int *pti);
int esm_proc_remote_ue_report_low_layer(nas_user_t *user, int is_standalone, int pti,
OctetString *msg);
int esm_proc_remote_ue_report_response(nas_user_t *user, int pti);
/*
* --------------------------------------------------------------------------
* PDN connectivity procedure
......
......@@ -1419,6 +1419,7 @@ int _nas_proc_remote_ue_report(nas_user_t *user, int cid)
//esm_sap.primitive = ESM_REMOTE_UE_REPORT;
esm_sap.is_standalone = TRUE;
esm_sap.data.remote_ue_report.pkmfaddress = 0;
esm_sap.data.remote_ue_report.cid = cid;
rc = esm_sap_send(user, &esm_sap);
LOG_FUNC_RETURN (rc);
......
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