Commit Graph

18 Commits

Author SHA1 Message Date
Bill Meier 5a0809c718 (Trivial) whitespace cleanup (mostly trailing whitespace).
svn path=/trunk/; revision=53172
2013-11-08 17:17:57 +00:00
Guy Harris 853da2eb9b The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Guy Harris d7380efa6d Put the code to fill in the struct wtap_pkthdr and to read the packet
data into a common routine, and use it in both the read and seek-read
routines.

svn path=/trunk/; revision=49996
2013-06-17 23:43:55 +00:00
Guy Harris 8c9edf1280 Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument.

This lets more of the libwiretap code be common between the read and
seek-read code paths, and also allows for more flexibility in the "fill
in the data" path - we can expand the buffer as needed in both cases.

svn path=/trunk/; revision=49949
2013-06-16 00:20:00 +00:00
Guy Harris 82f74c35fc Fill in the struct wtap_pkthdr in the seek-read routine.
svn path=/trunk/; revision=49404
2013-05-18 03:42:06 +00:00
Guy Harris 88e9d1c1e5 Do not call wtap_file_read_unknown_bytes() or
wtap_file_read_expected_bytes() from an open routine - open routines are
supposed to return -1 on error, 0 if the file doesn't appear to be a
file of the specified type, or 1 if the file does appear to be a file of
the specified type, but those macros will cause the caller to return
FALSE on errors (so that, even if there's an I/O error, it reports "the
file isn't a file of the specified type" rather than "we got an error
trying to read the file").

When doing reads in an open routine before we've concluded that the file
is probably of the right type, return 0, rather than -1, if we get
WTAP_ERR_SHORT_READ - if we don't have enough data to check whether a
file is of a given type, we should keep trying other types, not give up.
For reads done *after* we've concluded the file is probably of the right
type, if a read doesn't return the number of bytes we asked for, but
returns an error of 0, return WTAP_ERR_SHORT_READ - the file is
apparently cut short.

For NetMon and NetXRay/Windows Sniffer files, use a #define for the
magic number size, and use that for both magic numbers.

svn path=/trunk/; revision=46803
2012-12-27 12:19:25 +00:00
Guy Harris 07350b2b53 Squelch a (Y2.038K) warning.
svn path=/trunk/; revision=46751
2012-12-26 06:10:25 +00:00
Guy Harris 5996b49c53 Squelch implicit 64-bit-to-32-bit conversion warnings.
svn path=/trunk/; revision=46650
2012-12-21 03:32:16 +00:00
Jakub Zawadzki 78631020b8 Add wtap_pseudo_header union to wtap_pkthdr structure.
Use pkthdr instead of pseudo_header as argument for dissecting.

svn path=/trunk/; revision=45601
2012-10-16 21:50:57 +00:00
Jeff Morriss 3551a86c36 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45015
2012-09-20 01:29:52 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris 1fc695a022 Directly calculate the time stamp based on the offset in the stream from
the first bit in the stream.  This prevents accumulated truncation
errors.

Get the seek offset from file_tell().

svn path=/trunk/; revision=42436
2012-05-05 02:52:41 +00:00
Anders Broman ec0c5baf4f From Rolf Fiedler:
patch to fix mp2t.c to reject more byte streams that are not MPEG2.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7132

svn path=/trunk/; revision=42127
2012-04-18 08:32:12 +00:00
Jeff Morriss a572670849 From Martin Kaiser via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6984 :
The attached patch extends the mpeg2 ts format detection to take into account
that trailing bytes might be added to each packet.

Once it finds no sync after 188 bytes, it checks an additional 40 bytes for the
next sync byte and adjusts the packet size accordingly.

Only the 188 bytes of the actual ts packet are passed on to wiretap, the
trailer is omitted.

svn path=/trunk/; revision=41863
2012-03-30 23:19:49 +00:00
Anders Broman 995e10ef36 From Martin Kaiser:
wiretap mpeg2 ts: eof vs short read
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6909

svn path=/trunk/; revision=41350
2012-03-05 08:34:36 +00:00
Anders Broman 4db442ab90 From Martin Kaiser:
wiretap mpeg2 ts: more thorough check for sync byte.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6908

svn path=/trunk/; revision=41349
2012-03-05 08:30:39 +00:00
Guy Harris 57839d9e4a Flag mp2t file as really having only relative time stamps. Put the
comment on its own line in mpeg.c as well.

svn path=/trunk/; revision=41294
2012-03-02 10:17:36 +00:00
Anders Broman e82ad19e58 From Weston Schmidt: Add mpeg-ts capture file format support. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6894
svn path=/trunk/; revision=41286
2012-03-02 06:02:28 +00:00