Added support for Lucent/Ascend packet traces. The MAX and Pipeline router
family has a set of debug commands that allow you to log the traffic on a WAN or dialup connection as text, e.g. RECV-iguana:241:(task: B04E12C0, time: 1975358.50) 15 octets @ 8003D634 [0000]: FF 03 00 3D C0 06 C9 96 2D 04 C1 72 00 05 B8 Created wtap_seek_read() which parses the textual data for and Ascend trace, and does a normal fseek() and fread() for any other file type. The fseek()/fread() pairs in file.c were replaced with the new function. svn path=/trunk/; revision=652
This commit is contained in:
parent
078f9a67b9
commit
9386f23fee
|
@ -1,7 +1,7 @@
|
|||
# Makefile.am
|
||||
# Automake file for Ethereal
|
||||
#
|
||||
# $Id: Makefile.am,v 1.70 1999/09/10 05:15:09 gram Exp $
|
||||
# $Id: Makefile.am,v 1.71 1999/09/11 04:50:34 gerald Exp $
|
||||
#
|
||||
# Ethereal - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@zing.org>
|
||||
|
@ -55,6 +55,7 @@ ethereal_SOURCES = \
|
|||
globals.h \
|
||||
packet-aarp.c \
|
||||
packet-arp.c \
|
||||
packet-ascend.c\
|
||||
packet-atalk.c \
|
||||
packet-atm.c \
|
||||
packet-bootp.c \
|
||||
|
|
11
file.c
11
file.c
|
@ -1,7 +1,7 @@
|
|||
/* file.c
|
||||
* File I/O routines
|
||||
*
|
||||
* $Id: file.c,v 1.87 1999/09/09 02:42:24 gram Exp $
|
||||
* $Id: file.c,v 1.88 1999/09/11 04:50:34 gerald Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -708,8 +708,7 @@ filter_packets(capture_file *cf)
|
|||
|
||||
cf->count++;
|
||||
|
||||
fseek(cf->fh, fd->file_off, SEEK_SET);
|
||||
fread(cf->pd, sizeof(guint8), fd->cap_len, cf->fh);
|
||||
wtap_seek_read (cf-> cd_t, cf->fh, fd->file_off, cf->pd, fd->cap_len);
|
||||
|
||||
add_packet_to_packet_list(fd, cf, cf->pd);
|
||||
}
|
||||
|
@ -754,8 +753,7 @@ print_packets(capture_file *cf, int to_file, const char *dest)
|
|||
for (fd = cf->plist; fd != NULL; fd = fd->next) {
|
||||
cf->count++;
|
||||
|
||||
fseek(cf->fh, fd->file_off, SEEK_SET);
|
||||
fread(cf->pd, sizeof(guint8), fd->cap_len, cf->fh);
|
||||
wtap_seek_read (cf-> cd_t, cf->fh, fd->file_off, cf->pd, fd->cap_len);
|
||||
|
||||
/* create the logical protocol tree */
|
||||
protocol_tree = proto_tree_create_root();
|
||||
|
@ -896,8 +894,7 @@ select_packet(capture_file *cf, int row)
|
|||
cf->selected_packet = i;
|
||||
|
||||
/* Get the data in that frame. */
|
||||
fseek(cf->fh, cf->fd->file_off, SEEK_SET);
|
||||
fread(cf->pd, sizeof(guint8), cf->fd->cap_len, cf->fh);
|
||||
wtap_seek_read (cf-> cd_t, cf->fh, fd->file_off, cf->pd, fd->cap_len);
|
||||
|
||||
/* Create the logical protocol tree. */
|
||||
if (cf->protocol_tree)
|
||||
|
|
5
packet.c
5
packet.c
|
@ -1,7 +1,7 @@
|
|||
/* packet.c
|
||||
* Routines for packet disassembly
|
||||
*
|
||||
* $Id: packet.c,v 1.40 1999/08/24 03:19:23 guy Exp $
|
||||
* $Id: packet.c,v 1.41 1999/09/11 04:50:35 gerald Exp $
|
||||
*
|
||||
* Ethereal - Network traffic analyzer
|
||||
* By Gerald Combs <gerald@zing.org>
|
||||
|
@ -684,6 +684,9 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree)
|
|||
case WTAP_ENCAP_ATM_SNIFFER :
|
||||
dissect_atm(pd, fd, tree);
|
||||
break;
|
||||
case WTAP_ENCAP_ASCEND :
|
||||
dissect_ascend(pd, fd, tree);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
317
wiretap/Makefile
317
wiretap/Makefile
|
@ -1,7 +1,7 @@
|
|||
# Generated automatically from Makefile.in by configure.
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
@ -11,7 +11,6 @@
|
|||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = .
|
||||
|
@ -32,7 +31,7 @@ mandir = ${prefix}/man
|
|||
includedir = ${prefix}/include
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/libwtap.a
|
||||
pkglibdir = $(libdir)/libwtap.a
|
||||
|
@ -48,7 +47,8 @@ AUTOHEADER = autoheader
|
|||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = s,x,x,
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
|
@ -57,27 +57,65 @@ POST_INSTALL = :
|
|||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
AMTAR = gtar
|
||||
AMTARFLAGS = o
|
||||
CC = gcc
|
||||
GTK_CFLAGS = -I/usr/lib/glib/include -I/usr/X11R6/include
|
||||
GTK_CONFIG = /usr/bin/gtk-config
|
||||
GTK_LIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
|
||||
LIBWIRETAP_A =
|
||||
CPP = gcc -E
|
||||
FLEX_PATH =
|
||||
GLIB_CFLAGS = -I/usr/lib/glib/include
|
||||
GLIB_CONFIG = /usr/bin/glib-config
|
||||
GLIB_LIBS = -L/usr/lib -lglib
|
||||
GTK_CFLAGS =
|
||||
GTK_CONFIG =
|
||||
GTK_LIBS =
|
||||
LEX = /usr/bin/flex
|
||||
MAKEINFO = makeinfo
|
||||
PACKAGE = libwtap.a
|
||||
RANLIB = ranlib
|
||||
VERSION = 0.0.0
|
||||
YACC = bison -y
|
||||
|
||||
noinst_LIBRARIES =
|
||||
# Makefile.am
|
||||
# Automake file for Wiretap
|
||||
#
|
||||
# $Id: Makefile,v 1.12 1999/09/11 04:50:43 gerald Exp $
|
||||
#
|
||||
# Ethereal - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@zing.org>
|
||||
# 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.
|
||||
|
||||
EXTRA_LIBRARIES = libwiretap.a
|
||||
|
||||
CLEANFILES = libwiretap.a
|
||||
noinst_LIBRARIES = libwiretap.a
|
||||
|
||||
#EXTRA_LIBRARIES = libwiretap.a
|
||||
|
||||
CLEANFILES = \
|
||||
libwiretap.a \
|
||||
*~
|
||||
|
||||
|
||||
libwiretap_a_SOURCES = \
|
||||
ascend-grammar.y \
|
||||
ascend-scanner.l \
|
||||
ascend.c \
|
||||
ascend.h \
|
||||
buffer.c \
|
||||
buffer.h \
|
||||
config.h \
|
||||
debug.h \
|
||||
file.c \
|
||||
iptrace.c \
|
||||
iptrace.h \
|
||||
|
@ -85,12 +123,27 @@ libwiretap_a_SOURCES = \
|
|||
lanalyzer.h \
|
||||
libpcap.c \
|
||||
libpcap.h \
|
||||
netmon.c \
|
||||
netmon.h \
|
||||
netxray.c \
|
||||
netxray.h \
|
||||
ngsniffer.c \
|
||||
ngsniffer.h \
|
||||
radcom.c \
|
||||
radcom.h \
|
||||
snoop.c \
|
||||
snoop.h \
|
||||
wtap.c \
|
||||
wtap.h
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
config.h.win32 \
|
||||
Makefile.nmake
|
||||
|
||||
|
||||
# Any POSIX-compatible YACC should honor the -p flag
|
||||
YFLAGS = -d -p ascend
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
|
@ -101,59 +154,76 @@ LIBRARIES = $(noinst_LIBRARIES)
|
|||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I.
|
||||
CPPFLAGS =
|
||||
LDFLAGS =
|
||||
LIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -lglib -lXext -lX11 -lm
|
||||
LIBS = -L/usr/lib -lglib
|
||||
libwiretap_a_LIBADD =
|
||||
libwiretap_a_OBJECTS = buffer.o file.o iptrace.o lanalyzer.o libpcap.o \
|
||||
ngsniffer.o snoop.o wtap.o
|
||||
am_libwiretap_a_OBJECTS = ascend-grammar.o ascend-scanner.o ascend.o \
|
||||
buffer.o file.o iptrace.o lanalyzer.o libpcap.o netmon.o netxray.o \
|
||||
ngsniffer.o radcom.o snoop.o wtap.o
|
||||
libwiretap_a_OBJECTS = $(am_libwiretap_a_OBJECTS)
|
||||
AR = ar
|
||||
CFLAGS = -Wall -g -O2 -I/usr/lib/glib/include -I/usr/X11R6/include
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
|
||||
Makefile.in NEWS acconfig.h aclocal.m4 config.h.in configure \
|
||||
configure.in stamp-h.in
|
||||
LEX_OUTPUT_ROOT = lex.yy
|
||||
LEXLIB = -lfl
|
||||
CFLAGS = -Wall -g -O2 -I/usr/lib/glib/include
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(libwiretap_a_SOURCES)
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS acconfig.h acinclude.m4 aclocal.m4 \
|
||||
ascend-grammar.c ascend-grammar.h ascend-scanner.c config.h.in \
|
||||
configure configure.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
DEP_FILES = .deps/buffer.P .deps/file.P .deps/iptrace.P \
|
||||
.deps/lanalyzer.P .deps/libpcap.P .deps/ngsniffer.P .deps/snoop.P \
|
||||
.deps/wtap.P
|
||||
GZIP_ENV = --best
|
||||
DEP_FILES = .deps/ascend-grammar.P .deps/ascend-scanner.P \
|
||||
.deps/ascend.P .deps/buffer.P .deps/file.P .deps/iptrace.P \
|
||||
.deps/lanalyzer.P .deps/libpcap.P .deps/netmon.P .deps/netxray.P \
|
||||
.deps/ngsniffer.P .deps/radcom.P .deps/snoop.P .deps/wtap.P
|
||||
SOURCES = $(libwiretap_a_SOURCES)
|
||||
OBJECTS = $(libwiretap_a_OBJECTS)
|
||||
|
||||
all: Makefile $(LIBRARIES) config.h
|
||||
OBJECTS = $(am_libwiretap_a_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .c .l .o .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/$(altdir)configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): configure.in
|
||||
$(ACLOCAL_M4): configure.in acinclude.m4
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
$(srcdir)/configure: $(srcdir)/$(altdir)configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@:
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h stamp-hT
|
||||
@echo timestamp > stamp-hT 2> /dev/null
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h
|
||||
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
@mv stamp-hT stamp-h
|
||||
$(srcdir)/config.h.in: $(srcdir)/./stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/./stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/./stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/./stamp-h.in: $(top_srcdir)/$(altdir)configure.in $(ACLOCAL_M4) acconfig.h
|
||||
@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
|
||||
@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in
|
||||
@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
|
@ -173,12 +243,6 @@ distclean-noinstLIBRARIES:
|
|||
|
||||
maintainer-clean-noinstLIBRARIES:
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
|
@ -188,17 +252,44 @@ distclean-compile:
|
|||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
ascend-grammar.o:
|
||||
ascend-scanner.o:
|
||||
ascend.o:
|
||||
buffer.o:
|
||||
file.o:
|
||||
iptrace.o:
|
||||
lanalyzer.o:
|
||||
libpcap.o:
|
||||
netmon.o:
|
||||
netxray.o:
|
||||
ngsniffer.o:
|
||||
radcom.o:
|
||||
snoop.o:
|
||||
wtap.o:
|
||||
|
||||
libwiretap.a: $(libwiretap_a_OBJECTS) $(libwiretap_a_DEPENDENCIES)
|
||||
-rm -f libwiretap.a
|
||||
$(AR) cru libwiretap.a $(libwiretap_a_OBJECTS) $(libwiretap_a_LIBADD)
|
||||
$(RANLIB) libwiretap.a
|
||||
.l.c:
|
||||
$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
.y.c:
|
||||
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
ascend-grammar.h: ascend-grammar.c
|
||||
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
|
@ -227,29 +318,31 @@ top_distdir = $(distdir)
|
|||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& $(MAKE) install \
|
||||
&& $(MAKE) installcheck \
|
||||
&& $(MAKE) dist
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
$(AMTAR) ch$(AMTARFLAGS)f - $(distdir) | GZIP=$(GZIP_ENV) gzip -c > $(distdir).tar.gz
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
|
@ -262,9 +355,13 @@ distdir: $(DISTFILES)
|
|||
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
|
@ -276,72 +373,95 @@ mostlyclean-depend:
|
|||
clean-depend:
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
maintainer-clean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c $<
|
||||
@-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*D)/$(*F).P; \
|
||||
rm .deps/$(*D)/$(*F).pp
|
||||
|
||||
%.lo: %.c
|
||||
@echo '$(LTCOMPILE) -c $<'; \
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
|
||||
< .deps/$(*F).p > .deps/$(*F).P
|
||||
@-rm -f .deps/$(*F).p
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec:
|
||||
@$(NORMAL_INSTALL)
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*D)/$(*F).pp -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
||||
< .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
|
||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||
>> .deps/$(*D)/$(*F).P; \
|
||||
rm -f .deps/$(*D)/$(*F).pp
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-data:
|
||||
@$(NORMAL_INSTALL)
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LIBRARIES) config.h
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(DISTCLEANFILES)
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
|
||||
-test -z "ascend-scanner.cascend-grammar.hascend-grammar.c" || rm -f ascend-scanner.c ascend-grammar.h ascend-grammar.c
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-noinstLIBRARIES \
|
||||
mostlyclean-compile mostlyclean-tags mostlyclean-depend \
|
||||
mostlyclean-generic
|
||||
|
||||
clean: clean-hdr clean-noinstLIBRARIES clean-compile clean-tags \
|
||||
clean-depend clean-generic mostlyclean
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
distclean: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
|
||||
distclean-tags distclean-depend distclean-generic clean
|
||||
clean-am: clean-hdr clean-noinstLIBRARIES clean-compile clean-tags \
|
||||
clean-depend clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-noinstLIBRARIES distclean-compile \
|
||||
distclean-tags distclean-depend distclean-generic \
|
||||
clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-hdr maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-am: maintainer-clean-hdr \
|
||||
maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-depend maintainer-clean-generic \
|
||||
distclean
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
|
@ -350,12 +470,17 @@ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
|||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
|
||||
distclean-depend clean-depend maintainer-clean-depend info dvi \
|
||||
installcheck install-exec install-data install uninstall all \
|
||||
distclean-depend clean-depend maintainer-clean-depend info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all install-strip \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
ascend-scanner.c : ascend-scanner.l
|
||||
$(LEX) -Pascend -t $(srcdir)/ascend-scanner.l > ascend-scanner.c
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.am
|
||||
# Automake file for Wiretap
|
||||
#
|
||||
# $Id: Makefile.am,v 1.19 1999/09/09 03:54:38 guy Exp $
|
||||
# $Id: Makefile.am,v 1.20 1999/09/11 04:50:43 gerald Exp $
|
||||
#
|
||||
# Ethereal - Network traffic analyzer
|
||||
# By Gerald Combs <gerald@zing.org>
|
||||
|
@ -31,6 +31,10 @@ CLEANFILES = \
|
|||
*~
|
||||
|
||||
libwiretap_a_SOURCES = \
|
||||
ascend-grammar.y \
|
||||
ascend-scanner.l \
|
||||
ascend.c \
|
||||
ascend.h \
|
||||
buffer.c \
|
||||
buffer.h \
|
||||
file.c \
|
||||
|
@ -56,3 +60,9 @@ libwiretap_a_SOURCES = \
|
|||
EXTRA_DIST = \
|
||||
config.h.win32 \
|
||||
Makefile.nmake
|
||||
|
||||
# Any POSIX-compatible YACC should honor the -p flag
|
||||
YFLAGS=-d -p ascend
|
||||
|
||||
ascend-scanner.c : ascend-scanner.l
|
||||
$(LEX) -Pascend -t $(srcdir)/ascend-scanner.l > ascend-scanner.c
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $Id: configure.in,v 1.12 1999/07/13 02:53:23 gram Exp $
|
||||
# $Id: configure.in,v 1.13 1999/09/11 04:50:44 gerald Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(wtap.c)
|
||||
AM_INIT_AUTOMAKE(libwtap.a, 0.0.0)
|
||||
|
@ -7,7 +7,12 @@ AM_CONFIG_HEADER(config.h)
|
|||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(LEX, flex)
|
||||
|
||||
AC_SUBST(FLEX_PATH)
|
||||
|
||||
# If we're running gcc, add '-Wall' to CFLAGS.
|
||||
AC_MSG_CHECKING(to see if we can add '-Wall' to CFLAGS)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* file.c
|
||||
*
|
||||
* $Id: file.c,v 1.19 1999/08/28 01:19:43 guy Exp $
|
||||
* $Id: file.c,v 1.20 1999/09/11 04:50:44 gerald Exp $
|
||||
*
|
||||
* Wiretap Library
|
||||
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
||||
|
@ -33,6 +33,7 @@
|
|||
#include "lanalyzer.h"
|
||||
#include "ngsniffer.h"
|
||||
#include "radcom.h"
|
||||
#include "ascend.h"
|
||||
#include "libpcap.h"
|
||||
#include "snoop.h"
|
||||
#include "iptrace.h"
|
||||
|
@ -64,9 +65,16 @@ static int (*open_routines[])(wtap *, int *) = {
|
|||
iptrace_open,
|
||||
netmon_open,
|
||||
netxray_open,
|
||||
radcom_open
|
||||
radcom_open,
|
||||
ascend_open
|
||||
};
|
||||
|
||||
int wtap_def_seek_read (FILE *fh, int seek_off, guint8 *pd, int len)
|
||||
{
|
||||
fseek(fh, seek_off, SEEK_SET);
|
||||
return fread(pd, sizeof(guint8), len, fh);
|
||||
}
|
||||
|
||||
#define N_FILE_TYPES (sizeof open_routines / sizeof open_routines[0])
|
||||
|
||||
/* Opens a file and prepares a wtap struct */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* wtap.c
|
||||
*
|
||||
* $Id: wtap.c,v 1.17 1999/08/22 03:50:31 guy Exp $
|
||||
* $Id: wtap.c,v 1.18 1999/09/11 04:50:44 gerald Exp $
|
||||
*
|
||||
* Wiretap Library
|
||||
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
||||
|
@ -82,6 +82,9 @@ const char *wtap_file_type_string(wtap *wth)
|
|||
case WTAP_FILE_RADCOM:
|
||||
return "RADCOM WAN/LAN analyzer";
|
||||
|
||||
case WTAP_FILE_ASCEND:
|
||||
return "Lucent/Ascend access server trace";
|
||||
|
||||
default:
|
||||
g_error("Unknown capture file type %d", wth->file_type);
|
||||
return NULL;
|
||||
|
@ -156,6 +159,10 @@ void wtap_close(wtap *wth)
|
|||
g_free(wth->capture.netxray);
|
||||
break;
|
||||
|
||||
case WTAP_FILE_ASCEND:
|
||||
g_free(wth->capture.ascend);
|
||||
break;
|
||||
|
||||
/* default:
|
||||
nothing */
|
||||
}
|
||||
|
@ -179,3 +186,14 @@ int wtap_loop(wtap *wth, int count, wtap_handler callback, u_char* user,
|
|||
else
|
||||
return TRUE; /* success */
|
||||
}
|
||||
|
||||
int wtap_seek_read (int encaps, FILE *fh, int seek_off, guint8 *pd, int len) {
|
||||
switch (encaps) {
|
||||
case WTAP_ENCAP_ASCEND:
|
||||
ascend_seek_read(fh, seek_off, pd, len);
|
||||
break;
|
||||
default:
|
||||
wtap_def_seek_read(fh, seek_off, pd, len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* wtap.h
|
||||
*
|
||||
* $Id: wtap.h,v 1.35 1999/08/28 01:19:45 guy Exp $
|
||||
* $Id: wtap.h,v 1.36 1999/09/11 04:50:44 gerald Exp $
|
||||
*
|
||||
* Wiretap Library
|
||||
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
||||
|
@ -88,9 +88,10 @@
|
|||
#define WTAP_ENCAP_LAPB 11
|
||||
#define WTAP_ENCAP_ATM_SNIFFER 12
|
||||
#define WTAP_ENCAP_NULL 13
|
||||
#define WTAP_ENCAP_ASCEND 14
|
||||
|
||||
/* last WTAP_ENCAP_ value + 1 */
|
||||
#define WTAP_NUM_ENCAP_TYPES 13
|
||||
#define WTAP_NUM_ENCAP_TYPES 15
|
||||
|
||||
/* File types that can be read by wiretap.
|
||||
We may eventually support writing some or all of these file types,
|
||||
|
@ -108,6 +109,7 @@
|
|||
#define WTAP_FILE_NETXRAY_1_1 11
|
||||
#define WTAP_FILE_NETXRAY_2_001 12
|
||||
#define WTAP_FILE_RADCOM 13
|
||||
#define WTAP_FILE_ASCEND 14
|
||||
|
||||
/*
|
||||
* Maximum packet size we'll support.
|
||||
|
@ -163,6 +165,12 @@ typedef struct {
|
|||
int version_major;
|
||||
} netxray_t;
|
||||
|
||||
typedef struct {
|
||||
time_t inittime;
|
||||
int adjusted;
|
||||
int seek_add;
|
||||
} ascend_t;
|
||||
|
||||
/* Packet "pseudo-header" information for X.25 capture files. */
|
||||
struct x25_phdr {
|
||||
guint8 flags; /* ENCAP_LAPB : 1st bit means From DCE */
|
||||
|
@ -270,6 +278,7 @@ typedef struct wtap {
|
|||
radcom_t *radcom;
|
||||
netmon_t *netmon;
|
||||
netxray_t *netxray;
|
||||
ascend_t *ascend;
|
||||
} capture;
|
||||
|
||||
subtype_read_func subtype_read;
|
||||
|
@ -311,6 +320,8 @@ int wtap_file_type(wtap *wth);
|
|||
const char *wtap_file_type_string(wtap *wth);
|
||||
const char *wtap_strerror(int err);
|
||||
void wtap_close(wtap *wth);
|
||||
int wtap_seek_read (int encaps, FILE *fh, int seek_off, guint8 *pd, int len);
|
||||
int wtap_def_seek_read (FILE *fh, int seek_off, guint8 *pd, int len);
|
||||
|
||||
wtap_dumper* wtap_dump_open(const char *filename, int filetype, int encap,
|
||||
int snaplen, int *err);
|
||||
|
|
Loading…
Reference in New Issue