diff options
-rw-r--r-- | packet-q931.c | 11 | ||||
-rw-r--r-- | packet-tpkt.c | 53 |
2 files changed, 37 insertions, 27 deletions
diff --git a/packet-q931.c b/packet-q931.c index fe122e9381..9b80ddfce9 100644 --- a/packet-q931.c +++ b/packet-q931.c @@ -2,7 +2,7 @@ * Routines for Q.931 frame disassembly * Guy Harris <guy@alum.mit.edu> * - * $Id: packet-q931.c,v 1.39 2002/02/23 02:30:15 guy Exp $ + * $Id: packet-q931.c,v 1.40 2002/02/23 21:07:47 guy Exp $ * * Modified by Andreas Sikkema for possible use with H.323 * @@ -2518,8 +2518,15 @@ dissect_q931_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * is one, and that the code put a TPKT header in one * segment and the rest of the PDU in another. */ - if (tvb_length(tvb) == 4) + if (tvb_length(tvb) == 4) { + /* + * It is - call the "dissect TPKT over a TCP stream" + * routine. + */ + dissect_tpkt_encap(tvb, pinfo, tree, q931_desegment, + q931_tpkt_pdu_handle); return TRUE; + } /* * Well, we have more data than just the TPKT header; diff --git a/packet-tpkt.c b/packet-tpkt.c index e397654567..93424d98ff 100644 --- a/packet-tpkt.c +++ b/packet-tpkt.c @@ -7,7 +7,7 @@ * Routine to dissect RFC 1006 TPKT packet containing OSI TP PDU * Copyright 2001, Martin Thomas <Martin_A_Thomas@yahoo.com> * - * $Id: packet-tpkt.c,v 1.15 2002/02/23 02:30:15 guy Exp $ + * $Id: packet-tpkt.c,v 1.16 2002/02/23 21:07:48 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -141,14 +141,39 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* + * Get the length from the TPKT header. + */ + data_len = tvb_get_ntohs(tvb, offset + 2); + + /* + * Can we do reassembly? + */ + if (desegment && pinfo->can_desegment) { + /* + * Yes - is the payload split across segment + * boundaries? + */ + if (length_remaining < data_len + 4) { + /* + * Yes. Tell the TCP dissector where + * the data for this message starts in + * the data it handed us, and how many + * more bytes we need, and return. + */ + pinfo->desegment_offset = offset; + pinfo->desegment_len = + (data_len + 4) - length_remaining; + return; + } + } + + /* * Dissect the TPKT header. * Save and restore "pinfo->current_proto". */ saved_proto = pinfo->current_proto; pinfo->current_proto = "TPKT"; - data_len = tvb_get_ntohs(tvb, offset + 2); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "TPKT"); if (check_col(pinfo->cinfo, COL_INFO)) { @@ -175,28 +200,6 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } pinfo->current_proto = saved_proto; - /* - * Can we do reassembly? - */ - if (desegment && pinfo->can_desegment) { - /* - * Yes - is the payload split across segment - * boundaries? - */ - if (length_remaining < data_len + 4) { - /* - * Yes. Tell the TCP dissector where - * the data for this message starts in - * the data it handed us, and how many - * more bytes we need, and return. - */ - pinfo->desegment_offset = offset; - pinfo->desegment_len = - (data_len + 4) - length_remaining; - return; - } - } - /* Skip the TPKT header. */ offset += 4; |