Commit 95774e5b authored by nikaeinn's avatar nikaeinn

* fix the mac header parser when receving long BSR

* update the ciphering and integrity handling at the eNB
* add SECU complication directive to lte-softmodem  makefile
* update the config files, revert the log.c (modif by LG)
* pre-ci tests passed except for eMBMS


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5287 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9c194d17
......@@ -50,7 +50,6 @@ CFLAGS = \
-Wall \
-DENB_MODE \
-DENABLE_USE_MME \
-DEMIT_ASN_DEBUG=1 \
-DUSER_MODE \
-I./MESSAGES \
-I$(OUTDIR) \
......
#ifndef S1AP_ENB_DEFAULT_VALUES_H_
#define S1AP_ENB_DEFAULT_VALUES_H_
#define ENB_TAC (0)
#define ENB_TAC (1)
#define ENB_MCC (208)
#define ENB_MNC (34)
#define ENB_MNC (92)
#define ENB_NAME "Eurecom ENB"
#define ENB_NAME_FORMAT (ENB_NAME" %u")
......
......@@ -103,7 +103,7 @@ endif
EXTRA_CFLAGS += -I/usr/include -I/usr/realtime/include
EXTRA_CFLAGS += -I$(OPENAIR1_DIR)
EXTRA_CFLAGS += -DEMIT_ASN_DEBUG=0
#EXTRA_CFLAGS += -DEMIT_ASN_DEBUG=0
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR1_DIR)/PHY/Makefile.inc
......
......@@ -3060,7 +3060,7 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,ui
}
// If we've dropped the UE, go back to PRACH mode for this UE
#if !defined(EXMIMO_IOT)
//#if !defined(EXMIMO_IOT)
if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[harq_pid] == 20) {
LOG_I(PHY,"[eNB %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
phy_vars_eNB->Mod_id,frame,last_slot>>1, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[harq_pid]);
......@@ -3073,7 +3073,7 @@ void phy_procedures_eNB_RX(unsigned char last_slot,PHY_VARS_eNB *phy_vars_eNB,ui
remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[harq_pid]=0;
}
#endif
//#endif
}
} // ulsch in error
else {
......
......@@ -149,12 +149,16 @@ static void enb_config_display(void) {
printf( "----------------------------------------------------------------------\n");
for (i = 0; i < enb_properties.number; i++) {
printf( "ENB CONFIG no %u:\n\n", i);
printf( "\teNB name: \t%s:\n",enb_properties.properties[i]->eNB_name);
printf( "\teNB ID: \t%u:\n",enb_properties.properties[i]->eNB_id);
printf( "\tCell type:\t%s:\n",enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
printf( "\tTAC: \t%u:\n",enb_properties.properties[i]->tac);
printf( "\tMCC: \t%u:\n",enb_properties.properties[i]->mcc);
printf( "\tMNC: \t%u:\n",enb_properties.properties[i]->mnc);
printf( "\teNB name: \t%s:\n",enb_properties.properties[i]->eNB_name);
printf( "\teNB ID: \t%u:\n",enb_properties.properties[i]->eNB_id);
printf( "\tCell type: \t%s:\n",enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
printf( "\tTAC: \t%u:\n",enb_properties.properties[i]->tac);
printf( "\tMCC: \t%u:\n",enb_properties.properties[i]->mcc);
printf( "\tMNC: \t%u:\n",enb_properties.properties[i]->mnc);
printf( "\teutra band: \t%d:\n",enb_properties.properties[i]->eutra_band);
printf( "\tdownlink freq:\t%u:\n",enb_properties.properties[i]->downlink_frequency);
printf( "\tuplink freq: \t%d:\n",enb_properties.properties[i]->uplink_frequency_offset);
printf( "\n--------------------------------------------------------\n");
}
}
......@@ -233,8 +237,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
long int tdd_config_s;
const char* prefix_type;
long int eutra_band;
double downlink_frequency;
double uplink_frequency_offset;
long long downlink_frequency;
long long uplink_frequency_offset;
char* ipv4 = NULL;
char* ipv6 = NULL;
char* active = NULL;
......@@ -271,7 +275,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 1;
asn_debug = 0;
asn1_xer_print = 0;
} else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) {
asn_debug = 1;
......@@ -329,6 +333,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc)
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc)
&& config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_DEFAULT_PAGING_DRX, &default_drx)
)
) {
AssertError (0, parse_errors ++,
......@@ -423,14 +428,13 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
enb_properties.properties[enb_properties_index]->eutra_band = 7; // Default band
}
if(config_setting_lookup_float(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
enb_properties.properties[enb_properties_index]->downlink_frequency = downlink_frequency;
if(config_setting_lookup_int64(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
enb_properties.properties[enb_properties_index]->downlink_frequency = (unsigned int) downlink_frequency;
} else {
enb_properties.properties[enb_properties_index]->downlink_frequency = 2680000000UL; // Default downlink frequency
enb_properties.properties[enb_properties_index]->downlink_frequency = 2680000000UL; // Default downlink frequency
}
if(config_setting_lookup_float(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset = uplink_frequency_offset;
if(config_setting_lookup_int64(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset = (unsigned int) uplink_frequency_offset;
} else {
// Default uplink frequency offset
if (enb_properties.properties[enb_properties_index]->frame_type == FDD) {
......@@ -439,7 +443,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset = 0;
}
}
parse_errors += enb_check_band_frequencies(lib_config_file_name_pP,
enb_properties_index,
enb_properties.properties[enb_properties_index]->eutra_band,
......
......@@ -256,7 +256,7 @@ void terminate_ra_proc(module_id_t module_idP,frame_t frameP,rnti_t rnti,unsigne
payload_ptr = parse_ulsch_header(msg3,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,msg3_len);
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d Received CCCH: length %d, offset %d\n",
module_idP,frameP,rx_lengths[0],payload_ptr-msg3);
if ((num_ce == 0) && (num_sdu==1) && (rx_lcids[0] == CCCH)) { // This is an RRCConnectionRequest/Restablishment
if (/*(num_ce == 0) &&*/ (num_sdu==1) && (rx_lcids[0] == CCCH)) { // This is an RRCConnectionRequest/Restablishment
memcpy(&eNB_mac_inst[module_idP].RA_template[i].cont_res_id[0],payload_ptr,6);
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d Received CCCH: length %d, offset %d\n",
module_idP,frameP,rx_lengths[0],payload_ptr-msg3);
......@@ -496,11 +496,15 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
num_ces++;
mac_header_ptr++;
if (lcid==LONG_BSR)
ce_len+=4;
ce_len+=3;
else if (lcid==CRNTI)
ce_len+=2;
else if ((lcid==POWER_HEADROOM) || (lcid==TRUNCATED_BSR)|| (lcid== SHORT_BSR))
ce_len++;
else {
LOG_E(MAC,"unknown CE %d \n", lcid);
exit(-1);
}
}
}
}
......
......@@ -273,8 +273,8 @@ boolean_t pdcp_data_req(
#if defined(ENABLE_SECURITY)
if ((pdcp_p->security_activated != 0) &&
((pdcp_p->cipheringAlgorithm) != 0) &&
((pdcp_p->integrityProtAlgorithm) != 0)) {
(((pdcp_p->cipheringAlgorithm) != 0) ||
((pdcp_p->integrityProtAlgorithm) != 0))) {
if (enb_flagP == ENB_FLAG_NO)
start_meas(&eNB_pdcp_stats[enb_mod_idP].apply_security);
......@@ -289,6 +289,13 @@ boolean_t pdcp_data_req(
else
stop_meas(&UE_pdcp_stats[ue_mod_idP].apply_security);
}
LOG_D(PDCP,"MAC_I is %02x.%02x.%02x.%02x\n",
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP ],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +1],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +2],
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP +3]);
#endif
/* Print octets of outgoing data in hexadecimal form */
......
......@@ -444,7 +444,7 @@ public_pdcp(pdcp_stats_t UE_pdcp_stats[NUMBER_OF_UE_MAX];)
public_pdcp(pdcp_stats_t eNB_pdcp_stats[NUMBER_OF_eNB_MAX];)
protected_pdcp(pdcp_t pdcp_array_srb_ue[NUMBER_OF_UE_MAX][2];)
protected_pdcp(pdcp_t pdcp_array_drb_ue[NUMBER_OF_UE_MAX][maxDRB];)
protected_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][2];)
public_pdcp(pdcp_t pdcp_array_srb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][2];)
protected_pdcp(pdcp_t pdcp_array_drb_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][maxDRB];)
#if defined(Rel10)
public_pdcp(pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
......
......@@ -108,12 +108,12 @@ int pdcp_apply_security(pdcp_t *pdcp_entity, rb_id_t rb_id,
/* SRBs */
uint8_t *mac_i;
LOG_D(PDCP, "[OSA][RB %d] %s Applying control-plane security\n",
rb_id, (pdcp_entity->is_ue != 0) ? "UE -> eNB" : "eNB -> UE");
LOG_D(PDCP, "[OSA][RB %d] %s Applying control-plane security %d \n",
rb_id, (pdcp_entity->is_ue != 0) ? "UE -> eNB" : "eNB -> UE", pdcp_entity->integrityProtAlgorithm);
encrypt_params.message = pdcp_pdu_buffer;
encrypt_params.blength = (pdcp_header_len + sdu_buffer_size) << 3;
encrypt_params.key = pdcp_entity->kRRCint + 128;
encrypt_params.key = pdcp_entity->kRRCint + 16; // + 128;
mac_i = &pdcp_pdu_buffer[pdcp_header_len + sdu_buffer_size];
......@@ -122,12 +122,12 @@ int pdcp_apply_security(pdcp_t *pdcp_entity, rb_id_t rb_id,
stream_compute_integrity(pdcp_entity->integrityProtAlgorithm, &encrypt_params,
mac_i);
encrypt_params.key = pdcp_entity->kRRCenc + 128;
encrypt_params.key = pdcp_entity->kRRCenc; // + 128 // bit key
} else {
LOG_D(PDCP, "[OSA][RB %d] %s Applying user-plane security\n",
rb_id, (pdcp_entity->is_ue != 0) ? "UE -> eNB" : "eNB -> UE");
encrypt_params.key = pdcp_entity->kUPenc + 128;
encrypt_params.key = pdcp_entity->kUPenc;// + 128;
}
encrypt_params.message = &pdcp_pdu_buffer[pdcp_header_len];
......@@ -170,11 +170,11 @@ int pdcp_validate_security(pdcp_t *pdcp_entity, rb_id_t rb_id,
if (rb_id < DTCH) {
LOG_D(PDCP, "[OSA][RB %d] %s Validating control-plane security\n",
rb_id, (pdcp_entity->is_ue != 0) ? "eNB -> UE" : "UE -> eNB");
decrypt_params.key = pdcp_entity->kRRCenc + 128;
decrypt_params.key = pdcp_entity->kRRCenc;// + 128;
} else {
LOG_D(PDCP, "[OSA][RB %d] %s Validating user-plane security\n",
rb_id, (pdcp_entity->is_ue != 0) ? "eNB -> UE" : "UE -> eNB");
decrypt_params.key = pdcp_entity->kUPenc + 128;
decrypt_params.key = pdcp_entity->kUPenc;// + 128;
}
/* Uncipher the block */
......@@ -184,7 +184,7 @@ int pdcp_validate_security(pdcp_t *pdcp_entity, rb_id_t rb_id,
/* Now check the integrity of the complete PDU */
decrypt_params.message = pdcp_pdu_buffer;
decrypt_params.blength = sdu_buffer_size << 3;
decrypt_params.key = pdcp_entity->kRRCint + 128;
decrypt_params.key = pdcp_entity->kRRCint + 16;// 128;
if (stream_check_integrity(pdcp_entity->integrityProtAlgorithm,
&decrypt_params, &pdcp_pdu_buffer[sdu_buffer_size]) != 0)
......
......@@ -306,7 +306,7 @@ void mac_rlc_data_ind (
rlc_mode = rlc_union_p->mode;
} else {
rlc_mode = RLC_MODE_NONE;
AssertFatal (0 , "%s RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
//AssertFatal (0 , "%s RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
}
struct mac_data_ind data_ind = mac_rlc_deserialize_tb(buffer_pP, tb_sizeP, num_tbP, crcs_pP);
switch (rlc_mode) {
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ Address : EURECOM,
/*! \file rrc_eNB_S1AP.c
* \brief rrc S1AP procedures for eNB
* \author Laurent Winckel
* \author Laurent Winckel and Navid Nikaein
* \date 2013
* \version 1.0
* \company Eurecom
......@@ -50,11 +50,16 @@ Address : EURECOM,
# include "asn1_conversions.h"
# include "intertask_interface.h"
# include "pdcp.h"
# include "pdcp_primitives.h"
# include "s1ap_eNB.h"
# else
# include "../../S1AP/s1ap_eNB.h"
# endif
#if defined(ENABLE_SECURITY)
# include "UTIL/OSA/osa_defs.h"
#endif
/* Value to indicate an invalid UE initial id */
static const uint16_t UE_INITIAL_ID_INVALID = 0;
......@@ -69,8 +74,12 @@ static const uint16_t S1AP_INTEGRITY_EIA2_MASK = 0x2;
#ifdef Rel10
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia0_v920
#else
#ifdef EXMIMO_IOT
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_eia2
#else
# define INTEGRITY_ALGORITHM_NONE SecurityAlgorithmConfig__integrityProtAlgorithm_reserved
#endif
#endif
# if defined(ENABLE_ITTI)
/*! \fn uint16_t get_next_ue_initial_id(uint8_t mod_id)
......@@ -174,6 +183,7 @@ static uint8_t get_UE_index_from_s1ap_ids(uint8_t mod_id, uint16_t ue_initial_id
*\return the selected algorithm.
*/
static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms) {
if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) {
return SecurityAlgorithmConfig__cipheringAlgorithm_eea2;
}
......@@ -193,6 +203,7 @@ static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(ui
*\return the selected algorithm.
*/
static e_SecurityAlgorithmConfig__integrityProtAlgorithm rrc_eNB_select_integrity(uint16_t algorithms) {
if (algorithms & S1AP_INTEGRITY_EIA2_MASK) {
return SecurityAlgorithmConfig__integrityProtAlgorithm_eia2;
}
......@@ -234,8 +245,8 @@ static int rrc_eNB_process_security (uint8_t mod_id, uint8_t ue_index, security_
changed = TRUE;
}
LOG_I (RRC, "[eNB %d][UE %d] Selected security algorithms: %x, %x, %s",
mod_id, ue_index, cipheringAlgorithm, integrityProtAlgorithm, changed ? "changed" : "same");
LOG_I (RRC, "[eNB %d][UE %d] Selected security algorithms (%x): %x, %x, %s\n",
mod_id, ue_index, security_capabilities, cipheringAlgorithm, integrityProtAlgorithm, changed ? "changed" : "same");
return changed;
}
......@@ -259,10 +270,78 @@ static void process_eNB_security_key (uint8_t mod_id, uint8_t ue_index, uint8_t
}
ascii_buffer[2 * i] = '\0';
LOG_I (RRC, "[eNB %d][UE %d] Saved security key %s", mod_id, ue_index, ascii_buffer);
LOG_I (RRC, "[eNB %d][UE %d] Saved security key %s\n", mod_id, ue_index, ascii_buffer);
#endif
}
static void rrc_pdcp_config_security(uint8_t enb_mod_idP, uint8_t ue_mod_idP, uint8_t send_security_mode_command ){
#if defined(ENABLE_SECURITY)
SRB_ToAddModList_t *SRB_configList = eNB_rrc_inst[enb_mod_idP].SRB_configList[ue_mod_idP];
uint8_t *kRRCenc = NULL;
uint8_t *kRRCint = NULL;
uint8_t *kUPenc = NULL;
pdcp_t *pdcp_p = NULL;
static int print_keys= 1;
/* Derive the keys from kenb */
if (SRB_configList != NULL) {
derive_key_up_enc(eNB_rrc_inst[enb_mod_idP].ciphering_algorithm[ue_mod_idP],
eNB_rrc_inst[enb_mod_idP].kenb[ue_mod_idP], &kUPenc);
}
derive_key_rrc_enc(eNB_rrc_inst[enb_mod_idP].ciphering_algorithm[ue_mod_idP],
eNB_rrc_inst[enb_mod_idP].kenb[ue_mod_idP], &kRRCenc);
derive_key_rrc_int(eNB_rrc_inst[enb_mod_idP].integrity_algorithm[ue_mod_idP],
eNB_rrc_inst[enb_mod_idP].kenb[ue_mod_idP], &kRRCint);
#define DEBUG_SECURITY 1
#if defined (DEBUG_SECURITY)
#define msg printf
if (print_keys ==1 ) {
print_keys =0;
int i;
msg("\nKeNB:");
for(i = 0; i < 32; i++)
msg("%02x", eNB_rrc_inst[enb_mod_idP].kenb[ue_mod_idP][i]);
msg("\n");
msg("\nKRRCenc:");
for(i = 0; i < 32; i++)
msg("%02x", kRRCenc[i]);
msg("\n");
msg("\nKRRCint:");
for(i = 0; i < 32; i++)
msg("%02x", kRRCint[i]);
msg("\n");
}
#endif //DEBUG_SECURITY
pdcp_p = &pdcp_array_srb_eNB[enb_mod_idP][ue_mod_idP][DCCH-1];
pdcp_config_set_security(pdcp_p,
enb_mod_idP,
ue_mod_idP,
0,
ENB_FLAG_YES,
DCCH,
DCCH+2,
(send_security_mode_command == TRUE) ?
0 | (eNB_rrc_inst[enb_mod_idP].integrity_algorithm[ue_mod_idP] << 4) :
(eNB_rrc_inst[enb_mod_idP].ciphering_algorithm[ue_mod_idP] ) |
(eNB_rrc_inst[enb_mod_idP].integrity_algorithm[ue_mod_idP] << 4),
kRRCenc,
kRRCint,
kUPenc);
#endif
}
/*------------------------------------------------------------------------------*/
void rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(uint8_t mod_id, uint8_t ue_index) {
eNB_RRC_UE_INFO *UE_info = &eNB_rrc_inst[mod_id].Info.UE[ue_index];
......@@ -508,11 +587,18 @@ int rrc_eNB_process_S1AP_DOWNLINK_NAS(MessageDef *msg_p, const char *msg_name, i
if (eNB_rrc_inst[instance].Info.UE[ue_index].eNB_ue_s1ap_id == 0) {
eNB_rrc_inst[instance].Info.UE[ue_index].eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
}
/* Create message for PDCP (DLInformationTransfer_t) */
/* Create message for PDCP (DLInformationTransfer_t) */
length = do_DLInformationTransfer (instance, &buffer, rrc_eNB_get_next_transaction_identifier (instance),
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length,
S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer);
#ifdef RRC_MSG_PRINT
LOG_F(RRC,"RRC DL Information Transfer\n");
for (i = 0; i < length; i++)
LOG_F(RRC,"%02x ", ((uint8_t*)buffer)[i]);
LOG_F(RRC,"\n");
#endif
/* Transfer data to PDCP */
pdcp_rrc_data_req (instance, ue_index, 0 /* TODO put frame number ! */, 1, DCCH, *rrc_eNB_mui++, 0,
length, buffer, 1);
......@@ -590,15 +676,22 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
process_eNB_security_key (instance, ue_index, S1AP_INITIAL_CONTEXT_SETUP_REQ(msg_p).security_key);
{
uint8_t send_security_mode_command = TRUE;
if ((eNB_rrc_inst[instance].ciphering_algorithm[ue_index] == SecurityAlgorithmConfig__cipheringAlgorithm_eea0)
uint8_t send_security_mode_command = TRUE;
#ifndef EXMIMO_IOT
if ((eNB_rrc_inst[instance].ciphering_algorithm[ue_index] == SecurityAlgorithmConfig__cipheringAlgorithm_eea0)
&& (eNB_rrc_inst[instance].integrity_algorithm[ue_index] == INTEGRITY_ALGORITHM_NONE)) {
send_security_mode_command = FALSE;
}
#endif
rrc_pdcp_config_security(instance, ue_index,send_security_mode_command);
if (send_security_mode_command) {
rrc_eNB_generate_SecurityModeCommand (instance, 0 /* TODO put frame number ! */, ue_index);
rrc_eNB_generate_SecurityModeCommand (instance, 0 /* TODO put frame number ! */, ue_index);
send_security_mode_command = FALSE;
// apply ciphering after RRC security command mode
rrc_pdcp_config_security(instance, ue_index,send_security_mode_command);
}
else {
rrc_eNB_generate_UECapabilityEnquiry (instance, 0 /* TODO put frame number ! */, ue_index);
......
......@@ -153,7 +153,7 @@ int logInit (void)
g_log->log_component[RRC].flag = LOG_MED;
g_log->log_component[RRC].interval = 1;
g_log->log_component[RRC].fd = 0;
g_log->log_component[RRC].filelog = 0;
g_log->log_component[RRC].filelog = 1;
g_log->log_component[RRC].filelog_name = "/tmp/rrc.log";
g_log->log_component[NAS].name = "NAS";
......@@ -627,10 +627,12 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
// do not apply filtering for LOG_F
// only log messages which are enabled and are below the global log level and component's level threshold
if ((level != LOG_FILE) &&
if ((level != LOG_FILE) && ((level > c->level) && (level > g_log->level))) {
/* if ((level != LOG_FILE) &&
((level > c->level) ||
(level > g_log->level) ||
( c->level > g_log->level))) {
*/
return;
}
......
......@@ -61,7 +61,7 @@ int stream_compute_integrity_eia2(stream_cipher_t *stream_cipher, uint8_t out[4]
stream_cipher->blength, zero_bit);
for (i = 0; i < sizeof(m); i++)
index += sprintf(&payload[index], "0x%02x ", m[i]);
LOG_T(OSA, "Payload: %s\n", payload);
LOG_D(OSA, "Payload: %s\n", payload);
}
#endif
......@@ -86,7 +86,8 @@ int stream_compute_integrity(uint8_t algorithm, stream_cipher_t *stream_cipher,
LOG_E(OSA, "SNOW-3G algorithms are currently not implemented for integrity\n");
return -1;
} else if (algorithm == EIA2_128_ALG_ID) {
return stream_compute_integrity_eia2(stream_cipher, out);
LOG_D(OSA, "EIA2 algorithm applied for integrity\n");
return stream_compute_integrity_eia2(stream_cipher, out);
}
LOG_E(OSA, "Provided integrity algorithm is currently not supported = %u\n", algorithm);
return -1;
......
......@@ -67,7 +67,8 @@ LIBS += $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
#LG SHARED_DEPENDENCIES += $(UE_NAS_OBJ_DIR)/libuenas.a $(X2AP_OBJ_DIR)/libx2ap.a $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
SHARED_DEPENDENCIES += $(UE_NAS_OBJ_DIR)/libuenas.a $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a $(UDP_OBJ_DIR)/libudp.a $(GTPV1U_OBJ_DIR)/libgtpv1u.a
COMMON_CFLAGS += -DLOG_NO_THREAD -DEMIT_ASN_DEBUG
COMMON_CFLAGS += -DLOG_NO_THREAD
#-DEMIT_ASN_DEBUG
openair_cn_available = $(shell if [ -d "$(UE_NAS_DIR)" ]; then echo "0" ; else echo "1" ; fi )
ifeq ($(openair_cn_available), 0)
......@@ -198,4 +199,4 @@ common-cleanall:
@if [ -d $(SCTP_OBJ_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB cleanall OUTDIR=$(SCTP_OBJ_DIR); fi
@if [ -d $(UDP_OBJ_DIR) ]; then $(MAKE) -C $(UDP_DIR) -f Makefile.eNB cleanall OUTDIR=$(UDP_OBJ_DIR); fi
@if [ -d $(GTPV1U_OBJ_DIR) ]; then $(MAKE) -C $(GTPV1U_DIR) -f Makefile.eNB cleanall OUTDIR=$(GTPV1U_OBJ_DIR); fi
\ No newline at end of file
//Active_eNBs = ( "eNB_Eurecom_0", "eNB_Eurecom_1", "eNB_Eurecom_2", "eNB_Eurecom_3");
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
......@@ -23,102 +24,28 @@ eNBs =
default_paging_drx = "PAGING_DRX_256";
////////// Physical parameters:
frame_type = "FDD";
frame_type = "FDD";
prefix_type = "NORMAL";
downlink_frequency = 2680000000;
eutra_band = 7;
downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000;
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "2192:168:30::17";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
},
{ ipv4 = "192.168.13.11";
ipv6 = "2192:168:30::18";
active = "no";
preference = "ipv4";
}
);
},
{
////////// Identification parameters:
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_1";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256";
////////// Physical parameters:
frame_type = "FDD";
prefix_type = "NORMAL";
downlink_frequency = 2680000000;
uplink_frequency_offset = -120000000;
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.12.170";
ipv6 = "2192:168:30::17";
active = "yes";
preference = "ipv4";
},
{ ipv4 = "192.168.12.86";
ipv6 = "2192:168:30::18";
active = "no";
preference = "ipv4";
}
);
},
{
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_2";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
// Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256";
mme_ip_address = ( { ipv4 = "192.168.12.170";
ipv6 = "2192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
},
{
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_3";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
// Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256";
mme_ip_address = ( { ipv4 = "192.168.12.170";
ipv6 = "2192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24";
};
}
);
......@@ -3,9 +3,6 @@ Active_eNBs = ( "eNB_Eurecom_0");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
......
Active_eNBs = ( "eNB_Eurecom_0", "eNB_Eurecom_1", "eNB_Eurecom_2", "eNB_Eurecom_3");
//Active_eNBs = ( "eNB_Eurecom_0");
//Active_eNBs = ( "eNB_Eurecom_0", "eNB_Eurecom_1", "eNB_Eurecom_2", "eNB_Eurecom_3");
Active_eNBs = ( "eNB_Eurecom_0");
eNBs =
(
......@@ -12,11 +12,11 @@ eNBs =
eNB_name = "eNB_Eurecom_0";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
tracking_area_code = "1";
mobile_country_code = 208;
mobile_country_code = "208";
mobile_network_code = 92;
mobile_network_code = "92";
////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304
......@@ -48,12 +48,12 @@ eNBs =
eNB_name = "eNB_Eurecom_1";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = 208;
mobile_country_code = "208";
mobile_network_code = 92;
mobile_network_code = "92";
////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304
......@@ -85,12 +85,11 @@ eNBs =
eNB_name = "eNB_Eurecom_2";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
tracking_area_code = "1";
mobile_country_code = 208;
mobile_country_code = "208";
// EXMIMO_IOT mobile_network_code = 92;
mobile_network_code = 92;
mobile_network_code = "92";
// Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256";
......@@ -108,12 +107,11 @@ eNBs =
eNB_name = "eNB_Eurecom_3";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
tracking_area_code = "1";
mobile_country_code = 208;
mobile_country_code = "208";
// EXMIMO_IOT mobile_network_code = 92;
mobile_network_code = 92;
mobile_network_code = "92";
// Default Paging DRX of the eNB as defined in TS 36.304
default_paging_drx = "PAGING_DRX_256";
......