1998-10-10 03:32:20 +00:00
|
|
|
/* packet-fddi.c
|
|
|
|
* Routines for FDDI packet disassembly
|
|
|
|
*
|
2006-07-04 00:58:08 +00:00
|
|
|
* ANSI Standard X3T9.5/88-139, Rev 4.0
|
|
|
|
*
|
|
|
|
* ISO Standards 9314-N (N = 1 for PHY, N = 2 for MAC, N = 6 for SMT, etc.)
|
|
|
|
*
|
2003-01-26 19:35:31 +00:00
|
|
|
* Laurent Deniel <laurent.deniel@free.fr>
|
1998-10-10 03:32:20 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
1998-10-10 03:32:20 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1998-10-10 03:32:20 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1998-10-10 03:32:20 +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
|
|
|
*
|
1998-10-10 03:32:20 +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
|
|
|
*
|
1998-10-10 03:32:20 +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
|
|
|
|
|
1999-08-24 06:01:45 +00:00
|
|
|
#include <stdio.h>
|
2000-11-17 21:00:40 +00:00
|
|
|
#include <string.h>
|
1999-03-23 03:14:46 +00:00
|
|
|
#include <glib.h>
|
2002-01-21 07:37:49 +00:00
|
|
|
#include <epan/bitswap.h>
|
|
|
|
#include <epan/packet.h>
|
2004-09-27 22:55:15 +00:00
|
|
|
#include <epan/prefs.h>
|
2000-05-19 05:29:44 +00:00
|
|
|
#include "packet-fddi.h"
|
2000-02-15 21:06:58 +00:00
|
|
|
#include "packet-llc.h"
|
2004-09-29 00:06:36 +00:00
|
|
|
#include <epan/tap.h>
|
2003-06-10 19:34:36 +00:00
|
|
|
|
2004-08-06 19:57:49 +00:00
|
|
|
#include <epan/addr_resolv.h>
|
1998-10-10 03:32:20 +00:00
|
|
|
|
1999-07-29 05:47:07 +00:00
|
|
|
static int proto_fddi = -1;
|
|
|
|
static int hf_fddi_fc = -1;
|
2001-07-03 01:23:21 +00:00
|
|
|
static int hf_fddi_fc_clf = -1;
|
|
|
|
static int hf_fddi_fc_prio = -1;
|
|
|
|
static int hf_fddi_fc_smt_subtype = -1;
|
|
|
|
static int hf_fddi_fc_mac_subtype = -1;
|
1999-07-29 05:47:07 +00:00
|
|
|
static int hf_fddi_dst = -1;
|
|
|
|
static int hf_fddi_src = -1;
|
2000-03-20 22:22:45 +00:00
|
|
|
static int hf_fddi_addr = -1;
|
1999-07-07 22:52:57 +00:00
|
|
|
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint ett_fddi = -1;
|
2001-07-03 01:23:21 +00:00
|
|
|
static gint ett_fddi_fc = -1;
|
1999-11-16 11:44:20 +00:00
|
|
|
|
2003-08-29 10:59:12 +00:00
|
|
|
static int fddi_tap = -1;
|
|
|
|
|
2003-06-10 19:34:36 +00:00
|
|
|
static gboolean fddi_padding = FALSE;
|
|
|
|
|
|
|
|
#define FDDI_PADDING ((fddi_padding) ? 3 : 0)
|
|
|
|
|
1998-10-10 03:32:20 +00:00
|
|
|
/* FDDI Frame Control values */
|
|
|
|
|
|
|
|
#define FDDI_FC_VOID 0x00 /* Void frame */
|
|
|
|
#define FDDI_FC_NRT 0x80 /* Nonrestricted token */
|
|
|
|
#define FDDI_FC_RT 0xc0 /* Restricted token */
|
|
|
|
#define FDDI_FC_MAC 0xc0 /* MAC frame */
|
|
|
|
#define FDDI_FC_SMT 0x40 /* SMT frame */
|
|
|
|
#define FDDI_FC_SMT_INFO 0x41 /* SMT Info */
|
|
|
|
#define FDDI_FC_SMT_NSA 0x4F /* SMT Next station adrs */
|
|
|
|
#define FDDI_FC_SMT_MIN FDDI_FC_SMT_INFO
|
|
|
|
#define FDDI_FC_SMT_MAX FDDI_FC_SMT_NSA
|
|
|
|
#define FDDI_FC_MAC_MIN 0xc1
|
|
|
|
#define FDDI_FC_MAC_BEACON 0xc2 /* MAC Beacon frame */
|
|
|
|
#define FDDI_FC_MAC_CLAIM 0xc3 /* MAC Claim frame */
|
|
|
|
#define FDDI_FC_MAC_MAX 0xcf
|
|
|
|
#define FDDI_FC_LLC_ASYNC 0x50 /* Async. LLC frame */
|
|
|
|
#define FDDI_FC_LLC_ASYNC_MIN FDDI_FC_LLC_ASYNC
|
|
|
|
#define FDDI_FC_LLC_ASYNC_DEF 0x54
|
|
|
|
#define FDDI_FC_LLC_ASYNC_MAX 0x5f
|
|
|
|
#define FDDI_FC_LLC_SYNC 0xd0 /* Sync. LLC frame */
|
|
|
|
#define FDDI_FC_LLC_SYNC_MIN FDDI_FC_LLC_SYNC
|
|
|
|
#define FDDI_FC_LLC_SYNC_MAX 0xd7
|
|
|
|
#define FDDI_FC_IMP_ASYNC 0x60 /* Implementor Async. */
|
|
|
|
#define FDDI_FC_IMP_ASYNC_MIN FDDI_FC_IMP_ASYNC
|
|
|
|
#define FDDI_FC_IMP_ASYNC_MAX 0x6f
|
|
|
|
#define FDDI_FC_IMP_SYNC 0xe0 /* Implementor Synch. */
|
|
|
|
|
1999-08-24 06:01:45 +00:00
|
|
|
#define FDDI_FC_CLFF 0xF0 /* Class/Length/Format bits */
|
|
|
|
#define FDDI_FC_ZZZZ 0x0F /* Control bits */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Async frame ZZZZ bits:
|
|
|
|
*/
|
|
|
|
#define FDDI_FC_ASYNC_R 0x08 /* Reserved */
|
|
|
|
#define FDDI_FC_ASYNC_PRI 0x07 /* Priority */
|
|
|
|
|
2001-07-03 01:23:21 +00:00
|
|
|
#define CLFF_BITS(fc) (((fc) & FDDI_FC_CLFF) >> 4)
|
|
|
|
#define ZZZZ_BITS(fc) ((fc) & FDDI_FC_ZZZZ)
|
|
|
|
|
|
|
|
static const value_string clf_vals[] = {
|
|
|
|
{ CLFF_BITS(FDDI_FC_VOID), "Void" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_SMT), "SMT" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_LLC_ASYNC), "Async LLC" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_IMP_ASYNC), "Implementor Async" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_NRT), "Nonrestricted Token" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_MAC), "MAC" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_LLC_SYNC), "Sync LLC" },
|
|
|
|
{ CLFF_BITS(FDDI_FC_IMP_SYNC), "Implementor Sync" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string smt_subtype_vals[] = {
|
|
|
|
{ ZZZZ_BITS(FDDI_FC_SMT_INFO), "Info" },
|
|
|
|
{ ZZZZ_BITS(FDDI_FC_SMT_NSA), "Next Station Address" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string mac_subtype_vals[] = {
|
|
|
|
{ ZZZZ_BITS(FDDI_FC_MAC_BEACON), "Beacon" },
|
|
|
|
{ ZZZZ_BITS(FDDI_FC_MAC_CLAIM), "Claim" },
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
1998-10-10 03:32:20 +00:00
|
|
|
#define FDDI_HEADER_SIZE 13
|
|
|
|
|
|
|
|
/* field positions */
|
|
|
|
|
|
|
|
#define FDDI_P_FC 0
|
|
|
|
#define FDDI_P_DHOST 1
|
|
|
|
#define FDDI_P_SHOST 7
|
|
|
|
|
2001-01-03 10:34:42 +00:00
|
|
|
static dissector_handle_t llc_handle;
|
2001-11-26 01:03:35 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2001-01-03 10:34:42 +00:00
|
|
|
|
1999-07-07 22:52:57 +00:00
|
|
|
static void
|
2002-12-02 23:43:30 +00:00
|
|
|
swap_mac_addr(guint8 *swapped_addr, const guint8 *orig_addr)
|
1999-07-07 22:52:57 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) {
|
Move the table of bit-swapped byte values to "epan/bitswap.c", and
declare it, and define a "BIT_SWAP" macro that uses it, in
"epan/bitswap.h".
Use that macro to bit-swap bytes in the IEEE 802.11 dissector, rather
than the macro that was used (said macro used GCCisms and didn't compile
on Windows).
Make an "init_plugin()" routine to enable a plugin and call its init
routine, and call it from "check_plugin_status()" and
"plugins_enable_cb()", rather than having very similar code in two
places; "patable" is now part of libethereal, and, at least on Windows,
attempts to refer to it from "libui" failed. Make "patable" static to
"epan/plugins.c". (This may still not work, as now "libui" is calling a
routine in "libethereal"; if that fails, perhaps it's time to get rid of
the "enable/disable plugins" stuff completely, as new-style plugins, at
least, register themselves as protocols and should be controllable from
the "Edit->Protocols" window just as built-in dissectors are.)
svn path=/trunk/; revision=2649
2000-11-15 09:37:53 +00:00
|
|
|
swapped_addr[i] = BIT_SWAP(orig_addr[i]);
|
1999-07-07 22:52:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-02-09 00:35:38 +00:00
|
|
|
void
|
2002-08-02 23:36:07 +00:00
|
|
|
capture_fddi(const guchar *pd, int len, packet_counts *ld)
|
2000-01-23 08:55:37 +00:00
|
|
|
{
|
1999-02-09 00:35:38 +00:00
|
|
|
int offset = 0, fc;
|
|
|
|
|
2003-06-10 19:34:36 +00:00
|
|
|
if (!BYTES_ARE_IN_FRAME(0, len, FDDI_HEADER_SIZE + FDDI_PADDING)) {
|
1999-02-09 00:35:38 +00:00
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
}
|
2003-06-10 19:34:36 +00:00
|
|
|
offset = FDDI_PADDING + FDDI_HEADER_SIZE;
|
1999-02-09 00:35:38 +00:00
|
|
|
|
2003-06-10 19:34:36 +00:00
|
|
|
fc = (int) pd[FDDI_P_FC+FDDI_PADDING];
|
1999-02-09 00:35:38 +00:00
|
|
|
|
|
|
|
switch (fc) {
|
|
|
|
|
|
|
|
/* From now, only 802.2 SNAP (Async. LCC frame) is supported */
|
|
|
|
|
|
|
|
case FDDI_FC_LLC_ASYNC + 0 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 1 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 2 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 3 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 4 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 5 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 6 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 7 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 8 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 9 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 10 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 11 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 12 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 13 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 14 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 15 :
|
2001-11-20 21:59:18 +00:00
|
|
|
capture_llc(pd, offset, len, ld);
|
1999-02-09 00:35:38 +00:00
|
|
|
return;
|
|
|
|
default :
|
|
|
|
ld->other++;
|
|
|
|
return;
|
|
|
|
|
|
|
|
} /* fc */
|
|
|
|
|
|
|
|
} /* capture_fddi */
|
|
|
|
|
2005-07-30 01:01:02 +00:00
|
|
|
static const gchar *
|
1999-08-24 06:01:45 +00:00
|
|
|
fddifc_to_str(int fc)
|
|
|
|
{
|
|
|
|
static gchar strbuf[128+1];
|
|
|
|
|
|
|
|
switch (fc) {
|
|
|
|
|
|
|
|
case FDDI_FC_VOID: /* Void frame */
|
|
|
|
return "Void frame";
|
|
|
|
|
|
|
|
case FDDI_FC_NRT: /* Nonrestricted token */
|
|
|
|
return "Nonrestricted token";
|
|
|
|
|
|
|
|
case FDDI_FC_RT: /* Restricted token */
|
|
|
|
return "Restricted token";
|
|
|
|
|
|
|
|
case FDDI_FC_SMT_INFO: /* SMT Info */
|
|
|
|
return "SMT info";
|
|
|
|
|
|
|
|
case FDDI_FC_SMT_NSA: /* SMT Next station adrs */
|
|
|
|
return "SMT Next station address";
|
|
|
|
|
|
|
|
case FDDI_FC_MAC_BEACON: /* MAC Beacon frame */
|
|
|
|
return "MAC beacon";
|
|
|
|
|
|
|
|
case FDDI_FC_MAC_CLAIM: /* MAC Claim frame */
|
|
|
|
return "MAC claim token";
|
|
|
|
|
|
|
|
default:
|
|
|
|
switch (fc & FDDI_FC_CLFF) {
|
|
|
|
|
|
|
|
case FDDI_FC_MAC:
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "MAC frame, control %x", fc & FDDI_FC_ZZZZ);
|
1999-08-24 06:01:45 +00:00
|
|
|
return strbuf;
|
|
|
|
|
|
|
|
case FDDI_FC_SMT:
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "SMT frame, control %x", fc & FDDI_FC_ZZZZ);
|
1999-08-24 06:01:45 +00:00
|
|
|
return strbuf;
|
|
|
|
|
|
|
|
case FDDI_FC_LLC_ASYNC:
|
|
|
|
if (fc & FDDI_FC_ASYNC_R)
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
1999-08-24 06:01:45 +00:00
|
|
|
else
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "Async LLC frame, priority %d",
|
1999-08-24 06:01:45 +00:00
|
|
|
fc & FDDI_FC_ASYNC_PRI);
|
|
|
|
return strbuf;
|
|
|
|
|
|
|
|
case FDDI_FC_LLC_SYNC:
|
|
|
|
if (fc & FDDI_FC_ZZZZ) {
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "Sync LLC frame, control %x", fc & FDDI_FC_ZZZZ);
|
1999-08-24 06:01:45 +00:00
|
|
|
return strbuf;
|
|
|
|
} else
|
|
|
|
return "Sync LLC frame";
|
|
|
|
|
|
|
|
case FDDI_FC_IMP_ASYNC:
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "Implementor async frame, control %x",
|
1999-08-24 06:01:45 +00:00
|
|
|
fc & FDDI_FC_ZZZZ);
|
|
|
|
return strbuf;
|
|
|
|
|
|
|
|
case FDDI_FC_IMP_SYNC:
|
2005-08-18 19:31:15 +00:00
|
|
|
g_snprintf(strbuf, sizeof(strbuf), "Implementor sync frame, control %x",
|
1999-08-24 06:01:45 +00:00
|
|
|
fc & FDDI_FC_ZZZZ);
|
|
|
|
return strbuf;
|
|
|
|
|
|
|
|
default:
|
1999-09-10 04:53:14 +00:00
|
|
|
return "Unknown frame type";
|
1999-08-24 06:01:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-29 05:16:15 +00:00
|
|
|
|
|
|
|
static void
|
2000-05-11 08:18:09 +00:00
|
|
|
dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
Add a new Wiretap encapsulation type WTAP_ENCAP_FDDI_BITSWAPPED, meaning
"FDDI with the MAC addresses bit-swapped"; whether the MAC addresses are
bit-swapped is a property of the machine on which the capture was taken,
not of the machine on which the capture is being read - right now, none
of the capture file formats we read indicate whether FDDI MAC addresses
are bit-swapped, but this does let us treat non-"libpcap" captures as
being bit-swapped or not bit-swapped independent of the machine on which
they're being read (and of the machine on which they were captured, but
I have the impression they're bit-swapped on most platforms), and allows
us to, if, as, and when we implement packet capture in Wiretap, mark
packets in a capture file written in Wiretap-native format based on the
machine on which they are captured (assuming the rule "Ultrix, Alpha,
and BSD/OS are the only platforms that don't bit-swap", or some other
compile-time rule, gets the right answer, or that some platform has
drivers that can tell us whether the addresses are bit-swapped).
(NOTE: if, for any of the capture file formats used only on one
platform, FDDI MAC addresses aren't bit-swapped, the code to read that
capture file format should be fixed to flag them as not bit-swapped.)
Use the encapsulation type to decide whether to bit-swap addresses in
"dissect_fddi()".
svn path=/trunk/; revision=557
1999-08-24 03:19:34 +00:00
|
|
|
gboolean bitswapped)
|
1998-10-13 07:48:03 +00:00
|
|
|
{
|
2000-05-28 22:02:17 +00:00
|
|
|
proto_tree *fh_tree = NULL;
|
2008-05-15 01:44:53 +00:00
|
|
|
proto_item *ti, *hidden_item;
|
2005-07-30 01:01:02 +00:00
|
|
|
const gchar *fc_str;
|
2001-07-03 01:23:21 +00:00
|
|
|
proto_tree *fc_tree;
|
2002-08-02 23:36:07 +00:00
|
|
|
static guchar src[6], dst[6];
|
|
|
|
guchar src_swapped[6], dst_swapped[6];
|
2000-05-11 08:18:09 +00:00
|
|
|
tvbuff_t *next_tvb;
|
2003-08-29 10:59:12 +00:00
|
|
|
static fddi_hdr fddihdrs[4];
|
|
|
|
static int fddihdr_num=0;
|
|
|
|
fddi_hdr *fddihdr;
|
|
|
|
|
|
|
|
fddihdr_num++;
|
|
|
|
if(fddihdr_num>=4){
|
|
|
|
fddihdr_num=0;
|
|
|
|
}
|
|
|
|
fddihdr=&fddihdrs[fddihdr_num];
|
1998-10-10 03:32:20 +00:00
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FDDI");
|
1998-10-10 03:32:20 +00:00
|
|
|
|
2003-08-29 10:59:12 +00:00
|
|
|
fddihdr->fc = tvb_get_guint8(tvb, FDDI_P_FC + FDDI_PADDING);
|
|
|
|
fc_str = fddifc_to_str(fddihdr->fc);
|
1998-10-10 03:32:20 +00:00
|
|
|
|
2001-12-10 00:26:21 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_str(pinfo->cinfo, COL_INFO, fc_str);
|
2000-05-11 16:52:15 +00:00
|
|
|
|
2000-05-28 22:02:17 +00:00
|
|
|
if (tree) {
|
2003-06-10 19:34:36 +00:00
|
|
|
ti = proto_tree_add_protocol_format(tree, proto_fddi, tvb, 0, FDDI_HEADER_SIZE+FDDI_PADDING,
|
2000-05-28 22:02:17 +00:00
|
|
|
"Fiber Distributed Data Interface, %s", fc_str);
|
|
|
|
fh_tree = proto_item_add_subtree(ti, ett_fddi);
|
2003-08-29 10:59:12 +00:00
|
|
|
ti = proto_tree_add_uint_format(fh_tree, hf_fddi_fc, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc,
|
|
|
|
"Frame Control: 0x%02x (%s)", fddihdr->fc, fc_str);
|
2001-07-03 01:23:21 +00:00
|
|
|
fc_tree = proto_item_add_subtree(ti, ett_fddi_fc);
|
2003-08-29 10:59:12 +00:00
|
|
|
proto_tree_add_uint(fc_tree, hf_fddi_fc_clf, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc);
|
|
|
|
switch ((fddihdr->fc) & FDDI_FC_CLFF) {
|
2001-07-03 01:23:21 +00:00
|
|
|
|
|
|
|
case FDDI_FC_SMT:
|
2003-08-29 10:59:12 +00:00
|
|
|
proto_tree_add_uint(fc_tree, hf_fddi_fc_smt_subtype, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc);
|
2001-07-03 01:23:21 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FDDI_FC_MAC:
|
2003-08-29 10:59:12 +00:00
|
|
|
if (fddihdr->fc != FDDI_FC_RT)
|
|
|
|
proto_tree_add_uint(fc_tree, hf_fddi_fc_mac_subtype, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc);
|
2001-07-03 01:23:21 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FDDI_FC_LLC_ASYNC:
|
2003-08-29 10:59:12 +00:00
|
|
|
if (!((fddihdr->fc) & FDDI_FC_ASYNC_R))
|
|
|
|
proto_tree_add_uint(fc_tree, hf_fddi_fc_prio, tvb, FDDI_P_FC + FDDI_PADDING, 1, fddihdr->fc);
|
2001-07-03 01:23:21 +00:00
|
|
|
break;
|
|
|
|
}
|
2000-05-28 22:02:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Extract the destination address, possibly bit-swapping it. */
|
|
|
|
if (bitswapped)
|
2003-06-10 19:34:36 +00:00
|
|
|
swap_mac_addr(dst, tvb_get_ptr(tvb, FDDI_P_DHOST + FDDI_PADDING, 6));
|
2000-05-28 22:02:17 +00:00
|
|
|
else
|
2003-06-10 19:34:36 +00:00
|
|
|
memcpy(dst, tvb_get_ptr(tvb, FDDI_P_DHOST + FDDI_PADDING, 6), sizeof dst);
|
|
|
|
swap_mac_addr(dst_swapped, tvb_get_ptr(tvb, FDDI_P_DHOST + FDDI_PADDING, 6));
|
2000-05-28 22:02:17 +00:00
|
|
|
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
/* XXX - copy them to some buffer associated with "pi", rather than
|
2000-05-28 22:02:17 +00:00
|
|
|
just making "dst" static? */
|
2001-07-03 04:56:46 +00:00
|
|
|
SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, &dst[0]);
|
|
|
|
SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, &dst[0]);
|
2003-08-29 10:59:12 +00:00
|
|
|
SET_ADDRESS(&fddihdr->dst, AT_ETHER, 6, &dst[0]);
|
Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.
"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.
Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.
Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure. Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).
Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port. (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)
Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:
if nothing is found, creates a new entry in the hash table, and
assigns it a unique 32-bit conversation ID, and returns that
conversation ID;
if an entry is found, returns its conversation ID.
Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations. We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID. Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.
This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).
In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.
svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
|
|
|
|
2000-05-28 22:02:17 +00:00
|
|
|
if (fh_tree) {
|
2003-06-10 19:34:36 +00:00
|
|
|
proto_tree_add_ether(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST + FDDI_PADDING, 6, dst);
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST + FDDI_PADDING, 6, dst);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
1998-10-10 03:32:20 +00:00
|
|
|
|
2000-05-28 22:02:17 +00:00
|
|
|
/* hide some bit-swapped mac address fields in the proto_tree, just in case */
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_dst, tvb, FDDI_P_DHOST + FDDI_PADDING, 6, dst_swapped);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_addr, tvb, FDDI_P_DHOST + FDDI_PADDING, 6, dst_swapped);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
2000-05-28 22:02:17 +00:00
|
|
|
}
|
1998-10-10 03:32:20 +00:00
|
|
|
|
2000-05-28 22:02:17 +00:00
|
|
|
/* Extract the source address, possibly bit-swapping it. */
|
|
|
|
if (bitswapped)
|
2003-06-10 19:34:36 +00:00
|
|
|
swap_mac_addr(src, tvb_get_ptr(tvb, FDDI_P_SHOST + FDDI_PADDING, 6));
|
2000-05-28 22:02:17 +00:00
|
|
|
else
|
2003-06-10 19:34:36 +00:00
|
|
|
memcpy(src, tvb_get_ptr(tvb, FDDI_P_SHOST + FDDI_PADDING, 6), sizeof src);
|
|
|
|
swap_mac_addr(src_swapped, tvb_get_ptr(tvb, FDDI_P_SHOST + FDDI_PADDING, 6));
|
2000-05-28 22:02:17 +00:00
|
|
|
|
|
|
|
/* XXX - copy them to some buffer associated with "pi", rather than
|
|
|
|
just making "src" static? */
|
2001-07-03 04:56:46 +00:00
|
|
|
SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, &src[0]);
|
|
|
|
SET_ADDRESS(&pinfo->src, AT_ETHER, 6, &src[0]);
|
2003-08-29 10:59:12 +00:00
|
|
|
SET_ADDRESS(&fddihdr->src, AT_ETHER, 6, &src[0]);
|
2000-05-28 22:02:17 +00:00
|
|
|
|
|
|
|
if (fh_tree) {
|
2003-06-10 19:34:36 +00:00
|
|
|
proto_tree_add_ether(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST + FDDI_PADDING, 6, src);
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST + FDDI_PADDING, 6, src);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
1999-07-07 22:52:57 +00:00
|
|
|
|
|
|
|
/* hide some bit-swapped mac address fields in the proto_tree, just in case */
|
2008-05-15 01:44:53 +00:00
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_src, tvb, FDDI_P_SHOST + FDDI_PADDING, 6, src_swapped);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
|
|
|
hidden_item = proto_tree_add_ether(fh_tree, hf_fddi_addr, tvb, FDDI_P_SHOST + FDDI_PADDING, 6, src_swapped);
|
|
|
|
PROTO_ITEM_SET_HIDDEN(hidden_item);
|
1999-08-24 06:01:45 +00:00
|
|
|
}
|
2000-05-11 08:18:09 +00:00
|
|
|
|
2009-08-16 12:36:22 +00:00
|
|
|
next_tvb = tvb_new_subset_remaining(tvb, FDDI_HEADER_SIZE + FDDI_PADDING);
|
2000-05-11 08:18:09 +00:00
|
|
|
|
2003-08-29 10:59:12 +00:00
|
|
|
|
|
|
|
tap_queue_packet(fddi_tap, pinfo, fddihdr);
|
|
|
|
|
|
|
|
switch (fddihdr->fc) {
|
1998-10-10 03:32:20 +00:00
|
|
|
|
|
|
|
/* From now, only 802.2 SNAP (Async. LCC frame) is supported */
|
|
|
|
|
1998-10-10 18:23:43 +00:00
|
|
|
case FDDI_FC_LLC_ASYNC + 0 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 1 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 2 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 3 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 4 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 5 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 6 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 7 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 8 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 9 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 10 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 11 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 12 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 13 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 14 :
|
|
|
|
case FDDI_FC_LLC_ASYNC + 15 :
|
2001-01-03 10:34:42 +00:00
|
|
|
call_dissector(llc_handle, next_tvb, pinfo, tree);
|
1998-10-10 03:32:20 +00:00
|
|
|
return;
|
2002-08-28 21:04:11 +00:00
|
|
|
|
1998-10-10 03:32:20 +00:00
|
|
|
default :
|
2001-11-26 01:03:35 +00:00
|
|
|
call_dissector(data_handle,next_tvb, pinfo, tree);
|
1998-10-10 03:32:20 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
} /* fc */
|
|
|
|
} /* dissect_fddi */
|
1999-07-07 22:52:57 +00:00
|
|
|
|
2002-08-28 21:04:11 +00:00
|
|
|
|
2000-11-29 05:16:15 +00:00
|
|
|
static void
|
|
|
|
dissect_fddi_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_fddi(tvb, pinfo, tree, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_fddi_not_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
dissect_fddi(tvb, pinfo, tree, FALSE);
|
|
|
|
}
|
|
|
|
|
1999-07-07 22:52:57 +00:00
|
|
|
void
|
|
|
|
proto_register_fddi(void)
|
|
|
|
{
|
1999-07-15 15:33:52 +00:00
|
|
|
static hf_register_info hf[] = {
|
|
|
|
|
1999-08-24 06:01:45 +00:00
|
|
|
/*
|
|
|
|
* XXX - we want this guy to have his own private formatting
|
|
|
|
* routine, using "fc_to_str()"; if "fc_to_str()" returns
|
|
|
|
* NULL, just show the hex value, else show the string.
|
|
|
|
*/
|
1999-07-15 15:33:52 +00:00
|
|
|
{ &hf_fddi_fc,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Frame Control", "fddi.fc", 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 }},
|
1999-07-15 15:33:52 +00:00
|
|
|
|
2001-07-03 01:23:21 +00:00
|
|
|
{ &hf_fddi_fc_clf,
|
|
|
|
{ "Class/Length/Format", "fddi.fc.clf", FT_UINT8, BASE_HEX, VALS(clf_vals), FDDI_FC_CLFF,
|
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 }},
|
2001-07-03 01:23:21 +00:00
|
|
|
|
|
|
|
{ &hf_fddi_fc_prio,
|
|
|
|
{ "Priority", "fddi.fc.prio", FT_UINT8, BASE_DEC, NULL, FDDI_FC_ASYNC_PRI,
|
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 }},
|
2001-07-03 01:23:21 +00:00
|
|
|
|
|
|
|
{ &hf_fddi_fc_smt_subtype,
|
|
|
|
{ "SMT Subtype", "fddi.fc.smt_subtype", FT_UINT8, BASE_DEC, VALS(smt_subtype_vals), FDDI_FC_ZZZZ,
|
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 }},
|
2001-07-03 01:23:21 +00:00
|
|
|
|
|
|
|
{ &hf_fddi_fc_mac_subtype,
|
|
|
|
{ "MAC Subtype", "fddi.fc.mac_subtype", FT_UINT8, BASE_DEC, VALS(mac_subtype_vals), FDDI_FC_ZZZZ,
|
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 }},
|
2001-07-03 01:23:21 +00:00
|
|
|
|
1999-07-15 15:33:52 +00:00
|
|
|
{ &hf_fddi_dst,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Destination", "fddi.dst", FT_ETHER, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Destination Hardware Address", HFILL }},
|
1999-07-15 15:33:52 +00:00
|
|
|
|
|
|
|
{ &hf_fddi_src,
|
1999-10-12 06:21:15 +00:00
|
|
|
{ "Source", "fddi.src", FT_ETHER, 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 }},
|
2000-03-20 22:22:45 +00:00
|
|
|
|
|
|
|
{ &hf_fddi_addr,
|
|
|
|
{ "Source or Destination Address", "fddi.addr", FT_ETHER, BASE_NONE, NULL, 0x0,
|
2001-06-18 02:18:27 +00:00
|
|
|
"Source or Destination Hardware Address", HFILL }},
|
2000-03-20 22:22:45 +00:00
|
|
|
|
1999-07-08 03:18:20 +00:00
|
|
|
};
|
1999-11-16 11:44:20 +00:00
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_fddi,
|
2001-07-03 01:23:21 +00:00
|
|
|
&ett_fddi_fc,
|
1999-11-16 11:44:20 +00:00
|
|
|
};
|
1999-07-08 03:18:20 +00:00
|
|
|
|
2003-06-10 19:34:36 +00:00
|
|
|
module_t *fddi_module;
|
|
|
|
|
2001-01-03 06:56:03 +00:00
|
|
|
proto_fddi = proto_register_protocol("Fiber Distributed Data Interface",
|
|
|
|
"FDDI", "fddi");
|
1999-07-08 03:18:20 +00:00
|
|
|
proto_register_field_array(proto_fddi, hf, array_length(hf));
|
1999-11-16 11:44:20 +00:00
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2001-01-10 09:07:35 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Called from various dissectors for encapsulated FDDI frames.
|
|
|
|
* We assume the MAC addresses in them aren't bitswapped.
|
|
|
|
*/
|
|
|
|
register_dissector("fddi", dissect_fddi_not_bitswapped, proto_fddi);
|
2003-06-10 19:34:36 +00:00
|
|
|
|
|
|
|
fddi_module = prefs_register_protocol(proto_fddi, NULL);
|
|
|
|
prefs_register_bool_preference(fddi_module, "padding",
|
|
|
|
"Add 3-byte padding to all FDDI packets",
|
|
|
|
"Whether the FDDI dissector should add 3-byte padding to all "
|
|
|
|
"captured FDDI packets (useful with e.g. Tru64 UNIX tcpdump)",
|
|
|
|
&fddi_padding);
|
|
|
|
|
2003-08-29 10:59:12 +00:00
|
|
|
fddi_tap = register_tap("fddi");
|
1999-07-07 22:52:57 +00:00
|
|
|
}
|
2000-11-29 05:16:15 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_fddi(void)
|
|
|
|
{
|
2001-12-03 04:00:26 +00:00
|
|
|
dissector_handle_t fddi_handle, fddi_bitswapped_handle;
|
|
|
|
|
2001-01-03 10:34:42 +00:00
|
|
|
/*
|
|
|
|
* Get a handle for the LLC dissector.
|
|
|
|
*/
|
|
|
|
llc_handle = find_dissector("llc");
|
2001-11-26 01:03:35 +00:00
|
|
|
data_handle = find_dissector("data");
|
2001-01-03 10:34:42 +00:00
|
|
|
|
2001-12-03 04:00:26 +00:00
|
|
|
fddi_handle = find_dissector("fddi");
|
|
|
|
dissector_add("wtap_encap", WTAP_ENCAP_FDDI, fddi_handle);
|
|
|
|
fddi_bitswapped_handle =
|
|
|
|
create_dissector_handle(dissect_fddi_bitswapped, proto_fddi);
|
2001-01-09 06:32:10 +00:00
|
|
|
dissector_add("wtap_encap", WTAP_ENCAP_FDDI_BITSWAPPED,
|
2001-12-03 04:00:26 +00:00
|
|
|
fddi_bitswapped_handle);
|
2000-11-29 05:16:15 +00:00
|
|
|
}
|