From 1e1bbe52151155cfd3a079a4114ae550d78015b8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 24 Aug 2002 10:12:45 +0000 Subject: [PATCH] From Marcus Haebler: handle a sub-protocol field of 0x00 as PPP. Merge all the cases for handling PPP together. svn path=/trunk/; revision=6078 --- AUTHORS | 4 ++++ doc/ethereal.pod.template | 1 + packet-gtp.c | 30 +++++------------------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/AUTHORS b/AUTHORS index 2875fa7d29..eebfc3b41f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1385,6 +1385,10 @@ Flavio Poletti { v1 } +Marcus Haebler { + Handle a sub-protocol field of 0x00 as PPP +} + Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template index 6ad339fdf1..c4e0e23b5a 100644 --- a/doc/ethereal.pod.template +++ b/doc/ethereal.pod.template @@ -1471,6 +1471,7 @@ B. Bill Studenmund Brian Bruns Flavio Poletti + Marcus Haebler Alain Magloire was kind enough to give his permission to use his version of snprintf.c. diff --git a/packet-gtp.c b/packet-gtp.c index 0e4f1b5bea..70a83f97f9 100644 --- a/packet-gtp.c +++ b/packet-gtp.c @@ -4,7 +4,7 @@ * Copyright 2001, Michal Melerowicz * Nicolas Balkota * - * $Id: packet-gtp.c,v 1.33 2002/08/23 20:03:12 guy Exp $ + * $Id: packet-gtp.c,v 1.34 2002/08/24 10:12:42 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -456,6 +456,8 @@ static const value_string ver_types[] = { #define GTP_MSG_DATA_TRANSF_REQ 0xF0 #define GTP_MSG_DATA_TRANSF_RESP 0xF1 #define GTP_MSG_TPDU 0xFF + +#define GTP_PPP_0x00 0x00 #define GTP_PPP_0xC0 0xC0 #define GTP_PPP_0x80 0x80 #define GTP_PPP_0xC2 0xC2 @@ -4961,20 +4963,9 @@ dissect_gtpv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { sub_proto = tvb_get_guint8(tvb,GTPv1_HDR_LENGTH - hdr_offset); switch(sub_proto) { + case GTP_PPP_0x00: case GTP_PPP_0xC0: - next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset, -1, -1); - call_dissector(ppp_handle, next_tvb, pinfo, tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_append_str_gtp(pinfo->cinfo, COL_PROTOCOL, "PPP"); - break; - case GTP_PPP_0x80: - next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset, -1, -1); - call_dissector(ppp_handle, next_tvb, pinfo, tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_append_str_gtp(pinfo->cinfo, COL_PROTOCOL, "PPP"); - break; - case GTP_PPP_0xC2: next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset, -1, -1); call_dissector(ppp_handle, next_tvb, pinfo, tree); @@ -4985,20 +4976,9 @@ dissect_gtpv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case GTP_PPP_REQ_ERROR: sub_proto = tvb_get_guint8(tvb,GTPv1_HDR_LENGTH - hdr_offset+2); switch(sub_proto) { + case GTP_PPP_0x00: case GTP_PPP_0xC0: - next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset+2, -1, -1); - call_dissector(ppp_handle, next_tvb, pinfo, tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_append_str_gtp(pinfo->cinfo, COL_PROTOCOL, "PPP"); - break; - case GTP_PPP_0x80: - next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset+2, -1, -1); - call_dissector(ppp_handle, next_tvb, pinfo, tree); - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_append_str_gtp(pinfo->cinfo, COL_PROTOCOL, "PPP"); - break; - case GTP_PPP_0xC2: next_tvb = tvb_new_subset(tvb, GTPv1_HDR_LENGTH - hdr_offset+2, -1, -1); call_dissector(ppp_handle, next_tvb, pinfo, tree);