aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ip.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-08-23 09:09:35 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-08-23 09:09:35 +0000
commitba74395cbe82f5fee8967247e5ea72f6918be845 (patch)
tree56aae2194ef5f2c2ef809bb5272ec76f57a8da32 /packet-ip.c
parentfb0480ae436b31994ee8a2213a78252055f8832a (diff)
New feature. Statistics/EndpointTalkjers can now present a sortable table with a list of all seen conversations of a certain type.
Supported types are Ethernet/TokenRing/IP/UDP and TCP. Will add FibreChannel soon. The framework for this feature needs to be enhanced in the future so that by selecting one entry and click the right mousebutton, this will bring up a menu with Prepare/Match options with suboptions for AnyDirection, ForwardOnly or ReverseOnly which updates the display filter accordingly. Had to update some of the taps as well to change them to use a proper address structure for the address fields. We should now be able to to these stats correctly even for ip tunneled over ip tunnelled over ip ... svn path=/trunk/; revision=8222
Diffstat (limited to 'packet-ip.c')
-rw-r--r--packet-ip.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/packet-ip.c b/packet-ip.c
index 4fb016b85b..06a97afede 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.194 2003/07/11 09:30:48 guy Exp $
+ * $Id: packet-ip.c,v 1.195 2003/08/23 09:09:32 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -830,7 +830,6 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
eip_current=0;
}
iph=&eip_arr[eip_current];
- pinfo->private_data=iph;
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IP");
@@ -966,24 +965,29 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(ip_tree, hf_ip_checksum, tvb, offset + 10, 2, iph->ip_sum);
}
- tvb_memcpy(tvb, (guint8 *)&iph->ip_src, offset + 12, 4);
+ SET_ADDRESS(&pinfo->net_src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
+ SET_ADDRESS(&pinfo->src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
+ SET_ADDRESS(&iph->ip_src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
if (tree) {
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Src Addr: %s (%s)",
- get_hostname(iph->ip_src), ip_to_str((guint8 *) &iph->ip_src));
+ get_hostname((guint)(*((guint *)iph->ip_src.data))), ip_to_str((guint8 *) iph->ip_src.data));
}
- proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, iph->ip_src);
- proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, tvb, offset + 12, 4, iph->ip_src);
+ proto_tree_add_ipv4(ip_tree, hf_ip_src, tvb, offset + 12, 4, (guint)(*((guint *)iph->ip_src.data)));
+ proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, tvb, offset + 12, 4, (guint)(*((guint *)iph->ip_src.data)));
}
- tvb_memcpy(tvb, (guint8 *)&iph->ip_dst, offset + 16, 4);
+ SET_ADDRESS(&pinfo->net_dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
+ SET_ADDRESS(&pinfo->dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
+ SET_ADDRESS(&iph->ip_dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
+
if (tree) {
if (ip_summary_in_tree) {
proto_item_append_text(ti, ", Dst Addr: %s (%s)",
- get_hostname(iph->ip_dst), ip_to_str((guint8 *) &iph->ip_dst));
+ get_hostname((guint)(*((guint *)iph->ip_dst.data))), ip_to_str((guint8 *) &iph->ip_dst.data));
}
- proto_tree_add_ipv4(ip_tree, hf_ip_dst, tvb, offset + 16, 4, iph->ip_dst);
- proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, tvb, offset + 16, 4, iph->ip_dst);
+ proto_tree_add_ipv4(ip_tree, hf_ip_dst, tvb, offset + 16, 4, (guint)(*((guint *)iph->ip_dst.data)));
+ proto_tree_add_ipv4_hidden(ip_tree, hf_ip_addr, tvb, offset + 16, 4, (guint)(*((guint *)iph->ip_dst.data)));
}
if (tree) {
@@ -1006,11 +1010,6 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->iphdrlen = hlen;
- SET_ADDRESS(&pinfo->net_src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
- SET_ADDRESS(&pinfo->src, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_SRC, 4));
- SET_ADDRESS(&pinfo->net_dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
- SET_ADDRESS(&pinfo->dst, AT_IPv4, 4, tvb_get_ptr(tvb, offset + IPH_DST, 4));
-
/* Skip over header + options */
offset += hlen;
nxt = iph->ip_p; /* XXX - what if this isn't the same for all fragments? */