Skip to content
Snippets Groups Projects
Commit 5f29a4e5 authored by Dr.-Ing.  Javier Morgade's avatar Dr.-Ing. Javier Morgade
Browse files

Code cleanup

	-Removing unused files

	ACKNOWLEDGEMENT:
 	1. This commit was developed at Vicomtech (https://www.vicomtech.org) under UE project CDN-X-ALL: "CDN edge-cloud computing for efficient cache and reliable streaming aCROSS Aggregated unicast-multicast LinkS"
 	2. Project funded by Fed4FIRE+ OC5 (https://www.fed4fire.eu

)

Signed-off-by: Dr.-Ing.  Javier Morgade's avatarJavier Morgade <javier.morgade@ieee.org>
parent cad6e8a2
No related branches found
No related tags found
5 merge requests!755Integration develop-nr 2020 week 03,!754Release v1.2.0 candidate,!742Develop integration branch: 2019 week 51,!739Oai test fed4fire old,!736Ci test fallback
......@@ -568,19 +568,6 @@ int MCE_send_MBMS_SCHEDULING_INFORMATION(instance_t instance, /*uint32_t assoc_i
ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,m2ap_mbsfn_area_configuration_list);
//-------------
// ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie);
//-------------
//-------------
// ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie+1);
//-------------
/* xer_fprint(stdout,&asn_DEF_M2AP_MBSFN_Area_Configuration_Item,mbsfn_area_configuration_item_ie);
xer_fprint(stdout,&asn_DEF_M2AP_MBSFN_Area_Configuration_Item,mbsfn_area_configuration_item_ie_1);
......@@ -593,323 +580,14 @@ ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,m2ap_mbsfn_area_conf
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
// LOG_D(M2AP,"%p\n",&pdu);
// LOG_D(M2AP,"%p\n",out);
// LOG_D(M2AP,"%p\n",ie);
// LOG_D(M2AP,"%p\n",mbsfn_area_configuration_item_ie);
// LOG_D(M2AP,"%p\n",&mbsfn_area_configuration_item_ie->value.choice);
// {
// /* PMCH_Configuration_List */
//
// M2AP_PMCH_Configuration_ItemIEs_t * pmch_configuration_item_ies;
// pmch_configuration_item_ies = (M2AP_PMCH_Configuration_ItemIEs_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_ItemIEs_t));
// {
// pmch_configuration_item_ies->id = M2AP_ProtocolIE_ID_id_PMCH_Configuration_Item;
// pmch_configuration_item_ies->criticality = M2AP_Criticality_reject;
// pmch_configuration_item_ies->value.present = M2AP_PMCH_Configuration_ItemIEs__value_PR_PMCH_Configuration_Item;
// M2AP_PMCH_Configuration_Item_t * pmch_configuration_item;
// pmch_configuration_item = &pmch_configuration_item_ies->value.choice.PMCH_Configuration_Item;
// {
// //pmch_configuration_item->allocatedSubframesEnd;
// pmch_configuration_item->pmch_Configuration.dataMCS=13;
// //pmch_configuration_item->mchSchedulingPeriod;
// MBMSsessionListPerPMCH_Item__Member *member;
// member = (MBMSsessionListPerPMCH_Item__Member*)calloc(1,sizeof(MBMSsessionListPerPMCH_Item__Member));
// LOG_D(M2AP,"%p,%p,%p\n",pmch_configuration_item,&pmch_configuration_item->mbms_Session_List.list,member);
// ASN_SEQUENCE_ADD(&pmch_configuration_item->mbms_Session_List.list,member);
// }
// ////
// // //ASN_SEQUENCE_ADD(mbsfn_area_configuration_item_ie,pmch_configuration_item_ies);
//
// }
//
// M2AP_PMCH_Configuration_List_t * pmch_list = &mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List;
//
// ASN_SEQUENCE_ADD(&pmch_list->list,pmch_configuration_item_ies);
// LOG_D(M2AP,"%p,%p\n",&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies);
// //ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies);
// //ASN_SET_ADD(&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies);
// //ASN_SEQUENCE_ADD(mbsfn_area_configuration_item_ie,pmch_configuration_item_ies);
// /* MBSFN_Subframe_ConfigurationList */
// M2AP_MBSFN_Subframe_ConfigurationItem_t * mbsfn_subframe_configurationitem;
// mbsfn_subframe_configurationitem =(M2AP_MBSFN_Subframe_ConfigurationItem_t*)calloc(1,sizeof(M2AP_MBSFN_Subframe_ConfigurationItem_t));
// {
// mbsfn_subframe_configurationitem->id = M2AP_ProtocolIE_ID_id_MBSFN_Subframe_Configuration_Item;
// mbsfn_subframe_configurationitem->criticality = M2AP_Criticality_reject;
// mbsfn_subframe_configurationitem->value.present=M2AP_MBSFN_Subframe_ConfigurationItem__value_PR_MBSFN_Subframe_Configuration;
// }
//
// //ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item_ie->value.choice.MBSFN_Subframe_ConfigurationList.list,mbsfn_subframe_configurationitem);
// LOG_D(M2AP,"%p,%p\n",&mbsfn_area_configuration_item_ie->value.choice.PMCH_Configuration_List.list,mbsfn_subframe_configurationitem);
// //ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item_ie->value.choice.MBSFN_Subframe_ConfigurationList.list,mbsfn_subframe_configurationitem);
////
//// M2AP_Common_Subframe_Allocation_Period_t * common_subframe_allocation_period;
//// M2AP_MBSFN_Area_ID_t * mbsfn_area_id;
// }
// LOG_D(M2AP,"%p,%p\n",&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie);
// //ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie);
// ASN_SET_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie);
// M2AP_MBSFN_Area_Configuration_Item_t *mbsfn_area_configuration_item_ie_2;
// mbsfn_area_configuration_item_ie_2 =(M2AP_MBSFN_Area_Configuration_Item_t*)calloc(1,sizeof(M2AP_MBSFN_Area_Configuration_Item_t));
// {
// // mbsfn_area_configuration_item_ie->value.present = M2AP_MBSFN_Area_Configuration_Item__value_PR_PMCH_Configuration_List;
// /* PMCH_Configuration_List */
// // M2AP_PMCH_Configuration_ItemIEs_t * pmch_configuration_item_ies;
// // pmch_configuration_item_ies = (M2AP_PMCH_Configuration_ItemIEs_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_ItemIEs_t));
// // pmch_configuration_item_ies->id = M2AP_ProtocolIE_ID_id_PMCH_Configuration_Item;
// // pmch_configuration_item_ies->criticality = M2AP_Criticality_reject;
// // pmch_configuration_item_ies->value.present = M2AP_PMCH_Configuration_ItemIEs__value_PR_PMCH_Configuration_Item;
// // M2AP_PMCH_Configuration_Item_t * pmch_configuration_item;
// // pmch_configuration_item = &pmch_configuration_item_ies->value.choice.PMCH_Configuration_Item;
// ////
// // ASN_SEQUENCE_ADD(mbsfn_area_configuration_item_ie,pmch_configuration_item_ies);
// /* MBSFN_Subframe_ConfigurationList */
// M2AP_MBSFN_Subframe_ConfigurationItem_t * mbsfn_subframe_configurationitem;
// mbsfn_subframe_configurationitem =(M2AP_MBSFN_Subframe_ConfigurationItem_t*)calloc(1,sizeof(M2AP_MBSFN_Subframe_ConfigurationItem_t));
// {
// mbsfn_subframe_configurationitem->id = M2AP_ProtocolIE_ID_id_MBSFN_Subframe_Configuration_Item;
// mbsfn_subframe_configurationitem->criticality = M2AP_Criticality_reject;
// mbsfn_subframe_configurationitem->value.present=M2AP_MBSFN_Subframe_ConfigurationItem__value_PR_MBSFN_Subframe_Configuration;
// //M2AP_MBSFN_Subframe_Configuration_t * mbsfn_subframe_configuration;
// //mbsfn_subframe_configuration = (M2AP_MBSFN_Subframe_Configuration_t*)calloc(1,sizeof(M2AP_MBSFN_Subframe_Configuration_t));
// //ASN_SEQUENCE_ADD(mbsfn_subframe_configurationitem,mbsfn_subframe_configuration);
// M2AP_MBSFN_Subframe_Configuration_t * mbsfn_subframe_configuration;
// mbsfn_subframe_configuration = &mbsfn_subframe_configurationitem->value.choice.MBSFN_Subframe_Configuration;
// }
//
// ASN_SEQUENCE_ADD(mbsfn_area_configuration_item_ie_2,mbsfn_subframe_configurationitem);
// }
// ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item_ie_2);
// M2AP_MBSFN_Area_Configuration_List_t * m2ap_mbsfn_area_configuration_list;
// m2ap_mbsfn_area_configuration_list = &ie->value.choice.MBSFN_Area_Configuration_List;
// {
// M2AP_PMCH_Configuration_ItemIEs_t * pmch_configuration_item_ies;
// pmch_configuration_item_ies = (M2AP_PMCH_Configuration_ItemIEs_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_ItemIEs_t));
// pmch_configuration_item_ies->id = M2AP_ProtocolIE_ID_id_PMCH_Configuration_Item;
// pmch_configuration_item_ies->criticality = M2AP_Criticality_reject;
// pmch_configuration_item_ies->value.present = M2AP_PMCH_Configuration_ItemIEs__value_PR_PMCH_Configuration_Item;
// M2AP_PMCH_Configuration_Item_t * pmch_configuration_item;
// pmch_configuration_item = &pmch_configuration_item_ies->value.choice.PMCH_Configuration_Item;
//
// ASN_SEQUENCE_ADD(&m2ap_mbsfn_area_configuration_list->PMCH_Configuration_List.list,pmch_configuration_item_ies);
// }
//
// int num_mbsfn_available =0; // ?
// LOG_I(M2AP, "num_mbsfn_available = %d \n", num_mbsfn_available);
// for (i=0;
// i<num_mbsfn_available;
// i++) {
//
// //M2AP_MBSFN_Area_Configuration_Item_t *mbms_mbsfn_area_configuration_item_ies;
// //mbms_mbsfn_area_configuration_item_ies = ( M2AP_MBSFN_Area_Configuration_Item_t *)calloc(1, sizeof(M2AP_MBSFN_Area_Configuration_Item_t ));
// //mbms_configuration_data_item_ies->id = M2AP_ProtocolIE_ID_id_MBSFN_Area_Configuration_Item;
// //mbms_configuration_data_item_ies>criticality = M2AP_Criticality_reject;
// //mbms_mbsfn_area_configuration_item_ies->value.present = M2AP_MBSFN_Area_Configuration_Item__value_PR_M2AP_MBSFN_Area_Configuration_Item;
//
// M2AP_MBSFN_Area_Configuration_Item_t * mbsfn_area_configuration_item;
// mbsfn_area_configuration_item = (M2AP_MBSFN_Area_Configuration_Item_t*)calloc(1,sizeof(M2AP_MBSFN_Area_Configuration_Item_t));
// //mbsfn_area_configuration_item = &mbms_mbsfn_area_configuration_item_ies->value.choice.M2AP_MBSFN_Area_Configuration_Item;
// mbsfn_area_configuration_item->value.present = M2AP_MBSFN_Area_Configuration_Item__value_PR_PMCH_Configuration_List;
//
// M2AP_PMCH_Configuration_ItemIEs_t * pmch_configuration_item_ies;
// pmch_configuration_item_ies = (M2AP_PMCH_Configuration_ItemIEs_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_ItemIEs_t));
// pmch_configuration_item_ies->id = M2AP_ProtocolIE_ID_id_PMCH_Configuration_Item;
// pmch_configuration_item_ies->criticality = M2AP_Criticality_reject;
// pmch_configuration_item_ies->value.present = M2AP_PMCH_Configuration_ItemIEs__value_PR_PMCH_Configuration_Item;
// M2AP_PMCH_Configuration_Item_t * pmch_configuration_item;
// pmch_configuration_item = &pmch_configuration_item_ies->value.choice.PMCH_Configuration_Item;
// //memset((void*)&pmch_configuration_item,0,sizeof(M2AP_PMCH_Configuration_Item_t));
//
// ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies);
//// if(0)
//// {
//// /* PMCH_Configuration_List */
//// LOG_I(M2AP, "num_pmch_available = %d \n", num_mbsfn_available);
//// int num_pmch_available =0; // ?
//// for (j=0;
//// j<num_pmch_available;
//// j++) {
//// M2AP_PMCH_Configuration_ItemIEs_t * pmch_configuration_item_ies;
//// pmch_configuration_item_ies->id = (M2AP_PMCH_Configuration_ItemIEs_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_ItemIEs_t));
//// pmch_configuration_item_ies->criticality = M2AP_Criticality_reject;
//// pmch_configuration_item_ies->value.present = M2AP_PMCH_Configuration_ItemIEs__value_PR_PMCH_Configuration_Item;
////
//// M2AP_PMCH_Configuration_Item_t * pmch_configuration_item;
//// //pmch_configuration_item = (M2AP_PMCH_Configuration_Item_t*)calloc(1,sizeof(M2AP_PMCH_Configuration_Item_t));
//// pmch_configuration_item = &pmch_configuration_item_ies->value.choice.PMCH_Configuration_Item;
//// {
//// /* PMCH_Configuration */
//// /* allocateSubframesEnd */
//// //pmch_configuration_item.pmch_Configuration.allocatedSubframesEnd=;
//// /* dataMCS */
//// //pmch_configuration_item.pmch_Configuration.dataMCS=;
//// /* MCH_Scheduling_Period*/
//// //pmch_configuration_item.pmch_Configuration.mchSchedulingPeriod=;
////
//// /* MBMSsessionListPerPMCH */
//// LOG_I(M2AP, "num_mbms_session_available = %d \n", num_mbsfn_available);
//// int num_mbms_session_available =1; // ?
//// for(k=0;
//// k<num_mbms_session_available;
//// k++){
//// M2AP_MBMSsessionListPerPMCH_Item_t * session_list_per_pmch_item;
//// session_list_per_pmch_item=(M2AP_MBMSsessionListPerPMCH_Item_t*)calloc(1,sizeof(M2AP_MBMSsessionListPerPMCH_Item_t));
////
//// //session_list_per_pmch_item->tmgi=;
//// //session_list_per_pmch_item->lcid=;
//// //ASN_SEQUENCE_ADD(&pmch_configuration_item->mbms_Session_List.list,mbsfn_area_configuration_item);
//// }
////
//// }
//// ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item->value.choice.PMCH_Configuration_List.list,pmch_configuration_item_ies);
//// }
////
//// /* MBSFN_Subframe_ConfigurationList */
//// int num_mbsfn_subframe_available=0;
//// for(j=0;
//// j<num_mbsfn_subframe_available;
//// j++){
//// M2AP_MBSFN_Subframe_ConfigurationItem_t * mbsfn_subframe_configuration_item;
//// mbsfn_subframe_configuration_item = (M2AP_MBSFN_Subframe_ConfigurationItem_t*)calloc(1,sizeof(M2AP_MBSFN_Subframe_ConfigurationItem_t));
//// //mbsfn_subframe_configuration_item->MBSFN_Subframe_Configuration.radioframeAllocationPeriod=;
//// //mbsfn_subframe_configuration_item->MBSFN_Subframe_Configuration.radioframeAllocationOffset=;
//// //mbsfn_subframe_configuration_item->MBSFN_Subframe_Configuration.subframeAllocation.oneFrame=;
//// //mbsfn_subframe_configuration_item->MBSFN_Subframe_Configuration.subframeAllocation.fourFrames=;
////
//// ASN_SEQUENCE_ADD(&mbsfn_area_configuration_item->value.choice.MBSFN_Subframe_ConfigurationList.list,mbsfn_subframe_configuration_item);
////
//// }
//// /* Common_subframe_Allocation_Period */
//// mbsfn_area_configuration_item->value.choice.Common_Subframe_Allocation_Period=0;
//// /* MBSFN_Area_ID */
//// mbsfn_area_configuration_item->value.choice.MBSFN_Area_ID=0;
//// /*MBMS_Suspension_Notification_List*/
//// //TODO
//// }
// //ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List.list,mbsfn_area_configuration_item);
// ASN_SEQUENCE_ADD(&m2ap_mbsfn_area_configuration_list->list,mbsfn_area_configuration_item);
//
// }
/* encode */
if (m2ap_encode_pdu(&pdu,&buffer,&len) < 0){
return -1;
}
/*if (m2ap_encode_pdu(&pdu,&buffer,&len) < 0){
return -1;
}*/
/*buffer = &m2ap_message[0];
len = 62;
for(int i=0; i < len; i++ )
printf("%02X",buffer[i]);
printf("\n");*/
//printf("m2ap_mce_data_from_enb %p %p %d\n",m2ap_mce_data_from_enb, buffer, len);
m2ap_MCE_itti_send_sctp_data_req(instance,m2ap_mce_data_from_enb->assoc_id,buffer,len,0);
return 0;
// buffer2 = &m2ap_message[0];
// len2 = 62;
// for(int i=0; i < len2; i++ )
// printf("%02X",buffer2[i]);
// printf("\n");
//
// M2AP_M2AP_PDU_t pdu2;
// memset(&pdu2, 0, sizeof(pdu2));
// if (m2ap_decode_pdu(&pdu2, buffer2, len2) < 0) {
// LOG_E(M2AP, "SCHEDULING Failed to decode PDU\n");
// //return -1;
// }else{
// LOG_D(M2AP, "SCHEDULING OK to decode PDU\n");
// }
//
//
// M2AP_MbmsSchedulingInformation_t *container2;
// M2AP_MbmsSchedulingInformation_Ies_t *ie2;
// int i2 = 0;
// container2 = &pdu2.choice.initiatingMessage.value.choice.MbmsSchedulingInformation;
// M2AP_FIND_PROTOCOLIE_BY_ID(M2AP_MbmsSchedulingInformation_Ies_t, ie2, container2,M2AP_ProtocolIE_ID_id_MCCH_Update_Time ,true);
// LOG_D(M2AP, "SCHEDULING id %d\n",ie2->id);
// M2AP_FIND_PROTOCOLIE_BY_ID(M2AP_MbmsSchedulingInformation_Ies_t, ie2, container2,M2AP_ProtocolIE_ID_id_MBSFN_Area_Configuration_List ,true);
// LOG_D(M2AP, "SCHEDULING id %d\n",ie2->id);
//
//
//
// //M2AP_MBSFN_Area_Configuration_Item_t * kk = &ie->value.choice.MBSFN_Area_Configuration_List.list.array[0];
// //printf("M2AP_MBSFN_Area_Configuration_Item %d\n",kk->id);
//
// const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID((void*)&ie2->value.choice.MBSFN_Area_Configuration_List);
// void * memb_ptr = list->array[0];
// const asn_anonymous_sequence_ *list2 = _A_CSEQUENCE_FROM_VOID((void*)memb_ptr);
//
//
// void * memb_ptr1 = list2->array[0];
// M2AP_MBSFN_Area_Configuration_Item_t * m2ap_mbsfn_area_configuration_item1 = (M2AP_MBSFN_Area_Configuration_Item_t*)memb_ptr1;
// M2AP_PMCH_Configuration_Item_t * m2ap_pmchconfiguration_item =&(((M2AP_PMCH_Configuration_ItemIEs_t*)m2ap_mbsfn_area_configuration_item1->value.choice.PMCH_Configuration_List.list.array[0])->value.choice.PMCH_Configuration_Item);
// printf("dataMCS %d\n",m2ap_pmchconfiguration_item->pmch_Configuration.dataMCS);
// m2ap_pmchconfiguration_item->pmch_Configuration.dataMCS=4;
// printf("allocatedSubframesEnd %d\n",m2ap_pmchconfiguration_item->pmch_Configuration.allocatedSubframesEnd);
// M2AP_PMCH_Configuration_t * m2ap_pmchconfiguration = &m2ap_pmchconfiguration_item->pmch_Configuration;
// printf("M2AP_PMCH_Configuration_t dataMCS %d\n",m2ap_pmchconfiguration->dataMCS);
// printf("M2AP_PMCH_Configuration_t allocatedSubframesEnd %d\n",m2ap_pmchconfiguration->allocatedSubframesEnd);
// M2AP_MBMSsessionListPerPMCH_Item_t * m2ap_mbsfnsessionlistperPMCH = &m2ap_pmchconfiguration_item->mbms_Session_List;
// M2AP_TMGI_t * tmgi = &m2ap_mbsfnsessionlistperPMCH->list.array[0]->tmgi;
// M2AP_PLMN_Identity_t * pLMNidentity = &tmgi->pLMNidentity;
// MCC_MNC_TO_PLMNID(0,1,3/*instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,*/
// ,pLMNidentity);
//
//
// OCTET_STRING_t * serviceID = &tmgi->serviceID;
// M2AP_LCID_t * lcid = &m2ap_mbsfnsessionlistperPMCH->list.array[0]->lcid; //long
//
//
// void * memb_ptr2 = list2->array[1];
// M2AP_MBSFN_Area_Configuration_Item_t * m2ap_mbsfn_area_configuration_item2 = (M2AP_MBSFN_Area_Configuration_Item_t*)memb_ptr2;
// M2AP_MBSFN_Subframe_Configuration_t * m2ap_mbsfn_subframe_configuration_item =&(((M2AP_MBSFN_Subframe_ConfigurationItem_t*)m2ap_mbsfn_area_configuration_item2->value.choice.MBSFN_Subframe_ConfigurationList.list.array[0])->value.choice.MBSFN_Subframe_Configuration);
// //M2AP_MBSFN_Subframe_Configuration_t * m2ap_mbsfn_subframe_configuration = &m2ap_mbsfn_subframe_configuration_item->value.choice.MBSFN_Subframe_Configuration;
// printf("oneframe ? %d\n",(m2ap_mbsfn_subframe_configuration_item->subframeAllocation.present == M2AP_MBSFN_Subframe_Configuration__subframeAllocation_PR_oneFrame));
//
//
// void * memb_ptr3 = list2->array[2];
// M2AP_MBSFN_Area_Configuration_Item_t * m2ap_mbsfn_area_configuration_item3 = (M2AP_MBSFN_Area_Configuration_Item_t*)memb_ptr3;
// M2AP_Common_Subframe_Allocation_Period_t * m2ap_mbsfn_common_subframe_allocation_period = (M2AP_Common_Subframe_Allocation_Period_t*)m2ap_mbsfn_area_configuration_item3->value.choice.Common_Subframe_Allocation_Period;
//
// void * memb_ptr4 = list2->array[3];
// M2AP_MBSFN_Area_Configuration_Item_t * m2ap_mbsfn_area_configuration_item4 = (M2AP_MBSFN_Area_Configuration_Item_t*)memb_ptr4;
// M2AP_MBSFN_Area_ID_t * m2ap_mbsfn_area_id = (M2AP_MBSFN_Area_ID_t*)m2ap_mbsfn_area_configuration_item4->value.choice.MBSFN_Area_ID;
//
//
//
// //ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,list);
// ASN_SEQUENCE_ADD(&ie->value.choice.MBSFN_Area_Configuration_List,m2ap_mbsfn_area_configuration_list);
//
// LOG_D(M2AP,"Morgade\n");
// xer_fprint(stdout,&asn_DEF_M2AP_MBSFN_Area_Configuration_List, &ie->value.choice.MBSFN_Area_Configuration_List);
//
// /* encode */
// if (m2ap_encode_pdu(&pdu2,&buffer,&len) < 0){
// return -1;
// }
//
// //MCE_m2ap_itti_send_sctp_data_req(instance, m2ap_mce_data_from_mce->assoid,buffer,len,0);
// m2ap_MCE_itti_send_sctp_data_req(instance,assoc_id,buffer,len,0);
// return 0;
//
//
}
......@@ -1290,89 +968,9 @@ int MCE_send_M2_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/
}
}
//config_per_mbsfn_area_item->cellInformationList = ;//(M2AP_Cell_Information_List*)calloc(1,sizeof(M2AP_Cell_Information_List));
//config_per_mbsfn_area_item->subframeAllocationInfo.bits_unused = 4;
//ASN_SEQUENCE_ADD(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,config_per_mbsfn_area_item);
//config_per_mbsfn_area_item = &ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea;
//{
//}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* M2AP_MCCHrelatedBCCH_ConfigPerMBSFNArea_t */
//...
// int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
// LOG_D(M2AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
// for (i=0;
// i<num_cells_to_activate;
// i++) {
//
// M2AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
// cells_to_be_activated_list_item_ies = (M2AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(M2AP_Cells_to_be_Activated_List_ItemIEs_t));
// cells_to_be_activated_list_item_ies->id = M2AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
// cells_to_be_activated_list_item_ies->criticality = M2AP_Criticality_reject;
// cells_to_be_activated_list_item_ies->value.present = M2AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
//
// /* 3.1 cells to be Activated list item */
// M2AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
// memset((void *)&cells_to_be_activated_list_item, 0, sizeof(M2AP_Cells_to_be_Activated_List_Item_t));
//
// /* - nRCGI */
// M2AP_NRCGI_t nRCGI;
// MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
// &nRCGI.pLMN_Identity);
// NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity);
// cells_to_be_activated_list_item.nRCGI = nRCGI;
//
// /* optional */
// /* - nRPCI */
// if (1) {
// cells_to_be_activated_list_item.nRPCI = (M2AP_NRPCI_t *)calloc(1, sizeof(M2AP_NRPCI_t));
// *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->nrpci[i]; // int 0..1007
// }
//
// /* optional */
// /* - gNB-MCE System Information */
// if (1) {
// /* 3.1.2 gNB-MCESystem Information */
// M2AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
// cells_to_be_activated_list_itemExtIEs = (M2AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(M2AP_Cells_to_be_Activated_List_ItemExtIEs_t));
// cells_to_be_activated_list_itemExtIEs->id = M2AP_ProtocolIE_ID_id_gNB_MCESystemInformation;
// cells_to_be_activated_list_itemExtIEs->criticality = M2AP_Criticality_reject;
// cells_to_be_activated_list_itemExtIEs->extensionValue.present = M2AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_MCESystemInformation;
//
// M2AP_GNB_MCESystemInformation_t *gNB_MCESystemInformation = (M2AP_GNB_MCESystemInformation_t *)calloc(1, sizeof(M2AP_GNB_MCESystemInformation_t));
// //LOG_I(M2AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
// //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
// //printf("\n");
// OCTET_STRING_fromBuf(&gNB_MCESystemInformation->sImessage,
// (const char*)f1ap_setup_resp->SI_container[i][0],
// f1ap_setup_resp->SI_container_length[i][0]);
//
// LOG_D(M2AP, "f1ap_setup_resp->SI_container_length = %d \n", f1ap_setup_resp->SI_container_length[0][0]);
// cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_MCESystemInformation = *gNB_MCESystemInformation;
//
//
// M2AP_ProtocolExtensionContainer_160P9_t p_160P9_t;
// memset((void *)&p_160P9_t, 0, sizeof(M2AP_ProtocolExtensionContainer_160P9_t));
//
// ASN_SEQUENCE_ADD(&p_160P9_t.list,
// cells_to_be_activated_list_itemExtIEs);
// cells_to_be_activated_list_item.iE_Extensions = (struct M2AP_ProtocolExtensionContainer*)&p_160P9_t;
//
// }
// /* ADD */
// cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
// ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
// cells_to_be_activated_list_item_ies);
// }
// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) {
......@@ -1380,10 +978,6 @@ int MCE_send_M2_SETUP_RESPONSE(instance_t instance, /*uint32_t assoc_id,*/
return -1;
}
//MCE_m2ap_itti_send_sctp_data_req(instance, m2ap_mce_data_from_du->assoc_id, buffer, len, 0);
//printf(",m2ap_mce_data_from_enb->assoc_id %d\n",m2ap_mce_data_from_enb->assoc_id);
m2ap_MCE_itti_send_sctp_data_req(instance,m2ap_mce_data_from_enb->assoc_id,buffer,len,0);
return 0;
......@@ -1561,88 +1155,8 @@ int MCE_send_MCE_CONFIGURATION_UPDATE(instance_t instance, module_id_t du_mod_id
ASN_SEQUENCE_ADD(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,mcch_related_bcch_config_per_mbsfn_area_item_ies);
}
//config_per_mbsfn_area_item->cellInformationList = ;//(M2AP_Cell_Information_List*)calloc(1,sizeof(M2AP_Cell_Information_List));
//config_per_mbsfn_area_item->subframeAllocationInfo.bits_unused = 4;
//ASN_SEQUENCE_ADD(&ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea.list,config_per_mbsfn_area_item);
//config_per_mbsfn_area_item = &ie->value.choice.MCCHrelatedBCCH_ConfigPerMBSFNArea;
//{
//}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* M2AP_MCCHrelatedBCCH_ConfigPerMBSFNArea_t */
//...
// int num_cells_to_activate = f1ap_setup_resp->num_cells_to_activate;
// LOG_D(M2AP, "num_cells_to_activate = %d \n", num_cells_to_activate);
// for (i=0;
// i<num_cells_to_activate;
// i++) {
//
// M2AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
// cells_to_be_activated_list_item_ies = (M2AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(M2AP_Cells_to_be_Activated_List_ItemIEs_t));
// cells_to_be_activated_list_item_ies->id = M2AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
// cells_to_be_activated_list_item_ies->criticality = M2AP_Criticality_reject;
// cells_to_be_activated_list_item_ies->value.present = M2AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
//
// /* 3.1 cells to be Activated list item */
// M2AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
// memset((void *)&cells_to_be_activated_list_item, 0, sizeof(M2AP_Cells_to_be_Activated_List_Item_t));
//
// /* - nRCGI */
// M2AP_NRCGI_t nRCGI;
// MCC_MNC_TO_PLMNID(f1ap_setup_resp->mcc[i], f1ap_setup_resp->mnc[i], f1ap_setup_resp->mnc_digit_length[i],
// &nRCGI.pLMN_Identity);
// NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->nr_cellid[i], &nRCGI.nRCellIdentity);
// cells_to_be_activated_list_item.nRCGI = nRCGI;
//
// /* optional */
// /* - nRPCI */
// if (1) {
// cells_to_be_activated_list_item.nRPCI = (M2AP_NRPCI_t *)calloc(1, sizeof(M2AP_NRPCI_t));
// *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->nrpci[i]; // int 0..1007
// }
//
// /* optional */
// /* - gNB-MCE System Information */
// if (1) {
// /* 3.1.2 gNB-MCESystem Information */
// M2AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
// cells_to_be_activated_list_itemExtIEs = (M2AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(M2AP_Cells_to_be_Activated_List_ItemExtIEs_t));
// cells_to_be_activated_list_itemExtIEs->id = M2AP_ProtocolIE_ID_id_gNB_MCESystemInformation;
// cells_to_be_activated_list_itemExtIEs->criticality = M2AP_Criticality_reject;
// cells_to_be_activated_list_itemExtIEs->extensionValue.present = M2AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_MCESystemInformation;
//
// M2AP_GNB_MCESystemInformation_t *gNB_MCESystemInformation = (M2AP_GNB_MCESystemInformation_t *)calloc(1, sizeof(M2AP_GNB_MCESystemInformation_t));
// //LOG_I(M2AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
// //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
// //printf("\n");
// OCTET_STRING_fromBuf(&gNB_MCESystemInformation->sImessage,
// (const char*)f1ap_setup_resp->SI_container[i][0],
// f1ap_setup_resp->SI_container_length[i][0]);
//
// LOG_D(M2AP, "f1ap_setup_resp->SI_container_length = %d \n", f1ap_setup_resp->SI_container_length[0][0]);
// cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_MCESystemInformation = *gNB_MCESystemInformation;
//
//
// M2AP_ProtocolExtensionContainer_160P9_t p_160P9_t;
// memset((void *)&p_160P9_t, 0, sizeof(M2AP_ProtocolExtensionContainer_160P9_t));
//
// ASN_SEQUENCE_ADD(&p_160P9_t.list,
// cells_to_be_activated_list_itemExtIEs);
// cells_to_be_activated_list_item.iE_Extensions = (struct M2AP_ProtocolExtensionContainer*)&p_160P9_t;
//
// }
// /* ADD */
// cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
// ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
// cells_to_be_activated_list_item_ies);
// }
// ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* encode */
if (m2ap_encode_pdu(&pdu, &buffer, &len) < 0) {
......
......@@ -193,74 +193,8 @@ int eNB_handle_MBMS_SCHEDULING_INFORMATION(instance_t instance,
//xer_fprint(stdout, &asn_DEF_M2AP_MBSFN_Area_Configuration_List, &ie->value.choice.MBSFN_Area_Configuration_List);
}
//asn_DEF_M2AP_MBSFN_Area_Configuration_List
// void * sptr = (void*)&ie->value.choice.MBSFN_Area_Configuration_List;
// asn_TYPE_descriptor_t * td = &asn_DEF_M2AP_MBSFN_Area_Configuration_List;
// asn_enc_rval_t er;
// const asn_SET_OF_specifics_t *specs = (const asn_SET_OF_specifics_t *)td->specifics;
// const asn_TYPE_member_t *elm = td->elements;
// const asn_anonymous_sequence_ *list = _A_CSEQUENCE_FROM_VOID(sptr);
// const char *mname = specs->as_XMLValueList
// ? 0
// : ((*elm->name) ? elm->name : elm->type->xml_tag);
// size_t mlen = mname ? strlen(mname) : 0;
// //int xcan = (flags & XER_F_CANONICAL);
// //int i;
// if(!sptr) ASN__ENCODE_FAILED;
// er.encoded = 0;
// for(i = 0; i < list->count; i++) {
// asn_enc_rval_t tmper;
// void *memb_ptr = list->array[i];
// if(!memb_ptr) continue;
// if(mname) {
// //if(!xcan) ASN__TEXT_INDENT(1, ilevel);
// //ASN__CALLBACK3("<", 1, mname, mlen, ">", 1);
// }
// tmper = elm->type->op->xer_encoder(elm->type, memb_ptr, ilevel + 1,
// flags, cb, app_key);
// if(tmper.encoded == -1) return tmper;
// er.encoded += tmper.encoded;
// if(tmper.encoded == 0 && specs->as_XMLValueList) {
// const char *name = elm->type->xml_tag;
// size_t len = strlen(name);
// //if(!xcan) ASN__TEXT_INDENT(1, ilevel + 1);
// //ASN__CALLBACK3("<", 1, name, len, "/>", 2);
// }
// if(mname) {
// ASN__CALLBACK3("</", 2, mname, mlen, ">", 1);
// }
// }
//M2AP_FIND_PROTOCOLIE_BY_ID(M2AP_MBSFN_Area_Configuration_Item_t, &ie->value.choice.MBSFN_Area_Configuration_List.list, container2,M2AP_ProtocolIE_ID_id_PMCH_Configuration_List ,true);
//printf("count %d\n",((M2AP_MBSFN_Area_Configuration_Item_t*)ie->value.choice.MBSFN_Area_Configuration_List.list.array[0])->value.choice.PMCH_Configuration_List.list.count);
// M2AP_FIND_PROTOCOLIE_BY_ID(M2AP_M2SetupRequest_Ies_t, ie, container,
// M2AP_ProtocolIE_ID_id_GlobalEND_ID, true);
//itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p2);
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
// if(1){
// printf("m2ap_enb_data_g->assoc_id %d %d\n",m2ap_enb_data_g->assoc_id,assoc_id);
// eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance,NULL);
// }else
// //eNB_send_MBMS_SESSION_START_FAILURE(instance,assoc_id);
return 0;
}
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_decoder.c
* \brief m3ap decoder procedures for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#include <stdio.h>
#include "assertions.h"
#include "intertask_interface.h"
#include "m3ap_common.h"
#include "m3ap_eNB_decoder.h"
static int m3ap_eNB_decode_initiating_message(M3AP_M3AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage.procedureCode) {
case M3AP_ProcedureCode_id_m3Setup:
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
M3AP_INFO("m3ap_eNB_decode_initiating_message!\n");
break;
// case M3AP_ProcedureCode_id_handoverPreparation:
// //asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
// M3AP_INFO("m3ap_eNB_decode_initiating_message!\n");
// break;
//
// case M3AP_ProcedureCode_id_uEContextRelease:
// //asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
// M3AP_INFO("m3ap_eNB_decode_initiating_message!\n");
// break;
//
// case M3AP_ProcedureCode_id_handoverCancel:
// //asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
// M3AP_INFO("m3ap_eNB_decode_initiating_message!\n");
// break;
//
default:
M3AP_ERROR("Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
AssertFatal( 0, "Unknown procedure ID (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage.procedureCode);
return -1;
}
return 0;
}
static int m3ap_eNB_decode_successful_outcome(M3AP_M3AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome.procedureCode) {
case M3AP_ProcedureCode_id_m3Setup:
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
M3AP_INFO("m3ap_eNB_decode_successfuloutcome_message!\n");
break;
// case M3AP_ProcedureCode_id_handoverPreparation:
// //asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
// M3AP_INFO("m3ap_eNB_decode_successfuloutcome_message!\n");
// break;
//
default:
M3AP_ERROR("Unknown procedure ID (%d) for successfull outcome message\n",
(int)pdu->choice.successfulOutcome.procedureCode);
return -1;
}
return 0;
}
static int m3ap_eNB_decode_unsuccessful_outcome(M3AP_M3AP_PDU_t *pdu)
{
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome.procedureCode) {
case M3AP_ProcedureCode_id_m3Setup:
//asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_M3AP_M3AP_PDU, pdu);
M3AP_INFO("m3ap_eNB_decode_unsuccessfuloutcome_message!\n");
break;
default:
M3AP_ERROR("Unknown procedure ID (%d) for unsuccessfull outcome message\n",
(int)pdu->choice.unsuccessfulOutcome.procedureCode);
return -1;
}
return 0;
}
int m3ap_eNB_decode_pdu(M3AP_M3AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
{
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
dec_ret = aper_decode(NULL,
&asn_DEF_M3AP_M3AP_PDU,
(void **)&pdu,
buffer,
length,
0,
0);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, pdu);
}
if (dec_ret.code != RC_OK) {
M3AP_ERROR("Failed to decode pdu\n");
return -1;
}
switch(pdu->present) {
case M3AP_M3AP_PDU_PR_initiatingMessage:
return m3ap_eNB_decode_initiating_message(pdu);
case M3AP_M3AP_PDU_PR_successfulOutcome:
return m3ap_eNB_decode_successful_outcome(pdu);
case M3AP_M3AP_PDU_PR_unsuccessfulOutcome:
return m3ap_eNB_decode_unsuccessful_outcome(pdu);
default:
M3AP_DEBUG("Unknown presence (%d) or not implemented\n", (int)pdu->present);
break;
}
return -1;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_decoder.h
* \brief m3ap decoder procedures for eNB
* \author Konstantinos Alexandris <Konstantinos.Alexandris@eurecom.fr>, Cedric Roux <Cedric.Roux@eurecom.fr>, Navid Nikaein <Navid.Nikaein@eurecom.fr>
* \date 2018
* \version 1.0
*/
#ifndef M3AP_ENB_DECODER_H_
#define M3AP_ENB_DECODER_H_
int m3ap_eNB_decode_pdu(M3AP_M3AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length)
__attribute__ ((warn_unused_result));
#endif /* M3AP_ENB_DECODER_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_encoder.c
* \brief m3ap encoder procedures for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "assertions.h"
#include "conversions.h"
#include "intertask_interface.h"
#include "m3ap_common.h"
#include "m3ap_eNB_encoder.h"
int m3ap_eNB_encode_pdu(M3AP_M3AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
{
ssize_t encoded;
DevAssert(pdu != NULL);
DevAssert(buffer != NULL);
DevAssert(len != NULL);
if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_M3AP_M3AP_PDU, (void *)pdu);
}
encoded = aper_encode_to_new_buffer(&asn_DEF_M3AP_M3AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
return -1;
}
*len = encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_M3AP_M3AP_PDU, pdu);
return encoded;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_encoder.h
* \brief m3ap encoder procedures for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#ifndef M3AP_ENB_ENCODER_H_
#define M3AP_ENB_ENCODER_H_
int m3ap_eNB_encode_pdu(M3AP_M3AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
__attribute__ ((warn_unused_result));
#endif /* M3AP_ENB_ENCODER_H_ */
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_generate_messages.h
* \brief m3ap procedures for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#ifndef M3AP_ENB_GENERATE_MESSAGES_H_
#define M3AP_ENB_GENERATE_MESSAGES_H_
#include "m3ap_eNB_defs.h"
#include "m3ap_common.h"
int m3ap_eNB_generate_m3_setup_request(m3ap_eNB_instance_t *instance_p,
m3ap_eNB_data_t *m3ap_eNB_data_p);
int m3ap_eNB_generate_m3_setup_response(m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *m3ap_eNB_data_p);
int m3ap_eNB_generate_m3_setup_failure(instance_t instance,
uint32_t assoc_id,
M3AP_Cause_PR cause_type,
long cause_value,
long time_to_wait);
int m3ap_eNB_set_cause (M3AP_Cause_t * cause_p,
M3AP_Cause_PR cause_type,
long cause_value);
//int m3ap_eNB_generate_m2_handover_request (m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *m3ap_eNB_data_p,
// m3ap_handover_req_t *m3ap_handover_req, int ue_id);
//
//int m3ap_eNB_generate_m2_handover_request_ack (m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *m3ap_eNB_data_p,
// m3ap_handover_req_ack_t *m3ap_handover_req_ack);
//
//int m3ap_eNB_generate_m2_ue_context_release (m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *m3ap_eNB_data_p,
// m3ap_ue_context_release_t *m3ap_ue_context_release);
//
//int m3ap_eNB_generate_m2_handover_cancel (m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *m3ap_eNB_data_p,
// int m2_ue_id,
// m3ap_handover_cancel_cause_t cause);
#endif /* M3AP_ENB_GENERATE_MESSAGES_H_ */
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_handler.h
* \brief m3ap handler procedures for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#ifndef M3AP_ENB_HANDLERS_H_
#define M3AP_ENB_HANDLERS_H_
#include "m3ap_eNB_defs.h"
void m3ap_handle_m3_setup_message(m3ap_eNB_instance_t *instance_p, m3ap_eNB_data_t *eNB_desc_p, int sctp_shutdown);
int m3ap_eNB_handle_message(instance_t instance, uint32_t assoc_id, int32_t stream,
const uint8_t * const data, const uint32_t data_length);
#endif /* M3AP_ENB_HANDLERS_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_itti_messaging.c
* \brief m3ap tasks for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#include "intertask_interface.h"
#include "m3ap_eNB_itti_messaging.h"
void m3ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream)
{
MessageDef *message_p;
sctp_data_req_t *sctp_data_req;
message_p = itti_alloc_new_message(TASK_M3AP, SCTP_DATA_REQ);
sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req->assoc_id = assoc_id;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = stream;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
void m3ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id)
{
MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_M3AP, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file m3ap_eNB_itti_messaging.h
* \brief m3ap tasks for eNB
* \author Javier Morgade <javier.morgade@ieee.org>
* \date 2019
* \version 0.1
*/
#ifndef M3AP_ENB_ITTI_MESSAGING_H_
#define M3AP_ENB_ITTI_MESSAGING_H_
void m3ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
uint32_t buffer_length, uint16_t stream);
void m3ap_eNB_itti_send_sctp_close_association(instance_t instance, int32_t assoc_id);
#endif /* M3AP_ENB_ITTI_MESSAGING_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment