diff options
author | Gerald Combs <gerald@wireshark.org> | 1998-10-10 03:32:20 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 1998-10-10 03:32:20 +0000 |
commit | 1b26a7cdb777972eb23d0d7d0b320855c1a03877 (patch) | |
tree | 9232afabf0abc9a8e5f5243798fbcc25d4aaa725 /packet.c | |
parent | 54945ddd046378b83ea09c45c3c42293d20a0d77 (diff) | |
download | wireshark-1b26a7cdb777972eb23d0d7d0b320855c1a03877.tar.gz wireshark-1b26a7cdb777972eb23d0d7d0b320855c1a03877.tar.bz2 wireshark-1b26a7cdb777972eb23d0d7d0b320855c1a03877.zip |
* OSPF alignment fixes (Gerald)
* FDDI support (Laurent, Guy)
svn path=/trunk/; revision=36
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -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; |