Added PPPoE, PPTP, GRE, and ISAKMP dissectors.

svn path=/trunk/; revision=303
daniel/osmux
Gilbert Ramirez 1999-06-11 15:30:55 +00:00
parent 6d7cf738f0
commit 34450a8a35
22 changed files with 2849 additions and 167 deletions

View File

@ -88,6 +88,14 @@ John McDermott <jjm@jkintl.com> {
Pseudo-real-time capture
}
Jeff Jahr <jjahr@shastanets.com> {
PPP over Ethernet (PPPoe)
}
Brad Robel-Forrest <bradr@watchguard.com> {
ISAKMP, GRE, PPTP
}
Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.

View File

@ -37,8 +37,9 @@ ethereal_SOURCES = \
packet-fddi.c \
packet-ftp.c \
packet-giop.c \
packet-gre.c \
packet-http.c \
packet-icmpv6.c \
packet-icmpv6.c\
packet-ip.c \
packet-ip.h \
packet-ipsec.c \
@ -46,6 +47,7 @@ ethereal_SOURCES = \
packet-ipv6.h \
packet-ipx.c \
packet-ipx.h \
packet-isakmp.c\
packet-llc.c \
packet-lpd.c \
packet-nbipx.c \
@ -59,12 +61,14 @@ ethereal_SOURCES = \
packet-ospf.h \
packet-pop.c \
packet-ppp.c \
packet-pppoe.c \
packet-pptp.c \
packet-raw.c \
packet-rip.c \
packet-rip.h \
packet-smb.c \
packet-tcp.c \
packet-telnet.c \
packet-telnet.c\
packet-tftp.c \
packet-tr.c \
packet-trmac.c \

View File

@ -80,7 +80,7 @@ man_MANS = ethereal.1
sysconf_DATA = manuf
ethereal_SOURCES = alignment.h capture.c capture.h column.c column.h config.h ethereal.c ethereal.h ethertype.c etypes.h file.c file.h filter.c filter.h follow.c follow.h gtkpacket.c gtkpacket.h menu.c menu.h packet-aarp.c packet-arp.c packet-atalk.c packet-bootp.c packet-cdp.c packet-data.c packet-dns.c packet-dns.h packet-eth.c packet-fddi.c packet-ftp.c packet-giop.c packet-http.c packet-icmpv6.c packet-ip.c packet-ip.h packet-ipsec.c packet-ipv6.c packet-ipv6.h packet-ipx.c packet-ipx.h packet-llc.c packet-lpd.c packet-nbipx.c packet-nbns.c packet-ncp.c packet-ncp.h packet-nntp.c packet-null.c packet-osi.c packet-ospf.c packet-ospf.h packet-pop.c packet-ppp.c packet-raw.c packet-rip.c packet-rip.h packet-smb.c packet-tcp.c packet-telnet.c packet-tftp.c packet-tr.c packet-trmac.c packet-udp.c packet-vines.c packet-vines.h packet.c packet.h prefs.c prefs.h print.c print.h ps.c ps.h resolv.c resolv.h smb.h util.c util.h
ethereal_SOURCES = alignment.h capture.c capture.h column.c column.h config.h ethereal.c ethereal.h ethertype.c etypes.h file.c file.h filter.c filter.h follow.c follow.h gtkpacket.c gtkpacket.h menu.c menu.h packet-aarp.c packet-arp.c packet-atalk.c packet-bootp.c packet-cdp.c packet-data.c packet-dns.c packet-dns.h packet-eth.c packet-fddi.c packet-ftp.c packet-giop.c packet-gre.c packet-http.c packet-icmpv6.c packet-ip.c packet-ip.h packet-ipsec.c packet-ipv6.c packet-ipv6.h packet-ipx.c packet-ipx.h packet-isakmp.c packet-llc.c packet-lpd.c packet-nbipx.c packet-nbns.c packet-ncp.c packet-ncp.h packet-nntp.c packet-null.c packet-osi.c packet-ospf.c packet-ospf.h packet-pop.c packet-ppp.c packet-pppoe.c packet-pptp.c packet-raw.c packet-rip.c packet-rip.h packet-smb.c packet-tcp.c packet-telnet.c packet-tftp.c packet-tr.c packet-trmac.c packet-udp.c packet-vines.c packet-vines.h packet.c packet.h prefs.c prefs.h print.c print.h ps.c ps.h resolv.c resolv.h smb.h util.c util.h
EXTRA_ethereal_SOURCES = packet-snmp.c snprintf.c snprintf.h snprintf-imp.h
@ -110,13 +110,14 @@ LIBS = @LIBS@
ethereal_OBJECTS = capture.o column.o ethereal.o ethertype.o file.o \
filter.o follow.o gtkpacket.o menu.o packet-aarp.o packet-arp.o \
packet-atalk.o packet-bootp.o packet-cdp.o packet-data.o packet-dns.o \
packet-eth.o packet-fddi.o packet-ftp.o packet-giop.o packet-http.o \
packet-icmpv6.o packet-ip.o packet-ipsec.o packet-ipv6.o packet-ipx.o \
packet-llc.o packet-lpd.o packet-nbipx.o packet-nbns.o packet-ncp.o \
packet-nntp.o packet-null.o packet-osi.o packet-ospf.o packet-pop.o \
packet-ppp.o packet-raw.o packet-rip.o packet-smb.o packet-tcp.o \
packet-telnet.o packet-tftp.o packet-tr.o packet-trmac.o packet-udp.o \
packet-vines.o packet.o prefs.o print.o ps.o resolv.o util.o
packet-eth.o packet-fddi.o packet-ftp.o packet-giop.o packet-gre.o \
packet-http.o packet-icmpv6.o packet-ip.o packet-ipsec.o packet-ipv6.o \
packet-ipx.o packet-isakmp.o packet-llc.o packet-lpd.o packet-nbipx.o \
packet-nbns.o packet-ncp.o packet-nntp.o packet-null.o packet-osi.o \
packet-ospf.o packet-pop.o packet-ppp.o packet-pppoe.o packet-pptp.o \
packet-raw.o packet-rip.o packet-smb.o packet-tcp.o packet-telnet.o \
packet-tftp.o packet-tr.o packet-trmac.o packet-udp.o packet-vines.o \
packet.o prefs.o print.o ps.o resolv.o util.o
ethereal_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@ -144,17 +145,18 @@ DEP_FILES = .deps/capture.P .deps/column.P .deps/ethereal.P \
.deps/packet-atalk.P .deps/packet-bootp.P .deps/packet-cdp.P \
.deps/packet-data.P .deps/packet-dns.P .deps/packet-eth.P \
.deps/packet-fddi.P .deps/packet-ftp.P .deps/packet-giop.P \
.deps/packet-http.P .deps/packet-icmpv6.P .deps/packet-ip.P \
.deps/packet-ipsec.P .deps/packet-ipv6.P .deps/packet-ipx.P \
.deps/packet-llc.P .deps/packet-lpd.P .deps/packet-nbipx.P \
.deps/packet-nbns.P .deps/packet-ncp.P .deps/packet-nntp.P \
.deps/packet-null.P .deps/packet-osi.P .deps/packet-ospf.P \
.deps/packet-pop.P .deps/packet-ppp.P .deps/packet-raw.P \
.deps/packet-rip.P .deps/packet-smb.P .deps/packet-snmp.P \
.deps/packet-tcp.P .deps/packet-telnet.P .deps/packet-tftp.P \
.deps/packet-tr.P .deps/packet-trmac.P .deps/packet-udp.P \
.deps/packet-vines.P .deps/packet.P .deps/prefs.P .deps/print.P \
.deps/ps.P .deps/resolv.P .deps/snprintf.P .deps/util.P
.deps/packet-gre.P .deps/packet-http.P .deps/packet-icmpv6.P \
.deps/packet-ip.P .deps/packet-ipsec.P .deps/packet-ipv6.P \
.deps/packet-ipx.P .deps/packet-isakmp.P .deps/packet-llc.P \
.deps/packet-lpd.P .deps/packet-nbipx.P .deps/packet-nbns.P \
.deps/packet-ncp.P .deps/packet-nntp.P .deps/packet-null.P \
.deps/packet-osi.P .deps/packet-ospf.P .deps/packet-pop.P \
.deps/packet-ppp.P .deps/packet-pppoe.P .deps/packet-pptp.P \
.deps/packet-raw.P .deps/packet-rip.P .deps/packet-smb.P \
.deps/packet-snmp.P .deps/packet-tcp.P .deps/packet-telnet.P \
.deps/packet-tftp.P .deps/packet-tr.P .deps/packet-trmac.P \
.deps/packet-udp.P .deps/packet-vines.P .deps/packet.P .deps/prefs.P \
.deps/print.P .deps/ps.P .deps/resolv.P .deps/snprintf.P .deps/util.P
SOURCES = $(ethereal_SOURCES) $(EXTRA_ethereal_SOURCES)
OBJECTS = $(ethereal_OBJECTS)

4
NEWS
View File

@ -1,3 +1,7 @@
Overview of changes in Ethereal 0.6.3:
* PPPoE (PPP over Ethernet) added (Jeff Jahr)
* ISAKMP, GRE, PPTP added (Brad Robel-Forrest)
Overview of changes in Ethereal 0.6.2:
* Almost-real-time capture and display (John, Laurent)
* Initial support for SMB (Richard)

44
aclocal.m4 vendored
View File

@ -1,7 +1,7 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl aclocal.m4 generated automatically by aclocal 1.3
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
dnl This Makefile.in is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@ -192,8 +192,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
@ -205,6 +205,15 @@ AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])
#
# Check to make sure that the build environment is sane.
#
@ -267,7 +276,7 @@ AC_SUBST($1)])
# Configure paths for GTK+
# Owen Taylor 97-11-3
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
@ -281,15 +290,6 @@ AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
, enable_gtktest=yes)
for module in . $4
do
case "$module" in
gthread)
gtk_config_args="$gtk_config_args gthread"
;;
esac
done
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
@ -322,7 +322,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
LIBS="$LIBS $GTK_LIBS"
dnl
dnl Now check if the installed GTK is sufficiently new. (Also sanity
dnl checks the results of gtk-config to some extent
@ -331,7 +331,6 @@ dnl
AC_TRY_RUN([
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
@ -364,17 +363,6 @@ main ()
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||

View File

@ -1,7 +1,7 @@
/* capture.c
* Routines for packet capture windows
*
* $Id: capture.c,v 1.24 1999/06/05 01:44:11 guy Exp $
* $Id: capture.c,v 1.25 1999/06/11 15:30:34 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -435,7 +435,7 @@ capture_prep_close_cb(GtkWidget *w, gpointer win) {
void
capture(void) {
GtkWidget *cap_w, *main_vb, *count_lb, *tcp_lb, *udp_lb,
*ospf_lb, *other_lb, *stop_bt;
*ospf_lb, *gre_lb, *other_lb, *stop_bt;
pcap_t *pch;
gchar err_str[PCAP_ERRBUF_SIZE], label_str[32];
loop_data ld;
@ -451,6 +451,7 @@ capture(void) {
ld.counts.tcp = 0;
ld.counts.udp = 0;
ld.counts.ospf = 0;
ld.counts.gre = 0;
ld.counts.other = 0;
ld.pdh = NULL;
@ -510,6 +511,10 @@ capture(void) {
gtk_box_pack_start(GTK_BOX(main_vb), ospf_lb, FALSE, FALSE, 3);
gtk_widget_show(ospf_lb);
gre_lb = gtk_label_new("GRE: 0 (0.0%)");
gtk_box_pack_start(GTK_BOX(main_vb), gre_lb, FALSE, FALSE, 3);
gtk_widget_show(gre_lb);
other_lb = gtk_label_new("Other: 0 (0.0%)");
gtk_box_pack_start(GTK_BOX(main_vb), other_lb, FALSE, FALSE, 3);
gtk_widget_show(other_lb);
@ -553,6 +558,10 @@ capture(void) {
pct(ld.counts.ospf, ld.counts.total));
gtk_label_set(GTK_LABEL(ospf_lb), label_str);
sprintf(label_str, "GRE: %d (%.1f%%)", ld.counts.gre,
pct(ld.counts.gre, ld.counts.total));
gtk_label_set(GTK_LABEL(gre_lb), label_str);
sprintf(label_str, "Other: %d (%.1f%%)", ld.counts.other,
pct(ld.counts.other, ld.counts.total));
gtk_label_set(GTK_LABEL(other_lb), label_str);

View File

@ -7,6 +7,10 @@
byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
#undef PACKAGE
#undef VERSION
#undef HAVE_SA_LEN
#undef DATAFILE_DIR
@ -48,10 +52,3 @@
/* Define if you have the pcap library (-lpcap). */
#undef HAVE_LIBPCAP
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION

163
configure vendored
View File

@ -1133,15 +1133,6 @@ else
fi
for module in .
do
case "$module" in
gthread)
gtk_config_args="$gtk_config_args gthread"
;;
esac
done
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
@ -1158,7 +1149,7 @@ fi
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1162: checking for $ac_word" >&5
echo "configure:1153: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1193,7 +1184,7 @@ fi
min_gtk_version=1.0.0
echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
echo "configure:1197: checking for GTK - version >= $min_gtk_version" >&5
echo "configure:1188: checking for GTK - version >= $min_gtk_version" >&5
no_gtk=""
if test "$GTK_CONFIG" = "no" ; then
no_gtk=yes
@ -1210,18 +1201,17 @@ echo "configure:1197: checking for GTK - version >= $min_gtk_version" >&5
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
LIBS="$LIBS $GTK_LIBS"
rm -f conf.gtktest
if test "$cross_compiling" = yes; then
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 1220 "configure"
#line 1211 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
@ -1254,17 +1244,6 @@ main ()
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||
@ -1294,7 +1273,7 @@ main ()
}
EOF
if { (eval echo configure:1298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -1328,7 +1307,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
#line 1332 "configure"
#line 1311 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@ -1338,7 +1317,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
if { (eval echo configure:1342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK or finding the wrong"
@ -1379,7 +1358,7 @@ rm -f conftest*
# Evidently, some systems have pcap.h, etc. in */include/pcap
echo $ac_n "checking for extraneous pcap header directories""... $ac_c" 1>&6
echo "configure:1383: checking for extraneous pcap header directories" >&5
echo "configure:1362: checking for extraneous pcap header directories" >&5
found_pcap_dir=""
for pcap_dir in /usr/include/pcap /usr/local/include/pcap
do
@ -1399,7 +1378,7 @@ fi
# Pcap checks
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1403: checking how to run the C preprocessor" >&5
echo "configure:1382: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -1414,13 +1393,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1418 "configure"
#line 1397 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1431,13 +1410,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1435 "configure"
#line 1414 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1448,13 +1427,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1452 "configure"
#line 1431 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1480,17 +1459,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "net/bpf.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for net/bpf.h""... $ac_c" 1>&6
echo "configure:1484: checking for net/bpf.h" >&5
echo "configure:1463: checking for net/bpf.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1489 "configure"
#line 1468 "configure"
#include "confdefs.h"
#include <net/bpf.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1514,17 +1493,17 @@ fi
ac_safe=`echo "pcap.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pcap.h""... $ac_c" 1>&6
echo "configure:1518: checking for pcap.h" >&5
echo "configure:1497: checking for pcap.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1523 "configure"
#line 1502 "configure"
#include "confdefs.h"
#include <pcap.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1507: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1547,7 +1526,7 @@ else
fi
echo $ac_n "checking for pcap_open_offline in -lpcap""... $ac_c" 1>&6
echo "configure:1551: checking for pcap_open_offline in -lpcap" >&5
echo "configure:1530: checking for pcap_open_offline in -lpcap" >&5
ac_lib_var=`echo pcap'_'pcap_open_offline | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1555,7 +1534,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpcap $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1559 "configure"
#line 1538 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1566,7 +1545,7 @@ int main() {
pcap_open_offline()
; return 0; }
EOF
if { (eval echo configure:1570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1597,7 +1576,7 @@ fi
# Wiretap check
echo $ac_n "checking whether to include wiretap library""... $ac_c" 1>&6
echo "configure:1601: checking whether to include wiretap library" >&5
echo "configure:1580: checking whether to include wiretap library" >&5
# Check whether --with-wiretap or --without-wiretap was given.
if test "${with_wiretap+set}" = set; then
withval="$with_wiretap"
@ -1639,7 +1618,7 @@ fi
echo $ac_n "checking whether to enable ipv6 name resolution if available""... $ac_c" 1>&6
echo "configure:1643: checking whether to enable ipv6 name resolution if available" >&5
echo "configure:1622: checking whether to enable ipv6 name resolution if available" >&5
if test "x$enable_ipv6" = "xno" ; then
echo "$ac_t""no" 1>&6
else
@ -1649,12 +1628,12 @@ else
v6lib=none
echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6
echo "configure:1653: checking ipv6 stack type" >&5
echo "configure:1632: checking ipv6 stack type" >&5
for i in v6d toshiba kame inria zeta linux; do
case $i in
v6d)
cat > conftest.$ac_ext <<EOF
#line 1658 "configure"
#line 1637 "configure"
#include "confdefs.h"
dnl
#include </usr/local/v6/include/sys/types.h>
@ -1674,7 +1653,7 @@ rm -f conftest*
;;
toshiba)
cat > conftest.$ac_ext <<EOF
#line 1678 "configure"
#line 1657 "configure"
#include "confdefs.h"
dnl
#include <sys/param.h>
@ -1694,7 +1673,7 @@ rm -f conftest*
;;
kame)
cat > conftest.$ac_ext <<EOF
#line 1698 "configure"
#line 1677 "configure"
#include "confdefs.h"
dnl
#include <netinet/in.h>
@ -1714,7 +1693,7 @@ rm -f conftest*
;;
inria)
cat > conftest.$ac_ext <<EOF
#line 1718 "configure"
#line 1697 "configure"
#include "confdefs.h"
dnl
#include <netinet/in.h>
@ -1732,7 +1711,7 @@ rm -f conftest*
;;
zeta)
cat > conftest.$ac_ext <<EOF
#line 1736 "configure"
#line 1715 "configure"
#include "confdefs.h"
dnl
#include <sys/param.h>
@ -1781,12 +1760,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1785: checking for ANSI C header files" >&5
echo "configure:1764: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1790 "configure"
#line 1769 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -1794,7 +1773,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1811,7 +1790,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1815 "configure"
#line 1794 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -1829,7 +1808,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1833 "configure"
#line 1812 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -1850,7 +1829,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1854 "configure"
#line 1833 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -1861,7 +1840,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -1888,17 +1867,17 @@ for ac_hdr in fcntl.h sys/ioctl.h sys/time.h unistd.h stdarg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1892: checking for $ac_hdr" >&5
echo "configure:1871: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1897 "configure"
#line 1876 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1929,17 +1908,17 @@ for ac_hdr in sys/sockio.h sys/types.h netinet/in.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1933: checking for $ac_hdr" >&5
echo "configure:1912: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1938 "configure"
#line 1917 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1979,7 +1958,7 @@ fi
SNMP_A=''
SNMP_O=''
echo $ac_n "checking whether to use SNMP library if available""... $ac_c" 1>&6
echo "configure:1983: checking whether to use SNMP library if available" >&5
echo "configure:1962: checking whether to use SNMP library if available" >&5
if test "x$enable_snmp" = "xno" ; then
echo "$ac_t""no" 1>&6
else
@ -1988,17 +1967,17 @@ else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1992: checking for $ac_hdr" >&5
echo "configure:1971: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1997 "configure"
#line 1976 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -2025,7 +2004,7 @@ fi
done
echo $ac_n "checking for asn_parse_header in -lsnmp""... $ac_c" 1>&6
echo "configure:2029: checking for asn_parse_header in -lsnmp" >&5
echo "configure:2008: checking for asn_parse_header in -lsnmp" >&5
ac_lib_var=`echo snmp'_'asn_parse_header | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2033,7 +2012,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsnmp $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2037 "configure"
#line 2016 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2044,7 +2023,7 @@ int main() {
asn_parse_header()
; return 0; }
EOF
if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2077,12 +2056,12 @@ fi
# for get_interface_list().
echo $ac_n "checking for sa_len in struct sockaddr""... $ac_c" 1>&6
echo "configure:2081: checking for sa_len in struct sockaddr" >&5
echo "configure:2060: checking for sa_len in struct sockaddr" >&5
if eval "test \"`echo '$''{'ac_cv_ethereal_struct_sa_len'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2086 "configure"
#line 2065 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2090,7 +2069,7 @@ int main() {
struct sockaddr s; s.sa_len;
; return 0; }
EOF
if { (eval echo configure:2094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_ethereal_struct_sa_len=yes
else
@ -2113,14 +2092,14 @@ fi
# We must know our byte order
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:2117: checking whether byte ordering is bigendian" >&5
echo "configure:2096: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
#line 2124 "configure"
#line 2103 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@ -2131,11 +2110,11 @@ int main() {
#endif
; return 0; }
EOF
if { (eval echo configure:2135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
#line 2139 "configure"
#line 2118 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@ -2146,7 +2125,7 @@ int main() {
#endif
; return 0; }
EOF
if { (eval echo configure:2150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@ -2166,7 +2145,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 2170 "configure"
#line 2149 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@ -2179,7 +2158,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:2162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@ -2205,13 +2184,13 @@ fi
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:2209: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:2188: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
#line 2215 "configure"
#line 2194 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@ -2229,7 +2208,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 2233 "configure"
#line 2212 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@ -2251,12 +2230,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
fi
echo $ac_n "checking for socket""... $ac_c" 1>&6
echo "configure:2255: checking for socket" >&5
echo "configure:2234: checking for socket" >&5
if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2260 "configure"
#line 2239 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket(); below. */
@ -2279,7 +2258,7 @@ socket();
; return 0; }
EOF
if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_socket=yes"
else
@ -2305,12 +2284,12 @@ fi
SNPRINTF_C=""
SNPRINTF_O=""
echo $ac_n "checking for snprintf""... $ac_c" 1>&6
echo "configure:2309: checking for snprintf" >&5
echo "configure:2288: checking for snprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_snprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2314 "configure"
#line 2293 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char snprintf(); below. */
@ -2333,7 +2312,7 @@ snprintf();
; return 0; }
EOF
if { (eval echo configure:2337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_snprintf=yes"
else

View File

@ -362,6 +362,10 @@ B<http://ethereal.zing.org>.
Jun-ichiro itojun Hagino <itojun@iijlab.net>
Richard Sharpe <sharpe@ns.aus.com>
John McDermott <jjm@jkintl.com>
Jeff Jahr <jjahr@shastanets.com>
Brad Robel-Forrest <bradr@watchguard.com>
Brad Robel-Forrest <bradr@watchguard.com> {
Alain Magloire <alainm@rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.

View File

@ -1,6 +1,6 @@
/* ethereal.c
*
* $Id: ethereal.c,v 1.34 1999/05/12 06:04:46 gram Exp $
* $Id: ethereal.c,v 1.35 1999/06/11 15:30:36 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -132,6 +132,8 @@ about_ethereal( GtkWidget *w, gpointer data ) {
"Jun-ichiro itojun Hagino <itojun@iijlab.net>\n"
"Richard Sharpe <sharpe@ns.aus.com>\n"
"John McDermott <jjm@jkintl.com>\n"
"Jeff Jahr <jjahr@shastanets.com>\n"
"Brad Robel-Forrest <bradr@watchguard.com>\n"
"\nSee http://ethereal.zing.org for more information",
VERSION, comp_info_str);

View File

@ -2,7 +2,7 @@
* Routines for calling the right protocol for the ethertype.
* This is called by both packet-eth.c (Ethernet II) and packet-llc.c (SNAP)
*
* $Id: ethertype.c,v 1.13 1999/03/23 03:14:34 gram Exp $
* $Id: ethertype.c,v 1.14 1999/06/11 15:30:37 gram Exp $
*
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
*
@ -52,6 +52,8 @@ ethertype_to_str(guint16 etype, const char *fmt)
{ETHERTYPE_VINES, "Vines" },
{ETHERTYPE_CDP, "CDP" }, /* Cisco Discovery Protocol */
{ETHERTYPE_LOOP, "Loopback" }, /* Ethernet Loopback */
{ETHERTYPE_PPPOED, "PPPoE Discovery"},
{ETHERTYPE_PPPOES, "PPPoE Session" },
{0, NULL } };
return val_to_str(etype, etype_vals, fmt);
@ -112,6 +114,12 @@ ethertype(guint16 etype, int offset,
dissect_data(pd, offset, fd, tree);
if (check_col(fd, COL_PROTOCOL)) { col_add_fstr(fd, COL_PROTOCOL, "LOOP"); }
break;
case ETHERTYPE_PPPOED:
dissect_pppoed(pd, offset, fd, tree);
break;
case ETHERTYPE_PPPOES:
dissect_pppoes(pd, offset, fd, tree);
break;
default:
dissect_data(pd, offset, fd, tree);
if (check_col(fd, COL_PROTOCOL)) { col_add_fstr(fd, COL_PROTOCOL, "0x%04x", etype); }

View File

@ -1,7 +1,7 @@
/* etypes.h
* Defines ethernet packet types, similar to tcpdump's ethertype.h
*
* $Id: etypes.h,v 1.4 1998/12/19 00:12:20 hannes Exp $
* $Id: etypes.h,v 1.5 1999/06/11 15:30:37 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -78,4 +78,13 @@
#define ETHERTYPE_LOOP 0x9000 /* used for layer 2 testing (do i see my own frames on the wire) */
#endif
#ifndef ETHERTYPE_PPPOED
#define ETHERTYPE_PPPOED 0x8863 /* PPPoE Discovery Protocol */
#endif
#ifndef ETHERTYPE_PPPOES
#define ETHERTYPE_PPPOES 0x8864 /* PPPoE Session Protocol */
#endif
#endif /* etypes.h */

237
packet-gre.c Normal file
View File

@ -0,0 +1,237 @@
/* packet-gre.c
* Routines for the Generic Routing Encapsulation (GRE) protocol
* Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
*
* $Id: packet-gre.c,v 1.1 1999/06/11 15:30:37 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
* 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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <netinet/in.h>
#include <glib.h>
#include "packet.h"
/* bit positions for flags in header */
#define GH_B_C 0x8000
#define GH_B_R 0x4000
#define GH_B_K 0x2000
#define GH_B_S 0x1000
#define GH_B_s 0x0800
#define GH_B_RECUR 0x0700
#define GH_P_A 0x0080 /* only in special PPTPized GRE header */
#define GH_P_FLAGS 0x0078 /* only in special PPTPized GRE header */
#define GH_R_FLAGS 0x00F8
#define GH_B_VER 0x0007
#define GRE_PPP 0x880B
static int calc_len(guint16, int);
static void add_flags_and_ver(proto_tree *, guint16, int, int);
void
dissect_gre(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
guint16 flags_and_ver = pntohs(pd + offset);
guint16 type = pntohs(pd + offset + sizeof(flags_and_ver));
static const value_string typevals[] = {
{ GRE_PPP, "PPP" },
{ 0, NULL }
};
if (check_col(fd, COL_PROTOCOL))
col_add_str(fd, COL_PROTOCOL, "GRE");
if (check_col(fd, COL_INFO)) {
if (type == GRE_PPP)
col_add_str(fd, COL_INFO, "Encapsulated PPP");
else
col_add_str(fd, COL_INFO, "Encapsulated unknown");
}
if (fd->cap_len > offset && tree) {
int is_ppp;
proto_item * ti;
proto_tree * gre_tree;
if (type == GRE_PPP) {
is_ppp = 1;
ti = proto_tree_add_item(tree, offset, calc_len(flags_and_ver, 1),
"Generic Routing Encapsulation (PPP)");
gre_tree = proto_tree_new();
proto_item_add_subtree(ti, gre_tree, ETT_GRE);
add_flags_and_ver(gre_tree, flags_and_ver, offset, 1);
}
else {
is_ppp = 0;
ti = proto_tree_add_item(tree, offset, calc_len(flags_and_ver, 1),
"Generic Routing Encapsulation");
gre_tree = proto_tree_new();
proto_item_add_subtree(ti, gre_tree, ETT_GRE);
add_flags_and_ver(gre_tree, flags_and_ver, offset, 0);
}
offset += sizeof(flags_and_ver);
proto_tree_add_item(gre_tree, offset, sizeof(type),
"Protocol Type: %s (%#04x)",
val_to_str(type, typevals, "Unknown"), type);
offset += sizeof(type);
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) {
guint16 checksum = pntohs(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(checksum),
"Checksum: %u", checksum);
offset += sizeof(checksum);
}
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) {
guint16 rtoffset = pntohs(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(rtoffset),
"Offset: %u", rtoffset);
offset += sizeof(rtoffset);
}
if (flags_and_ver & GH_B_K) {
if (is_ppp) {
guint16 paylen;
guint16 callid;
paylen = pntohs(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(paylen),
"Payload length: %u", paylen);
offset += sizeof(paylen);
callid = pntohs(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(callid),
"Call ID: %u", callid);
offset += sizeof(callid);
}
else {
guint32 key = pntohl(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(key),
"Key: %u", key);
offset += sizeof(key);
}
}
if (flags_and_ver & GH_B_S) {
guint32 seqnum = pntohl(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(seqnum),
"Sequence number: %u", seqnum);
offset += sizeof(seqnum);
}
if (is_ppp && flags_and_ver & GH_P_A) {
guint32 acknum = pntohl(pd + offset);
proto_tree_add_item(gre_tree, offset, sizeof(acknum),
"Acknowledgement number: %u", acknum);
offset += sizeof(acknum);
}
if (flags_and_ver & GH_B_R) {
proto_tree_add_item(gre_tree, offset, sizeof(guint16),
"Address family: %u", pntohs(pd + offset));
offset += sizeof(guint16);
proto_tree_add_item(gre_tree, offset, 1,
"SRE offset: %u", pd[offset++]);
proto_tree_add_item(gre_tree, offset, 1,
"SRE length: %u", pd[offset++]);
}
switch (type) {
case GRE_PPP:
dissect_payload_ppp(pd, offset, fd, tree);
break;
default:
dissect_data(pd, offset, fd, gre_tree);
}
}
}
static int
calc_len(guint16 flags_and_ver, int is_ppp) {
int len = 4;
if (flags_and_ver & GH_B_C || flags_and_ver & GH_B_R) len += 4;
if (flags_and_ver & GH_B_K) len += 4;
if (flags_and_ver & GH_B_S) len += 4;
if (is_ppp && flags_and_ver & GH_P_A) len += 4;
return len;
}
static void
add_flags_and_ver(proto_tree *tree, guint16 flags_and_ver, int offset, int is_ppp) {
proto_item * ti;
proto_tree * fv_tree;
int nbits = sizeof(flags_and_ver) * 8;
ti = proto_tree_add_item(tree, offset, 2,
"Flags and version: %#08x", flags_and_ver);
fv_tree = proto_tree_new();
proto_item_add_subtree(ti, fv_tree, ETT_GRE_FLAGS);
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_C, nbits,
"Checksum", "No checksum"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_R, nbits,
"Routing", "No routing"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_K, nbits,
"Key", "No key"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_S, nbits,
"Sequence number", "No sequence number"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_B_s, nbits,
"Strict source route", "No strict source route"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_numeric_bitfield(flags_and_ver, GH_B_RECUR, nbits,
"Recursion control: %u"));
if (is_ppp) {
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_boolean_bitfield(flags_and_ver, GH_P_A, nbits,
"Acknowledgment number", "No acknowledgment number"));
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_numeric_bitfield(flags_and_ver, GH_P_FLAGS, nbits,
"Flags: %u"));
}
else {
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_numeric_bitfield(flags_and_ver, GH_R_FLAGS, nbits,
"Flags: %u"));
}
proto_tree_add_item(fv_tree, offset, sizeof(flags_and_ver), "%s",
decode_numeric_bitfield(flags_and_ver, GH_B_VER, nbits,
"Version: %u"));
}

View File

@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
* $Id: packet-ip.c,v 1.23 1999/05/20 02:41:22 guy Exp $
* $Id: packet-ip.c,v 1.24 1999/06/11 15:30:37 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -203,6 +203,9 @@ capture_ip(const u_char *pd, int offset, guint32 cap_len, packet_counts *ld) {
case IP_PROTO_OSPF:
ld->ospf++;
break;
case IP_PROTO_GRE:
ld->gre++;
break;
default:
ld->other++;
}
@ -586,6 +589,7 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
case IP_PROTO_TCP:
case IP_PROTO_UDP:
case IP_PROTO_OSPF:
case IP_PROTO_GRE:
case IP_PROTO_ESP:
case IP_PROTO_AH:
case IP_PROTO_IPV6:
@ -741,6 +745,9 @@ again:
nxt = pd[offset];
offset += advance;
goto again;
case IP_PROTO_GRE:
dissect_gre(pd, offset, fd, tree);
break;
case IP_PROTO_ESP:
dissect_esp(pd, offset, fd, tree);
break;

View File

@ -1,7 +1,7 @@
/* packet-ip.h
* Definitions for IP packet disassembly structures and routines
*
* $Id: packet-ip.h,v 1.2 1999/03/28 18:31:59 gram Exp $
* $Id: packet-ip.h,v 1.3 1999/06/11 15:30:38 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>