Commit Graph

111 Commits

Author SHA1 Message Date
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Jörg Mayer 96adc5f4a1 - Include the .h files in their .c files.
- Remove epan/dissectors/packet-sna.h, it isn't used anywhere.

svn path=/trunk/; revision=15475
2005-08-20 16:19:22 +00:00
Guy Harris 38ec1644e6 Add APIs to Wiretap to return the file of the size as supplied by the OS
(so if the file's gzipped, it's *NOT* the size of the file after
uncompressing), and an approximation of the amount of that data read
sequentially so far.

Use those for various progress bars and the like.

Make the fstat() in the Ascend trace reader directly use wth->fd, as
it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as
we're no longer directly using fstat() or lseek() in Ethereal), so get
rid of wtap_fd().

svn path=/trunk/; revision=15437
2005-08-19 19:40:00 +00:00
Anders Broman 8b0ed89155 From Hannes Gredler
- add support for Multi-Link Frame-Relay (FRF.15) captures
  taken on Juniper ML-, LS-, AS- PICs.

- rework of the common juniper header dissector:
    test the extension flag (0x80) which indicates that there are
    meta-information like interface-index, interface-name etc.
    present

- minor bugfix (LSQ L3-proto masks, direction masks were broken)

svn path=/trunk/; revision=15316
2005-08-12 21:08:02 +00:00
Anders Broman bd12fbef7f From Hannes Gredler:
support for support for DLT_JUNIPER_MLPPP

svn path=/trunk/; revision=14994
2005-07-22 15:55:06 +00:00
Anders Broman 8e48f993ae From Mark C Brown,:
Fixes for LAP-B (SX25L2) and X.25 (SX25L3) nettl trace records.

svn path=/trunk/; revision=14385
2005-05-17 19:50:38 +00:00
Ronnie Sahlberg 4e3c7cc716 From Hannes Gredler
support for Juniper PPPOE encapsulation


svn path=/trunk/; revision=14346
2005-05-11 11:24:17 +00:00
Michael Tüxen 23d022349d - Add support for libpcap files for MTP2 with a per packet header
indicating the direction, narrowband/broadband, and interface number.
- Add support to display the direction and interface number.
- Add support to packet-mtp2.c to use the broadband/narrowband indication.

svn path=/trunk/; revision=14265
2005-05-02 14:07:33 +00:00
Guy Harris 9f0d946003 Fix up the table of encapsulation type strings to match the new set of
encapsulation types.

svn path=/trunk/; revision=14007
2005-04-03 12:05:05 +00:00
Guy Harris 466c3e9c8d Make editcap use wtap_read(); that eliminates the last user of
wtap_loop(), so eliminate wtap_loop().

svn path=/trunk/; revision=14006
2005-04-03 11:00:49 +00:00
Guy Harris 467ece8920 From Florian Lohoff: Redback SmartEdge SE400/800 tcpdump disassembly.
svn path=/trunk/; revision=13212
2005-01-31 03:03:02 +00:00
Guy Harris c29e427533 From Yoshihiro Oyama: support "-" as a file name, referring to the
standard input.  Opening it for random access isn't supported; we add a
new error for that.

svn path=/trunk/; revision=13189
2005-01-28 11:31:19 +00:00
Guy Harris 36e8efcbca From Hannes Gredler: support for Juniper's DLT_JUNIPER_ATM{1,2} values.
svn path=/trunk/; revision=13130
2005-01-20 05:40:56 +00:00
Guy Harris 2f01986159 Add an entry for the new DLT_GPRS_LLC (so that nobody working on
Ethereal, unaware that the Ethereal team does *NOT* control libpcap
format, thinks they can just grab 169 and use it for their own
purposes).

svn path=/trunk/; revision=12678
2004-12-07 17:54:08 +00:00
Guy Harris 1e6a5d408c As Sam Leffler notes, the radiotap header isn't BSD-only, it's also used
by his madwifi Atheros driver on Linux; rename
WTAP_ENCAP_IEEE_802_11_WLAN_BSD to WTAP_ENCAP_IEEE_802_11_WLAN_RADIOTAP,
and change its text name from "ieee-802-11-bsd" to
"ieee-802-11-radiotap".

svn path=/trunk/; revision=12429
2004-10-29 02:40:01 +00:00
Guy Harris 3cdebd31db From Mark C. Brown: fix support for nettl NETTL_SUBSYS_NS_LS_ICMP and
NETTL_SUBSYS_NS_LS_ICMPV6 - they don't even have IP headers, so we need
to directly call the ICMP and ICMPv6 dissectors.

svn path=/trunk/; revision=12047
2004-09-19 07:13:52 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris c16562407d Add an encapsulation type for BACnet MS/TP, and map the newly-assigned
libpcap DLT_ value for BACnet MS/TP to it.

svn path=/trunk/; revision=11126
2004-06-07 20:28:51 +00:00
Guy Harris 5eb39c4638 From Albert Chin: "config.h" should come before all other #includes.
svn path=/trunk/; revision=10528
2004-03-30 19:37:31 +00:00
Guy Harris 30b2831847 Add support for DLT_APPLE_IP_OVER_IEEE_1394.
svn path=/trunk/; revision=10446
2004-03-23 01:02:41 +00:00
Guy Harris 48cd9f9358 Add support for DLT_ value 99, as used by the Axent Raptor
firewall/Symantec Enterprise Firewall.  Thanks, Axent/Symantec, for not
asking us for a DLT_ value and not telling us about the link-layer type.

svn path=/trunk/; revision=10361
2004-03-11 09:18:33 +00:00
Guy Harris ba72e955dc Have "wtap_read()" set "wth->phdr.pkt_encap" to "wth->file_encap",
rather than requiring individual capture file type handlers to do it
(unless they're doing per-packet encapsulation, in which case we check
to make sure they didn't *leave* it as WTAP_ENCAP_PER_PACKET).

svn path=/trunk/; revision=10290
2004-03-03 22:24:53 +00:00
Guy Harris cf131d9e16 The DLT_ value 127 is being used for the BSD radio header, and the
current CVS libpcap uses 163 for the AVS radio header (127 was never
used for the AVS radio header).  Redo the Wiretap encapsulation values
for that (and shuffle them to put the 802.11 Wiretap values together).

svn path=/trunk/; revision=9904
2004-01-29 10:58:28 +00:00
Guy Harris 677db2dadd From Tomas Kukosa: reserve private WTAP_ENCAP values and map them to
reserved private DLT_ values.

svn path=/trunk/; revision=9892
2004-01-28 01:24:30 +00:00
Guy Harris d6cd61061e Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for
WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and
WTAP_ERR_BAD_RECORD errors.  Replace the error messages logged with
"g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed
strings returned as the error info string, and change the callers of
those routines to, for those errors, put the info string into the
printed message or alert box for the error.

Add messages for cases where those errors were returned without printing
an additional message.

Nobody uses the error code from "cf_read()" - "cf_read()" puts up the
alert box itself for failures; get rid of the error code, so it just
returns a success/failure indication.

Rename "file_read_error_message()" to "cf_read_error_message()", as it
handles read errors from Wiretap, and have it take an error info string
as an argument.  (That handles a lot of the work of putting the info
string into the error message.)

Make some variables in "ascend-grammar.y" static.

Check the return value of "erf_read_header()" in "erf_seek_read()".

Get rid of an unused #define in "i4btrace.c".

svn path=/trunk/; revision=9852
2004-01-25 21:55:17 +00:00
Guy Harris b8299f0b98 From Jan Kiszka: IrDA support.
svn path=/trunk/; revision=9345
2003-12-18 19:07:14 +00:00
Guy Harris 02260b4056 From Jeff Morriss: add support for libpcap MTP2 and MTP3 captures.
Add a missing entry in "encap_table[]" for Bluetooth H4, and fix some
comments.

svn path=/trunk/; revision=9157
2003-12-03 22:40:39 +00:00
Guy Harris b624dce63b Add a new WTAP_ENCAP_CHDLC_WITH_PHDR type, to distinguish Cisco HDLC
captures with packet direction information from captures without it.
Use them appropriately.

svn path=/trunk/; revision=8780
2003-10-25 07:17:28 +00:00
Guy Harris 11a979dd4c Fix a typo.
svn path=/trunk/; revision=7681
2003-05-16 00:34:33 +00:00
Guy Harris 86f3c38c4a From Can Erkin Acar: OpenBSD is now using tcpdump.org-assigned DLT_
value for DLT_PFLOG, and that goes along with a change to the link-layer
header for DLT_PFLOG - support both the old and new values and format.

svn path=/trunk/; revision=7676
2003-05-15 07:14:46 +00:00
Guy Harris 3cc1053182 A captured length bigger than the actual length makes no sense; clip the
captured length so it's <= the actual length.

svn path=/trunk/; revision=7268
2003-03-04 02:38:02 +00:00
Guy Harris f88816e60f Add WTAP_ENCAP_FRELAY_WITH_PHDR for use with Frame Relay capture files
that have direction information.

Support writing WTAP_ENCAP_FRELAY_WITH_PHDR and WTAP_ENCAP_PPP_WITH_PHDR
captures out in libpcap format - we throw away the direction
information, but so it goes.

When reading/writing Windows Sniffer format, read and write the
direction flag.

svn path=/trunk/; revision=7052
2003-01-31 01:02:14 +00:00
Guy Harris 8e6518ea60 In the BSDs, ARCNET packets don't have an offset field between the
addresses and the protocol type, as supplied by BPF; on Linux, they *do*
have an offset field, as supplied by PF_PACKET sockets.  Add a new
WTAP_ENCAP_ARCNET_LINUX, with packets that include the offset field, and
don't dissect an offset in WTAP_ENCAP_ARCNET packets.

Map a libpcap link-layer type of 129 to WTAP_ENCAP_ARCNET_LINUX; that
value was recently assigned to Linux-style ARCNET.

Add some more ARCNET protocol IDs.

For most protocol IDs, dissect an ATA 878.2 fragmentation header; don't
do it for RFC 1051 IP and ARP, and Diagnose packets.  Set the length of
the ARCNET protocol tree item appropriately.

Dissect both the RFC 1051 and RFC 1201 styles of IP and ARP over ARCNET,
and dissect the RFC 1201 style of RARP as well.

svn path=/trunk/; revision=6981
2003-01-23 04:04:01 +00:00
Guy Harris 94800ef0fb From Chris Waters: support Tazmen Sniffer Protocol and DLT_TZSP captures
from network-based libpcaps that use that protocol.

svn path=/trunk/; revision=6875
2003-01-08 05:03:54 +00:00
Guy Harris e56b77f4cd Add support for SDLC encapsulation in DOS Sniffer captures; that
includes adding an SDLC dissector.

svn path=/trunk/; revision=6848
2003-01-03 22:31:26 +00:00
Guy Harris 0a5be3f18b Rename WTAP_ENCAP_ATM_SNIFFER to WTAP_ENCAP_ATM_PDUS, as it's not just
used for the DOS-based ATM Sniffer.  (That's not a great name, but I
couldn't think of a better one.)

Add a new WTAP_ENCAP_ATM_PDUS_UNTRUNCATED encapsulation type for capture
files where reassembled frames don't have trailers, such as the AAL5
trailer, chopped off.  That's what at least some versions of the
Windows-based ATM Sniffer appear to have.

Map the ATM capture file type for NetXRay captures to
WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, and put in stuff to fill in what we've
reverse-engineered, so far, for the pseudo-header; there's more that
needs to be done on it, e.g. getting the channel, AAL type, and traffic
type (or inferring them if they're not in the packet header).

svn path=/trunk/; revision=6840
2003-01-03 06:45:45 +00:00
Guy Harris 156254096a Add an item for Wellfleet HDLC.
svn path=/trunk/; revision=6813
2002-12-20 21:59:33 +00:00
Guy Harris 8ee4a65f76 From Solomon Peachy: support for new "wlancap" 802.11 extra-information
header.

Add overflow checks to "BYTES_ARE_IN_FRAME()", and cast all arguments to
unsigned values (negative values should never be passed) to squelch
compiler warnings.

svn path=/trunk/; revision=6567
2002-11-06 21:49:34 +00:00
Guy Harris 56f644145e Discard the WTAP_ENCAP_LAPD encapsulation type in favor of a
WTAP_ENCAP_ISDN encapsulation type, which includes a pseudo-header
giving the direction (user-to-network or network-to-user) and the
channel number.

Add a new circuit type, using the ISDN channel number as the circuit ID.

Add an ISDN dissector to put the direction and channel number into the
protocol tree and to call the appropriate dissector for the payload
based on the channel (LAPD for the D channel; V.120, PPP, or data for B
channels, based on some heuristics).

svn path=/trunk/; revision=6521
2002-10-31 07:12:42 +00:00
Guy Harris 2a54cd2a76 Add a Wiretap encapsulation type for RFC 2625 IP-over-Fibre Channel, and
map libpcap's DLT_IP_OVER_FC to it.

svn path=/trunk/; revision=6473
2002-10-22 09:11:13 +00:00
Jörg Mayer 64b6acac6d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6115
2002-08-28 20:30:45 +00:00
Guy Harris 20557c1fb7 From Anand V. Narwani: add an entry for the DOCSIS encapsulation to the
Wiretap table of encapsuations.

svn path=/trunk/; revision=5955
2002-08-06 05:40:47 +00:00
Guy Harris 5d929e0e8f From Motonori Shindo: support for reading CoSine L2 debug output.
svn path=/trunk/; revision=5922
2002-07-31 19:27:57 +00:00
Guy Harris 6e21561be8 From Joerg Mayer:
All files:
  - Replace types from sys/types.h by those from glib.h
  - Replace ntoh family of macros from netinet/in.h and winsock2.h
    by g_ntoh family from glib.h
  - Remove now unneeded includes of sys/types.h, netinet/in.h and
    winsock2.h
wtap.h
  Move includes to the top

svn path=/trunk/; revision=5909
2002-07-29 06:09:59 +00:00
Guy Harris 44d19627ef From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the
	standard error.

	Optimize the capture loop.

Fix some of the error-message printing code in Ethereal and Tethereal.

Have Wiretap check whether it can seek on a file descriptor, and pass
the results of that test to the file-type-specific "open for output"
routine.  Have the "open for output" routines for files where we need to
seek when writing the file return an error if seeks don't work.

svn path=/trunk/; revision=5884
2002-07-16 07:15:09 +00:00
Guy Harris 1b72ef68e6 Add a new error for attempts to open a pipe or FIFO for random access.
Have "wtap_open_offline()", if asked to open a FIFO, return that error
if it was asked to open the file for random access.

svn path=/trunk/; revision=5643
2002-06-07 07:47:58 +00:00
Guy Harris b2c46086c3 Use WTAP_ENCAP_IEEE_802_11_WITH_RADIO for AiroPeek files, rather than
having a special encapsulation type for AiroPeek files.

svn path=/trunk/; revision=5123
2002-04-08 09:44:42 +00:00
Guy Harris 939b3c8e0a Add an encapsulation type for "802.11 with radio information"; that type
returns radio information such as signal strength, channel, and data
rate in a pseudo-header.  Add that pseudo-header.

Use the "802.11 with radio information" encapsulation type for Wireless
Sniffer files; extract the radio information from where it appears to be
in the header.

Add dissector code for that encapsulation type.

Fix an error in the code to put radio information into the AiroPeek
tree.

Make the "wrapped" flag for NetXRay/Windows Sniffer captures a
"gboolean".

svn path=/trunk/; revision=5122
2002-04-08 09:09:49 +00:00
Guy Harris b5e9cef2bf Make "wtap_seek_read()" return TRUE on success and FALSE on error, like
"wtap_read()".

Add some additional error checks to the Sniffer file reader.

svn path=/trunk/; revision=4875
2002-03-05 08:40:27 +00:00
Guy Harris e300f4db52 Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.

Check for errors in one call to it, and note that we should do so in
other places.

In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.

In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.

In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).

svn path=/trunk/; revision=4874
2002-03-05 05:58:41 +00:00