summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>1998-10-10 03:32:20 +0000
committerGerald Combs <gerald@wireshark.org>1998-10-10 03:32:20 +0000
commit1b26a7cdb777972eb23d0d7d0b320855c1a03877 (patch)
tree9232afabf0abc9a8e5f5243798fbcc25d4aaa725 /packet.c
parent54945ddd046378b83ea09c45c3c42293d20a0d77 (diff)
downloadwireshark-1b26a7cdb777972eb23d0d7d0b320855c1a03877.tar.gz
* OSPF alignment fixes (Gerald)
* FDDI support (Laurent, Guy) svn path=/trunk/; revision=36
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index 00f8b3c4d2..a86708cc98 100644
--- a/packet.c
+++ b/packet.c
@@ -1,7 +1,7 @@
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.4 1998/09/27 22:12:42 gerald Exp $
+ * $Id: packet.c,v 1.5 1998/10/10 03:32:16 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -27,12 +27,20 @@
# include "config.h"
#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
+#ifdef NEED_SNPRINTF_H
+# include "snprintf.h"
+#endif
+
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
@@ -198,6 +206,21 @@ decode_start_len(GtkTreeItem *ti, gint *pstart, gint *plen)
*plen = t_info & 0xffff;
}
+/* Tries to match val against each element in the value_string array vs.
+ Returns the associated string ptr on a match, or NULL on failure.
+ Len is the length of the array. */
+gchar*
+match_strval(guint32 val, value_string *vs, gint len) {
+ gint i;
+
+ for (i = 0; i < len; i++) {
+ if (vs[i].value == val)
+ return(vs[i].strptr);
+ }
+
+ return(NULL);
+}
+
static const char *mon_names[12] = {
"Jan",
"Feb",
@@ -265,6 +288,9 @@ dissect_packet(const u_char *pd, guint32 ts_secs, guint32 ts_usecs,
case DLT_EN10MB :
dissect_eth(pd, fd, tree);
break;
+ case DLT_FDDI :
+ dissect_fddi(pd, fd, tree);
+ break;
case DLT_IEEE802 :
dissect_tr(pd, fd, tree);
break;