aboutsummaryrefslogtreecommitdiffstats
path: root/packet-clnp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-01 08:29:37 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-10-01 08:29:37 +0000
commitb1fe7b4f6bdd19b47bb5ef01e3280f6f5e2acaee (patch)
tree469015385bd66c0d924f444094baf9b94145393e /packet-clnp.c
parenta7c9b9a623650feb0a60578edae2421a7ed40117 (diff)
Have a flag in the "packet_info" structure, which indicates whether the
stuff currently being dissected is part of a packet included in an error packet (e.g., an ICMP Unreachable packet). Have the TCP dissector not bother doing reassembly if the TCP segment is part of an error packet, rather than an actual TCP transmission; other dissectors might want to treat those packets specially as well. Add to the "tcpinfo" structure a flag indicating whether the URG flag was set, rather than having the zero or non-zero value of the urgent pointer indicate that. (Yes, at least as I read RFC 793, a zero urgent pointer value isn't useful, as it means "the stuff before this segment is urgent", but it's certainly possible to put onto the wire a TCP segment with URG set and a zero urgent pointer.) Don't dissect the TCP header by grabbing the entire header with "tvb_memcpy()" and then pulling stuff out of it - extract stuff with individual tvbuff calls, and put stuff into the protocol tree and the Info column as we extract it, so that we can dissect a partial header. This lets us, for example, get the source and destination ports from the TCP header of the part of a TCP segment included in a minimum-length ICMPv4 error packet. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3986 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-clnp.c')
-rw-r--r--packet-clnp.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/packet-clnp.c b/packet-clnp.c
index b16c097149..b1594a6751 100644
--- a/packet-clnp.c
+++ b/packet-clnp.c
@@ -1,7 +1,7 @@
/* packet-clnp.c
* Routines for ISO/OSI network and transport protocol packet disassembly
*
- * $Id: packet-clnp.c,v 1.34 2001/09/27 10:35:40 guy Exp $
+ * $Id: packet-clnp.c,v 1.35 2001/10/01 08:29:34 guy Exp $
* Laurent Deniel <deniel@worldnet.fr>
* Ralf Schneider <Ralf.Schneider@t-online.de>
*
@@ -1592,6 +1592,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
address save_net_dst;
address save_src;
address save_dst;
+ gboolean save_in_error_pkt;
fragment_data *fd_head;
tvbuff_t *volatile next_tvb;
packet_info save_pi;
@@ -2022,10 +2023,20 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
save_src = pinfo->src;
save_dst = pinfo->dst;
+ /* Save the current value of the "we're inside an error packet"
+ flag, and set that flag; subdissectors may treat packets
+ that are the payload of error packets differently from
+ "real" packets. */
+ save_in_error_pkt = pinfo->in_error_pkt;
+ pinfo->in_error_pkt = TRUE;
+
/* Dissect the contained packet.
Catch ReportedBoundsError, and do nothing if we see it,
because it's not an error if the contained packet is short;
- there's no guarantee that all of it was included. */
+ there's no guarantee that all of it was included.
+
+ XXX - should catch BoundsError, and re-throw it after cleaning
+ up. */
ti = proto_tree_add_text(clnp_tree, tvb, offset, next_length,
"Discarded PDU");
discpdu_tree = proto_item_add_subtree(ti, ett_clnp_disc_pdu);
@@ -2037,6 +2048,9 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
ENDTRY;
+ /* Restore the "we're inside an error packet" flag. */
+ pinfo->in_error_pkt = save_in_error_pkt;
+
/* Restore the addresses. */
pinfo->dl_src = save_dl_src;
pinfo->dl_dst = save_dl_dst;