aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/daintree-sna.c
AgeCommit message (Collapse)AuthorFilesLines
2013-05-17Move the header-processing code into a common daintree_sna_scan_header()Guy Harris1-63/+80
routine. Rename daintree_sna_hex_char() to daintree_sna_process_hex_data() (to more clearly indicate what it does - it doesn't process a single character, it processes a whole bunch of them), and have it do some error checking and fill in the length field in the wtap_pkthdr. svn path=/trunk/; revision=49356
2012-12-27Do not call wtap_file_read_unknown_bytes() orGuy Harris1-3/+13
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-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-3/+3
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45015
2012-05-04file_seek() used to be a wrapper around fseek() or gzseek(), both ofGuy Harris1-4/+1
which could use lseek() and were thus expensive due to system call overhead. To avoid making a system call for every packet on a sequential read, we maintained a data_offset field in the wtap structure for sequential reads. It's now a routine that just returns information from the FILE_T data structure, so it's cheap. Use it, rather than maintaining the data_offset field. Readers for some file formats need to maintain file offset themselves; have them do so in their private data structures. svn path=/trunk/; revision=42423
2012-04-22Global variables considered harmful (and unnecessary).Guy Harris1-13/+10
svn path=/trunk/; revision=42189
2012-02-25Add a presence flag field to the packet information structure filled inGuy Harris1-0/+2
by Wiretap, to indicate whether certain fields in that structure actually have data in them. Use the "time stamp present" flag to omit showing time stamp information for packets (and "packets") that don't have time stamps; don't bother working very hard to "fake" a time stamp for data files. Use the "interface ID present" flag to omit the interface ID for packets that don't have an interface ID. We don't use the "captured length, separate from packet length, present" flag to omit the captured length; that flag might be present but equal to the packet length, and if you want to know if a packet was cut short by a snapshot length, comparing the values would be the way to do that. More work is needed to have wiretap/pcapng.c properly report the flags, e.g. reporting no time stamp being present for a Simple Packet Block. svn path=/trunk/; revision=41185
2011-12-13Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports anyGuy Harris1-7/+7
form of corruption/bogosity in a file, including in a file header as well as in records in the file. Change the error message wtap_strerror() returns for it to reflect that. Use it for some file header problems for which it wasn't already being used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only be used for files that we have no reason to believe are invalid but that have a version number we don't know about or some other non-link-layer-encapsulation-type value we don't know about. svn path=/trunk/; revision=40175
2011-09-01Use guint8 rather than guchar for raw octets and pointers to arrays ofGuy Harris1-5/+5
same. Add to wiretap/pcap-common.c a routine to fill in the pseudo-header for ATM (by looking at the VPI, VCI, and packet data, and guessing) and Ethernet (setting the FCS length appropriately). Use it for both pcap and pcap-ng files. svn path=/trunk/; revision=38840
2011-04-21Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discoveredGuy Harris1-6/+6
by the gunzipping code. Have it also supply a err_info string, and report it. Have file_error() supply an err_info string. Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to suggest a decompression error - into the rawshark and tshark errors, along the lines of what other programs print. Fix a case in the Netscaler code where we weren't fetching the error code on a read failure. svn path=/trunk/; revision=36748
2011-04-07Be more picky about our sscanf integer field widths. Hopefully this willGerald Combs1-1/+1
help squelch Coverity CIDs 701-709. svn path=/trunk/; revision=36511
2010-08-24Fix issue which causes daintree-sna frames to be rejected with "capture ↵Bill Meier1-0/+2
length > packet length". This fix adds back two lines of code removed in SVN #33678. "Define WTAP_ENCAP_IEEE802_15_4_NOFCS, for use in file formats that don't include the FCS, and use it for the Daintree SNA file format. [...]" This fix just restores the discarding of two end-of-frame "pad" bytes as each frame is read from the capture file; This seems to me to be the correct behaviour. svn path=/trunk/; revision=33909
2010-08-24From Hamish Moffatt:Anders Broman1-0/+1
daintree-sna.c doesn't initialise capture_file snapshot_length. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5128 svn path=/trunk/; revision=33904
2010-07-30Define WTAP_ENCAP_IEEE802_15_4_NOFCS, for use in file formats that don'tGuy Harris1-9/+15
include the FCS, and use it for the Daintree SNA file format. While we're at it, explicitly check to make sure the purported packet length gives it at least one byte of packet data, and fix some print formats to use %u for unsigned values. svn path=/trunk/; revision=33678
2009-12-04Revise #31172 slightly to clarify #define dependenciesBill Meier1-4/+6
svn path=/trunk/; revision=31173
2009-12-04From: babiBill Meier1-2/+6
[Fix] potential memory problem (crash?) in daintree-sna. See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4294 (A parameterized version of the patch supplied in the above) svn path=/trunk/; revision=31172
2009-09-29Read nsecs as a signed value.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=30189
2009-05-24From Fred Fierling (bug 3486):Stig Bjørlykke1-0/+266
Added support for Daintree's Sensor Network Analyzer capture files. svn path=/trunk/; revision=28463