1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* This file contains functions that maps values received in F1AP message with
20 * its corresponding values used in DU and vice-versa */
22 #include "common_def.h"
23 #include "TimeToWaitE2.h"
24 #include "du_app_mac_inf.h"
25 #include "du_e2ap_mgr.h"
26 #include "E2nodeComponentInterfaceType.h"
28 /************************************************************************
30 * @brief Converts enum values into actual value of E2 wait timer
34 * Function : convertE2WaitTimerEnumToValue
36 * Functionality: Converts enum values into actual value of E2 wait timer
38 * @params[in] Enum value of e2 wait timer
39 * @return Actual value of e2 wait timer
41 * **********************************************************************/
43 uint8_t convertE2WaitTimerEnumToValue(uint8_t timerToWait)
47 case TimeToWaitE2_v1s:
50 case TimeToWaitE2_v2s:
53 case TimeToWaitE2_v5s:
56 case TimeToWaitE2_v10s:
59 case TimeToWaitE2_v20s:
62 case TimeToWaitE2_v60s:
66 DU_LOG("\nERROR --> F1AP: Invalid value of E2 Wait timer");
71 /*******************************************************************
73 * @brief Converts DU specific failure cause to E2 interface
78 * Function : convertDuCauseToE2Cause
80 * Functionality: Converts DU specific failure cause to E2
81 * interface failure cause
83 * @params[in] DU specific failure cause
84 * E2 specific failure cause
88 * ****************************************************************/
89 void convertDuCauseToE2Cause(CauseOfResult l2Cause, E2FailureCause *failureCause)
93 case STATS_ID_NOT_FOUND:
96 failureCause->causeType = E2_RIC_REQUEST;
97 failureCause->cause = E2_ACTION_NOT_SUPPORTED;
100 case RESOURCE_UNAVAILABLE:
102 failureCause->causeType = E2_RIC_REQUEST;
103 failureCause->cause = E2_FUNCTION_RESOURCE_LIMIT;
108 failureCause->causeType = E2_RIC_REQUEST;
109 failureCause->cause = E2_RIC_REQUEST_CAUSE_UNSPECIFIED;
115 /************************************************************************
117 * @brief Converts InterfaceType into E2nodeComponentInterfaceType value
121 * Function : convertInterfaceToE2ComponentInterfaceType
123 * Functionality: Convert InterfaceType into E2nodeComponentInterfaceType
126 * @params[in] Actual value of interface
127 * @return Enum value of e2 interface
129 * **********************************************************************/
131 uint8_t convertInterfaceToE2ComponentInterfaceType(uint8_t interface)
136 return E2nodeComponentInterfaceType_ng;
139 return E2nodeComponentInterfaceType_xn;
142 return E2nodeComponentInterfaceType_e1;
145 return E2nodeComponentInterfaceType_f1;
148 return E2nodeComponentInterfaceType_w1;
151 return E2nodeComponentInterfaceType_s1;
154 return E2nodeComponentInterfaceType_x2;
159 /*******************************************************************
161 * @brief Converts MAC-specific Measurement type to E2 interface
162 * specific measurement type
166 * Function : convertMacMeasTypeToE2MeasType
168 * Functionality: Converts MAC-specific Measurement type to E2
169 * interface specific measurement type
171 * @params[in] MAC specific measurement type
172 * E2 interface specific measurement type
176 * ****************************************************************/
177 uint8_t convertMacMeasTypeToE2MeasType(MacMeasurementType macMeasName, char *e2MeasName)
179 uint8_t measNameLen = 0;
183 case MAC_DL_TOTAL_PRB_USAGE:
185 measNameLen = strlen("RRU.PrbTotDl");
186 memcpy(e2MeasName, "RRU.PrbTotDl", measNameLen+1);
189 case MAC_UL_TOTAL_PRB_USAGE:
191 measNameLen = strlen("RRU.PrbTotUl");
192 memcpy(e2MeasName, "RRU.PrbTotUl", measNameLen+1);
197 DU_LOG("\nERROR --> E2AP : MAC mesurement type [%d] not supported", macMeasName);
204 /**********************************************************************
206 **********************************************************************/