aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-12-08 22:35:30 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-12-08 22:35:30 +0000
commit5af0a7cc1627d9e86bc8d9e0320990c36a1c95db (patch)
treebf80dca00dfe10d6592fa23968a12fecc1ecb28a
parentd8bacf75611bd7172d9ad33642dc57af1fee7723 (diff)
Add a capture routine for IP-over-FC, and call it from the capture code.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6767 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--Makefile.am3
-rw-r--r--capture.c6
-rw-r--r--packet-ipfc.c15
-rw-r--r--packet-ipfc.h29
4 files changed, 50 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 138f12412b..55e65b9bc5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
# Makefile.am
# Automake file for Ethereal
#
-# $Id: Makefile.am,v 1.526 2002/12/08 03:38:19 gerald Exp $
+# $Id: Makefile.am,v 1.527 2002/12/08 22:35:30 guy Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
@@ -530,6 +530,7 @@ noinst_HEADERS = \
packet-ieee8023.h \
packet-igmp.h \
packet-ip.h \
+ packet-ipfc.h \
packet-ipsec.h \
packet-ipv6.h \
packet-ipx.h \
diff --git a/capture.c b/capture.c
index 3186857a58..e7b0dde4c4 100644
--- a/capture.c
+++ b/capture.c
@@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
- * $Id: capture.c,v 1.195 2002/10/19 07:52:12 guy Exp $
+ * $Id: capture.c,v 1.196 2002/12/08 22:35:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -160,6 +160,7 @@
#include "packet-ieee80211.h"
#include "packet-chdlc.h"
#include "packet-prism.h"
+#include "packet-ipfc.h"
#ifdef WIN32
#include "capture-wpcap.h"
@@ -2246,6 +2247,9 @@ capture_pcap_cb(guchar *user, const struct pcap_pkthdr *phdr,
case WTAP_ENCAP_ATM_SNIFFER:
capture_atm(&pseudo_header, pd, whdr.caplen, &ld->counts);
break;
+ case WTAP_ENCAP_IP_OVER_FC:
+ capture_ipfc(pd, whdr.caplen, &ld->counts);
+ break;
/* XXX - some ATM drivers on FreeBSD might prepend a 4-byte ATM
pseudo-header to DLT_ATM_RFC1483, with LLC header following;
we might have to implement that at some point. */
diff --git a/packet-ipfc.c b/packet-ipfc.c
index f61143406d..f4d83b9b8c 100644
--- a/packet-ipfc.c
+++ b/packet-ipfc.c
@@ -2,7 +2,7 @@
* Routines for Decoding FC header for IP/FC
* Copyright 2001, Dinesh G Dutt <ddutt@cisco.com>
*
- * $Id: packet-ipfc.c,v 1.3 2002/12/08 22:01:20 guy Exp $
+ * $Id: packet-ipfc.c,v 1.4 2002/12/08 22:35:30 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -36,6 +36,8 @@
#include <epan/packet.h>
#include "etypes.h"
#include "packet-fc.h"
+#include "packet-ipfc.h"
+#include "packet-llc.h"
/* Initialize the protocol and registered fields */
static int proto_ipfc = -1;
@@ -46,6 +48,17 @@ static int hf_ipfc_network_sa = -1;
static gint ett_ipfc = -1;
static dissector_handle_t llc_handle;
+void
+capture_ipfc (const guchar *pd, int len, packet_counts *ld)
+{
+ if (!BYTES_ARE_IN_FRAME(0, len, 16)) {
+ ld->other++;
+ return;
+ }
+
+ capture_llc(pd, 16, len, ld);
+}
+
static void
dissect_ipfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
diff --git a/packet-ipfc.h b/packet-ipfc.h
new file mode 100644
index 0000000000..2c86f4b837
--- /dev/null
+++ b/packet-ipfc.h
@@ -0,0 +1,29 @@
+/* packet-ipfc.h
+ *
+ * $Id: packet-ipfc.h,v 1.1 2002/12/08 22:35:30 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.
+ */
+
+#ifndef __PACKET_IPFC_H__
+#define __PACKET_IPFC_H__
+
+void capture_ipfc(const guchar *, int, packet_counts *);
+
+#endif