aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mac-lte.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-03-08 06:06:56 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-03-08 06:06:56 +0000
commit2cc8731bec160668fcec00ca061e45997515db51 (patch)
treeb5aec3c775cbbdadc987a18eba4ea210ce59e3c4 /epan/dissectors/packet-mac-lte.c
parentc6c7efd1a7837780954e456bf97d4caec1fe3adb (diff)
From beroset:
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48185
Diffstat (limited to 'epan/dissectors/packet-mac-lte.c')
-rw-r--r--epan/dissectors/packet-mac-lte.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 83abbc029f..a9688d58bb 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -1266,10 +1266,10 @@ static gboolean dissect_mac_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
offset += (gint)strlen(MAC_LTE_START_STRING);
/* If redissecting, use previous info struct (if available) */
- p_mac_lte_info = p_get_proto_data(pinfo->fd, proto_mac_lte);
+ p_mac_lte_info = (mac_lte_info *)p_get_proto_data(pinfo->fd, proto_mac_lte);
if (p_mac_lte_info == NULL) {
/* Allocate new info struct for this frame */
- p_mac_lte_info = se_alloc0(sizeof(struct mac_lte_info));
+ p_mac_lte_info = se_new0(struct mac_lte_info);
infoAlreadySet = FALSE;
}
else {
@@ -1619,7 +1619,7 @@ static void dissect_rar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
gint offset, mac_lte_info *p_mac_lte_info, mac_lte_tap_info *tap_info)
{
gint number_of_rars = 0; /* No of RAR bodies expected following headers */
- guint8 *rapids = ep_alloc(MAX_RAR_PDUS * sizeof(guint8));
+ guint8 *rapids = (guint8 *)ep_alloc(MAX_RAR_PDUS * sizeof(guint8));
gboolean backoff_indicator_seen = FALSE;
guint8 backoff_indicator = 0;
guint8 extension;
@@ -1911,9 +1911,9 @@ static void call_rlc_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
struct rlc_lte_info *p_rlc_lte_info;
/* Resuse or create RLC info */
- p_rlc_lte_info = p_get_proto_data(pinfo->fd, proto_rlc_lte);
+ p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(pinfo->fd, proto_rlc_lte);
if (p_rlc_lte_info == NULL) {
- p_rlc_lte_info = se_alloc0(sizeof(struct rlc_lte_info));
+ p_rlc_lte_info = se_new0(struct rlc_lte_info);
}
/* Fill in struct details for srb channels */
@@ -1985,7 +1985,7 @@ static void TrackReportedDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
}
/* Look up entry for this UE/RNTI */
- ueData = g_hash_table_lookup(mac_lte_dl_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti));
+ ueData = (DLHarqBuffers *)g_hash_table_lookup(mac_lte_dl_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti));
if (ueData != NULL) {
/* Get previous info for this harq-id */
@@ -2010,16 +2010,16 @@ static void TrackReportedDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
if ((total_gap >= 8) && (total_gap <= 13)) {
/* Resend detected! Store result pointing back. */
- result = se_alloc0(sizeof(DLHARQResult));
+ result = se_new0(DLHARQResult);
result->previousSet = TRUE;
result->previousFrameNum = lastData->framenum;
result->timeSincePreviousFrame = total_gap;
g_hash_table_insert(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num), result);
/* Now make previous frame point forward to here */
- original_result = g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
+ original_result = (DLHARQResult *)g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
if (original_result == NULL) {
- original_result = se_alloc0(sizeof(ULHARQResult));
+ original_result = se_new0(DLHARQResult);
g_hash_table_insert(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(lastData->framenum), original_result);
}
original_result->nextSet = TRUE;
@@ -2031,7 +2031,7 @@ static void TrackReportedDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
}
else {
/* Allocate entry in table for this UE/RNTI */
- ueData = se_alloc0(sizeof(DLHarqBuffers));
+ ueData = se_new0(DLHarqBuffers);
g_hash_table_insert(mac_lte_dl_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti), ueData);
}
@@ -2046,7 +2046,7 @@ static void TrackReportedDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
}
else {
/* Not first time, so just set whats already stored in result */
- result = g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ result = (DLHARQResult *)g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
}
@@ -2082,7 +2082,7 @@ static void TrackReportedDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
/* Return TRUE if the given packet is thought to be a retx */
int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction)
{
- struct mac_lte_info *p_mac_lte_info = p_get_proto_data(pinfo->fd, proto_mac_lte);
+ struct mac_lte_info *p_mac_lte_info = (struct mac_lte_info *)p_get_proto_data(pinfo->fd, proto_mac_lte);
if (direction == DIRECTION_UPLINK) {
/* For UL, retx count is stored in per-packet struct */
@@ -2095,7 +2095,7 @@ int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction)
}
else {
/* Otherwise look up in table */
- DLHARQResult *result = g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ DLHARQResult *result = (DLHARQResult *)g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
return ((result != NULL) && result->previousSet);
}
}
@@ -2127,8 +2127,8 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
LastFrameData *thisData = NULL;
/* Look up entry for this UE/RNTI */
- ULHarqBuffers *ueData =
- g_hash_table_lookup(mac_lte_ul_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti));
+ ULHarqBuffers *ueData = (ULHarqBuffers *)g_hash_table_lookup(
+ mac_lte_ul_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti));
if (ueData != NULL) {
if (p_mac_lte_info->reTxCount >= 1) {
/* Looking for frame previously on this harq-id */
@@ -2155,16 +2155,16 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
ULHARQResult *original_result;
/* Original detected!!! Store result pointing back */
- result = se_alloc0(sizeof(ULHARQResult));
+ result = se_new0(ULHARQResult);
result->previousSet = TRUE;
result->previousFrameNum = lastData->framenum;
result->timeSincePreviousFrame = total_gap;
g_hash_table_insert(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num), result);
/* Now make previous frame point forward to here */
- original_result = g_hash_table_lookup(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
+ original_result = (ULHARQResult *)g_hash_table_lookup(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
if (original_result == NULL) {
- original_result = se_alloc0(sizeof(ULHARQResult));
+ original_result = se_new0(ULHARQResult);
g_hash_table_insert(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(lastData->framenum), original_result);
}
original_result->nextSet = TRUE;
@@ -2177,7 +2177,7 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
}
else {
/* Allocate entry in table for this UE/RNTI */
- ueData = se_alloc0(sizeof(ULHarqBuffers));
+ ueData = se_new0(ULHarqBuffers);
g_hash_table_insert(mac_lte_ul_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti), ueData);
}
@@ -2192,7 +2192,7 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
}
else {
/* Not first time, so just get whats already stored in result */
- result = g_hash_table_lookup(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ result = (ULHARQResult *)g_hash_table_lookup(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
}
/* Show any link back to previous Tx */
@@ -2239,10 +2239,10 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
static SRResult *GetSRResult(guint32 frameNum, gboolean can_create)
{
SRResult *result;
- result = g_hash_table_lookup(mac_lte_sr_request_hash, GUINT_TO_POINTER(frameNum));
+ result = (SRResult *)g_hash_table_lookup(mac_lte_sr_request_hash, GUINT_TO_POINTER(frameNum));
if ((result == NULL) && can_create) {
- result = se_alloc0(sizeof(SRResult));
+ result = se_new0(SRResult);
g_hash_table_insert(mac_lte_sr_request_hash, GUINT_TO_POINTER((guint)frameNum), result);
}
return result;
@@ -2273,10 +2273,10 @@ static void TrackSRInfo(SREvent event, packet_info *pinfo, proto_tree *tree,
}
/* Create state for this RNTI if necessary */
- state = g_hash_table_lookup(mac_lte_ue_sr_state, GUINT_TO_POINTER((guint)rnti));
+ state = (SRState *)g_hash_table_lookup(mac_lte_ue_sr_state, GUINT_TO_POINTER((guint)rnti));
if (state == NULL) {
/* Allocate status for this RNTI */
- state = se_alloc(sizeof(SRState));
+ state = se_new(SRState);
state->status = None;
g_hash_table_insert(mac_lte_ue_sr_state, GUINT_TO_POINTER((guint)rnti), state);
}
@@ -2504,7 +2504,7 @@ static guint16 count_ues_tti(mac_lte_info *p_mac_lte_info, packet_info *pinfo)
tti_info_t *tti_info;
/* Just return any previous result */
- TTIInfoResult_t *result = g_hash_table_lookup(mac_lte_tti_info_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ TTIInfoResult_t *result = (TTIInfoResult_t *)g_hash_table_lookup(mac_lte_tti_info_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
if (result != NULL) {
return result->ues_in_tti;
}
@@ -2544,7 +2544,7 @@ static guint16 count_ues_tti(mac_lte_info *p_mac_lte_info, packet_info *pinfo)
}
/* Set result state for this frame */
- result = se_alloc(sizeof(TTIInfoResult_t));
+ result = se_new(TTIInfoResult_t);
result->ues_in_tti = tti_info->ues_in_tti;
g_hash_table_insert(mac_lte_tti_info_result_hash,
GUINT_TO_POINTER(pinfo->fd->num), result);
@@ -2557,7 +2557,7 @@ static guint16 count_ues_tti(mac_lte_info *p_mac_lte_info, packet_info *pinfo)
static void show_ues_tti(packet_info *pinfo, mac_lte_info *p_mac_lte_info, tvbuff_t *tvb, proto_tree *context_tree)
{
/* Look up result */
- TTIInfoResult_t *result = g_hash_table_lookup(mac_lte_tti_info_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ TTIInfoResult_t *result = (TTIInfoResult_t *)g_hash_table_lookup(mac_lte_tti_info_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
if (result != NULL) {
proto_item *ti = proto_tree_add_uint(context_tree,
(p_mac_lte_info->direction == DIRECTION_UPLINK) ?
@@ -2611,7 +2611,7 @@ static void lookup_rlc_channel_from_lcid(guint16 ueid,
}
else {
/* Look up the mappings for this UE */
- ue_dynamic_drb_mappings_t *ue_mappings = g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
+ ue_dynamic_drb_mappings_t *ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
if (!ue_mappings) {
return;
}
@@ -3054,7 +3054,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tvb, offset, 6, ENC_NA);
/* Get pointer to result struct for this frame */
- crResult = g_hash_table_lookup(mac_lte_cr_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
+ crResult = (ContentionResolutionResult *)g_hash_table_lookup(mac_lte_cr_result_hash, GUINT_TO_POINTER(pinfo->fd->num));
if (crResult == NULL) {
/* Need to set result by looking for and comparing with Msg3 */
@@ -3062,11 +3062,11 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
guint msg3Key = p_mac_lte_info->rnti;
/* Allocate result and add it to the table */
- crResult = se_alloc(sizeof(ContentionResolutionResult));
+ crResult = se_new(ContentionResolutionResult);
g_hash_table_insert(mac_lte_cr_result_hash, GUINT_TO_POINTER(pinfo->fd->num), crResult);
/* Look for Msg3 */
- msg3Data = g_hash_table_lookup(mac_lte_msg3_hash, GUINT_TO_POINTER(msg3Key));
+ msg3Data = (Msg3Data *)g_hash_table_lookup(mac_lte_msg3_hash, GUINT_TO_POINTER(msg3Key));
/* Compare CCCH bytes */
if (msg3Data != NULL) {
@@ -3585,12 +3585,12 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
if ((lcids[n] == 0) && (direction == DIRECTION_UPLINK) && (data_length == 6)) {
if (!pinfo->fd->flags.visited) {
guint key = p_mac_lte_info->rnti;
- Msg3Data *data = g_hash_table_lookup(mac_lte_msg3_hash, GUINT_TO_POINTER(key));
+ Msg3Data *data = (Msg3Data *)g_hash_table_lookup(mac_lte_msg3_hash, GUINT_TO_POINTER(key));
/* Look for previous entry for this UE */
if (data == NULL) {
/* Allocate space for data and add to table */
- data = se_alloc(sizeof(Msg3Data));
+ data = se_new(Msg3Data);
g_hash_table_insert(mac_lte_msg3_hash, GUINT_TO_POINTER(key), data);
}
@@ -4184,7 +4184,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint n;
/* Allocate and zero tap struct */
- mac_lte_tap_info *tap_info = ep_alloc0(sizeof(mac_lte_tap_info));
+ mac_lte_tap_info *tap_info = (mac_lte_tap_info *)ep_alloc0(sizeof(mac_lte_tap_info));
/* Set protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-LTE");
@@ -4195,7 +4195,7 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
mac_lte_tree = proto_item_add_subtree(pdu_ti, ett_mac_lte);
/* Look for packet info! */
- p_mac_lte_info = p_get_proto_data(pinfo->fd, proto_mac_lte);
+ p_mac_lte_info = (mac_lte_info *)p_get_proto_data(pinfo->fd, proto_mac_lte);
/* Can't dissect anything without it... */
if (p_mac_lte_info == NULL) {
@@ -4679,8 +4679,8 @@ static void mac_lte_init_protocol(void)
static void* lcid_drb_mapping_copy_cb(void* dest, const void* orig, size_t len _U_)
{
- const lcid_drb_mapping_t *o = orig;
- lcid_drb_mapping_t *d = dest;
+ const lcid_drb_mapping_t *o = (const lcid_drb_mapping_t *)orig;
+ lcid_drb_mapping_t *d = (lcid_drb_mapping_t *)dest;
/* Copy all items over */
d->lcid = o->lcid;
@@ -4710,9 +4710,9 @@ void set_mac_lte_channel_mapping(guint16 ueid, guint8 lcid,
}
/* Look for existing UE entry */
- ue_mappings = g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
+ ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
if (!ue_mappings) {
- ue_mappings = se_alloc0(sizeof(ue_dynamic_drb_mappings_t));
+ ue_mappings = se_new0(ue_dynamic_drb_mappings_t);
g_hash_table_insert(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid), ue_mappings);
}
@@ -4751,7 +4751,7 @@ static guint8 get_mac_lte_channel_priority(guint16 ueid, guint8 lcid,
}
/* Look up the mappings for this UE */
- ue_mappings = g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
+ ue_mappings = (ue_dynamic_drb_mappings_t *)g_hash_table_lookup(mac_lte_ue_channels_hash, GUINT_TO_POINTER((guint)ueid));
if (!ue_mappings) {
return 0;
}
@@ -4768,7 +4768,7 @@ static guint8 get_mac_lte_channel_priority(guint16 ueid, guint8 lcid,
/* Function to be called from outside this module (e.g. in a plugin) to get per-packet data */
mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo)
{
- return p_get_proto_data(pinfo->fd, proto_mac_lte);
+ return (mac_lte_info *)p_get_proto_data(pinfo->fd, proto_mac_lte);
}
/* Function to be called from outside this module (e.g. in a plugin) to set per-packet data */
@@ -5876,7 +5876,7 @@ void proto_register_mac_lte(void)
sizeof(lcid_drb_mapping_t),
"drb_logchans",
TRUE,
- (void*) &lcid_drb_mappings,
+ (void**) &lcid_drb_mappings,
&num_lcid_drb_mappings,
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
"", /* TODO: is this ref to help manual? */