Commit f256ebc8 authored by Raymond Knopp's avatar Raymond Knopp

Remote UE Report message with payload (Default PKMF address) addition

parent dadff785
......@@ -2345,7 +2345,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
phr_p->R = 0;
LOG_I(MAC,
LOG_D(MAC,
"[UE %d] Frame %d report PHR with mapping (%d->%d) for LCID %d\n",
module_idP, frameP, get_PHR(module_idP, CC_id, eNB_index),
phr_p->PH, POWER_HEADROOM);
......
......@@ -15,19 +15,39 @@
#include "TLVDecoder.h"
#include "RemoteUEReport.h"
#include "PKMFAddress.h"
#include "RemoteUEContext.h"
int decode_remote_ue_report(remote_ue_report_msg *remoteuereport, uint8_t *buffer, uint32_t len)
{
uint32_t decoded = 0;
int decoded_result = 0;
//remoteuereport->pkmfaddress.pkmfipv4address = 1 ;
// Check if we got a NULL pointer and if buffer length is >= minimum length expected for the message.
CHECK_PDU_POINTER_AND_LENGTH_DECODER(buffer, REMOTE_UE_REPORT_RESPONSE_MINIMUM_LENGTH, len);
CHECK_PDU_POINTER_AND_LENGTH_DECODER(buffer, REMOTE_UE_REPORT_MINIMUM_LENGTH, len);
/* Decoding mandatory fields */
/* Decoding optional fields */
while(len - decoded > 0) {
uint8_t ieiDecoded = *(buffer + decoded);
/* Type | value iei are below 0x80 so just return the first 4 bits */
if (ieiDecoded >= 0x80)
ieiDecoded = ieiDecoded & 0xf0;
if ((decoded_result = decode_pkmf_address(&remoteuereport->pkmfaddress, 0, buffer + decoded, len - decoded)) < 0)
switch(ieiDecoded) {
case REMOTE_UE_REPORT_PKMF_ADDRESS_IEI:
if ((decoded_result = decode_pkmf_address(&remoteuereport->pkmfaddress,
REMOTE_UE_REPORT_PKMF_ADDRESS_IEI,
buffer + decoded,
len - decoded)) < 0)
return decoded_result;
else
decoded += decoded_result;
/* Set corresponding mask to 1 in presencemask */
remoteuereport->presencemask |= REMOTE_UE_REPORT_PKMF_ADDRESS_PRESENT;
break;
}
}
return decoded;
}
......@@ -35,13 +55,44 @@ int encode_remote_ue_report(remote_ue_report_msg *remoteuereport, uint8_t *buffe
{
int encoded = 0;
int encode_result = 0;
//uint32_t testip [4] = {0,1,2,3};
//remoteuereport->pkmfaddress.pkmfipv4address = testip ;
/* Checking IEI and pointer */
CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, REMOTE_UE_REPORT_RESPONSE_MINIMUM_LENGTH, len);
CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, REMOTE_UE_REPORT_MINIMUM_LENGTH, len);
remoteuereport->pkmfaddress.pkmfipv4address = 0;
if ((encode_result = encode_pkmf_address(&remoteuereport->pkmfaddress, 0, buffer + encoded, len - encoded)) < 0)//Return in case of error
if ((remoteuereport->presencemask & REMOTE_UE_CONTEXT_PRESENT) == REMOTE_UE_CONTEXT_PRESENT)
{
if ((encode_result = encode_remote_ue_context(&remoteuereport->remoteuecontext,
REMOTE_UE_REPORT_REMOTE_UE_CONTEXT_IEI,
buffer + encoded,
len - encoded)) < 0)
return encode_result;
else
encoded += encode_result;
}
if ((remoteuereport->presencemask & REMOTE_UE_REPORT_PKMF_ADDRESS_PRESENT)
== REMOTE_UE_REPORT_PKMF_ADDRESS_PRESENT)
{
if ((encode_result = encode_pkmf_address(&remoteuereport->pkmfaddress,
REMOTE_UE_REPORT_PKMF_ADDRESS_IEI ,
buffer + encoded,
len - encoded)) < 0)//Return in case of error
return encode_result;
else
encoded += encode_result;
return encoded;
}
LOG_TRACE(INFO, "ESM-SAP - Remote UE Report message is out %d", len);
return encoded;
}
......@@ -12,22 +12,36 @@
#include "EpsBearerIdentity.h"
#include "ProcedureTransactionIdentity.h"
#include "PKMFAddress.h"
#include "MessageType.h"
#include "RemoteUEContext.h"
#ifndef OPENAIR3_NAS_COMMON_ESM_MSG_REMOTEUEREPORT_H_
#define OPENAIR3_NAS_COMMON_ESM_MSG_REMOTEUEREPORT_H_
/* Minimum length macro. Formed by minimum length of each mandatory field */
#define REMOTE_UE_REPORT_RESPONSE_MINIMUM_LENGTH (0)
#define REMOTE_UE_REPORT_MINIMUM_LENGTH (0)
#define REMOTE_UE_REPORT_MAXIMUM_LENGTH (20)
# define REMOTE_UE_CONTEXT_PRESENT (1<<0)
# define REMOTE_UE_REPORT_PKMF_ADDRESS_PRESENT (1<<1)
typedef enum remote_ue_report_iei_tag {
REMOTE_UE_REPORT_REMOTE_UE_CONTEXT_IEI = 0x79,
REMOTE_UE_REPORT_PKMF_ADDRESS_IEI = 0x6f,
} remote_ue_report_iei;
typedef struct remote_ue_report_msg_tag {
/* Mandatory fields */
ProtocolDiscriminator protocoldiscriminator:4;
EpsBearerIdentity epsbeareridentity:4;
ProcedureTransactionIdentity proceduretransactionidentity;
MessageType messagetype;
/* Optional fields */
uint32_t presencemask;
remote_ue_context_t remoteuecontext;
pkmf_address_t pkmfaddress;
//RemoteUEContext remoteuecontext;
} remote_ue_report_msg;
} remote_ue_report_msg;
int decode_remote_ue_report(remote_ue_report_msg *remoteuereport, uint8_t *buffer, uint32_t len);
......
......@@ -369,7 +369,9 @@ int esm_msg_encode(ESM_msg *msg, uint8_t *buffer, uint32_t len)
break;
case REMOTE_UE_REPORT:
//LOG_TRACE(INFO, "Remote UE Report is encoded");
encode_result = encode_remote_ue_report(&msg->remote_ue_report, buffer, len);
//LOG_TRACE(INFO, "Remote UE Report is encoded");
break;
case REMOTE_UE_REPORT_RESPONSE:
......
......@@ -11,11 +11,14 @@
#include <stdbool.h>
#include "PKMFAddress.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
//static int encode_pkmf_address(pkmf_address_t *pkmfaddress, uint8_t iei, uint8_t *buffer, uint32_t len);
//static int decode_pkmf_address(pkmf_address_t *pkmfaddress, uint8_t iei, uint8_t *buffer, uint32_t len);
//static int encode_pkmf_addressfield(pkmfaddress_t *pkmf, uint8_t *buffer);
int decode_pkmf_address(
pkmf_address_t *pkmfaddress,
......@@ -36,12 +39,12 @@ int decode_pkmf_address(
memset (pkmfaddress, 0, sizeof (pkmf_address_t));
//OAILOG_TRACE (LOG_NAS_EMM, "decode_pkmf_address = %d\n", ielen);
CHECK_LENGTH_DECODER (len - decoded, ielen);
pkmfaddress->spare = (*(buffer + decoded) >> 3) & 0x1;
pkmfaddress->addresstype = *(buffer + decoded) & 0x1;
pkmfaddress->spare = (*(buffer + decoded) >> 3) & 0xf;
pkmfaddress->addresstype = *(buffer + decoded) & 0xf;
decoded++;
if (iei > 1)
{
pkmfaddress->pkmfipv4address = *(buffer + decoded ) & 0xf;
//pkmfaddress->pkmfipaddress = *(buffer + decoded ) & 0xf;
decoded++;
}
......@@ -62,23 +65,57 @@ int encode_pkmf_address(
{
uint8_t *lenPtr;
uint32_t encoded = 0;
int encoded_rc = TLV_ENCODE_VALUE_DOESNT_MATCH;
LOG_TRACE(INFO, "Send PKMF address %d", len);
/* Checking IEI and pointer */
CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, PKMF_ADDRESS_MINIMUM_LENGTH, len);
#if defined (NAS_DEBUG)
dump_pkmf_address_xml(pkmfaddress, iei);
#endif
if (iei > 0)
{
*buffer = iei;
encoded++;
}
lenPtr = (buffer + encoded);
encoded++;
*(buffer + encoded) = 0x00 | ((pkmfaddress->spare & 0x1) << 3) | (pkmfaddress->addresstype & 0x1);
encoded++;
lenPtr = (buffer + encoded);
encoded++;
*(buffer + encoded) = pkmfaddress->pkmfipv4address;
//pkmfaddress->addresstype = ADDRESS_TYPE_IPV4;
*(buffer + encoded) = 0x00 | (((pkmfaddress->spare) & 0x1f) << 3)|
((pkmfaddress->addresstype = ADDRESS_TYPE_IPV4)& 0x7);
encoded++;
//if (pkmfaddress->addresstype = ADDRESS_TYPE_IPV4){
*(buffer + encoded) = (&pkmfaddress->pkmfipaddress);
memcpy((void*)(buffer + encoded), (const void*)(&pkmfaddress->pkmfipaddress.ipv4), 4);
encoded += 4;
// }
//else if(pkmfaddress->addresstype = ADDRESS_TYPE_IPV6)
// {
//*(buffer + encoded) = (&pkmfaddress->pkmfipaddress);
// memcpy((void*)(buffer + encoded), (const void*)(&pkmfaddress->pkmfipaddress.ipv6),6);
// encoded +=6;
//}
//encoded++;
*lenPtr = encoded - 1 - ((iei > 0) ? 1 : 0);
}
LOG_TRACE(INFO, "Send PKMF address %d", len);
return encoded;
}
void dump_pkmf_address_xml(pkmf_address_t *pkmfaddress, uint8_t iei)
{
printf("<PKMF Address>\n");
}
if (iei > 0)
/* Don't display IEI if = 0 */
printf(" <IEI>0x%X</IEI>\n", iei);
printf("%s</Access Point Name>\n",
dump_octet_string_xml(&pkmfaddress->pkmfipaddress));
}
......@@ -8,17 +8,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <netinet/in.h>
#ifndef OPENAIR3_NAS_COMMON_IES_PKMFADDRESS_H_
#define OPENAIR3_NAS_COMMON_IES_PKMFADDRESS_H_
#define PKMF_ADDRESS_MINIMUM_LENGTH 2
#define PKMF_ADDRESS_MAXIMUM_LENGTH 5
//typedef struct pkmf_s{
//uint8_t digit1:8;
//uint8_t digit2:8;
//uint8_t digit3:8;
//uint8_t digit4:8;
//}pkmf_t;
//typedef pkmf_t pkmfaddress_t;
typedef struct pkmf_address_s {
uint8_t spare:5;
#define ADDRESS_TYPE 001
uint8_t addresstype:3;
#define PKMF_IPV4_ADDRESS
//uint32_t pkmfipv4address;
uint32_t pkmfipv4address;
uint8_t spare:5;
#define ADDRESS_TYPE_IPV4 0b001
#define ADDRESS_TYPE_IPV6 0b010
uint8_t addresstype:3;
#define PKMF_IP_ADDRESS
union {
struct in_addr ipv4; // char ipv4[4]; 4 bytes
struct in6_addr ipv6; // char ipv6[16] // 16 bytes
}pkmfipaddress;
//pkmfaddress_t pkmfipv4address;
}pkmf_address_t;
......@@ -26,5 +45,6 @@ int encode_pkmf_address(pkmf_address_t *pkmfaddress, uint8_t iei, uint8_t *buffe
int decode_pkmf_address(pkmf_address_t *pkmfaddress, uint8_t iei, uint8_t *buffer, uint32_t len);
void dump_pkmf_address_xml(pkmf_address_t *pkmfaddress, uint8_t iei);
#endif /* OPENAIR3_NAS_COMMON_IES_PKMFADDRESS_H_ */
......@@ -9,10 +9,11 @@
#include <stdint.h>
#include <stdbool.h>
#include "RemoteUEContext.h"
#include "RemoteUserID.h"
#include "TLVEncoder.h"
#include "TLVDecoder.h"
#include "nas_log.h"
//#include "RemoteUserID.h"
......@@ -218,6 +219,7 @@ int nas_encode_imsi (imsi_identity_t * imsi, uint8_t * buffer)
*(buffer + encoded) = 0x00 | (imsi->identity_digit3 << 4) | imsi->identity_digit2;
encoded++;
// Quick fix, should do a loop, but try without modifying struct!
if (imsi->num_digits > 3) {
if (imsi->oddeven != IMSI_EVEN) {
*(buffer + encoded) = 0x00 | (imsi->identity_digit5 << 4) | imsi->identity_digit4;
......
......@@ -48,7 +48,7 @@ typedef struct remote_ue_context_s {
#define EVEN_IDENTITY 0
#define ODD_IDENTITY 1
uint8_t oddevenindic:1;
bool flags_present;
uint8_t flags_present;
imsi_identity_t *imsi_identity;
}remote_ue_context_t;
......
......@@ -94,13 +94,13 @@ int encode_remote_user_id(
lenPtr = (buffer + encoded);
encoded++;
if(remoteuserid->spare_instance){
*(buffer + encoded) = 0x00 | ((remoteuserid->spare & 0x1) << 4) | (remoteuserid->instance & 0x1);
*(buffer + encoded) = 0x00 | ((remoteuserid->spare & 0x1f) << 4) | (remoteuserid->instance & 0x1f);
encoded++;
}
if(remoteuserid->flags_present){
*(buffer + encoded) = ((remoteuserid->spare1 & 0x7) << 2) | // spare coded as zero
*(buffer + encoded) = ((remoteuserid->spare1 & 0x3f) << 2) | // spare coded as zero
((remoteuserid->imeif & 0x1) << 1) |
(remoteuserid->msisdnf & 0x1);
encoded++;
......
......@@ -47,7 +47,7 @@ typedef struct imsi_identity_s {
uint8_t num_digits;
} imsi_identity_t;
typedef imsi_identity_t;
//#define imsi_identity_t;
typedef struct remote_user_id_s {
......@@ -60,8 +60,8 @@ typedef struct remote_user_id_s {
#define REMOTE_USER_ID_MSISDN 0
uint8_t msisdnf:1;
bool flags_present;
bool spare_instance;
uint8_t flags_present;
uint8_t spare_instance;
imsi_identity_t *imsi_identity;
}remote_user_id_t;
......
......@@ -198,6 +198,8 @@ const char* esmMsgType(int type)
return "ESM_INFORMATION_RESPONSE";
} else if (type == ESM_STATUS) {
return "ESM_STATUS";
}else if (type == REMOTE_UE_REPORT) {
return "REMOTE_UE_REPORT";
} else {
return "Unknown ESM message type";
}
......
......@@ -112,6 +112,7 @@ static int _deactivate_eps_bearer_context_request(char* buffer, int length, cons
static int _deactivate_eps_bearer_context_accept(char* buffer, int length, const deactivate_eps_bearer_context_accept_msg* msg);
static int _esm_status(char* buffer, int length, const esm_status_msg* msg);
static int _remote_ue_report(char* buffer, int length, const remote_ue_report_msg* msg);
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
......@@ -781,6 +782,12 @@ _nas_process_esm(
&msg->deactivate_eps_bearer_context_accept);
break;
case REMOTE_UE_REPORT:
index += _remote_ue_report(buffer + index, length - index,
&msg->remote_ue_report);
break;
case ESM_STATUS:
index += _esm_status(buffer + index, length - index,
&msg->esm_status);
......@@ -1036,6 +1043,23 @@ _deactivate_eps_bearer_context_accept(
return (index);
}
/*
-----------------------------------------------------------------------------
* Process Deactivate EPS Bearer Context Accept
*-----------------------------------------------------------------------------
*/
static int
_remote_ue_report
(char* buffer,
int length,
const remote_ue_report_msg* msg)
{
int index = 0;
return (index);
}
/*
*-----------------------------------------------------------------------------
* Process ESM Status
......
......@@ -227,6 +227,7 @@ static int _process_pdn_disconnect_request(const pdn_disconnect_request_msg* msg
static int _process_activate_default_eps_bearer_context_accept(const activate_default_eps_bearer_context_accept_msg* msg);
static int _process_activate_default_eps_bearer_context_reject(const activate_default_eps_bearer_context_reject_msg* msg);
static int _process_deactivate_eps_bearer_context_accept(const deactivate_eps_bearer_context_accept_msg* msg);
static int _process_remote_ue_report(remote_ue_report_msg* msg);
static void _dump_buffer(const Byte_t* buffer, size_t len)
{
......@@ -962,6 +963,11 @@ static int _process_esm_msg(ESM_msg* msg)
&msg->activate_default_eps_bearer_context_reject);
break;
case REMOTE_UE_REPORT:
rc = _process_remote_ue_report(
&msg->remote_ue_report);
break;
case DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT:
rc = _process_deactivate_eps_bearer_context_accept(
&msg->deactivate_eps_bearer_context_accept);
......@@ -1163,6 +1169,22 @@ static int _process_activate_default_eps_bearer_context_reject(const activate_de
return (0);
}
/*
* Process Remote UE Report ESM message
*/
static int _process_remote_ue_report(remote_ue_report_msg* msg)
{
printf("Remote UE Report\n");
printf("INFO\t:\tProtocolDiscriminator\t\t= %d\n", msg->protocoldiscriminator);
printf("INFO\t:\tEpsBearerIdentity\t\t= %d\n", msg->epsbeareridentity);
printf("INFO\t:\tProcedureTransactionIdentity\t= %d\n", msg->proceduretransactionidentity);
//printf("INFO\t:\tMessageType\t\t\t= 0x%.2x\n", msg->messagetype);
//printf("INFO\t:\tESM cause\t\t\t= %d\n", msg->esmcause);
return (0);
}
/*
* Process Deactivate EPS Bearer Context Accept ESM message
*/
......
......@@ -158,8 +158,7 @@ int esm_proc_pdn_connectivity(nas_user_t *user, int cid, int is_to_define,
LOG_FUNC_RETURN(rc);
} else if (pti != NULL) {
LOG_TRACE(INFO, "ESM-PROC - Assign new procedure transaction identity "
"(cid=%d)", cid);
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);
......
......@@ -80,13 +80,14 @@ int esm_proc_remote_ue_report(nas_user_t *user,int cid, unsigned int *pti)
{
LOG_FUNC_IN;
int rc = RETURNerror;
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 ");
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);
......@@ -105,3 +106,56 @@ 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 **
** **
** Description: Initiates Remote UE Report procedure **
** **
** **
** 3GPP TS 24.301, section 6.5.1.2 **
** The Relay UE requests send Remote UE Report message to inform
** the network about a new Off network UE. **
** **
** **
** 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 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_low_layer(nas_user_t *user, int is_standalone, int pti,
OctetString *msg)
{
LOG_FUNC_IN;
esm_pt_data_t *esm_pt_data = user->esm_pt_data;
int rc = RETURNok;
LOG_TRACE(INFO, "ESM-PROC - Initiate Remote UE Report (pti=%d)", pti);
if (is_standalone) {
emm_sap_t emm_sap;
emm_esm_data_t *emm_esm = &emm_sap.u.emm_esm.u.data;
/*
* Notity EMM that ESM PDU has to be forwarded to lower layers
*/
emm_sap.primitive = EMMESM_UNITDATA_REQ;
emm_sap.u.emm_esm.ueid = user->ueid;
emm_esm->msg.length = msg->length;
emm_esm->msg.value = msg->value;
rc = emm_sap_send(user, &emm_sap);
}
LOG_FUNC_RETURN(rc);
}
......@@ -161,17 +161,21 @@ int esm_sap_send(nas_user_t *user, esm_sap_t *msg)
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 = 0;
unsigned int pti;
int cid;
/* Assign new procedure transaction identity */
rc = esm_proc_remote_ue_report(user, cid, &pti);
rc = _esm_sap_send(user, REMOTE_UE_REPORT,
msg->is_standalone,
pti, EPS_BEARER_IDENTITY_UNASSIGNED,
&msg->data, &msg->send);
}
break;
case ESM_PDN_CONNECTIVITY_REQ:
......@@ -773,12 +777,19 @@ static int _esm_sap_send(nas_user_t *user, int msg_type, int is_standalone,
case BEARER_RESOURCE_MODIFICATION_REQUEST:
break;
case REMOTE_UE_REPORT:
esm_msg.header.message_type = REMOTE_UE_REPORT;
case REMOTE_UE_REPORT: {
/*
* Process Remote UE Report message to send to the MME
*/
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);
/* Setup callback function used to send Remote UE Report
* message onto the network */
esm_procedure = esm_proc_remote_ue_report_low_layer;
//#error "TODO"//
break;
}
default:
LOG_TRACE(WARNING, "ESM-SAP - Send unexpected ESM message 0x%x",
msg_type);
......
......@@ -78,6 +78,7 @@ typedef enum esm_primitive_s {
/* ESM data indication ("raw" ESM message) */
ESM_UNITDATA_IND,
ESM_REMOTE_UE_REPORT_REQ,
//ESM_REMOTE_UE_REPORT,
ESM_END
} esm_primitive_t;
......@@ -142,7 +143,7 @@ typedef struct esm_eps_bearer_context_deactivate_s {
* ---------------------------------------------------------
*/
typedef struct esm_remote_ue_report_s {
unsigned int dummy;
int pkmfaddress;
} esm_remote_ue_report_t;
/*
......
......@@ -478,14 +478,25 @@ int esm_send_remote_ue_report(int ebi,
remote_ue_report_msg *msg)
{
LOG_FUNC_IN;
//uint32_t testip [4] = {0,1,2,3};
/* Mandatory - ESM message header */
msg->protocoldiscriminator = EPS_SESSION_MANAGEMENT_MESSAGE;
msg->epsbeareridentity = ebi;
//msg->messagetype = DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT;
msg->messagetype = REMOTE_UE_REPORT;
msg->proceduretransactionidentity = PROCEDURE_TRANSACTION_IDENTITY_UNASSIGNED;
/* Optional IEs */
msg->pkmfaddress.pkmfipv4address = 0;
//msg->pkmfaddress ;
//{
/* Optional IEs */
msg->presencemask = 0;
msg->presencemask |= REMOTE_UE_CONTEXT_PRESENT;
msg->remoteuecontext;
msg->presencemask = 0;
msg->presencemask |= REMOTE_UE_REPORT_PKMF_ADDRESS_PRESENT;
msg->pkmfaddress;
//#define ADDRESS_TYPE_IPV4 0b001
//msg ->pkmfaddress.addresstype==ADDRESS_TYPE_IPV4;
//}
LOG_TRACE(INFO, "ESM-SAP - Send Remote UE Report message"
" message (pti=%d, ebi=%d)",
......@@ -494,9 +505,6 @@ int esm_send_remote_ue_report(int ebi,
LOG_FUNC_RETURN(RETURNok);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
......
......@@ -123,6 +123,8 @@ int esm_proc_status(nas_user_t *user, int is_standalone, int pti, OctetString *m
* --------------------------------------------------------------------------
*/
int esm_proc_remote_ue_report(nas_user_t *user,int cid, unsigned int *pti);
int esm_proc_remote_ue_report_low_layer(nas_user_t *user, int is_standalone, int pti,
OctetString *msg);
/*
* --------------------------------------------------------------------------
* PDN connectivity procedure
......
......@@ -83,6 +83,7 @@ static const uint8_t esm_message_ids[] = {
ESM_INFORMATION_REQUEST,
ESM_INFORMATION_RESPONSE,
ESM_STATUS,
REMOTE_UE_REPORT,
};
......
......@@ -1416,8 +1416,9 @@ int _nas_proc_remote_ue_report(nas_user_t *user, int cid)
* for the specified PDN
*/
esm_sap.primitive = ESM_REMOTE_UE_REPORT_REQ;
//esm_sap.primitive = ESM_REMOTE_UE_REPORT;
esm_sap.is_standalone = TRUE;
esm_sap.data.remote_ue_report.dummy = 0;
esm_sap.data.remote_ue_report.pkmfaddress = 0;
rc = esm_sap_send(user, &esm_sap);
LOG_FUNC_RETURN (rc);
......
......@@ -206,14 +206,14 @@ void *nas_ue_task(void *args_p)
//for Remote UE Report
case NAS_REMOTE_UE_REPORT: {
int cid = 0; // unused now
int cid = 1; // unused now
int UEid = 0;
int ret = nas_proc_remote_ue_report_test(user, cid); // generate NAS PDU (remote ue report)
// To send remote ue report to be sent by RRC UE to CN
//int nas_itti_ul_data_req(const uint32_t ue_id, void *const data, const uint32_t length, int user_id);
uint8_t testdata [] = {0,1,2,3};
nas_itti_ul_data_req(UEid, testdata, sizeof(testdata));
//uint8_t testdata [] = {0,1,2,5};
//nas_itti_ul_data_req(UEid, testdata, sizeof(testdata));
LOG_I(NAS, "[UE %d] Received NAS REMOTE UE REPORT %s: \n", Mod_id, ITTI_MSG_NAME (msg_p));
/* TODO not processed by NAS currently */
}
......
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