diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-10-18 21:00:01 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-10-18 21:00:01 +0000 |
commit | 27df774d0b8e57ae9ee7e5589d7e4cc9a54268e1 (patch) | |
tree | 6584b5fe66afe4a5adb5bda9211cf61ed2a3c6ce | |
parent | 5b99f89521eb3b4a08cc274163736b667a8e76cc (diff) | |
download | wireshark-27df774d0b8e57ae9ee7e5589d7e4cc9a54268e1.tar.gz wireshark-27df774d0b8e57ae9ee7e5589d7e4cc9a54268e1.tar.bz2 wireshark-27df774d0b8e57ae9ee7e5589d7e4cc9a54268e1.zip |
From Peter Fales: ARCNET support.
Sort the lists of dissectors in the DISSECTOR_SRC macros in
"Makefile.am" and "Makefile.nmake".
svn path=/trunk/; revision=6450
-rw-r--r-- | AUTHORS | 4 | ||||
-rw-r--r-- | Makefile.am | 14 | ||||
-rw-r--r-- | Makefile.nmake | 13 | ||||
-rw-r--r-- | arcnet_pids.h | 28 | ||||
-rw-r--r-- | doc/ethereal.pod.template | 1 | ||||
-rw-r--r-- | packet-arcnet.c | 185 | ||||
-rw-r--r-- | packet-arp.c | 4 | ||||
-rw-r--r-- | packet-ip.c | 4 | ||||
-rw-r--r-- | packet-ipx.c | 9 |
9 files changed, 247 insertions, 15 deletions
@@ -1468,6 +1468,10 @@ Jason House <jhouse [AT] mitre.org> { Win32 compilation fix for zlib builds } +Peter Fales <psfales [AT] lucent.com> { + ARCNET support +} + Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/Makefile.am b/Makefile.am index 50d244f916..dabebe7860 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ # Makefile.am # Automake file for Ethereal # -# $Id: Makefile.am,v 1.507 2002/10/09 00:48:10 jmayer Exp $ +# $Id: Makefile.am,v 1.508 2002/10/18 20:59:56 guy Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs <gerald@ethereal.com> @@ -89,6 +89,7 @@ DISSECTOR_SRC = \ packet-ajp13.c \ packet-aodv.c \ packet-aodv6.c \ + packet-arcnet.c \ packet-arp.c \ packet-asap.c \ packet-ascend.c\ @@ -114,6 +115,7 @@ DISSECTOR_SRC = \ packet-cups.c \ packet-data.c \ packet-dccp.c \ + packet-dcerpc.c \ packet-dcerpc-afs4int.c \ packet-dcerpc-bossvr.c \ packet-dcerpc-browser.c \ @@ -160,7 +162,6 @@ DISSECTOR_SRC = \ packet-dcerpc-ubikdisk.c \ packet-dcerpc-ubikvote.c \ packet-dcerpc-wkssvc.c \ - packet-dcerpc.c \ packet-ddtp.c \ packet-dec-bpdu.c \ packet-dhcpv6.c \ @@ -212,11 +213,11 @@ DISSECTOR_SRC = \ packet-irc.c \ packet-isakmp.c\ packet-iscsi.c \ + packet-isis.c \ packet-isis-clv.c \ packet-isis-hello.c \ packet-isis-lsp.c \ packet-isis-snp.c \ - packet-isis.c \ packet-isl.c \ packet-isup.c \ packet-iua.c \ @@ -265,8 +266,8 @@ DISSECTOR_SRC = \ packet-ntlmssp.c \ packet-ntp.c \ packet-null.c \ - packet-osi-options.c \ packet-osi.c \ + packet-osi-options.c \ packet-ospf.c \ packet-pcnfsd.c \ packet-pflog.c \ @@ -314,12 +315,12 @@ DISSECTOR_SRC = \ packet-slimp3.c \ packet-sll.c \ packet-slowprotocols.c \ + packet-smb.c \ packet-smb-browse.c \ packet-smb-common.c \ packet-smb-logon.c \ packet-smb-mailslot.c \ packet-smb-pipe.c \ - packet-smb.c \ packet-smpp.c \ packet-smtp.c \ packet-sna.c \ @@ -331,8 +332,8 @@ DISSECTOR_SRC = \ packet-srvloc.c \ packet-sscop.c \ packet-ssl.c \ - packet-stat-notify.c \ packet-stat.c \ + packet-stat-notify.c \ packet-sua.c \ packet-syslog.c \ packet-tacacs.c \ @@ -588,6 +589,7 @@ ETHEREAL_COMMON_SRC = \ afn.h \ aftypes.h \ alignment.h \ + arcnet_pids.h \ asn1.c \ asn1.h \ bridged_pids.h \ diff --git a/Makefile.nmake b/Makefile.nmake index c84de72ae9..d574b84df3 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -1,7 +1,7 @@ ## Makefile for building ethereal.exe with Microsoft C and nmake ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake # -# $Id: Makefile.nmake,v 1.242 2002/10/16 14:45:27 gerald Exp $ +# $Id: Makefile.nmake,v 1.243 2002/10/18 20:59:56 guy Exp $ include config.nmake include <win32.mak> @@ -32,6 +32,7 @@ DISSECTOR_SRC = \ packet-ajp13.c \ packet-aodv.c \ packet-aodv6.c \ + packet-arcnet.c \ packet-arp.c \ packet-asap.c \ packet-ascend.c\ @@ -95,8 +96,8 @@ DISSECTOR_SRC = \ packet-dcerpc-rs_replist.c \ packet-dcerpc-rs_unix.c \ packet-dcerpc-rsec_login.c \ - packet-dcerpc-secidmap.c \ packet-dcerpc-samr.c \ + packet-dcerpc-secidmap.c \ packet-dcerpc-spoolss.c \ packet-dcerpc-srvsvc.c \ packet-dcerpc-tapi.c \ @@ -225,9 +226,9 @@ DISSECTOR_SRC = \ packet-q931.c \ packet-qllc.c \ packet-quake.c \ - packet-quakeworld.c \ packet-quake2.c \ packet-quake3.c \ + packet-quakeworld.c \ packet-radius.c\ packet-ranap.c \ packet-raw.c \ @@ -267,9 +268,9 @@ DISSECTOR_SRC = \ packet-smtp.c \ packet-sna.c \ packet-snaeth.c \ - packet-spnego.c \ packet-snmp.c \ packet-socks.c \ + packet-spnego.c \ packet-spray.c \ packet-srvloc.c \ packet-sscop.c \ @@ -297,12 +298,12 @@ DISSECTOR_SRC = \ packet-vlan.c \ packet-vrrp.c \ packet-vtp.c \ + packet-wap.c \ packet-wccp.c \ packet-wcp.c \ packet-who.c \ - packet-wap.c \ - packet-wtls.c \ packet-wsp.c \ + packet-wtls.c \ packet-wtp.c \ packet-x11.c \ packet-x25.c \ diff --git a/arcnet_pids.h b/arcnet_pids.h new file mode 100644 index 0000000000..a9e4e999b0 --- /dev/null +++ b/arcnet_pids.h @@ -0,0 +1,28 @@ +/* arcnet_pids.h + * ARCNET protocol ID values + * Copyright 2001-2002, Peter Fales <ethereal@fales-lorenz.net> + * + * $Id: arcnet_pids.h,v 1.1 2002/10/18 20:59:57 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * 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. + * + * 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. + * + * 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. + */ + +#define ARCNET_PROTO_IP 0xd4 +#define ARCNET_PROTO_ARP 0xd5 +#define ARCNET_PROTO_IPX 0xfa diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template index 64dafca8d3..1db146213f 100644 --- a/doc/ethereal.pod.template +++ b/doc/ethereal.pod.template @@ -1544,6 +1544,7 @@ B<http://www.ethereal.com>. Lutz Jaenicke <Lutz.Jaenicke [AT] aet.TU-Cottbus.DE> Senthil Kumar Nagappan <sknagappan [AT] yahoo.com> Jason House <jhouse [AT] mitre.org> + Peter Fales <psfales [AT] lucent.com> Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/packet-arcnet.c b/packet-arcnet.c new file mode 100644 index 0000000000..72043512c9 --- /dev/null +++ b/packet-arcnet.c @@ -0,0 +1,185 @@ +/* packet-arcnet.c + * Routines for arcnet dissection + * Copyright 2001-2002, Peter Fales <ethereal@fales-lorenz.net> + * + * $Id: packet-arcnet.c,v 1.1 2002/10/18 20:59:57 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * 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. + * + * 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. + * + * 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 <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif + +#include <glib.h> + +#ifdef NEED_SNPRINTF_H +# include "snprintf.h" +#endif + +#include <epan/packet.h> +#if 0 +#include "packet-ip.h" +#endif +#include "arcnet_pids.h" + +/* Initialize the protocol and registered fields */ +static int proto_arcnet = -1; +static int hf_arcnet_src = -1; +static int hf_arcnet_dst = -1; +static int hf_arcnet_protID = -1; + +/* Initialize the subtree pointers */ +static gint ett_arcnet = -1; + +static dissector_table_t arcnet_dissector_table; +static dissector_handle_t data_handle; + +/* Code to actually dissect the packets */ +static void +dissect_arcnet (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) +{ + guint8 dst, src, protID; + tvbuff_t *next_tvb; + +/* Set up structures needed to add the protocol subtree and manage it */ + proto_item *ti; + proto_tree *arcnet_tree; + +/* Make entries in Protocol column and Info column on summary display */ + if (check_col (pinfo->cinfo, COL_PROTOCOL)) + col_set_str (pinfo->cinfo, COL_PROTOCOL, "ARCNET"); + + if (check_col (pinfo->cinfo, COL_INFO)) + col_set_str (pinfo->cinfo, COL_INFO, "ARCNET"); + + src = tvb_get_guint8 (tvb, 0); + dst = tvb_get_guint8 (tvb, 1); + protID = tvb_get_guint8 (tvb, 4); + +/* In the interest of speed, if "tree" is NULL, don't do any work not + necessary to generate protocol tree items. */ + if (tree) + { + +/* create display subtree for the protocol */ + ti = + proto_tree_add_item (tree, proto_arcnet, tvb, 0, tvb_length (tvb), + FALSE); + + arcnet_tree = proto_item_add_subtree (ti, ett_arcnet); + + proto_tree_add_uint (tree, hf_arcnet_src, tvb, 0, 1, src); + proto_tree_add_uint (tree, hf_arcnet_dst, tvb, 1, 1, dst); + proto_tree_add_uint (tree, hf_arcnet_protID, tvb, 4, 1, protID); + } + +/* If this protocol has a sub-dissector call it here, see section 1.8 */ + + next_tvb = tvb_new_subset (tvb, 8, -1, -1); + + if (!dissector_try_port (arcnet_dissector_table, protID, + next_tvb, pinfo, tree)) + { + if (check_col (pinfo->cinfo, COL_PROTOCOL)) + { + col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", protID); + } + call_dissector (data_handle, next_tvb, pinfo, tree); + } + +} + + +/* Register the protocol with Ethereal */ + +/* this format is require because a script is used to build the C function + that calls all the protocol registration. +*/ + +static const value_string arcnet_prot_id_vals[] = { + {ARCNET_PROTO_IP, "IP packet"}, + {ARCNET_PROTO_ARP, "ARP packet"}, + {ARCNET_PROTO_IPX, "IPX packet"}, + {0, NULL} +}; + +void +proto_register_arcnet (void) +{ + +/* Setup list of header fields See Section 1.6.1 for details*/ + static hf_register_info hf[] = { + {&hf_arcnet_src, + {"Source", "arcnet.src", + FT_UINT8, BASE_HEX, NULL, 0, + "Source ID", HFILL} + }, + {&hf_arcnet_dst, + {"Dest", "arcnet.dst", + FT_UINT8, BASE_HEX, NULL, 0, + "Dest ID", HFILL} + }, + {&hf_arcnet_protID, + {"Protocol ID", "arcnet.protID", + FT_UINT8, BASE_HEX, VALS(arcnet_prot_id_vals), 0, + "Proto type", HFILL} + }, + }; + +/* Setup protocol subtree array */ + static gint *ett[] = { + &ett_arcnet, + }; + + arcnet_dissector_table = register_dissector_table ("arcnet.protocol_id", + "ARCNET Protocol ID", + FT_UINT8, BASE_HEX); + +/* Register the protocol name and description */ + proto_arcnet = proto_register_protocol ("ARCNET", "ARCNET", "arcnet"); + +/* Required function calls to register the header fields and subtrees used */ + proto_register_field_array (proto_arcnet, hf, array_length (hf)); + proto_register_subtree_array (ett, array_length (ett)); +} + + +void +proto_reg_handoff_arcnet (void) +{ + dissector_handle_t arcnet_handle; + + arcnet_handle = create_dissector_handle (dissect_arcnet, proto_arcnet); + + dissector_add ("wtap_encap", WTAP_ENCAP_ARCNET, arcnet_handle); + data_handle = find_dissector ("data"); +} diff --git a/packet-arp.c b/packet-arp.c index 2093764e1c..45b73dfe76 100644 --- a/packet-arp.c +++ b/packet-arp.c @@ -1,7 +1,7 @@ /* packet-arp.c * Routines for ARP packet disassembly * - * $Id: packet-arp.c,v 1.53 2002/08/28 21:00:07 jmayer Exp $ + * $Id: packet-arp.c,v 1.54 2002/10/18 20:59:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -33,6 +33,7 @@ #include <epan/resolv.h> #include "packet-arp.h" #include "etypes.h" +#include "arcnet_pids.h" static int proto_arp = -1; static int hf_arp_hard_type = -1; @@ -994,4 +995,5 @@ proto_reg_handoff_arp(void) arp_handle = create_dissector_handle(dissect_arp, proto_arp); dissector_add("ethertype", ETHERTYPE_ARP, arp_handle); dissector_add("ethertype", ETHERTYPE_REVARP, arp_handle); + dissector_add("arcnet.protocol_id", ARCNET_PROTO_ARP, arp_handle); } diff --git a/packet-ip.c b/packet-ip.c index 06c70c1bed..9ec5ce89d0 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.173 2002/08/28 21:00:17 jmayer Exp $ + * $Id: packet-ip.c,v 1.174 2002/10/18 20:59:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -44,6 +44,7 @@ #include "ppptypes.h" #include "llcsaps.h" #include "aftypes.h" +#include "arcnet_pids.h" #include "packet-ip.h" #include "packet-ipsec.h" #include "in_cksum.h" @@ -1753,6 +1754,7 @@ proto_reg_handoff_ip(void) dissector_add("chdlctype", ETHERTYPE_IP, ip_handle); dissector_add("fr.ietf", NLPID_IP, ip_handle); dissector_add("x.25.spi", NLPID_IP, ip_handle); + dissector_add("arcnet.protocol_id", ARCNET_PROTO_IP, ip_handle); } void diff --git a/packet-ipx.c b/packet-ipx.c index 142639dc33..ca01159c36 100644 --- a/packet-ipx.c +++ b/packet-ipx.c @@ -2,7 +2,7 @@ * Routines for NetWare's IPX * Gilbert Ramirez <gram@alumni.rice.edu> * - * $Id: packet-ipx.c,v 1.114 2002/10/15 04:30:58 guy Exp $ + * $Id: packet-ipx.c,v 1.115 2002/10/18 20:59:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -37,6 +37,7 @@ #include "ppptypes.h" #include "llcsaps.h" #include "aftypes.h" +#include "arcnet_pids.h" /* The information in this module (IPX, SPX, NCP) comes from: NetWare LAN Analysis, Second Edition @@ -1078,14 +1079,20 @@ proto_reg_handoff_ipx(void) dissector_add("llc.dsap", SAP_NETWARE, ipx_handle); dissector_add("null.type", BSD_AF_IPX, ipx_handle); dissector_add("gre.proto", ETHERTYPE_IPX, ipx_handle); + dissector_add("arcnet.protocol_id", ARCNET_PROTO_IPX, ipx_handle); + spx_handle = create_dissector_handle(dissect_spx, proto_spx); dissector_add("ipx.packet_type", IPX_PACKET_TYPE_SPX, spx_handle); + ipxsap_handle = find_dissector("ipxsap"); dissector_add("ipx.socket", IPX_SOCKET_SAP, ipxsap_handle); + ipxrip_handle = create_dissector_handle(dissect_ipxrip, proto_ipxrip); dissector_add("ipx.socket", IPX_SOCKET_IPXRIP, ipxrip_handle); + ipxmsg_handle = create_dissector_handle(dissect_ipxmsg, proto_ipxmsg); dissector_add("ipx.socket", IPX_SOCKET_IPX_MESSAGE, ipxmsg_handle); dissector_add("ipx.socket", IPX_SOCKET_IPX_MESSAGE1, ipxmsg_handle); + data_handle = find_dissector("data"); } |