1999-06-11 15:30:55 +00:00
|
|
|
/* packet-gre.c
|
|
|
|
* Routines for the Generic Routing Encapsulation (GRE) protocol
|
|
|
|
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1999-06-11 15:30:55 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-06-11 15:30:55 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-06-11 15:30:55 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-06-11 15:30:55 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-06-11 15:30:55 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/packet.h>
|
2007-12-16 22:46:42 +00:00
|
|
|
#include "packet-gre.h"
|
2000-11-29 06:17:34 +00:00
|
|
|
#include "packet-wccp.h"
|
2004-09-28 00:06:32 +00:00
|
|
|
#include <epan/in_cksum.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include <epan/greproto.h>
|
2004-09-29 00:52:45 +00:00
|
|
|
#include <epan/ipproto.h>
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/llcsaps.h>
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-10-23 19:02:59 +00:00
|
|
|
/*
|
|
|
|
* See RFC 1701 "Generic Routing Encapsulation (GRE)", RFC 1702
|
|
|
|
* "Generic Routing Encapsulation over IPv4 networks", RFC 2637
|
|
|
|
* "Point-to-Point Tunneling Protocol (PPTP)", RFC 2784 "Generic
|
2004-05-15 19:54:10 +00:00
|
|
|
* Routing Encapsulation (GRE)", RFC 2890 "Key and Sequence
|
|
|
|
* Number Extensions to GRE" and draft-ietf-mpls-in-ip-or-gre-07.txt
|
|
|
|
* "Encapsulating MPLS in IP or Generic Routing Encapsulation (GRE)".
|
2001-10-23 19:02:59 +00:00
|
|
|
*/
|
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_gre = -1;
|
1999-12-12 03:05:57 +00:00
|
|
|
static int hf_gre_proto = -1;
|
2004-09-23 17:15:26 +00:00
|
|
|
static int hf_gre_key = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2006-03-27 16:23:00 +00:00
|
|
|
/* Ref 3GPP2 A.S0012-C v2.0 and A.S0008-A v1.0 */
|
|
|
|
static int hf_gre_3ggp2_attrib_id =-1;
|
|
|
|
static int hf_gre_3ggp2_attrib_length = -1;
|
|
|
|
static int hf_gre_3ggp2_sdi = -1;
|
|
|
|
static int hf_gre_3ggp2_fci = -1;
|
|
|
|
static int hf_gre_3ggp2_di = -1;
|
|
|
|
static int hf_gre_3ggp2_flow_disc = -1;
|
|
|
|
static int hf_gre_3ggp2_seg = -1;
|
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_gre = -1;
|
|
|
|
static gint ett_gre_flags = -1;
|
2000-11-29 06:17:34 +00:00
|
|
|
static gint ett_gre_wccp2_redirect_header = -1;
|
2006-03-24 07:09:35 +00:00
|
|
|
static gint ett_3gpp2_attribs = -1;
|
2006-03-29 17:00:16 +00:00
|
|
|
static gint ett_3gpp2_attr = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2001-01-13 07:47:49 +00:00
|
|
|
static dissector_table_t gre_dissector_table;
|
2001-11-25 22:51:14 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2001-01-13 07:47:49 +00:00
|
|
|
|
1999-06-11 15:30:55 +00:00
|
|
|
/* bit positions for flags in header */
|
|
|
|
#define GH_B_C 0x8000
|
|
|
|
#define GH_B_R 0x4000
|
|
|
|
#define GH_B_K 0x2000
|
|
|
|
#define GH_B_S 0x1000
|
|
|
|
#define GH_B_s 0x0800
|
|
|
|
#define GH_B_RECUR 0x0700
|
|
|
|
#define GH_P_A 0x0080 /* only in special PPTPized GRE header */
|
|
|
|
#define GH_P_FLAGS 0x0078 /* only in special PPTPized GRE header */
|
|
|
|
#define GH_R_FLAGS 0x00F8
|
|
|
|
#define GH_B_VER 0x0007
|
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
static void add_flags_and_ver(proto_tree *, guint16, tvbuff_t *, int, int);
|
|
|
|
static void dissect_gre_wccp2_redirect_header(tvbuff_t *, int, proto_tree *);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2007-12-16 22:46:42 +00:00
|
|
|
const value_string gre_typevals[] = {
|
2001-04-03 05:42:11 +00:00
|
|
|
{ ETHERTYPE_PPP, "PPP" },
|
|
|
|
{ ETHERTYPE_IP, "IP" },
|
2003-06-10 05:38:52 +00:00
|
|
|
{ SAP_OSINL5, "OSI"},
|
2001-04-03 05:42:11 +00:00
|
|
|
{ GRE_WCCP, "WCCP"},
|
2005-12-09 16:14:42 +00:00
|
|
|
{ GRE_NHRP, "NHRP"},
|
2007-04-14 01:07:36 +00:00
|
|
|
{ GRE_ERSPAN, "ERSPAN"},
|
2001-04-03 05:42:11 +00:00
|
|
|
{ ETHERTYPE_IPX, "IPX"},
|
|
|
|
{ ETHERTYPE_ETHBRIDGE, "Transparent Ethernet bridging" },
|
2004-12-01 20:58:22 +00:00
|
|
|
{ ETHERTYPE_RAW_FR, "Frame Relay"},
|
2004-01-29 03:51:25 +00:00
|
|
|
{ ETHERTYPE_IPv6, "IPv6" },
|
2004-05-15 19:54:10 +00:00
|
|
|
{ ETHERTYPE_MPLS, "MPLS label switched packet" },
|
2004-12-01 21:05:45 +00:00
|
|
|
{ ETHERTYPE_CDMA2000_A10_UBS,"CDMA2000 A10 Unstructured byte stream" },
|
2008-12-10 23:28:51 +00:00
|
|
|
{ ETHERTYPE_3GPP2, "CDMA2000 A10 3GPP2 Packet" },
|
|
|
|
{ GRE_ARUBA_8200, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8210, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8220, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8230, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8240, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8250, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8260, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8270, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8280, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8290, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82A0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82B0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82C0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82D0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82E0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_82F0, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8300, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8310, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8320, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8330, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8340, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8350, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8360, "ARUBA WLAN" },
|
|
|
|
{ GRE_ARUBA_8370, "ARUBA WLAN" },
|
2001-04-03 05:42:11 +00:00
|
|
|
{ 0, NULL }
|
1999-12-12 03:05:57 +00:00
|
|
|
};
|
|
|
|
|
2006-03-24 07:09:35 +00:00
|
|
|
#define ID_3GPP2_SDI_FLAG 1
|
|
|
|
#define ID_3GPP2_FLOW_CTRL 2
|
|
|
|
#define ID_3GPP2_FLOW_DISCRIMINATOR 3
|
|
|
|
#define ID_3GPP2_SEG 4
|
|
|
|
|
2006-03-27 16:23:00 +00:00
|
|
|
static const value_string gre_3ggp2_seg_vals[] = {
|
2006-03-24 07:09:35 +00:00
|
|
|
{ 0x00, "Packet Started" },
|
2006-03-27 16:23:00 +00:00
|
|
|
{ 0x01, "Packet continued" },
|
2006-03-24 07:09:35 +00:00
|
|
|
{ 0x02, "Packet Ended" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
2006-03-27 16:23:00 +00:00
|
|
|
/* 3GPP2 A.S0012-C v2.0
|
|
|
|
* 2.6.1 GRE Attributes
|
|
|
|
*/
|
|
|
|
static const value_string gre_3ggp2_attrib_id_vals[] = {
|
2006-03-29 17:00:16 +00:00
|
|
|
{ 0x01, "1x SDB/HRPD DOS Indicator" },
|
2006-03-27 16:23:00 +00:00
|
|
|
{ 0x02, "Flow Control Indication" },
|
|
|
|
/* A.S0008-A v1.0 */
|
|
|
|
{ 0x03, "IP Flow Discriminator" },
|
|
|
|
{ 0x04, "Segmentation Indication" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string gre_3ggp2_sdi_val = {
|
2006-03-29 17:00:16 +00:00
|
|
|
"Packet suitable for 1x SDB or HRPD DOS transmission",
|
2006-03-27 16:23:00 +00:00
|
|
|
"Reserved"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string gre_3ggp2_fci_val = {
|
|
|
|
"XOFF",
|
|
|
|
"XON"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string gre_3ggp2_di_val = {
|
|
|
|
"INDEFINITE:",
|
|
|
|
"TEMPORARY"
|
|
|
|
};
|
2006-03-24 07:09:35 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
dissect_gre_3gpp2_attribs(tvbuff_t *tvb, int offset, proto_tree *tree)
|
|
|
|
{
|
|
|
|
gboolean last_attrib = FALSE;
|
2006-03-29 17:00:16 +00:00
|
|
|
proto_item* attr_item;
|
|
|
|
proto_tree* attr_tree;
|
|
|
|
guint8 value;
|
|
|
|
int start_offset = offset;
|
2006-03-24 07:09:35 +00:00
|
|
|
|
|
|
|
proto_item* ti =
|
|
|
|
proto_tree_add_text(tree, tvb, offset, 0, "3GPP2 Attributes");
|
|
|
|
|
|
|
|
proto_tree* atree = proto_item_add_subtree(ti, ett_3gpp2_attribs);
|
|
|
|
|
|
|
|
while(last_attrib != TRUE)
|
|
|
|
{
|
|
|
|
guint8 attrib_id = tvb_get_guint8(tvb, offset);
|
|
|
|
guint8 attrib_length = tvb_get_guint8(tvb, offset + 1);
|
|
|
|
|
2006-03-29 17:00:16 +00:00
|
|
|
attr_item = proto_tree_add_text(atree, tvb, offset, attrib_length + 1, "%s",
|
|
|
|
val_to_str((attrib_id&0x7f), gre_3ggp2_attrib_id_vals, "%u (Unknown)"));
|
|
|
|
attr_tree = proto_item_add_subtree(attr_item, ett_3gpp2_attr);
|
|
|
|
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_attrib_id, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_attrib_length, tvb, offset+1, 1, FALSE);
|
2006-03-27 16:23:00 +00:00
|
|
|
|
2006-03-24 07:09:35 +00:00
|
|
|
offset += 2;
|
|
|
|
last_attrib = (attrib_id & 0x80)?TRUE:FALSE;
|
|
|
|
attrib_id &= 0x7F;
|
|
|
|
|
|
|
|
switch(attrib_id)
|
|
|
|
{
|
|
|
|
case ID_3GPP2_FLOW_DISCRIMINATOR:
|
|
|
|
{
|
2006-03-29 17:00:16 +00:00
|
|
|
value = tvb_get_guint8(tvb,offset);
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_flow_disc, tvb, offset, attrib_length, FALSE);
|
|
|
|
proto_item_append_text(attr_item," - 0x%x",value);
|
2006-03-24 07:09:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_3GPP2_SDI_FLAG:
|
|
|
|
{
|
2006-03-29 17:00:16 +00:00
|
|
|
value = tvb_get_guint8(tvb,offset);
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_sdi, tvb, offset, attrib_length, FALSE);
|
|
|
|
proto_item_append_text(attr_item," - %s",
|
|
|
|
(value & 0x80) ? "Packet suitable for 1x SDB or HRPD DOS transmission" : "Reserved");
|
|
|
|
|
2006-03-24 07:09:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_3GPP2_SEG:
|
|
|
|
{
|
2006-03-29 17:00:16 +00:00
|
|
|
value = tvb_get_guint8(tvb,offset) >>6;
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_seg, tvb, offset, attrib_length, FALSE);
|
|
|
|
proto_item_append_text(attr_item," - %s",val_to_str(value, gre_3ggp2_seg_vals, "0x%02X - Unknown"));
|
2006-03-24 07:09:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ID_3GPP2_FLOW_CTRL:
|
|
|
|
{
|
2006-03-29 17:00:16 +00:00
|
|
|
value = tvb_get_guint8(tvb,offset);
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_fci, tvb, offset, attrib_length, FALSE);
|
|
|
|
proto_item_append_text(attr_item," - %s",
|
|
|
|
(value & 0x80) ? "XON" : "XOFF");
|
|
|
|
proto_tree_add_item(attr_tree, hf_gre_3ggp2_di, tvb, offset, attrib_length, FALSE);
|
|
|
|
proto_item_append_text(attr_item,"/%s",
|
|
|
|
(value & 0x40) ? "INDEFINITE" : "TEMPORARY");
|
2006-03-24 07:09:35 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
offset += attrib_length;
|
|
|
|
}
|
2006-03-29 17:00:16 +00:00
|
|
|
proto_item_set_len(ti, offset - start_offset);
|
2006-03-24 07:09:35 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2000-04-16 22:46:25 +00:00
|
|
|
static void
|
2000-11-29 07:42:35 +00:00
|
|
|
dissect_gre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
int offset = 0;
|
|
|
|
guint16 flags_and_ver;
|
|
|
|
guint16 type;
|
2001-01-07 22:08:31 +00:00
|
|
|
gboolean is_ppp = FALSE;
|
|
|
|
gboolean is_wccp2 = FALSE;
|
|
|
|
guint len = 4;
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *gre_tree = NULL;
|
1999-12-09 02:53:33 +00:00
|
|
|
guint16 sre_af;
|
|
|
|
guint8 sre_length;
|
2000-05-25 07:42:26 +00:00
|
|
|
tvbuff_t *next_tvb;
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
flags_and_ver = tvb_get_ntohs(tvb, offset);
|
|
|
|
type = tvb_get_ntohs(tvb, offset + sizeof(flags_and_ver));
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GRE");
|
2000-12-15 00:03:09 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Encapsulated %s",
|
2007-12-16 22:46:42 +00:00
|
|
|
val_to_str(type, gre_typevals, "0x%04X (unknown)"));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2000-12-15 00:03:09 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R)
|
|
|
|
len += 4;
|
|
|
|
if (flags_and_ver & GH_B_K)
|
|
|
|
len += 4;
|
|
|
|
if (flags_and_ver & GH_B_S)
|
|
|
|
len += 4;
|
|
|
|
switch (type) {
|
1999-12-12 03:05:57 +00:00
|
|
|
|
2001-01-13 07:47:49 +00:00
|
|
|
case ETHERTYPE_PPP:
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_P_A)
|
1999-12-12 03:05:57 +00:00
|
|
|
len += 4;
|
2001-01-07 22:08:31 +00:00
|
|
|
is_ppp = TRUE;
|
|
|
|
break;
|
2006-03-24 07:09:35 +00:00
|
|
|
case ETHERTYPE_3GPP2:
|
2004-12-12 20:28:18 +00:00
|
|
|
case ETHERTYPE_CDMA2000_A10_UBS:
|
|
|
|
if (flags_and_ver & GH_P_A)
|
|
|
|
len += 4;
|
|
|
|
is_ppp = TRUE;
|
|
|
|
break;
|
2001-01-07 22:08:31 +00:00
|
|
|
|
|
|
|
case GRE_WCCP:
|
|
|
|
/* WCCP2 puts an extra 4 octets into the header, but uses the same
|
|
|
|
encapsulation type; if it looks as if the first octet of the packet
|
|
|
|
isn't the beginning of an IPv4 header, assume it's WCCP2. */
|
|
|
|
if ((tvb_get_guint8(tvb, offset + sizeof(flags_and_ver) + sizeof(type)) & 0xF0) != 0x40) {
|
1999-12-12 03:05:57 +00:00
|
|
|
len += 4;
|
2001-01-07 22:08:31 +00:00
|
|
|
is_wccp2 = TRUE;
|
1999-12-12 03:05:57 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
break;
|
|
|
|
}
|
1999-12-12 03:05:57 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (tree) {
|
2000-11-29 07:42:35 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_gre, tvb, offset, len,
|
1999-12-10 21:27:13 +00:00
|
|
|
"Generic Routing Encapsulation (%s)",
|
2007-12-16 22:46:42 +00:00
|
|
|
val_to_str(type, gre_typevals, "0x%04X - unknown"));
|
1999-12-10 21:27:13 +00:00
|
|
|
gre_tree = proto_item_add_subtree(ti, ett_gre);
|
2000-11-29 07:42:35 +00:00
|
|
|
add_flags_and_ver(gre_tree, flags_and_ver, tvb, offset, is_ppp);
|
2001-01-07 22:08:31 +00:00
|
|
|
}
|
|
|
|
offset += sizeof(flags_and_ver);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (tree) {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_uint(gre_tree, hf_gre_proto, tvb, offset, sizeof(type), type);
|
2001-01-07 22:08:31 +00:00
|
|
|
}
|
|
|
|
offset += sizeof(type);
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) {
|
|
|
|
if (tree) {
|
2000-12-15 00:03:09 +00:00
|
|
|
guint length, reported_length;
|
|
|
|
vec_t cksum_vec[1];
|
|
|
|
guint16 cksum, computed_cksum;
|
|
|
|
|
|
|
|
cksum = tvb_get_ntohs(tvb, offset);
|
|
|
|
length = tvb_length(tvb);
|
|
|
|
reported_length = tvb_reported_length(tvb);
|
|
|
|
if ((flags_and_ver & GH_B_C) && !pinfo->fragmented
|
|
|
|
&& length >= reported_length) {
|
|
|
|
/* The Checksum Present bit is set, and the packet isn't part of a
|
|
|
|
fragmented datagram and isn't truncated, so we can checksum it. */
|
|
|
|
|
|
|
|
cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, reported_length);
|
|
|
|
cksum_vec[0].len = reported_length;
|
|
|
|
computed_cksum = in_cksum(cksum_vec, 1);
|
|
|
|
if (computed_cksum == 0) {
|
2001-01-07 22:08:31 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
2005-07-08 22:11:13 +00:00
|
|
|
"Checksum: 0x%04x [correct]", cksum);
|
2000-12-15 00:03:09 +00:00
|
|
|
} else {
|
2001-01-07 22:08:31 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
2005-07-08 22:11:13 +00:00
|
|
|
"Checksum: 0x%04x [incorrect, should be 0x%04x]",
|
2000-12-15 00:03:09 +00:00
|
|
|
cksum, in_cksum_shouldbe(cksum, computed_cksum));
|
|
|
|
}
|
|
|
|
} else {
|
2001-01-07 22:08:31 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
2000-12-15 00:03:09 +00:00
|
|
|
"Checksum: 0x%04x", cksum);
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 2;
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) {
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
|
|
|
"Offset: %u", tvb_get_ntohs(tvb, offset));
|
|
|
|
}
|
|
|
|
offset += 2;
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_K) {
|
2005-04-14 09:29:23 +00:00
|
|
|
if (is_ppp && type!=ETHERTYPE_CDMA2000_A10_UBS) {
|
2001-01-07 22:08:31 +00:00
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
|
|
|
"Payload length: %u", tvb_get_ntohs(tvb, offset));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 2;
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 2,
|
|
|
|
"Call ID: %u", tvb_get_ntohs(tvb, offset));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 2;
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
else {
|
2004-09-23 17:15:26 +00:00
|
|
|
if (tree)
|
|
|
|
proto_tree_add_item(gre_tree, hf_gre_key, tvb, offset, 4, FALSE);
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_S) {
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 4,
|
|
|
|
"Sequence number: %u", tvb_get_ntohl(tvb, offset));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (is_ppp && flags_and_ver & GH_P_A) {
|
|
|
|
if (tree) {
|
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 4,
|
|
|
|
"Acknowledgement number: %u", tvb_get_ntohl(tvb, offset));
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += 4;
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-07 22:08:31 +00:00
|
|
|
if (flags_and_ver & GH_B_R) {
|
|
|
|
for (;;) {
|
|
|
|
sre_af = tvb_get_ntohs(tvb, offset);
|
|
|
|
if (tree) {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, sizeof(guint16),
|
1999-12-09 02:53:33 +00:00
|
|
|
"Address family: %u", sre_af);
|
2001-01-07 22:08:31 +00:00
|
|
|
}
|
|
|
|
offset += sizeof(guint16);
|
|
|
|
if (tree) {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, 1,
|
|
|
|
"SRE offset: %u", tvb_get_guint8(tvb, offset));
|
2001-01-07 22:08:31 +00:00
|
|
|
}
|
|
|
|
offset += sizeof(guint8);
|
|
|
|
sre_length = tvb_get_guint8(tvb, offset);
|
|
|
|
if (tree) {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(gre_tree, tvb, offset, sizeof(guint8),
|
1999-12-09 02:53:33 +00:00
|
|
|
"SRE length: %u", sre_length);
|
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
offset += sizeof(guint8);
|
|
|
|
if (sre_af == 0 && sre_length == 0)
|
|
|
|
break;
|
|
|
|
offset += sre_length;
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-01-07 22:08:31 +00:00
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
|
2001-01-13 07:47:49 +00:00
|
|
|
if (type == GRE_WCCP) {
|
|
|
|
if (is_wccp2) {
|
|
|
|
if (tree)
|
|
|
|
dissect_gre_wccp2_redirect_header(tvb, offset, gre_tree);
|
|
|
|
offset += 4;
|
|
|
|
}
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
2001-10-23 19:02:59 +00:00
|
|
|
|
2006-03-24 07:09:35 +00:00
|
|
|
if(type == ETHERTYPE_3GPP2) {
|
|
|
|
offset = dissect_gre_3gpp2_attribs(tvb, offset, gre_tree);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-10-23 19:02:59 +00:00
|
|
|
/* If the S bit is not set, this packet might not have a payload, so
|
|
|
|
check whether there's any data left, first.
|
|
|
|
|
|
|
|
XXX - the S bit isn't in RFC 2784, which deprecates that bit
|
|
|
|
and some other bits in RFC 1701 and says that they should be
|
|
|
|
zero for RFC 2784-compliant GRE; as such, the absence of the
|
|
|
|
S bit doesn't necessarily mean there's no payload. */
|
|
|
|
if (!(flags_and_ver & GH_B_S)) {
|
|
|
|
if (tvb_reported_length_remaining(tvb, offset) <= 0)
|
|
|
|
return; /* no payload */
|
|
|
|
}
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
2001-01-13 07:47:49 +00:00
|
|
|
if (!dissector_try_port(gre_dissector_table, type, next_tvb, pinfo, tree))
|
2001-11-25 22:51:14 +00:00
|
|
|
call_dissector(data_handle,next_tvb, pinfo, gre_tree);
|
1999-06-11 15:30:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2000-11-29 07:42:35 +00:00
|
|
|
add_flags_and_ver(proto_tree *tree, guint16 flags_and_ver, tvbuff_t *tvb,
|
|
|
|
int offset, int is_ppp)
|
|
|
|
{
|
1999-06-11 15:30:55 +00:00
|
|
|
proto_item * ti;
|
|
|
|
proto_tree * fv_tree;
|
|
|
|
int nbits = sizeof(flags_and_ver) * 8;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, 2,
|
1999-12-10 02:29:48 +00:00
|
|
|
"Flags and version: %#04x", flags_and_ver);
|
1999-11-16 11:44:20 +00:00
|
|
|
fv_tree = proto_item_add_subtree(ti, ett_gre_flags);
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_B_C, nbits,
|
|
|
|
"Checksum", "No checksum"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_B_R, nbits,
|
|
|
|
"Routing", "No routing"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_B_K, nbits,
|
|
|
|
"Key", "No key"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_B_S, nbits,
|
|
|
|
"Sequence number", "No sequence number"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_B_s, nbits,
|
|
|
|
"Strict source route", "No strict source route"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_numeric_bitfield(flags_and_ver, GH_B_RECUR, nbits,
|
|
|
|
"Recursion control: %u"));
|
|
|
|
if (is_ppp) {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_boolean_bitfield(flags_and_ver, GH_P_A, nbits,
|
|
|
|
"Acknowledgment number", "No acknowledgment number"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_numeric_bitfield(flags_and_ver, GH_P_FLAGS, nbits,
|
|
|
|
"Flags: %u"));
|
|
|
|
}
|
|
|
|
else {
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_numeric_bitfield(flags_and_ver, GH_R_FLAGS, nbits,
|
|
|
|
"Flags: %u"));
|
|
|
|
}
|
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(fv_tree, tvb, offset, sizeof(flags_and_ver), "%s",
|
1999-06-11 15:30:55 +00:00
|
|
|
decode_numeric_bitfield(flags_and_ver, GH_B_VER, nbits,
|
|
|
|
"Version: %u"));
|
|
|
|
}
|
2000-11-29 06:17:34 +00:00
|
|
|
|
|
|
|
static void
|
2000-11-29 07:42:35 +00:00
|
|
|
dissect_gre_wccp2_redirect_header(tvbuff_t *tvb, int offset, proto_tree *tree)
|
2000-11-29 06:17:34 +00:00
|
|
|
{
|
|
|
|
proto_item * ti;
|
|
|
|
proto_tree * rh_tree;
|
|
|
|
guint8 rh_flags;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
ti = proto_tree_add_text(tree, tvb, offset, 4, "Redirect header");
|
2000-11-29 06:17:34 +00:00
|
|
|
rh_tree = proto_item_add_subtree(ti, ett_gre_wccp2_redirect_header);
|
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
rh_flags = tvb_get_guint8(tvb, offset);
|
|
|
|
proto_tree_add_text(rh_tree, tvb, offset, 1, "%s",
|
2000-11-29 06:17:34 +00:00
|
|
|
decode_boolean_bitfield(rh_flags, 0x80, 8,
|
|
|
|
"Dynamic service", "Well-known service"));
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(rh_tree, tvb, offset, 1, "%s",
|
2000-11-29 06:17:34 +00:00
|
|
|
decode_boolean_bitfield(rh_flags, 0x40, 8,
|
|
|
|
"Alternative bucket used", "Alternative bucket not used"));
|
|
|
|
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(rh_tree, tvb, offset + 1, 1, "Service ID: %s",
|
|
|
|
val_to_str(tvb_get_guint8(tvb, offset + 1), service_id_vals, "Unknown (0x%02X)"));
|
2000-11-29 06:17:34 +00:00
|
|
|
if (rh_flags & 0x40)
|
2000-11-29 07:42:35 +00:00
|
|
|
proto_tree_add_text(rh_tree, tvb, offset + 2, 1, "Alternative bucket index: %u",
|
|
|
|
tvb_get_guint8(tvb, offset + 2));
|
|
|
|
proto_tree_add_text(rh_tree, tvb, offset + 3, 1, "Primary bucket index: %u",
|
|
|
|
tvb_get_guint8(tvb, offset + 3));
|
2000-11-29 06:17:34 +00:00
|
|
|
}
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
void
|
|
|
|
proto_register_gre(void)
|
|
|
|
{
|
1999-12-12 03:05:57 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_gre_proto,
|
2007-12-16 22:46:42 +00:00
|
|
|
{ "Protocol Type", "gre.proto", FT_UINT16, BASE_HEX, VALS(gre_typevals), 0x0,
|
2005-12-09 16:14:42 +00:00
|
|
|
"The protocol that is GRE encapsulated", HFILL }
|
1999-12-12 03:05:57 +00:00
|
|
|
},
|
2004-09-23 17:15:26 +00:00
|
|
|
{ &hf_gre_key,
|
2005-12-09 16:14:42 +00:00
|
|
|
{ "GRE Key", "gre.key", FT_UINT32, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2004-09-23 17:15:26 +00:00
|
|
|
},
|
2006-03-27 16:23:00 +00:00
|
|
|
{ &hf_gre_3ggp2_attrib_id,
|
|
|
|
{ "Type", "gre.ggp2_attrib_id", FT_UINT8, BASE_HEX, VALS(gre_3ggp2_attrib_id_vals), 0x7f,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_attrib_length,
|
|
|
|
{ "Length", "gre.ggp2_attrib_length", FT_UINT8, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_sdi,
|
2006-03-29 17:00:16 +00:00
|
|
|
{ "SDI/DOS", "gre.3ggp2_sdi", FT_BOOLEAN, 16, TFS(&gre_3ggp2_sdi_val), 0x8000,
|
|
|
|
"Short Data Indicator(SDI)/Data Over Signaling (DOS)", HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_fci,
|
|
|
|
{ "Flow Control Indicator", "gre.3ggp2_fci", FT_BOOLEAN, 16, TFS(&gre_3ggp2_fci_val), 0x8000,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_di,
|
|
|
|
{ "Duration Indicator", "gre.3ggp2_di", FT_BOOLEAN, 16, TFS(&gre_3ggp2_di_val), 0x4000,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_flow_disc,
|
|
|
|
{ "Flow ID", "gre.ggp2_flow_disc", FT_BYTES, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
|
|
|
{ &hf_gre_3ggp2_seg,
|
|
|
|
{ "Type", "gre.ggp2_3ggp2_seg", FT_UINT16, BASE_HEX, VALS(gre_3ggp2_seg_vals), 0xc000,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-03-27 16:23:00 +00:00
|
|
|
},
|
1999-12-12 03:05:57 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_gre,
|
1999-12-08 21:38:14 +00:00
|
|
|
&ett_gre_flags,
|
2000-11-29 06:17:34 +00:00
|
|
|
&ett_gre_wccp2_redirect_header,
|
2006-03-24 07:09:35 +00:00
|
|
|
&ett_3gpp2_attribs,
|
2006-03-29 17:00:16 +00:00
|
|
|
&ett_3gpp2_attr,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
1999-07-29 05:47:07 +00:00
|
|
|
|
2005-12-09 16:14:42 +00:00
|
|
|
proto_gre = proto_register_protocol("Generic Routing Encapsulation",
|
|
|
|
"GRE", "gre");
|
|
|
|
proto_register_field_array(proto_gre, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2001-01-13 07:47:49 +00:00
|
|
|
|
|
|
|
/* subdissector code */
|
2001-12-08 06:41:48 +00:00
|
|
|
gre_dissector_table = register_dissector_table("gre.proto",
|
2005-12-09 16:14:42 +00:00
|
|
|
"GRE protocol type", FT_UINT16, BASE_HEX);
|
1999-07-29 05:47:07 +00:00
|
|
|
}
|
2000-04-16 22:46:25 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_gre(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t gre_handle;
|
|
|
|
|
|
|
|
gre_handle = create_dissector_handle(dissect_gre, proto_gre);
|
|
|
|
dissector_add("ip.proto", IP_PROTO_GRE, gre_handle);
|
2001-11-25 22:51:14 +00:00
|
|
|
data_handle = find_dissector("data");
|
2000-04-16 22:46:25 +00:00
|
|
|
}
|