Commit Graph

21 Commits

Author SHA1 Message Date
Guy Harris e425e372ca Have "fddifc_to_str()" return "Unknown frame type" for a frame type it
doesn't know about, and eliminate the check in "dissect_fddi()" where we
check if its return value was NULL and, if so, print "Unknown frame
type".

svn path=/trunk/; revision=644
1999-09-10 04:53:14 +00:00
Gilbert Ramirez b0bd01b53f Changed default return value of fddifc_to_str from NULL to "". The value
is passed to col_add_str, which is then passed to strncpy, which, at least
in glibc 2.1, doesn't like NULL pointers passed to it in lieu of empty
strings.

svn path=/trunk/; revision=643
1999-09-10 03:16:08 +00:00
Guy Harris b24043fe31 More completely decode the frame control field of an FDDI frame.
In the summary display for FDDI frames, make the protocol FDDI and the
info field the description of the frame control field (which will be
overridden by other protocols, if the frame is an async LLC frame).

svn path=/trunk/; revision=558
1999-08-24 06:01:45 +00:00
Guy Harris 678b5fd6ff Add a new Wiretap encapsulation type WTAP_ENCAP_FDDI_BITSWAPPED, meaning
"FDDI with the MAC addresses bit-swapped"; whether the MAC addresses are
bit-swapped is a property of the machine on which the capture was taken,
not of the machine on which the capture is being read - right now, none
of the capture file formats we read indicate whether FDDI MAC addresses
are bit-swapped, but this does let us treat non-"libpcap" captures as
being bit-swapped or not bit-swapped independent of the machine on which
they're being read (and of the machine on which they were captured, but
I have the impression they're bit-swapped on most platforms), and allows
us to, if, as, and when we implement packet capture in Wiretap, mark
packets in a capture file written in Wiretap-native format based on the
machine on which they are captured (assuming the rule "Ultrix, Alpha,
and BSD/OS are the only platforms that don't bit-swap", or some other
compile-time rule, gets the right answer, or that some platform has
drivers that can tell us whether the addresses are bit-swapped).

(NOTE: if, for any of the capture file formats used only on one
platform, FDDI MAC addresses aren't bit-swapped, the code to read that
capture file format should be fixed to flag them as not bit-swapped.)

Use the encapsulation type to decide whether to bit-swap addresses in
"dissect_fddi()".

svn path=/trunk/; revision=557
1999-08-24 03:19:34 +00:00
Gilbert Ramirez 42aba512c6 Alwasy compile in swaptab[] so that we can swap addresses, even if we
don't need to.

svn path=/trunk/; revision=554
1999-08-23 22:13:35 +00:00
Gilbert Ramirez b2f932c1db Changed the display filter scanner from GLIB's GScanner to lex. The code
as it standed depends on your lex being flex, but that only matters if you're
a developer. The distribution will include the dfilter-scanner.c file, so
that if the user doesn't modify dfilter-scanner.l, he won't need flex to
re-create the *.c file.

The new lex scanner gives me better syntax checking for ether addresses. I
thought I could get by using GScanner, but it simply wasn't powerful enough.

All operands have English-like abbreviations and C-like syntax:
and, && ; or, || ; eq, == ; ne, != ; , etc.

I removed the ETHER_VENDOR type in favor of letting the user use the [x:y]
notation:	ether.src[0:3] == 0:6:29 instead of ether.srcvendor == 00:06:29

I implemented the IPXNET field type; it had been there before, but was
not implemented. I chose to make it use integer values rather than byte
ranges, since an IPX Network is 4 bytes. So a display filter looks like this:
	ipx.srcnet == 0xc0a82c00
rather than this:
	ipx.srcnet == c0:a8:2c:00

I can supposrt the byte-range type IPXNET in the future, very trivially.

I still have more work to do on the parser though. It needs to check ranges
when extracting byte ranges ([x:y]) from packets. And I need to get rid
of those reduce/reduce errors from yacc!

svn path=/trunk/; revision=414
1999-08-01 04:28:20 +00:00
Gilbert Ramirez 7bd6c15378 Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.

svn path=/trunk/; revision=402
1999-07-29 05:47:07 +00:00
Gilbert Ramirez 0d36ec8de2 Modified the proto_register_field_array usage again. Thanks to Guy's
suggestion, this new method using a static array should use less memory
and be faster. It also has a nice side-effect of making the source-code
more readble, IMHO.

Changed the print routines to look for protocol proto_data instead of
looking at the text label as they did before, hoping that the data hex
dump field item starts with "Data (".

Added the -G keyword to ethereal to make it dump a glossary of display
filter keywords to stdout and exit. This data is then formatted with
the doc/dfilter2pod perl program to pod format, which is combined
with doc/ethereal.pod.template to create doc/ethereal.pod, from which
the ethereal manpage is created. This way we can keep the manpage up-to-date
with a list of fields that can be filtered on.

svn path=/trunk/; revision=364
1999-07-15 15:33:52 +00:00
Gilbert Ramirez acad5a3730 Documented the proto_register_field_array() function, and converted
the registration functions in packet-fddi.c and packet-eth.c to this new
registration method.

svn path=/trunk/; revision=346
1999-07-08 03:18:20 +00:00
Gilbert Ramirez 07f42b5b31 Created a new protocol tree implementation and a new display filter
mechanism that is built into ethereal. Wiretap is now used to read all
file formats. Libpcap is used only for capturing.

svn path=/trunk/; revision=342
1999-07-07 22:52:57 +00:00
Gilbert Ramirez ef3dfe2077 Removed all references to gtk objects from packet*.[ch] files. They now
reference the protocol tree with struct proto_tree and struct proto_item
objects. That way, the packet decoding source code file can be used with
non-gtk packet decoders, like a curses-based ethereal, e.g. I also re-arranged
some of the information in packet.h to more appropriate places (like other
packet-*.[ch] files).

svn path=/trunk/; revision=223
1999-03-23 03:14:46 +00:00
Gilbert Ramirez dc6a300eab Add the right byte count to fddi's initial add_item_to_tree so that the entire
FDDI header is highlighted in the hex dump.

svn path=/trunk/; revision=207
1999-03-02 20:50:05 +00:00
Guy Harris 75305346b5 When doing a capture, decode enough of the incoming packets to correctly
update the packet counts and percentages in the dialog box popped up
during a capture, even for non-Ethernet captures.

svn path=/trunk/; revision=184
1999-02-09 00:35:38 +00:00
Gerald Combs 6ca358948b * Added column formatting functionality.
* Added check_col(), add_col_str() and add_col_fmt() to replace references
  to ft->win_info.
* Added column prefs handling code.

svn path=/trunk/; revision=97
1998-11-17 04:29:13 +00:00
Guy Harris 4b2b211cd5 We have to include <sys/types.h>, if we have it, to declare "u_char", as
we no longer include <pcap.h>.

svn path=/trunk/; revision=84
1998-11-12 21:22:47 +00:00
Gilbert Ramirez fcb4c78a6a 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
1998-11-12 00:06:47 +00:00
Guy Harris f2f366e715 On most systems, bit-swap the bytes of an FDDI MAC address. (List of
systems on which you don't bit-swap them taken from "tcpdump"; the list
may not be complete.)

svn path=/trunk/; revision=48
1998-10-13 07:48:03 +00:00
Guy Harris d9850d803f Remove the length-on-wire and length-captured values from the FDDI
detail display; that's now in the "frame" detail display.

svn path=/trunk/; revision=46
1998-10-13 05:55:45 +00:00
Guy Harris 6de55279b9 Fix to use #define values as subscripts of "win_info[]".
svn path=/trunk/; revision=43
1998-10-13 05:12:13 +00:00
Gerald Combs 73e19611fd * Fixes for bugs introduced in last night's commit.
svn path=/trunk/; revision=37
1998-10-10 18:23:43 +00:00
Gerald Combs 1b26a7cdb7 * OSPF alignment fixes (Gerald)
* FDDI support (Laurent, Guy)

svn path=/trunk/; revision=36
1998-10-10 03:32:20 +00:00