aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gmrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-gmrp.c')
-rw-r--r--epan/dissectors/packet-gmrp.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/epan/dissectors/packet-gmrp.c b/epan/dissectors/packet-gmrp.c
index fe20aa21ff..2e7d753751 100644
--- a/epan/dissectors/packet-gmrp.c
+++ b/epan/dissectors/packet-gmrp.c
@@ -69,7 +69,7 @@ static const value_string attribute_type_vals[] = {
/* The length of GMRP LeaveAll attribute should be 2 octets (one for length
* and the other for event) */
-#define GMRP_LENGTH_LEAVEALL (sizeof(guint8)+sizeof(guint8))
+#define GMRP_LENGTH_LEAVEALL (int)(sizeof(guint8)+sizeof(guint8))
/* The length of GMRP attribute other than LeaveAll should be:
*
@@ -78,8 +78,8 @@ static const value_string attribute_type_vals[] = {
* 3 bytes for Service Requirement (1 for length, 1 for event, 1 for attribute value)
*
*/
-#define GMRP_GROUP_MEMBERSHIP_NON_LEAVEALL (sizeof(guint8)+sizeof(guint8)+(6*sizeof(guint8)))
-#define GMRP_SERVICE_REQUIREMENT_NON_LEAVEALL (sizeof(guint8)+sizeof(guint8)+sizeof(guint8))
+#define GMRP_GROUP_MEMBERSHIP_NON_LEAVEALL (int)(sizeof(guint8)+sizeof(guint8)+(6*sizeof(guint8)))
+#define GMRP_SERVICE_REQUIREMENT_NON_LEAVEALL (int)(sizeof(guint8)+sizeof(guint8)+sizeof(guint8))
/* Packet offset definitions */
#define GARP_PROTOCOL_ID 0
@@ -128,7 +128,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
protocol_id = tvb_get_ntohs(tvb, GARP_PROTOCOL_ID);
proto_tree_add_uint_format(gmrp_tree, hf_gmrp_proto_id, tvb,
- GARP_PROTOCOL_ID, sizeof(guint16),
+ GARP_PROTOCOL_ID, (int)sizeof(guint16),
protocol_id,
"Protocol Identifier: 0x%04x (%s)",
protocol_id,
@@ -139,16 +139,16 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Currently only one protocol ID is supported */
if (protocol_id != GARP_DEFAULT_PROTOCOL_ID)
{
- proto_tree_add_text(gmrp_tree, tvb, GARP_PROTOCOL_ID, sizeof(guint16),
+ proto_tree_add_text(gmrp_tree, tvb, GARP_PROTOCOL_ID, (int)sizeof(guint16),
" (Warning: this version of Wireshark only knows about protocol id = 1)");
call_dissector(data_handle,
- tvb_new_subset_remaining(tvb, GARP_PROTOCOL_ID + sizeof(guint16)),
+ tvb_new_subset_remaining(tvb, GARP_PROTOCOL_ID + (int)sizeof(guint16)),
pinfo, tree);
return;
}
- offset += sizeof(guint16);
- length -= sizeof(guint16);
+ offset += (int)sizeof(guint16);
+ length -= (int)sizeof(guint16);
msg_index = 0;
@@ -167,7 +167,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* End of GARP PDU */
if (msg_index)
{
- proto_tree_add_text(gmrp_tree, tvb, offset, sizeof(guint8),
+ proto_tree_add_text(gmrp_tree, tvb, offset, (int)sizeof(guint8),
"End of pdu");
break;
}
@@ -180,14 +180,14 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- offset += sizeof(guint8);
- length -= sizeof(guint8);
+ offset += (int)sizeof(guint8);
+ length -= (int)sizeof(guint8);
msg_item = proto_tree_add_text(gmrp_tree, tvb, msg_start, -1,
"Message %d", msg_index + 1);
proto_tree_add_uint(gmrp_tree, hf_gmrp_attribute_type, tvb,
- msg_start, sizeof(guint8), octet);
+ msg_start, (int)sizeof(guint8), octet);
/* GMRP supports Group Membership and Service Requirement as attribute types */
if ( (octet != GMRP_ATTRIBUTE_TYPE_GROUP_MEMBERSHIP) && (octet != GMRP_ATTRIBUTE_TYPE_SERVICE_REQUIREMENT) )
@@ -217,10 +217,10 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (attr_index)
{
proto_tree_add_text(gmrp_tree, tvb, offset,
- sizeof(guint8), " End of mark");
+ (int)sizeof(guint8), " End of mark");
- offset += sizeof(guint8);
- length -= sizeof(guint8);
+ offset += (int)sizeof(guint8);
+ length -= (int)sizeof(guint8);
proto_item_set_len(msg_item, offset - msg_start);
break;
@@ -237,23 +237,23 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 event;
- offset += sizeof(guint8);
- length -= sizeof(guint8);
+ offset += (int)sizeof(guint8);
+ length -= (int)sizeof(guint8);
attr_item = proto_tree_add_text(gmrp_tree, tvb,
attr_start, -1, " Attribute %d", attr_index + 1);
proto_tree_add_uint(gmrp_tree, hf_gmrp_attribute_length,
- tvb, attr_start, sizeof(guint8), octet);
+ tvb, attr_start, (int)sizeof(guint8), octet);
/* Read in attribute event */
event = tvb_get_guint8(tvb, offset);
proto_tree_add_uint(gmrp_tree, hf_gmrp_attribute_event,
- tvb, offset, sizeof(guint8), event);
+ tvb, offset, (int)sizeof(guint8), event);
- offset += sizeof(guint8);
- length -= sizeof(guint8);
+ offset += (int)sizeof(guint8);
+ length -= (int)sizeof(guint8);
switch (event) {
@@ -287,20 +287,20 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* Group Membership */
proto_tree_add_item(gmrp_tree, hf_gmrp_attribute_value_group_membership,
- tvb, offset, (6*sizeof(guint8)), ENC_NA);
+ tvb, offset, (int)(6*sizeof(guint8)), ENC_NA);
- offset += 6*sizeof(guint8);
- length -= 6*sizeof(guint8);
+ offset += (int)(6*sizeof(guint8));
+ length -= (int)(6*sizeof(guint8));
}
else
if ( GMRP_ATTRIBUTE_TYPE_SERVICE_REQUIREMENT == attribute_type )
{
/* Service Requirement */
proto_tree_add_item(gmrp_tree, hf_gmrp_attribute_value_service_requirement,
- tvb, offset, sizeof(guint8), ENC_BIG_ENDIAN);
+ tvb, offset, (int)sizeof(guint8), ENC_BIG_ENDIAN);
- offset += sizeof(guint8);
- length -= sizeof(guint8);
+ offset += (int)sizeof(guint8);
+ length -= (int)sizeof(guint8);
}
else
{