aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/etherpeek.c
AgeCommit message (Collapse)AuthorFilesLines
2006-11-05change all file offsets from long to gint64 so we can - theoretically - ↵ulfl1-8/+8
handle files > 2GB correct. Please distclean Win32 builds! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19814 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-26Ethereal now requires 64-bit integer support, so get rid of the tests ofguy1-12/+9
G_HAVE_GINT64. Get rid of the floating-point stuff in the Etherpeek Classic file reading code, just use 64-bit integers. Fix up the calculation of the nanoseconds portion of the time stamp. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15544 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-25timestamp display precision:ulfl1-0/+1
- automatic adjustment depending on file format - manual adjustment through menu items save the setting in the recent file git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15534 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! ulfl1-5/+5
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... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-03-03Have "wtap_read()" set "wth->phdr.pkt_encap" to "wth->file_encap",guy1-2/+1
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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10290 f5534014-38df-0310-8fa8-9805f1628bb7
2004-02-06Fix up a comment to note that this is also used for AiroPeek, and usedguy1-2/+9
only for versions 5, 6, and 7 of the file format. Add another comment explaining why this refers to "etherpeek" even though it's also used for AiroPeek and probably also TokenPeek. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9989 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-27Supply a pseudo-header for all 802.11 packets; add an "fcs_len" field toguy1-7/+17
it, similar to the Ethernet pseudo-header's "fcs_len" field, and use it in the 802.11 dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9884 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-10/+20
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". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-18WildPackets' EtherHelp appears to write EtherPeek-compatible files,guy1-1/+15
except that the 0x80 bit is turned on in the file version number field. Turn that bit off before processing that field. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9342 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-01Have a pseudo-header for Ethernet packets, giving the size of the FCS -guy1-7/+98
0 means "there is no FCS in the packet data", 4 means "there is an FCS in the packet data", -1 means "I don't know whether there's an FCS in the packet data, guess based on the packet size". Assume that Ethernet encapsulated inside other protocols has no FCS, by having the "eth" dissector assume that (and not check for an Ethernet pseudo-header). Have "ethertype()" take an argument giving the FCS size; pass 0 when appropriate. Fix up Wiretap routines to set the pseudo-header. This means we no longer use the "generic" seek-and-read routine, so get rid of it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8574 f5534014-38df-0310-8fa8-9805f1628bb7
2003-06-25GCC 3.3 noticed that checking whether the length of the slice is > 65535guy1-13/+1
is pointless, as it's a 16-bit unsigned quantity. Remove those checks - but note in a comment that WTAP_MAX_PACKET_SIZE must be at least 65535 (as there might well be link-layer types with packets at least that large). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7934 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-7/+7
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6115 f5534014-38df-0310-8fa8-9805f1628bb7
2002-07-29From Joerg Mayer:guy1-16/+12
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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5909 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-07Graeme Hewson noted that zlib has a bug wherein "gzseek()" doesn't setguy1-4/+2
the internal z_err value for the stream if an "fseek()" call it makes fails, so that if "gzerror()" is subsequently called, it returns Z_OK rather than an error. To work around this, we pass "file_seek()" an "int *err", and have the with-zlib version of "file_seek()" check, if "gzseek()" fails, whether the return value of "file_error()" is 0 and, if so, have it return "errno" instead. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5642 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-08The length passed into "seek_read" routines is the length supplied byguy1-6/+1
the "read" routine, which means it's already had any end-of-frame padding/FCS removed; we don't need to remove it in the "seek_read" routine. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5124 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-08Use WTAP_ENCAP_IEEE_802_11_WITH_RADIO for AiroPeek files, rather thanguy1-3/+105
having a special encapsulation type for AiroPeek files. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5123 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-27From Joerg Mayer: remove unused variables and declarations ofguy1-7/+1
non-existent functions. Remove the "filetype" argument from the "can_write_encap" functions for particular capture file types - the argument value is implicit, in that the routine being called is the routine for that particular file type. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4823 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-15Put in a missing "break;" statement. (Testing the untested AiroPeekguy1-1/+2
support revealed that I'd left it out; putting it back made it work.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4740 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromguy1-2/+2
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4709 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-29Untested support for AiroPeek captures.guy1-7/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4619 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-23Get rid of "m"/"M" and other Macintosh references in names - it appearsguy1-98/+166
that EtherPeek for Windows uses the same format as EtherPeek for MacOS, so the code isn't specific to the MacOS version. Check the physMedium value in the secondary header, and leave a placeholder for a value of 1, which is presumably used in AiroPeek captures. Treat unknown mediaType and physMedium values as indications that we don't have a *Peek file, not as unsupported *Peek files - we need all the heuristics we can get. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4601 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-22From Alan Harrison: set "wth->phdr.pkt_encap" to "wth->file_encap" inguy1-1/+2
the V7-format read routine. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4597 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Fixes to EtherPeek file reader code, from Alan Harrison.guy1-15/+44
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4593 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-18The time base in an EtherPeek capture isn't necessarily the start timeguy1-13/+12
of the capture, so change some names and comments. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4563 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-18It's EtherPeek, not Etherpeek, as WildPackets' Web site indicates.guy1-8/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4562 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-18In the EtherPeek file reader, keep the capture start time in a privateguy1-60/+76
data structure attached to the "wtap" structure, rather than in a pseudo-header structure; get rid of the EtherPeek pseudo-header structure, as it's not actually used as a pseudo-header, it's just used as private data for the EtherPeek reader. Get rid of an extra level of indentation in switch statements. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4561 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-05The data structure for per-packet headers for Mac V5 and V6 Etherpeekguy1-64/+96
files would put a 32-bit quantity on a 16-bit boundary without padding; this means that many compilers will insert the padding and thus make the structure not match what's in the file. Instead of using a C structure, #define values for the offsets of fields, read the header into an array of bytes, and extract values using the offsets. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4334 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-13Hopefully the last time I have to change my e-mail address.gram1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4199 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-04Use longs as file offsets, so that on platforms with 64-bit "long" weguy1-5/+5
can handle capture files bigger than 2GB. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3993 f5534014-38df-0310-8fa8-9805f1628bb7
2001-07-13From Joerg Mayer:guy1-3/+3
* gcc 3.0 warning fixes: - text2pcap.c: The number of characters to scan should probably not be 0 - wiretap/csids.c: using preincrement on a variable used on both sides of an assignment might be undefined by the C99(?) standard * turn on additional warnings for epan and wiretap too - epan/configure.in - wiretap/configure.in * Fix some warnings (missing includes, signed/unsigned, missing initializers) found by turning on the warnings - all other files :-) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3709 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-10Obliging every capture file reader's "open()" routine to seek to theguy1-4/+1
beginning of the file before reading anything from the file is bogus - do that in the loop that tries each of the open routines, instead. (They may have to reset the seek pointer later if, for example, the capture file begins with the first packet, and the "open()" routine looks at that packet to try to guess whether the packet is in the file format in question.) Set "wth->data_offset" to 0 while you're at it, so capture file readers don't have to do that, either. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3123 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-09Include "etherpeek.h", which declares routines we define, not "snoop.h",guy1-2/+2
which declares routines we neither define nor use. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3121 f5534014-38df-0310-8fa8-9805f1628bb7
2001-02-22Etherpeek version 5, 6, and 7 support, from Daniel Thompson.guy1-0/+314
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3066 f5534014-38df-0310-8fa8-9805f1628bb7