Commit bad96263 authored by Eurecom's avatar Eurecom

Merge branch 'NR_SA_F1AP_5GRECORDS' of...

Merge branch 'NR_SA_F1AP_5GRECORDS' of https://gitlab.eurecom.fr/oai/openairinterface5g into NR_SA_F1AP_5GRECORDS
parents d5fbf807 d4d5fafb
......@@ -459,7 +459,8 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int rb_id;
int i;
if(IS_SOFTMODEM_NOS1){
if(UE_NAS_USE_TUN){
LOG_D(PDCP, "IP packet received, to be sent to UE TUN interface");
len = write(nas_sock_fd[0], buf, size);
if (len != size) {
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
......
......@@ -1265,6 +1265,9 @@ nr_rrc_ue_process_masterCellGroup(
//TODO (resume all suspended radio bearers and resume SCG transmission for all radio bearers, if suspended)
// NSA procedures
}
if(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config == NULL){
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config = malloc(sizeof(NR_CellGroupConfig_t));
}
if( cellGroupConfig->rlc_BearerToReleaseList != NULL){
......@@ -1273,10 +1276,24 @@ nr_rrc_ue_process_masterCellGroup(
if( cellGroupConfig->rlc_BearerToAddModList != NULL){
//TODO (perform the RLC bearer addition/modification as specified in 5.3.5.5.4)
if(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList != NULL){
free(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList);
}
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList = calloc(1, sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList));
memcpy(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList,cellGroupConfig->rlc_BearerToAddModList,
sizeof(struct NR_CellGroupConfig__rlc_BearerToAddModList));
}
if( cellGroupConfig->mac_CellGroupConfig != NULL){
//TODO (configure the MAC entity of this cell group as specified in 5.3.5.5.5)
LOG_I(RRC, "Received mac_CellGroupConfig from gNB\n");
if(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->mac_CellGroupConfig != NULL){
LOG_E(RRC, "UE RRC instance already contains mac CellGroupConfig which will be overwritten\n");
free(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->mac_CellGroupConfig);
}
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->mac_CellGroupConfig = malloc(sizeof(struct NR_MAC_CellGroupConfig));
memcpy(NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->mac_CellGroupConfig,cellGroupConfig->mac_CellGroupConfig,
sizeof(struct NR_MAC_CellGroupConfig));
}
if( cellGroupConfig->sCellToReleaseList != NULL){
......@@ -2132,28 +2149,28 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4));
// Refresh DRBs
// nr_rrc_pdcp_config_asn1_req(ctxt_pP,
// NULL,
// radioBearerConfig->drb_ToAddModList,
// NULL,
// NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm |
// (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
// NULL,
// NULL,
// kUPenc,
// NULL,
// NULL,
// NR_UE_rrc_inst[ctxt_pP->module_id].defaultDRB,
// NULL);
nr_rrc_pdcp_config_asn1_req(ctxt_pP,
NULL,
radioBearerConfig->drb_ToAddModList,
NULL,
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm |
(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
NULL,
NULL,
kUPenc,
NULL,
NULL,
NR_UE_rrc_inst[ctxt_pP->module_id].defaultDRB,
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList);
// Refresh DRBs
// nr_rrc_rlc_config_asn1_req(ctxt_pP,
// NULL,
// radioBearerConfig->drb_ToAddModList,
// NULL,
// NULL,
// NULL
// );
} // drb_ToAddModList
nr_rrc_rlc_config_asn1_req(ctxt_pP,
NULL,
radioBearerConfig->drb_ToAddModList,
NULL,
NULL,
NR_UE_rrc_inst[ctxt_pP->module_id].cell_group_config->rlc_BearerToAddModList
);
} // drb_ToAddModList //
if (radioBearerConfig->drb_ToReleaseList != NULL) {
for (i = 0; i < radioBearerConfig->drb_ToReleaseList->list.count; i++) {
......@@ -2188,9 +2205,17 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
// nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig);
}
if(ie->nonCriticalExtension->masterCellGroup!=NULL) {
nr_rrc_ue_process_masterCellGroup(
ctxt_pP,
gNB_index,
ie->nonCriticalExtension->masterCellGroup);
}
if (ie->radioBearerConfig != NULL) {
LOG_I(NR_RRC, "radio Bearer Configuration is present\n");
// nr_sa_rrc_ue_process_radioBearerConfig(ctxt_pP, gNB_index, ie->radioBearerConfig);
nr_sa_rrc_ue_process_radioBearerConfig(ctxt_pP, gNB_index, ie->radioBearerConfig);
}
/* Check if there is dedicated NAS information to forward to NAS */
......
......@@ -38,7 +38,8 @@
#include "aka_functions.h"
#include "secu_defs.h"
#include "PduSessionEstablishRequest.h"
# include "intertask_interface.h"
#include "intertask_interface.h"
#include "openair2/RRC/NAS/nas_config.h"
/*char netName[] = "5G:mnc093.mcc208.3gppnetwork.org";
char imsi[] = "2089300007487";
......@@ -57,6 +58,7 @@ const uint8_t opc[16] = {0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0
uint8_t *registration_request_buf;
uint32_t registration_request_len;
extern char *baseNetAddress;
static int nas_protected_security_header_encode(
char *buffer,
......@@ -816,6 +818,16 @@ void *nas_nrue_task(void *args_p)
LOG_I(NAS, "Send NAS_UPLINK_DATA_REQ message(PduSessionEstablishRequest)\n");
}
}
else if((pdu_buffer + 16) != NULL){
msg_type = *(pdu_buffer + 16);
if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){
sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40));
int third_octet = *(pdu_buffer + 41);
int fourth_octet = *(pdu_buffer + 42);
LOG_I(NAS, "Received PDU Session Establishment Accept\n");
nas_config(1,third_octet,fourth_octet,"ue");
}
}
break;
}
......
......@@ -59,6 +59,7 @@
// message type for 5GS session management
#define FGS_PDU_SESSION_ESTABLISHMENT_REQ 0b11000001 /* 193= 0xc1 */
#define FGS_PDU_SESSION_ESTABLISHMENT_ACC 0b11000010 /* 194= 0xc2 */
#define INITIAL_REGISTRATION 0b001
......
......@@ -703,7 +703,7 @@ static int Gtpv1uHandleGpdu(int h,
int offset=8;
if( msgHdr->E || msgHdr->S ||msgHdr->PN)
offset+=4;
offset+=8;
// This context is not good for gtp
// frame, ... has no meaning
......
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