aboutsummaryrefslogtreecommitdiffstats
path: root/packet.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1998-11-12 00:06:47 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1998-11-12 00:06:47 +0000
commitfcb4c78a6a01d22f0db9d6de870342511030cb01 (patch)
treed32b2d7467b0266e722aa763c9b48cf0df2c802c /packet.c
parentc2eeef9467d44eb4ea2cd6bd08f62f5c9c293810 (diff)
A lengthy patch to add the wiretap library. Wiretap is not used by default
because it is still in its infancy, but it can be compiled in optionally. The library exists in its own subdirectory ethereal/wiretap. This patch also edits all the packet-*.c files to remove the #include <pcap.h> line which is unnecessary in these files. In the ethereal code, file.c is the most heavily modified with #ifdef WITH_WIRETAP lines for the optional library. svn path=/trunk/; revision=82
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 672058fb28..226adcd861 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.9 1998/10/28 01:16:48 guy Exp $
+ * $Id: packet.c,v 1.10 1998/11/12 00:06:40 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -295,6 +295,28 @@ dissect_packet(const u_char *pd, guint32 ts_secs, guint32 ts_usecs,
fd->cap_len);
}
+#ifdef WITH_WIRETAP
+ switch (cf.lnk_t) {
+ case WTAP_ENCAP_ETHERNET :
+ dissect_eth(pd, fd, tree);
+ break;
+ case WTAP_ENCAP_FDDI :
+ dissect_fddi(pd, fd, tree);
+ break;
+ case WTAP_ENCAP_TR :
+ dissect_tr(pd, fd, tree);
+ break;
+ case WTAP_ENCAP_NONE :
+ dissect_null(pd, fd, tree);
+ break;
+ case WTAP_ENCAP_PPP :
+ dissect_ppp(pd, fd, tree);
+ break;
+ case WTAP_ENCAP_RAW_IP :
+ dissect_raw(pd, fd, tree);
+ break;
+ }
+#else
switch (cf.lnk_t) {
case DLT_EN10MB :
dissect_eth(pd, fd, tree);
@@ -315,4 +337,5 @@ dissect_packet(const u_char *pd, guint32 ts_secs, guint32 ts_usecs,
dissect_raw(pd, fd, tree);
break;
}
+#endif
}