Commit 61f7b836 authored by gauthier's avatar gauthier
Browse files

Updated for integration as tasks in oaisim executable.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4596 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent e90b9e1f
......@@ -2,12 +2,10 @@
#define MIH_C_C
#include "MIH_C.h"
//-----------------------------------------------------------------------------
void MIH_C_init(int log_outputP) {
void MIH_C_init(void) {
//-----------------------------------------------------------------------------
MIH_C_log_init(log_outputP);
}
//-----------------------------------------------------------------------------
void MIH_C_exit(void) {
//-----------------------------------------------------------------------------
MIH_C_log_exit();
}
......@@ -9,12 +9,12 @@ unsigned int MIH_C_BITMAP82String(MIH_C_BITMAP8_T* dataP, char* bufP) {
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP8_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP8_T* dataP) {
DEBUG_ENCODE("%s: %02X\n", __FUNCTION__, *dataP);
printf("[MIH_C] %s: %02X\n", __FUNCTION__, *dataP);
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP16_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP16_T* dataP) {
DEBUG_ENCODE("%s: %04X\n", __FUNCTION__, *dataP);
printf("[MIH_C] %s: %04X\n", __FUNCTION__, *dataP);
BitBuffer_write16(bbP, *dataP);
}
//-----------------------------------------------------------------------------
......@@ -25,7 +25,7 @@ unsigned int MIH_C_BITMAP162String(MIH_C_BITMAP16_T* dataP, char* bufP) {
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP24_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP24_T* dataP) {
//-----------------------------------------------------------------------------
DEBUG_ENCODE("%s: %02X%02X%02X\n", __FUNCTION__, dataP->val[0],dataP->val[1], dataP->val[2]);
printf("[MIH_C] %s: %02X%02X%02X\n", __FUNCTION__, dataP->val[0],dataP->val[1], dataP->val[2]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[1]);
MIH_C_BITMAP8_encode(bbP, &dataP->val[2]);
......@@ -37,27 +37,27 @@ unsigned int MIH_C_BITMAP242String(MIH_C_BITMAP24_T* dataP, char* bufP) {
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP32_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP32_T* dataP) {
DEBUG_ENCODE("%s: %08X\n", __FUNCTION__, *dataP);
printf("[MIH_C] %s: %08X\n", __FUNCTION__, *dataP);
BitBuffer_write32(bbP, *dataP);
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP64_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP64_T* dataP) {
//-----------------------------------------------------------------------------
DEBUG_ENCODE("%s: %16X\n", __FUNCTION__, *dataP);
printf("[MIH_C] %s: %16X\n", __FUNCTION__, *dataP);
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)(*dataP>>32));
BitBuffer_write32(bbP, (MIH_C_UNSIGNED_INT4_T)*dataP);
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP128_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP128_T* dataP) {
//-----------------------------------------------------------------------------
DEBUG_ENCODE("%s: %16X%16X\n", __FUNCTION__, dataP->val[0], dataP->val[1]);
printf("[MIH_C] %s: %16X%16X\n", __FUNCTION__, dataP->val[0], dataP->val[1]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[1]);
}
//-----------------------------------------------------------------------------
inline void MIH_C_BITMAP256_encode(Bit_Buffer_t* bbP, MIH_C_BITMAP256_T* dataP) {
//-----------------------------------------------------------------------------
DEBUG_ENCODE("%s: %16X%16X%16X%16X\n", __FUNCTION__, dataP->val[0], dataP->val[1], dataP->val[2], dataP->val[3]);
printf("[MIH_C] %s: %16X%16X%16X%16X\n", __FUNCTION__, dataP->val[0], dataP->val[1], dataP->val[2], dataP->val[3]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[0]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[1]);
MIH_C_BITMAP64_encode(bbP, &dataP->val[2]);
......@@ -98,7 +98,7 @@ inline void MIH_C_OCTET_encode(Bit_Buffer_t* bbP, MIH_C_F1_Generic_Octet_t *data
}
//-----------------------------------------------------------------------------
inline void MIH_C_UNSIGNED_INT1_encode(Bit_Buffer_t* bbP, MIH_C_UNSIGNED_INT1_T* dataP) {
DEBUG_ENCODE("%s: %02X\n", __FUNCTION__, *dataP);
printf("[MIH_C] %s: %02X\n", __FUNCTION__, *dataP);
BitBuffer_write8(bbP, *dataP);
}
//-----------------------------------------------------------------------------
......@@ -216,7 +216,7 @@ inline void MIH_C_LIST_LENGTH_encode(Bit_Buffer_t* bbP, u_int16_t lengthP) {
int length;
if (lengthP <= 128) {
#ifdef DEBUG_TRACE_DETAILS
DEBUG_ENCODE("%s: Length %02X\n", __FUNCTION__, lengthP);
printf("[MIH_C] %s: Length %02X\n", __FUNCTION__, lengthP);
#endif
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)lengthP);
} else {
......@@ -224,7 +224,7 @@ inline void MIH_C_LIST_LENGTH_encode(Bit_Buffer_t* bbP, u_int16_t lengthP) {
if (((lengthP - 128) % 255) != 0) {
num_more_bytes += 1;
}
DEBUG_ENCODE("%s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
printf("[MIH_C] %s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
BitBuffer_write8(bbP, (MIH_C_UNSIGNED_INT1_T)(128 + num_more_bytes));
length = lengthP - 128;
while (length > 0) {
......@@ -249,7 +249,7 @@ inline u_int16_t MIH_C_LIST_LENGTH_get_encode_num_bytes(u_int16_t lengthP) {
if (((lengthP - 128) % 255) != 0) {
num_more_bytes += 1;
}
DEBUG_ENCODE("%s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
printf("[MIH_C] %s: Length %02X on %d more bytes\n", __FUNCTION__, lengthP, num_more_bytes);
return num_more_bytes + sizeof (MIH_C_UNSIGNED_INT1_T);
}
}
......@@ -268,12 +268,12 @@ inline void MIH_C_LIST_LENGTH_decode(Bit_Buffer_t* bbP, u_int16_t *lengthP) {
num_more_bytes = num_more_bytes - 1;
}
#ifdef DEBUG_TRACE_DETAILS
DEBUG_DECODE("%s: Length %d \n", __FUNCTION__, *lengthP);
printf("[MIH_C] %s: Length %d \n", __FUNCTION__, *lengthP);
#endif
} else {
*lengthP = byte1;
#ifdef DEBUG_TRACE_DETAILS
DEBUG_DECODE("%s: Length %d \n", __FUNCTION__, *lengthP);
printf("[MIH_C] %s: Length %d \n", __FUNCTION__, *lengthP);
#endif
}
}
......
......@@ -106,7 +106,7 @@ inline void MIH_C_LINK_ADDR_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP)
MIH_C_OTHER_L2_ADDR_encode(bbP, &dataP->_union.other_l2_addr);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -133,7 +133,7 @@ inline void MIH_C_LINK_ADDR_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ADDR_T *dataP)
MIH_C_OTHER_L2_ADDR_decode(bbP, &dataP->_union.other_l2_addr);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ADDR_T %d\n", dataP->choice);
}
}
......
......@@ -38,7 +38,7 @@ inline void MIH_C_DEV_STATE_RSP_encode(Bit_Buffer_t* bbP, MIH_C_DEV_STATE_RSP_T
MIH_C_BATT_LEVEL_encode(bbP, &dataP->_union.batt_level);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_DEV_STATE_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_DEV_STATE_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -53,7 +53,7 @@ inline void MIH_C_DEV_STATE_RSP_decode(Bit_Buffer_t* bbP, MIH_C_DEV_STATE_RSP_T
MIH_C_BATT_LEVEL_decode(bbP, &dataP->_union.batt_level);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_DEV_STATE_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_DEV_STATE_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -218,7 +218,7 @@ inline void MIH_C_LINK_ACTION_REQ_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RE
MIH_C_LINK_ADDR_encode(bbP, &dataP->_union.link_addr);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ACTION_REQ_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ACTION_REQ_T %d\n", dataP->choice);
}
MIH_C_LINK_ACTION_encode(bbP, &dataP->link_action);
MIH_C_LINK_AC_EX_TIME_encode(bbP, &dataP->link_action_ex_time);
......@@ -235,7 +235,7 @@ inline void MIH_C_LINK_ACTION_REQ_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RE
MIH_C_LINK_ADDR_decode(bbP, &dataP->_union.link_addr);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ACTION_REQ_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ACTION_REQ_T %d\n", dataP->choice);
}
MIH_C_LINK_ACTION_decode(bbP, &dataP->link_action);
MIH_C_LINK_AC_EX_TIME_decode(bbP, &dataP->link_action_ex_time);
......@@ -268,7 +268,7 @@ inline void MIH_C_SIG_STRENGTH_encode(Bit_Buffer_t* bbP, MIH_C_SIG_STRENGTH_T *d
MIH_C_PERCENTAGE_encode(bbP, &dataP->_union.percentage);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_SIG_STRENGTH_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_SIG_STRENGTH_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -283,7 +283,7 @@ inline void MIH_C_SIG_STRENGTH_decode(Bit_Buffer_t* bbP, MIH_C_SIG_STRENGTH_T *d
MIH_C_PERCENTAGE_decode(bbP, &dataP->_union.percentage);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_SIG_STRENGTH_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_SIG_STRENGTH_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -327,7 +327,7 @@ inline void MIH_C_LINK_ACTION_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RS
MIH_C_LINK_SCAN_RSP_LIST_encode(bbP, &dataP->_union.link_scan_rsp_list);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ACTION_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_ACTION_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -343,7 +343,7 @@ inline void MIH_C_LINK_ACTION_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_ACTION_RS
MIH_C_LINK_SCAN_RSP_LIST_decode(bbP, &dataP->_union.link_scan_rsp_list);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ACTION_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_ACTION_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -413,7 +413,7 @@ inline void MIH_C_LINK_PARAM_TYPE_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_TYP
case 11: MIH_C_LINK_PARAM_802_22_encode(bbP, &dataP->_union.link_param_802_22); break;
case 12: MIH_C_LINK_PARAM_LTE_encode(bbP, &dataP->_union.link_param_lte); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_TYPE_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_TYPE_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -437,7 +437,7 @@ inline void MIH_C_LINK_PARAM_TYPE_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_TYP
case 11: MIH_C_LINK_PARAM_802_22_decode(bbP, &dataP->_union.link_param_802_22); break;
case 12: MIH_C_LINK_PARAM_LTE_decode(bbP, &dataP->_union.link_param_802_22); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_TYPE_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_TYPE_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -483,7 +483,7 @@ inline void MIH_C_LINK_CFG_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_PARAM_
MIH_C_LINK_SCAN_RSP_LIST_encode(bbP, &dataP->_union.link_scan_rsp_list);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_CFG_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_CFG_PARAM_T %d\n", dataP->choice);
}
MIH_C_TH_ACTION_encode(bbP, &dataP->th_action);
MIH_C_THRESHOLD_LIST_encode(bbP, &dataP->threshold_list);
......@@ -503,7 +503,7 @@ inline void MIH_C_LINK_CFG_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_CFG_PARAM_
MIH_C_LINK_SCAN_RSP_LIST_decode(bbP, &dataP->_union.link_scan_rsp_list);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_CFG_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_CFG_PARAM_T %d\n", dataP->choice);
}
MIH_C_TH_ACTION_decode(bbP, &dataP->th_action);
MIH_C_THRESHOLD_LIST_decode(bbP, &dataP->threshold_list);
......@@ -566,7 +566,7 @@ inline void MIH_C_LINK_DESC_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_DESC_RSP_T
MIH_C_NUM_QUEUE_encode(bbP, &dataP->_union.num_queue);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_DESC_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_DESC_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -581,7 +581,7 @@ inline void MIH_C_LINK_DESC_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_DESC_RSP_T
MIH_C_NUM_QUEUE_decode(bbP, &dataP->_union.num_queue);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_DESC_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_DESC_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -613,7 +613,7 @@ inline void MIH_C_LINK_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_T *dataP
case 0: MIH_C_LINK_PARAM_VAL_encode(bbP, &dataP->_union.link_param_val); break;
case 1: MIH_C_QOS_PARAM_VAL_encode(bbP, &dataP->_union.qos_param_val); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -625,7 +625,7 @@ inline void MIH_C_LINK_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_T *dataP
case 0: MIH_C_LINK_PARAM_VAL_decode(bbP, &dataP->_union.link_param_val); break;
case 1: MIH_C_QOS_PARAM_VAL_decode(bbP, &dataP->_union.qos_param_val); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -656,7 +656,7 @@ inline void MIH_C_LINK_PARAM_RPT_encode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_RPT_
case 0: break;
case 1: MIH_C_THRESHOLD_encode(bbP, &dataP->_union.threshold); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_RPT_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_PARAM_RPT_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -668,7 +668,7 @@ inline void MIH_C_LINK_PARAM_RPT_decode(Bit_Buffer_t* bbP, MIH_C_LINK_PARAM_RPT_
case 0: break;
case 1: MIH_C_THRESHOLD_decode(bbP, &dataP->_union.threshold); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_RPT_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_PARAM_RPT_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -709,7 +709,7 @@ inline void MIH_C_LINK_STATES_RSP_encode(Bit_Buffer_t* bbP, MIH_C_LINK_STATES_RS
case 0: MIH_C_OPMODE_encode(bbP, &dataP->_union.op_mode); break;
case 1: MIH_C_CHANNEL_ID_encode(bbP, &dataP->_union.channel_id); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_STATES_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_STATES_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -720,7 +720,7 @@ inline void MIH_C_LINK_STATES_RSP_decode(Bit_Buffer_t* bbP, MIH_C_LINK_STATES_RS
case 0: MIH_C_OPMODE_decode(bbP, &dataP->_union.op_mode); break;
case 1: MIH_C_CHANNEL_ID_decode(bbP, &dataP->_union.channel_id); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_STATES_RSP_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_STATES_RSP_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -776,7 +776,7 @@ inline void MIH_C_LINK_TUPLE_ID_encode(Bit_Buffer_t* bbP, MIH_C_LINK_TUPLE_ID_T
case 0: break;
case 1: MIH_C_LINK_ADDR_encode(bbP, &dataP->_union.link_addr); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_TUPLE_ID_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_TUPLE_ID_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -788,7 +788,7 @@ inline void MIH_C_LINK_TUPLE_ID_decode(Bit_Buffer_t* bbP, MIH_C_LINK_TUPLE_ID_T
case 0: break;
case 1: MIH_C_LINK_ADDR_decode(bbP, &dataP->_union.link_addr); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_TUPLE_ID_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_TUPLE_ID_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......
......@@ -159,7 +159,7 @@ inline void MIH_C_QOS_PARAM_VAL_encode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T
case 4: MIH_C_PK_DELAY_JITTER_LIST_encode(bbP, &dataP->_union.pk_delay_jitter_list); break;
case 5: MIH_C_PK_LOSS_RATE_LIST_encode(bbP, &dataP->_union.pk_loss_rate_list); break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -174,7 +174,7 @@ inline void MIH_C_QOS_PARAM_VAL_decode(Bit_Buffer_t* bbP, MIH_C_QOS_PARAM_VAL_T
case 4: MIH_C_PK_DELAY_JITTER_LIST_decode(bbP, &dataP->_union.pk_delay_jitter_list); break;
case 5: MIH_C_PK_LOSS_RATE_LIST_decode(bbP, &dataP->_union.pk_loss_rate_list); break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_PARAM_VAL_T %d\n", dataP->choice);
}
}
......
......@@ -99,7 +99,7 @@ inline void MIH_C_MARK_encode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP) {
MIH_C_BITMAP24_encode(bbP, &dataP->_union.flow_label_mask);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -114,7 +114,7 @@ inline void MIH_C_MARK_decode(Bit_Buffer_t* bbP, MIH_C_MARK_T *dataP) {
MIH_C_BITMAP24_decode(bbP, &dataP->_union.flow_label_mask);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_MARK_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -160,7 +160,7 @@ inline void MIH_C_QOS_encode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP) {
MIH_C_COS_encode(bbP, &dataP->_union.cos);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -178,7 +178,7 @@ inline void MIH_C_QOS_decode(Bit_Buffer_t* bbP, MIH_C_QOS_T *dataP) {
MIH_C_COS_decode(bbP, &dataP->_union.cos);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_QOS_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -250,7 +250,7 @@ inline void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_LINK_DATA_RATE_encode(bbP, &dataP->_union_link_data_rate.link_data_rate);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_qos);
switch (dataP->choice_qos) {
......@@ -260,7 +260,7 @@ inline void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_QOS_encode(bbP, &dataP->_union_qos.qos);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_jumbo_enable);
switch (dataP->choice_jumbo_enable) {
......@@ -270,7 +270,7 @@ inline void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_JUMBO_ENABLE_encode(bbP, &dataP->_union_jumbo_enable.jumbo_enable);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
......@@ -280,7 +280,7 @@ inline void MIH_C_RESOURCE_DESC_encode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_MULTICAST_ENABLE_encode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
}
}
//-----------------------------------------------------------------------------
......@@ -297,7 +297,7 @@ inline void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_LINK_DATA_RATE_decode(bbP, &dataP->_union_link_data_rate.link_data_rate);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_link_data_rate OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_link_data_rate);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_qos);
switch (dataP->choice_qos) {
......@@ -307,7 +307,7 @@ inline void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_QOS_decode(bbP, &dataP->_union_qos.qos);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_qos OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_qos);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_jumbo_enable);
switch (dataP->choice_jumbo_enable) {
......@@ -317,7 +317,7 @@ inline void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_JUMBO_ENABLE_decode(bbP, &dataP->_union_jumbo_enable.jumbo_enable);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_jumbo_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_jumbo_enable);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_multicast_enable);
switch (dataP->choice_multicast_enable) {
......@@ -327,7 +327,7 @@ inline void MIH_C_RESOURCE_DESC_decode(Bit_Buffer_t* bbP, MIH_C_RESOURCE_DESC_T
MIH_C_MULTICAST_ENABLE_decode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_RESOURCE_DESC_T %d\n", dataP->choice_multicast_enable);
}
}
//-----------------------------------------------------------------------------
......@@ -386,7 +386,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_MULTICAST_ENABLE_encode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_mark_qos);
switch (dataP->choice_mark_qos) {
......@@ -397,7 +397,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_QOS_encode(bbP, &dataP->_union_mark_qos.mark_qos.qos);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
}
MIH_C_CHOICE_encode(bbP, &dataP->choice_mark_drop_eligibility);
switch (dataP->choice_mark_drop_eligibility) {
......@@ -408,7 +408,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_encode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_DROP_ELIGIBILITY_encode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.drop_eligibility);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
}
}
//-----------------------------------------------------------------------------
......@@ -424,7 +424,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_MULTICAST_ENABLE_decode(bbP, &dataP->_union_multicast_enable.multicast_enable);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_multicast_enable OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_multicast_enable);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_mark_qos);
switch (dataP->choice_mark_qos) {
......@@ -435,7 +435,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_QOS_decode(bbP, &dataP->_union_mark_qos.mark_qos.qos);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_mark_qos OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_qos);
}
MIH_C_CHOICE_decode(bbP, &dataP->choice_mark_drop_eligibility);
switch (dataP->choice_mark_drop_eligibility) {
......@@ -446,7 +446,7 @@ inline void MIH_C_FLOW_ATTRIBUTE_decode(Bit_Buffer_t* bbP, MIH_C_FLOW_ATTRIBUTE_
MIH_C_DROP_ELIGIBILITY_decode(bbP, &dataP->_union_mark_drop_eligibility.mark_drop_eligibility.drop_eligibility);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE choice_mark_drop_eligibility OF MIH_C_FLOW_ATTRIBUTE_T %d\n", dataP->choice_mark_drop_eligibility);
}
}
//-----------------------------------------------------------------------------
......@@ -484,7 +484,7 @@ inline void MIH_C_LINK_AC_PARAM_encode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T
MIH_C_RESOURCE_DESC_encode(bbP, &dataP->_union.resource_desc);
break;
default:
ERR("NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR ENCODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
}
}
//-----------------------------------------------------------------------------
......@@ -501,8 +501,8 @@ inline void MIH_C_LINK_AC_PARAM_decode(Bit_Buffer_t* bbP, MIH_C_LINK_AC_PARAM_T
MIH_C_RESOURCE_DESC_decode(bbP, &dataP->_union.resource_desc);
break;
default:
ERR("NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
printf("[MIH_C] ERROR NO KNOWN VALUE FOR DECODING CHOICE OF MIH_C_LINK_AC_PARAM_T %d\n", dataP->choice);
}
}
#endif
\ No newline at end of file
#endif
......@@ -7,7 +7,6 @@
#include <arpa/inet.h>
//-----------------------------------------------------------------------------
#include "MIH_C_bit_buffer.h"
#include "MIH_C_log.h"
//-----------------------------------------------------------------------------
Bit_Buffer_t* new_BitBuffer_0(void)
//-----------------------------------------------------------------------------
......@@ -115,7 +114,7 @@ u_int32_t BitBuffer_read(Bit_Buffer_t* bbP, const unsigned int nb_bitsP)
//cout << dec << "BitBuffer_read(" << nb_bitsP << ")"<< endl;
if (BitBuffer_isCheckReadOverflowOK(bbP, nb_bitsP)) {
if (nb_bitsP > (sizeof(unsigned long)*8)) {
ERR("BitBuffer_read nb bits too large - must be <= sizeof(long int)*8");
printf("[MIH_C] ERROR BitBuffer_read nb bits too large - must be <= sizeof(long int)*8");
} else {
do {
data_l = data_l << 8;
......@@ -254,7 +253,7 @@ void BitBuffer_write8b(Bit_Buffer_t* bbP, u_int8_t valueP, unsigned int nb_bitsP
valueP = valueP & ((u_int8_t)(0xFF) >> (8 - nb_bitsP));
//std::cout << "BitBuffer_write char " << (u_int32_t)(valueP) << " " << nb_bitsP << " bits" << std::endl;
if (nb_bitsP > (sizeof(unsigned char)*8)) {
ERR("BitBuffer_write nb bits too large - must be <= sizeof(char)*8");
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof(char)*8");
} else {
if (bbP->m_bit_mod_8_position == 0) {
if (nb_bitsP == (sizeof(unsigned char)*8)) {
......@@ -288,7 +287,7 @@ void BitBuffer_write16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigned int nb_bit
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int16_t)(0xFFFF) >> (16 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int16_t)*8)) {
ERR("BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
} else {
if (nb_bitsP > 8) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (8 - (16-nb_bitsP))), nb_bitsP - 8);
......@@ -308,7 +307,7 @@ void BitBuffer_writelittleendian16b(Bit_Buffer_t* bbP, u_int16_t valueP, unsigne
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int16_t)(0xFFFF) >> (16 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int16_t)*8)) {
ERR("BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (short)*8");
} else {
if (nb_bitsP > 8) {
BitBuffer_write8(bbP,(u_int8_t)(valueP));
......@@ -328,7 +327,7 @@ void BitBuffer_write32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigned int nb_bit
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int32_t)(0xFFFFFFFF) >> (32 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int32_t)*8)) {
ERR("BitBuffer_write nb bits too large - must be <= sizeof (int)*8");
printf("[MIH_C] ERROR BitBuffer_write nb bits too large - must be <= sizeof (int)*8");
} else {
if (nb_bitsP > 24) {
//BitBuffer_write8b(bbP,(u_int8_t)(valueP >> (24 - (32-nb_bitsP))), nb_bitsP - 24);
......@@ -359,7 +358,7 @@ void BitBuffer_writelittleendian32b(Bit_Buffer_t* bbP, u_int32_t valueP, unsigne
if (BitBuffer_isCheckWriteOverflowOK(bbP,nb_bitsP)) {
valueP = valueP & ((u_int32_t)(0xFFFFFFFF) >> (32 - nb_bitsP));
if (nb_bitsP > (sizeof (u_int32_t)*8)) {
ERR("BitBuffer_write nb bits too large - must be <= sizeof (int)*8");