diff --git a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Link_Primitives.h b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Link_Primitives.h index 3f34154296b14cc2a50ab91f30d3b15c0c4213fc..517511981e0bbe599d4fc3b8f5d837414068c12b 100755 --- a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Link_Primitives.h +++ b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Link_Primitives.h @@ -200,8 +200,8 @@ typedef struct MIH_C_Link_Configure_Thresholds_request LIST(MIH_C_LINK_CFG_PARAM, LinkConfigureParameterList) /*!< \brief A list of link threshold parameters.*/ }__attribute__((__packed__))MIH_C_Link_Configure_Thresholds_request_t; - -TYPEDEF_LIST(MIH_C_LINK_CFG_STATUS, 16); +#define MIH_C_LINK_CFG_STATUS_LIST_LENGTH 16 +TYPEDEF_LIST(MIH_C_LINK_CFG_STATUS, MIH_C_LINK_CFG_STATUS_LIST_LENGTH); /*! \struct MIH_C_Link_Configure_Thresholds_confirm * \brief Structure defining the Link_Configure_Thresholds.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.13.2 Link_Configure_Thresholds.confirm) */ diff --git a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h index 79317eb12ff5689f1c55b32d37e0a3d2ee700ab2..a35f47d4726fd24e5fe367834d55153fe65c1a21 100755 --- a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h +++ b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h @@ -546,13 +546,18 @@ u_int16_t MIH_C_LIST_LENGTH_get_encode_length(u_int16_t lengthP); DATA_TYPE_NAME ## _encode(bbP, &listP->val[index++]);\ }\ }\ + };\ + inline void DATA_TYPE_NAME ## _LIST_init(DATA_TYPE_NAME ## _LIST_T *listP) {\ + listP->length = 0;\ + memset(listP->val, 0, MAX_LENGTH*sizeof(DATA_TYPE_NAME ## _T));\ }; #else #define TYPEDEF_LIST(DATA_TYPE_NAME, MAX_LENGTH) typedef struct DATA_TYPE_NAME ## _LIST { u_int16_t length; DATA_TYPE_NAME ## _T val[MAX_LENGTH];} DATA_TYPE_NAME ## _LIST_T;\ extern unsigned int DATA_TYPE_NAME ## _LIST2String(DATA_TYPE_NAME ## _LIST_T *listP, char* bufP);\ extern void DATA_TYPE_NAME ## _LIST_decode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP);\ - extern void DATA_TYPE_NAME ## _LIST_encode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP); + extern void DATA_TYPE_NAME ## _LIST_encode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP);\ + extern void DATA_TYPE_NAME ## _LIST_init(DATA_TYPE_NAME ## _LIST_T *listP); #endif #define LIST(DATA_TYPE_NAME, VAR_NAME) DATA_TYPE_NAME ## _LIST_T VAR_NAME ## _list;