aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-14 14:33:46 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2013-12-14 14:33:46 +0000
commite0e86bab5a246069f6b51bf552b6bc2564136b4b (patch)
treef0ba66660da68048d7baaa14aa1e1f2ab4981a8d /epan/dissectors
parent2754c08d932d20fff1aca664dd925d63e1e46ff3 (diff)
Fix const warnings.
svn path=/trunk/; revision=54092
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-enip.c4
-rw-r--r--epan/dissectors/packet-hartip.c6
-rw-r--r--epan/dissectors/packet-iec104.c4
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c4
-rw-r--r--epan/dissectors/packet-mac-lte.c9
-rw-r--r--epan/dissectors/packet-netflow.c6
-rw-r--r--epan/dissectors/packet-smpp.c2
-rw-r--r--epan/dissectors/packet-socks.c2
-rw-r--r--epan/dissectors/packet-tcp.c4
-rw-r--r--epan/dissectors/packet-tr.c8
-rw-r--r--epan/dissectors/packet-ucp.c2
-rw-r--r--epan/dissectors/packet-wbxml.c4
12 files changed, 29 insertions, 26 deletions
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 3e223013d8..2a28c82dd2 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -914,14 +914,14 @@ enip_open_cip_connection( packet_info *pinfo, cip_conn_info_t* connInfo)
if ((connInfo->O2T.port == 0) || (connInfo->O2T.type == CONN_TYPE_MULTICAST))
connInfo->O2T.port = ENIP_IO_PORT;
if ((connInfo->O2T.ipaddress.type == AT_NONE) ||
- ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->O2T.ipaddress.data)) == 0) ||
+ ((connInfo->O2T.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->O2T.ipaddress.data)) == 0) ||
((connInfo->O2T.ipaddress.type == AT_IPv6) && (memcmp(connInfo->O2T.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) ||
(connInfo->O2T.type != CONN_TYPE_MULTICAST))
connInfo->O2T.ipaddress = pinfo->src;
if ((connInfo->T2O.port == 0) || (connInfo->T2O.type == CONN_TYPE_MULTICAST))
connInfo->T2O.port = ENIP_IO_PORT;
if ((connInfo->T2O.ipaddress.type == AT_NONE) ||
- ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(guint32*)connInfo->T2O.ipaddress.data)) == 0) ||
+ ((connInfo->T2O.ipaddress.type == AT_IPv4) && ((*(const guint32*)connInfo->T2O.ipaddress.data)) == 0) ||
((connInfo->T2O.ipaddress.type == AT_IPv6) && (memcmp(connInfo->T2O.ipaddress.data, &ipv6_zero, sizeof(ipv6_zero)) == 0)) ||
(connInfo->T2O.type != CONN_TYPE_MULTICAST))
connInfo->T2O.ipaddress = pinfo->dst;
diff --git a/epan/dissectors/packet-hartip.c b/epan/dissectors/packet-hartip.c
index 61543522b8..14f650bf77 100644
--- a/epan/dissectors/packet-hartip.c
+++ b/epan/dissectors/packet-hartip.c
@@ -297,9 +297,9 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_,
hartip_message_id_values,
"Unknown message %d");
- tick_stat_node(st, (guint8*)st_str_packets, 0, FALSE);
- tick_stat_node(st, (guint8*)message_type_node_str, st_node_packets, FALSE);
- tick_stat_node(st, (guint8*)message_id_node_str, message_type_node, FALSE);
+ tick_stat_node(st, st_str_packets, 0, FALSE);
+ tick_stat_node(st, message_type_node_str, st_node_packets, FALSE);
+ tick_stat_node(st, message_id_node_str, message_type_node, FALSE);
return 1;
}
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index f9e17705f8..d8caf61e5a 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -713,9 +713,9 @@ static proto_item* get_InfoObjectAddress(guint32 *asdu_info_obj_addr, tvbuff_t *
static guint8 get_TypeIdLength(guint8 TypeId)
{
guint8 ret = 0;
- td_asdu_length *item;
+ const td_asdu_length *item;
- item = (td_asdu_length *)asdu_length;
+ item = asdu_length;
while (item->value)
{
if (item->value == TypeId)
diff --git a/epan/dissectors/packet-ieee80211-radiotap.c b/epan/dissectors/packet-ieee80211-radiotap.c
index db50f25348..7cae8f111c 100644
--- a/epan/dissectors/packet-ieee80211-radiotap.c
+++ b/epan/dissectors/packet-ieee80211-radiotap.c
@@ -872,14 +872,14 @@ capture_radiotap(const guchar * pd, int offset, int len, packet_counts * ld)
guint16 it_len;
guint32 present, xpresent;
guint8 rflags;
- struct ieee80211_radiotap_header *hdr;
+ const struct ieee80211_radiotap_header *hdr;
if (!BYTES_ARE_IN_FRAME(offset, len,
sizeof(struct ieee80211_radiotap_header))) {
ld->other++;
return;
}
- hdr = (struct ieee80211_radiotap_header *)pd;
+ hdr = (const struct ieee80211_radiotap_header *)pd;
it_len = pletoh16(&hdr->it_len);
if (!BYTES_ARE_IN_FRAME(offset, len, it_len)) {
ld->other++;
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c
index 4704408c93..85478e2127 100644
--- a/epan/dissectors/packet-mac-lte.c
+++ b/epan/dissectors/packet-mac-lte.c
@@ -1243,15 +1243,18 @@ static GHashTable *mac_lte_drx_frame_result = NULL;
static gint mac_lte_framenum_instance_hash_equal(gconstpointer v, gconstpointer v2)
{
- drx_state_key_t *p1 = (drx_state_key_t*)v;
- drx_state_key_t *p2 = (drx_state_key_t*)v2;
+ const drx_state_key_t *p1 = (const drx_state_key_t*)v;
+ const drx_state_key_t *p2 = (const drx_state_key_t*)v2;
+
return ((p1->frameNumber == p2->frameNumber) &&
(p1->pdu_instance == p2->pdu_instance));
}
static guint mac_lte_framenum_instance_hash_func(gconstpointer v)
{
- drx_state_key_t *p1 = (drx_state_key_t*)v;
+ const drx_state_key_t *p1 = (const drx_state_key_t*)v;
+
+ /* XXX which one return ? */
return p1->frameNumber + (p1->pdu_instance >> 8);
return GPOINTER_TO_UINT(v);
}
diff --git a/epan/dissectors/packet-netflow.c b/epan/dissectors/packet-netflow.c
index 9abfbb6c5f..0d64a345c5 100644
--- a/epan/dissectors/packet-netflow.c
+++ b/epan/dissectors/packet-netflow.c
@@ -5562,8 +5562,8 @@ static v9_v10_tmplt_t *v9_v10_tmplt_build_key(v9_v10_tmplt_t *tmplt_p, packet_in
static gboolean
v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2)
{
- const v9_v10_tmplt_t *ta = (v9_v10_tmplt_t *)k1;
- const v9_v10_tmplt_t *tb = (v9_v10_tmplt_t *)k2;
+ const v9_v10_tmplt_t *ta = (const v9_v10_tmplt_t *)k1;
+ const v9_v10_tmplt_t *tb = (const v9_v10_tmplt_t *)k2;
return (
(CMP_ADDRESS(&ta->src_addr, &tb->src_addr) == 0) &&
@@ -5578,7 +5578,7 @@ v9_v10_tmplt_table_equal(gconstpointer k1, gconstpointer k2)
static guint
v9_v10_tmplt_table_hash(gconstpointer k)
{
- const v9_v10_tmplt_t *tmplt_p = (v9_v10_tmplt_t *)k;
+ const v9_v10_tmplt_t *tmplt_p = (const v9_v10_tmplt_t *)k;
guint32 val;
val = tmplt_p->src_id + (tmplt_p->tmplt_id << 9) + tmplt_p->src_port + tmplt_p->dst_port;
diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c
index ae843d31d2..03178158f3 100644
--- a/epan/dissectors/packet-smpp.c
+++ b/epan/dissectors/packet-smpp.c
@@ -1124,7 +1124,7 @@ smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */
epan_dissect_t *edt _U_,
const void *p) /* Used for getting SMPP command_id values */
{
- smpp_tap_rec_t* tap_rec = (smpp_tap_rec_t*)p;
+ const smpp_tap_rec_t* tap_rec = (const smpp_tap_rec_t*)p;
tick_stat_node(st, "SMPP Operations", 0, TRUE);
diff --git a/epan/dissectors/packet-socks.c b/epan/dissectors/packet-socks.c
index b0256ede87..416a5f885d 100644
--- a/epan/dissectors/packet-socks.c
+++ b/epan/dissectors/packet-socks.c
@@ -1120,7 +1120,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
if (hash_info->dst_addr.type == AT_IPv4) {
ti = proto_tree_add_ipv4( socks_tree, hf_socks_ip_dst, tvb,
- offset, 0, *((guint32*)hash_info->dst_addr.data));
+ offset, 0, *((const guint32*)hash_info->dst_addr.data));
PROTO_ITEM_SET_GENERATED(ti);
} else if (hash_info->dst_addr.type == AT_IPv6) {
ti = proto_tree_add_ipv6( socks_tree, hf_socks_ip6_dst, tvb,
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index 214fa430ee..58bac2df2b 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -4460,9 +4460,9 @@ dissect_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* We haven't turned checksum checking off; checksum it. */
/* Set up the fields of the pseudo-header. */
- cksum_vec[0].ptr = (guint8 *)pinfo->src.data;
+ cksum_vec[0].ptr = (const guint8 *)pinfo->src.data;
cksum_vec[0].len = pinfo->src.len;
- cksum_vec[1].ptr = (guint8 *)pinfo->dst.data;
+ cksum_vec[1].ptr = (const guint8 *)pinfo->dst.data;
cksum_vec[1].len = pinfo->dst.len;
cksum_vec[2].ptr = (const guint8 *)phdr;
switch (pinfo->src.type) {
diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c
index 483ea73ade..6b7538260d 100644
--- a/epan/dissectors/packet-tr.c
+++ b/epan/dissectors/packet-tr.c
@@ -516,11 +516,11 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(bf_tree, hf_tr_fc_type, tr_tvb, 1, 1, trh->fc);
proto_tree_add_uint(bf_tree, hf_tr_fc_pcf, tr_tvb, 1, 1, trh->fc);
- proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (guint8 *)trh->dst.data);
- proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (guint8 *)trh->src.data);
- hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (guint8 *)trh->dst.data);
+ proto_tree_add_ether(tr_tree, hf_tr_dst, tr_tvb, 2, 6, (const guint8 *)trh->dst.data);
+ proto_tree_add_ether(tr_tree, hf_tr_src, tr_tvb, 8, 6, (const guint8 *)trh->src.data);
+ hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 2, 6, (const guint8 *)trh->dst.data);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (guint8 *)trh->src.data);
+ hidden_item = proto_tree_add_ether(tr_tree, hf_tr_addr, tr_tvb, 8, 6, (const guint8 *)trh->src.data);
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_boolean(tr_tree, hf_tr_sr, tr_tvb, 8, 1, source_routed);
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index 25eea68e9c..06d60e2c77 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -670,7 +670,7 @@ ucp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */
epan_dissect_t *edt _U_,
const void *p) /* Used for getting UCP stats */
{
- ucp_tap_rec_t *tap_rec = (ucp_tap_rec_t*)p;
+ const ucp_tap_rec_t *tap_rec = (const ucp_tap_rec_t*)p;
tick_stat_node(st, st_str_ucp, 0, TRUE);
diff --git a/epan/dissectors/packet-wbxml.c b/epan/dissectors/packet-wbxml.c
index a6682565b6..abab51268b 100644
--- a/epan/dissectors/packet-wbxml.c
+++ b/epan/dissectors/packet-wbxml.c
@@ -7522,7 +7522,7 @@ parse_wbxml_tag_defined (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
DebugLog(("STAG: LITERAL tag (peek = 0x%02X, off = %u) - TableRef follows!\n", peek, off));
idx = tvb_get_guintvar (tvb, off+1, &tag_len);
str_len = tvb_strsize (tvb, str_tbl+idx);
- tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
+ tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
tag_new_known = 0; /* invalidate known tag_new */
} else { /* Known tag */
tag_new_known = peek & 0x3F;
@@ -7908,7 +7908,7 @@ parse_wbxml_tag (proto_tree *tree, tvbuff_t *tvb, guint32 offset,
" - TableRef follows!\n", peek, off));
idx = tvb_get_guintvar (tvb, off+1, &tag_len);
str_len = tvb_strsize (tvb, str_tbl+idx);
- tag_new_literal = (gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
+ tag_new_literal = (const gchar*)tvb_get_ptr (tvb, str_tbl+idx, str_len);
tag_new_known = 0; /* invalidate known tag_new */
} else { /* Known tag */
tag_new_known = peek & 0x3F;