Commit 9feaf7b7 authored by Lionel Gauthier's avatar Lionel Gauthier

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
......
......@@ -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;
......
......@@ -51,7 +51,7 @@
** indications and sends Link Event Subscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msgP: Pointer to the received MIH message **
** Inputs: msg_pP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
......@@ -59,28 +59,29 @@
** Others: ralpriv **
** **
***************************************************************************/
void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Subscribe_request_t* msgP)
void mRAL_subscribe_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Subscribe_request_t *msg_pP)
{
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
/* Check whether the action request is supported */
if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_SUBSCRIBE)
{
MIH_C_LINK_EVENT_LIST_T mih_subscribed_req_event_list;
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list |= (msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list |= (msg_pP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_subscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list & msgP->primitive.RequestedLinkEventList;
mih_subscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list & msg_pP->primitive.RequestedLinkEventList;
status = MIH_C_STATUS_SUCCESS;
mRAL_send_event_subscribe_confirm(instanceP, &msgP->header.transaction_id,
mRAL_send_event_subscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
&mih_subscribed_req_event_list);
}
else
{
mRAL_send_event_subscribe_confirm(instanceP, &msgP->header.transaction_id,
mRAL_send_event_subscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
NULL);
}
......@@ -94,7 +95,7 @@ void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Even
** indications and sends Link Event Unsubscribe confirmation **
** to the MIH-F. **
** **
** Inputs: msgP: Pointer to the received MIH message **
** Inputs: msg_pP: Pointer to the received MIH message **
** Others: None **
** **
** Outputs: None **
......@@ -102,10 +103,11 @@ void mRAL_subscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Even
** Others: ralpriv **
** **
***************************************************************************/
void mRAL_unsubscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Event_Unsubscribe_request_t* msgP)
void mRAL_unsubscribe_request(ral_ue_instance_t instanceP,
MIH_C_Message_Link_Event_Unsubscribe_request_t *msg_pP)
{
MIH_C_STATUS_T status = MIH_C_STATUS_REJECTED;
unsigned int mod_id = instanceP - NB_eNB_INST;
module_id_t mod_id = instanceP - NB_eNB_INST;
/* Check whether the action request is supported */
if (g_ue_ral_obj[mod_id].mih_supported_link_command_list & MIH_C_BIT_LINK_EVENT_UNSUBSCRIBE)
......@@ -115,18 +117,18 @@ void mRAL_unsubscribe_request(ral_ue_instance_t instanceP, MIH_C_Message_Link_Ev
saved_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list;
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list &= ~(msgP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
g_ue_ral_obj[mod_id].mih_subscribe_req_event_list &= ~(msg_pP->primitive.RequestedLinkEventList & g_ue_ral_obj[mod_id].mih_supported_link_event_list);
mih_unsubscribed_req_event_list = g_ue_ral_obj[mod_id].mih_subscribe_req_event_list ^ saved_req_event_list;
status = MIH_C_STATUS_SUCCESS;
mRAL_send_event_unsubscribe_confirm(instanceP, &msgP->header.transaction_id,
mRAL_send_event_unsubscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
&mih_unsubscribed_req_event_list);
}
else
{
mRAL_send_event_unsubscribe_confirm(instanceP, &msgP->header.transaction_id,
mRAL_send_event_unsubscribe_confirm(instanceP, &msg_pP->header.transaction_id,
&status,
NULL);
}
......
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