Commit 9feaf7b7 authored by gauthier's avatar gauthier
Browse files

Minor updates, updated link register with 3GPP_ADDR

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5105 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5ada426c
......@@ -35,7 +35,7 @@
#define ENB_DEFAULT_LINK_ID_RAL "enb_lte_link"
#define ENB_DEFAULT_LINK_ADDRESS_RAL "060080149150"
#define ENB_DEFAULT_MIHF_ID "mihf_enb"
#define ENB_DEFAULT_ADDRESS_3GPP "0335060080149150"
#define ENB_DEFAULT_3GPP_ADDRESS "0000000000000000"
//-----------------------------------------------------------------------------
......
......@@ -69,6 +69,7 @@
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
protected_lteralenb_mih_msg(void eRAL_MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_enb_instance_t instanceP, MIH_C_3GPP_ADDR_T* _3gpp_addr_pP, u_int8_t* str_pP));
protected_lteralenb_mih_msg(int eRAL_mihf_connect(ral_enb_instance_t instanceP);)
......
......@@ -485,11 +485,11 @@ MIH_C_LINK_AC_RESULT_T eRAL_action_link_flow_attr(ral_enb_instance_t instanceP)
MIH_C_LINK_AC_RESULT_T eRAL_action_link_activate_resources(ral_enb_instance_t instanceP){
//---------------------------------------------------------------------------
MIH_C_RESOURCE_DESC_T *res = &g_link_action.link_ac_param._union.resource_desc;
MIH_C_COS_T classIdDL = 0;
MIH_C_COS_T classIdUL = 0;
MIH_C_COS_T classIdDL = 0;
MIH_C_COS_T classIdUL = 0;
MIH_C_LINK_DATA_RATE_T resBitrateDL = 0;
MIH_C_LINK_DATA_RATE_T resBitrateUL = 0;
MIH_C_BOOLEAN_T multicast = MIH_C_BOOLEAN_FALSE;
MIH_C_BOOLEAN_T multicast = MIH_C_BOOLEAN_FALSE;
/* TODO: To be initialized downlink/uplink */
if (res->choice_qos) {
......@@ -765,10 +765,10 @@ MIH_C_LINK_AC_RESULT_T eRAL_action_link_activate_resources(ral_enb_instance_t in
***************************************************************************/
MIH_C_LINK_AC_RESULT_T eRAL_action_link_deactivate_resources(ral_enb_instance_t instanceP)
{
MIH_C_RESOURCE_DESC_T *res = &g_link_action.link_ac_param._union.resource_desc;
MIH_C_RESOURCE_DESC_T *res = &g_link_action.link_ac_param._union.resource_desc;
struct ral_lte_channel *currChannel;
int mt_ix, ch_ix, f_ix;
int cnxid;
int mt_ix, ch_ix, f_ix;
int cnxid;
/* Get the connection identifier */
f_ix = eRAL_action_get_channel_id(instanceP, &res->flow_id, &cnxid);
......
......@@ -33,29 +33,35 @@ static int ueid2eui48(uint8_t *euiP, uint8_t* ue_idP)
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_system_configuration_indication(instance_t instanceP, MessageDef *msg_p)
void eRAL_rx_rrc_ral_system_configuration_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
g_enb_ral_obj[instanceP].plmn_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_p).plmn_id;
g_enb_ral_obj[instanceP].cell_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_p).cell_id;
module_id_t mod_id = instanceP;
g_enb_ral_obj[mod_id].plmn_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_pP).plmn_id;
g_enb_ral_obj[mod_id].cell_id = RRC_RAL_SYSTEM_CONFIGURATION_IND(msg_pP).cell_id;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, MessageDef *msg_p)
void eRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
uint8_t ue_id_array[MIH_C_3GPP_ADDR_LENGTH];
uint8_t mn_link_addr[MIH_C_3GPP_ADDR_LENGTH];
uint64_t ue_id; //EUI-64
int i;
#endif
module_id_t mod_id = instanceP;
// The LINK_ID contains the MN LINK_ADDR
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_LINK_ADDR;
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_ADDR;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
memset(ue_id_array, 0, MIH_C_3GPP_ADDR_LENGTH);
#warning "TO DO FIX UE_ID TYPE in rrc_ral_connection_establishment_ind_t"
ue_id = (uint64_t)RRC_RAL_CONNECTION_ESTABLISHMENT_IND(msg_p).ue_id;
ue_id = (uint64_t)RRC_RAL_CONNECTION_ESTABLISHMENT_IND(msg_pP).ue_id;
for (i = 0; i < MIH_C_3GPP_ADDR_LENGTH; i++) {
ue_id_array[MIH_C_3GPP_ADDR_LENGTH-1-i] = (ue_id & 0x00000000000000FF);
ue_id = ue_id >> 8;
......@@ -63,8 +69,23 @@ void eRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, M
ueid2eui48(mn_link_addr, ue_id_array);
MIH_C_3GPP_ADDR_set(&(link_tuple_id.link_id.link_addr._union._3gpp_addr), NULL, 8);
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
// The optional LINK_ADDR contains a link address of PoA.
eRAL_MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_tuple_id._union.link_addr._union._3gpp_addr, (uint8_t*)ENB_DEFAULT_3GPP_ADDRESS);
#else
#warning TO DO UE ID
// preserve byte order of plmn id
memcpy(link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_enb_ral_obj[mod_id].plmn_id, 3);
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = g_enb_ral_obj[mod_id].cell_id;
LOG_D(RAL_ENB, "PLMN ID %d.%d.%d\n",
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[2]);
LOG_D(RAL_ENB, "CELL ID %d\n",
link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id);
#endif
eRAL_send_link_up_indication(instanceP, &g_enb_ral_obj[instanceP].transaction_id,
&link_tuple_id,
......@@ -77,27 +98,62 @@ void eRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, M
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_reestablishment_indication(instance_t instance, MessageDef *msg_p)
void eRAL_rx_rrc_ral_connection_reestablishment_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
module_id_t mod_id = instanceP;
#warning "TO DO ral_rx_rrc_ral_connection_reestablishment_indication"
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_reconfiguration_indication(instance_t instance, MessageDef *msg_p)
void eRAL_rx_rrc_ral_connection_reconfiguration_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
uint8_t ue_id_array[MIH_C_3GPP_ADDR_LENGTH];
uint8_t mn_link_addr[MIH_C_3GPP_ADDR_LENGTH];
uint64_t ue_id; //EUI-64
int i;
module_id_t mod_id = instanceP;
// The LINK_ID contains the MN LINK_ADDR
link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_ADDR;
memset(ue_id_array, 0, MIH_C_3GPP_ADDR_LENGTH);
#warning "TO DO FIX UE_ID TYPE in rrc_ral_connection_establishment_ind_t"
ue_id = (uint64_t)RRC_RAL_CONNECTION_ESTABLISHMENT_IND(msg_pP).ue_id;
for (i = 0; i < MIH_C_3GPP_ADDR_LENGTH; i++) {
ue_id_array[MIH_C_3GPP_ADDR_LENGTH-1-i] = (ue_id & 0x00000000000000FF);
ue_id = ue_id >> 8;
}
ueid2eui48(mn_link_addr, ue_id_array);
MIH_C_3GPP_ADDR_set(&(link_tuple_id.link_id.link_addr._union._3gpp_addr), NULL, 8);
//The optional LINK_ADDR may contains a link address of PoA.
link_tuple_id.choice = MIH_C_LINK_TUPLE_ID_CHOICE_NULL;
eRAL_send_link_up_indication(instanceP, &g_enb_ral_obj[instanceP].transaction_id,
&link_tuple_id,
NULL, //MIH_C_LINK_ADDR_T *old_arP,(Optional) Old Access Router link address.
NULL, //MIH_C_LINK_ADDR_T *new_arP,(Optional) New Access Router link address.
NULL, //MIH_C_IP_RENEWAL_FLAG_T *flagP, (Optional) Indicates whether the MN needs to change IP Address in the new PoA.
NULL); //MIH_C_IP_MOB_MGMT_T *mobil_mngtP, (Optional) Indicates the type of Mobility Management Protocol supported by the new PoA.
g_enb_ral_obj[mod_id].transaction_id ++;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_measurement_report_indication(instance_t instance, MessageDef *msg_p)
void eRAL_rx_rrc_ral_measurement_report_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
module_id_t mod_id = instanceP;
}
//---------------------------------------------------------------------------------------------------------------------
void eRAL_rx_rrc_ral_connection_release_indication(instance_t instance, MessageDef *msg_p)
void eRAL_rx_rrc_ral_connection_release_indication(instance_t instanceP, MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
module_id_t mod_id = instanceP;
}
......
......@@ -44,10 +44,9 @@
#define UE_DEFAULT_LINK_ID_RAL "ue_lte_link"
#define UE_DEFAULT_LINK_ADDRESS_RAL "060080149150"
#define UE_DEFAULT_MIHF_ID "mihf2_ue"
#define DEFAULT_ADDRESS_3GPP "0335060080149150"
#define DEFAULT_ADDRESS_eNB "0000000000000001"
//#define UE_DEFAULT_3GPP_ADDRESS "0335060080149150"
#define UE_DEFAULT_3GPP_ADDRESS "0000000000000000"
#define USE_3GPP_ADDR_AS_LINK_ADDR 1
//-----------------------------------------------------------------------------
// Constants for scenario
#define PREDEFINED_MIH_PLMN_ID 503
......
......@@ -50,7 +50,7 @@ void mRAL_action_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Action_
MessageDef *message_p = NULL;
rrc_ral_connection_release_req_t release_req;
rrc_ral_connection_establishment_req_t connection_establishment_req;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
status = MIH_C_STATUS_SUCCESS;
link_action_result = MIH_C_LINK_AC_RESULT_SUCCESS;
......
......@@ -151,8 +151,8 @@ void mRAL_init_default_values(void)
//---------------------------------------------------------------------------
int mRAL_initialize(void) {
//---------------------------------------------------------------------------
ral_ue_instance_t instance = 0;
unsigned int mod_id = 0;
ral_ue_instance_t instance = 0;
module_id_t mod_id = 0;
char *char_tmp = NULL;
MIH_C_init();
......@@ -163,7 +163,7 @@ int mRAL_initialize(void) {
g_ue_ral_fd2instance = hashtable_create (32, NULL, hash_free_int_func);
for (mod_id = 0; mod_id < oai_emulation.info.nb_ue_local; mod_id++) {
for (mod_id = oai_emulation.info.first_ue_local; mod_id < oai_emulation.info.first_ue_local+ oai_emulation.info.nb_ue_local; mod_id++) {
instance = mod_id + NB_eNB_INST;
char_tmp = calloc(1, strlen(g_conf_ue_ral_listening_port) + 3); // 2 digits + \0 ->99 mod_ids
......
......@@ -57,8 +57,8 @@ static char g_msg_codec_print_buffer[8192] = {};
//-----------------------------------------------------------------------------
int mRAL_send_to_mih(ral_ue_instance_t instanceP, u_int8_t *buffer_pP, size_t lenP) {
//-----------------------------------------------------------------------------
int result;
unsigned int mod_id = instanceP - NB_eNB_INST;
int result;
module_id_t mod_id = instanceP - NB_eNB_INST;
result = send(g_ue_ral_obj[mod_id].mih_sock_desc, (const void *)buffer_pP, lenP, 0);
if (result != lenP) {
LOG_E(RAL_UE, "send_to_mih %d bytes failed, returned %d: %s\n", lenP, result, strerror(errno));
......@@ -73,7 +73,7 @@ int mRAL_mihf_connect(ral_ue_instance_t instanceP){
struct addrinfo *addr, *rp; /* endpoint address */
int rc; /* returned error code */
int optval; /* socket option value */
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
unsigned char buf[sizeof(struct sockaddr_in6)];
......@@ -195,7 +195,8 @@ void MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_ue_instance_t instanceP, MIH_C_3G
u_int8_t val_temp;
unsigned char address_3gpp[32];
unsigned char buf[3];
u_int8_t _3gpp_byte_address[8];
u_int8_t _3gpp_byte_address[8];
module_id_t mod_id = instanceP - NB_eNB_INST;
strcpy((char *)address_3gpp, (char *)str_pP);
for(l=0; l<8; l++)
......@@ -208,7 +209,7 @@ void MIH_C_3GPP_ADDR_load_3gpp_str_address(ral_ue_instance_t instanceP, MIH_C_3G
sscanf((const char *)buf,"%hhx", &val_temp);
_3gpp_byte_address[l] = val_temp;
}
_3gpp_byte_address[7] += instanceP;
_3gpp_byte_address[7] += mod_id;
MIH_C_3GPP_ADDR_set(_3gpp_addr_pP, _3gpp_byte_address, 8);
}
......@@ -224,7 +225,7 @@ void mRAL_send_link_register_indication(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Register_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -246,13 +247,16 @@ void mRAL_send_link_register_indication(ral_ue_instance_t instanceP,
message.primitive.Link_Id.link_type = MIH_C_WIRELESS_LTE; //MIH_C_WIRELESS_UMTS;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
message.primitive.Link_Id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(instanceP, &message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP);
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
message.primitive.Link_Id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_LINK_TUPLE_ID_CHOICE_NULL;//MIH_C_CHOICE_3GPP_ADDR;
message.primitive.Link_Id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_3G_CELL_ID;
memcpy(message.primitive.Link_Id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &g_ue_ral_obj[mod_id].plmn_id, 3);
message.primitive.Link_Id.link_addr._union._3gpp_3g_cell_id.cell_id = g_ue_ral_obj[mod_id].cell_id;
#endif
//MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)&(g_ue_ral_obj[instanceP].ipv6_l2id[0]), strlen(DEFAULT_ADDRESS_3GPP));
////MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP, strlen(DEFAULT_ADDRESS_3GPP));
////MIH_C_3GPP_ADDR_load_3gpp_str_address(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP);
//MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)&(g_ue_ral_obj[instanceP].ipv6_l2id[0]), strlen(UE_DEFAULT_3GPP_ADDRESS));
////MIH_C_3GPP_ADDR_set(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS, strlen(UE_DEFAULT_3GPP_ADDRESS));
////MIH_C_3GPP_ADDR_load_3gpp_str_address(&message.primitive.Link_Id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
message_total_length = MIH_C_Link_Message_Encode_Link_Register_indication(bb_p, &message);
......@@ -279,7 +283,7 @@ void mRAL_send_link_detected_indication(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Detected_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -321,7 +325,7 @@ void mRAL_send_link_up_indication(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Up_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -365,10 +369,7 @@ void mRAL_send_link_parameters_report_indication(ral_ue_instance_t in
MIH_C_Message_Link_Parameters_Report_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
#ifdef MSCGEN_PYTOOL
unsigned int index;
#endif
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -410,7 +411,7 @@ void mRAL_send_link_going_down_indication(ral_ue_instance_t instanceP
MIH_C_Message_Link_Going_Down_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -454,7 +455,7 @@ void mRAL_send_link_down_indication(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Down_indication_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -498,7 +499,7 @@ void mRAL_send_link_action_confirm(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Action_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
......@@ -534,7 +535,7 @@ void mRAL_send_link_action_confirm(ral_ue_instance_t instanceP,
}
//-----------------------------------------------------------------------------
void mRAL_send_capability_discover_confirm(ral_ue_instance_t instanceP,
void mRAL_send_capability_discover_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *supported_link_event_list_pP,
......@@ -543,7 +544,7 @@ void mRAL_send_capability_discover_confirm(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Capability_Discover_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -575,7 +576,7 @@ void mRAL_send_capability_discover_confirm(ral_ue_instance_t instanceP,
}
//-----------------------------------------------------------------------------
void mRAL_send_event_subscribe_confirm(ral_ue_instance_t instanceP,
void mRAL_send_event_subscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *response_link_event_list_pP) {
......@@ -583,7 +584,7 @@ void mRAL_send_event_subscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Subscribe_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -614,7 +615,7 @@ void mRAL_send_event_subscribe_confirm(ral_ue_instance_t instanceP,
}
//-----------------------------------------------------------------------------
void mRAL_send_event_unsubscribe_confirm(ral_ue_instance_t instanceP,
void mRAL_send_event_unsubscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_EVENT_LIST_T *response_link_event_list_pP) {
......@@ -622,7 +623,7 @@ void mRAL_send_event_unsubscribe_confirm(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Unsubscribe_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -653,7 +654,7 @@ void mRAL_send_event_unsubscribe_confirm(ral_ue_instance_t instanceP,
}
//-----------------------------------------------------------------------------
void mRAL_send_configure_thresholds_confirm(ral_ue_instance_t instanceP,
void mRAL_send_configure_thresholds_confirm(ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_CFG_STATUS_LIST_T *link_configure_status_list_pP) {
......@@ -661,7 +662,7 @@ void mRAL_send_configure_thresholds_confirm(ral_ue_instance_t instan
MIH_C_Message_Link_Configure_Thresholds_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
BitBuffer_wrap(bb_p, g_msg_codec_send_buffer, (unsigned int)MSG_CODEC_SEND_BUFFER_SIZE);
......@@ -692,7 +693,7 @@ void mRAL_send_configure_thresholds_confirm(ral_ue_instance_t instan
}
//-----------------------------------------------------------------------------
void mRAL_send_get_parameters_confirm (ral_ue_instance_t instanceP,
void mRAL_send_get_parameters_confirm (ral_ue_instance_t instanceP,
MIH_C_TRANSACTION_ID_T *transaction_id_pP,
MIH_C_STATUS_T *status_pP,
MIH_C_LINK_PARAM_LIST_T *link_parameters_status_list_pP,
......@@ -702,7 +703,7 @@ void mRAL_send_get_parameters_confirm (ral_ue_instance_t instanc
MIH_C_Message_Link_Get_Parameters_confirm_t message;
Bit_Buffer_t *bb_p;
int message_total_length;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
bb_p = new_BitBuffer_0();
......@@ -740,12 +741,14 @@ void mRAL_send_get_parameters_confirm (ral_ue_instance_t instanc
***************************************************************************/
//-----------------------------------------------------------------------------
int mRAL_mih_link_msg_decode(ral_ue_instance_t instanceP, Bit_Buffer_t* bbP, MIH_C_Message_Wrapper_t *message_wrapperP) {
int mRAL_mih_link_msg_decode(ral_ue_instance_t instanceP,
Bit_Buffer_t *bbP,
MIH_C_Message_Wrapper_t *message_wrapperP) {
//-----------------------------------------------------------------------------
int status = MIH_MESSAGE_DECODE_FAILURE;
MIH_C_HEADER_T header;
MIH_C_STATUS_T mih_status;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
if ((bbP != NULL) && (message_wrapperP != NULL)) {
......@@ -860,7 +863,7 @@ int mRAL_mih_link_process_message(ral_ue_instance_t instanceP){
Bit_Buffer_t *bb_p;
struct sockaddr_in udp_socket;
socklen_t sockaddr_len;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
total_bytes_to_decode = 0;
nb_bytes_received = 0;
......
......@@ -40,7 +40,8 @@
#include "lteRALue.h"
//-----------------------------------------------------------------------------
void mRAL_get_parameters_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Get_Parameters_request_t* messageP) {
void mRAL_get_parameters_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Get_Parameters_request_t *messageP) {
//-----------------------------------------------------------------------------
MIH_C_STATUS_T status;
MIH_C_LINK_PARAM_LIST_T link_parameters_status_list;
......
......@@ -35,9 +35,9 @@ static int ueid2eui48(uint8_t *euiP, uint8_t* ue_idP)
return 0;
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP, MessageDef *msg_p)
void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_STATUS_T status;
......@@ -49,19 +49,19 @@ void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP, MessageDef *msg_p)
ac_result = MIH_C_LINK_AC_RESULT_SUCCESS;
memset(&scan_rsp_list, 0, sizeof(MIH_C_LINK_SCAN_RSP_LIST_T));
for (i = 0 ; i < RRC_RAL_SCAN_CONF (msg_p).num_scan_resp; i++) {
for (i = 0 ; i < RRC_RAL_SCAN_CONF (msg_pP).num_scan_resp; i++) {
// TO DO
memcpy(&scan_rsp_list.val[i].link_addr, &RRC_RAL_SCAN_CONF (msg_p).link_scan_resp[i].link_addr, sizeof(MIH_C_LINK_ADDR_T));
memcpy(&scan_rsp_list.val[i].link_addr, &RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].link_addr, sizeof(MIH_C_LINK_ADDR_T));
// TO DO
memcpy(&scan_rsp_list.val[i].network_id, &RRC_RAL_SCAN_CONF (msg_p).link_scan_resp[i].network_id, sizeof(MIH_C_NETWORK_ID_T));
memcpy(&scan_rsp_list.val[i].network_id, &RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].network_id, sizeof(MIH_C_NETWORK_ID_T));
scan_rsp_list.val[i].sig_strength.choice = RRC_RAL_SCAN_CONF (msg_p).link_scan_resp[i].sig_strength.choice;
scan_rsp_list.val[i].sig_strength.choice = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength.choice;
switch (scan_rsp_list.val[i].sig_strength.choice) {
case RAL_SIG_STRENGTH_CHOICE_DBM:
scan_rsp_list.val[i].sig_strength._union.dbm = RRC_RAL_SCAN_CONF (msg_p).link_scan_resp[i].sig_strength._union.dbm;
scan_rsp_list.val[i].sig_strength._union.dbm = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength._union.dbm;
break;
case RAL_SIG_STRENGTH_CHOICE_PERCENTAGE:
scan_rsp_list.val[i].sig_strength._union.percentage = RRC_RAL_SCAN_CONF (msg_p).link_scan_resp[i].sig_strength._union.percentage;
scan_rsp_list.val[i].sig_strength._union.percentage = RRC_RAL_SCAN_CONF (msg_pP).link_scan_resp[i].sig_strength._union.percentage;
break;
default:
LOG_E(RAL_UE, "INVALID RRC_RAL_SCAN_CONF field sig_strength.choice %d\n", scan_rsp_list.val[i].sig_strength.choice);
......@@ -70,7 +70,7 @@ void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP, MessageDef *msg_p)
scan_rsp_list.length += 1;
}
mRAL_send_link_action_confirm(instanceP,
&RRC_RAL_SCAN_CONF (msg_p).transaction_id,
&RRC_RAL_SCAN_CONF (msg_pP).transaction_id,
&status,
&scan_rsp_list,
&ac_result);
......@@ -78,30 +78,31 @@ void mRAL_rx_rrc_ral_scan_confirm(instance_t instanceP, MessageDef *msg_p)
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_system_information_indication(instance_t instanceP, MessageDef *msg_p)
void mRAL_rx_rrc_ral_system_information_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_DET_INFO_T link_det_info;
int i;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
memset(&link_det_info, 0, sizeof(MIH_C_LINK_DET_INFO_T));
// save cell parameters
g_ue_ral_obj[mod_id].cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).cell_id;
memcpy(&g_ue_ral_obj[mod_id].plmn_id, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).plmn_id, sizeof(g_ue_ral_obj[mod_id].plmn_id));
g_ue_ral_obj[mod_id].cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).cell_id;
memcpy(&g_ue_ral_obj[mod_id].plmn_id, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).plmn_id, sizeof(g_ue_ral_obj[mod_id].plmn_id));
// link id
link_det_info.link_tuple_id.link_id.link_type = MIH_C_WIRELESS_LTE;
#ifdef USE_3GPP_ADDR_AS_LINK_ADDR
link_det_info.link_tuple_id.link_id.link_addr.choice = (MIH_C_CHOICE_T)MIH_C_CHOICE_3GPP_ADDR;
MIH_C_3GPP_ADDR_load_3gpp_str_address(instanceP, &link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)DEFAULT_ADDRESS_3GPP);
MIH_C_3GPP_ADDR_load_3gpp_str_address(mod_id, &link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_addr, (u_int8_t*)UE_DEFAULT_3GPP_ADDRESS);
#else
link_det_info.link_tuple_id.link_id.link_addr.choice = MIH_C_CHOICE_3GPP_3G_CELL_ID;
// preserve byte order of plmn id
memcpy(link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).plmn_id, 3);
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).cell_id;
memcpy(link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val, &RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).plmn_id, 3);
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.cell_id = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).cell_id;
LOG_D(RAL_UE, "PLMN ID %d.%d.%d\n", link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[0],
link_det_info.link_tuple_id.link_id.link_addr._union._3gpp_3g_cell_id.plmn_id.val[1],
......@@ -116,11 +117,11 @@ void mRAL_rx_rrc_ral_system_information_indication(instance_t instanceP, Message
MIH_C_NET_AUX_ID_set(&link_det_info.net_aux_id, (u_int8_t *)PREDEFINED_MIH_NETAUX_ID, strlen(PREDEFINED_MIH_NETAUX_ID));
link_det_info.sig_strength.choice = MIH_C_SIG_STRENGTH_CHOICE_DBM;
link_det_info.sig_strength._union.dbm = RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).dbm;
link_det_info.sig_strength._union.dbm = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).dbm;
link_det_info.sinr = RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).sinr;
link_det_info.sinr = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).sinr;
link_det_info.link_data_rate = RRC_RAL_SYSTEM_INFORMATION_IND(msg_p).link_data_rate;
link_det_info.link_data_rate = RRC_RAL_SYSTEM_INFORMATION_IND(msg_pP).link_data_rate;
link_det_info.link_mihcap_flag = g_ue_ral_obj[mod_id].link_mihcap_flag;
......@@ -132,18 +133,19 @@ void mRAL_rx_rrc_ral_system_information_indication(instance_t instanceP, Message
}
//---------------------------------------------------------------------------------------------------------------------
void mRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP, MessageDef *msg_p)
void mRAL_rx_rrc_ral_connection_establishment_indication(instance_t instanceP,
MessageDef *msg_pP)
//---------------------------------------------------------------------------------------------------------------------
{
MIH_C_LINK_TUPLE_ID_T link_tuple_id;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;