aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
AgeCommit message (Collapse)AuthorFilesLines
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-02-25Fix file.c: Dereference of null pointer (clang analyzer)Hadriel Kaplan1-4/+4
Change-Id: Ib96e5ffb284234562c2883c13e93109173e22179 Reviewed-on: https://code.wireshark.org/review/368 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25Wireshark: Add option to choose format type of capture fileMichal Labedzki1-5/+5
The best heuristic can fail, so add possibility to manually choose capture file format type, so not correctly recognize file format can be loaded in Wireshark. On the other side now it is possible to open capture file as file format to be dissected. Change-Id: I5a9f662b32ff7e042f753a92eaaa86c6e41f400a Reviewed-on: https://code.wireshark.org/review/16 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Evan Huus <eapache@gmail.com>
2014-02-07Replace "svn" with "git" all over the place.Gerald Combs1-1/+1
Rename "SVNPATH" to "GITBRANCH" since that seems more appropriate. Rename "svnversion.h" to "version.h" as Evan suggested. Update some URLs. In make-version.pl, make sure we don't set an improper upstream branch name. Use the number of commits + short hash from `git describe` for package names by default. Change-Id: I922bba8d83eabdf49284a119f55b4076bc469b96 Reviewed-on: https://code.wireshark.org/review/139 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-01-22Don't write out packets that have a "captured length" bigger than we'reGuy Harris1-4/+31
willing to read or that's bigger than will fit in the file format; instead, report an error. For the "I can't write a packet of that type in that file type" error, report the file type in question. svn path=/trunk/; revision=54882
2014-01-21Check the return of wtap_dump_close() even if we've gotten a read error;Guy Harris1-3/+10
the only reason not to check it is if we've already gotten a write error and another write error would be superfluous (either "you got two of the same error" or "you got an I/O error *and* you ran out of disk space/disk quota" is of limited interest). Discard the return value of wtap_dump_close() in the case where we've already gotten a write error, in the hopes of squelching a Coverity warning. svn path=/trunk/; revision=54872
2014-01-13Fix crash when exporting to CSV filePascal Quantin1-1/+1
svn path=/trunk/; revision=54722
2014-01-02No seek-read routines use the length argument, so eliminate it fromGuy Harris1-2/+1
wtap_seek_read(). svn path=/trunk/; revision=54570
2013-12-05int -> gbooleanMartin Kaiser1-1/+1
svn path=/trunk/; revision=53800
2013-11-24Rmove packet_info argument from packet_list_append(), never used.Jakub Zawadzki1-1/+1
Part of attachment 12060, from Didier Gautheron (bug #9419). svn path=/trunk/; revision=53544
2013-11-17Move the epan/filesystem.c routines to wsutil; they're not specific toGuy Harris1-1/+1
packet dissection, they're specific to the entire Wireshark suite of programs. svn path=/trunk/; revision=53377
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-11-08The "file types" we have are actually combinations of types andGuy Harris1-11/+12
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-10-20Try to fix recent test failures (wild guess, can't reproduce).Jakub Zawadzki1-8/+6
svn path=/trunk/; revision=52717
2013-10-20wireshark: use epan_dissect_reset(), rawshark: fix missing ↵Jakub Zawadzki1-101/+156
epan_dissect_cleanup() svn path=/trunk/; revision=52711
2013-10-11cf_start_tail() is (now) just a wrapper around cf_open(). Get rid of it and ↵Jeff Morriss1-9/+0
just call cf_open(). svn path=/trunk/; revision=52553
2013-10-09g_list_prepend() is faster.Anders Broman1-1/+1
svn path=/trunk/; revision=52475
2013-09-22Get rid of struct addrinfo, use the hastables for name resolution instead.Anders Broman1-5/+4
svn path=/trunk/; revision=52176
2013-09-05Try to fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9106 :Pascal Quantin1-0/+1
Intialize phdr structure to avoid an invalid access to phdr->opt_comment svn path=/trunk/; revision=51791
2013-08-14Global variables considered harmful.Guy Harris1-53/+41
svn path=/trunk/; revision=51352
2013-08-13Only rescan packets if we have packets to rescan. Fixes at least the surfaceEvan Huus1-1/+3
problem in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9033 The underlying scoping issues may not be fully resolved yet. svn path=/trunk/; revision=51327
2013-08-07It's not necessary to call epan_free() in cf_open(): cf_close() (which isJeff Morriss1-2/+3
called by cf_open()) already calls epan_free(). svn path=/trunk/; revision=51188
2013-08-01use explicit cast to squelch compiler warningMartin Kaiser1-1/+1
svn path=/trunk/; revision=51093
2013-08-01Remove fdata->opt_comment, add pkt_comment to pinfoJakub Zawadzki1-20/+106
Original (read from file) comments can be accessed by pkthdr->opt_comment Keep user comments in seperated BST, add new method for epan session to get it. svn path=/trunk/; revision=51090
2013-07-30Remove interface_id, pack_flags from frame_data structure.Jakub Zawadzki1-4/+4
This patch assumes that wtap_phdr interface_id, pack_flags both from initial read and seek read will contain same values. Please fix if it's not. svn path=/trunk/; revision=51041
2013-07-23Make a routine not used outside file.c static.Guy Harris1-1/+1
svn path=/trunk/; revision=50857
2013-07-22Abuse epan_t more: add callback to get interface name.Jakub Zawadzki1-1/+2
svn path=/trunk/; revision=50794
2013-07-21Fix file.c:112:1: error: ‘static’ is not at beginning of declarationEvan Huus1-1/+1
[-Werror=old-style-declaration] svn path=/trunk/; revision=50775
2013-07-21Replace relative timestamp with reference frame number. Saves 16B per frame.Jakub Zawadzki1-15/+15
svn path=/trunk/; revision=50772
2013-07-21Add helper function to epan_session which can be used to get absolute ↵Jakub Zawadzki1-4/+36
timestamp of given frame. Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number. This patch reduce size of frame_data by 8B (amd64) This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13) svn path=/trunk/; revision=50765
2013-07-21Some work on multi file dissectionJakub Zawadzki1-22/+21
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-16Move merge.{h,c} into wiretap: these modules use wiretap to merge files.Jeff Morriss1-13/+14
svn path=/trunk/; revision=50656
2013-07-12Move the print modules into epan.Jeff Morriss1-2/+3
svn path=/trunk/; revision=50526
2013-07-11Move some more modules into epan.Jeff Morriss1-1/+0
svn path=/trunk/; revision=50517
2013-07-11packet dissection now takes pointer to tvb instead of guint8 dataJakub Zawadzki1-13/+14
implement frame_tvbuff, right now almost a copy of 'real' tvb. svn path=/trunk/; revision=50497
2013-06-29Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+0
svn path=/trunk/; revision=50232
2013-06-26Move tempfile.{h,c} into wsutil.Jeff Morriss1-1/+1
svn path=/trunk/; revision=50163
2013-06-25Fix build with packet editor enabled. (Fix a typo while we're at it.)Guy Harris1-1/+2
svn path=/trunk/; revision=50153
2013-06-20inform expert info layer about the current number of packet commentsMartin Kaiser1-0/+3
when the last comment is removed and we have no other expert info, the maximum severity is changed from comment to none svn path=/trunk/; revision=50091
2013-06-19Allow for column headers not to be printed in order to make it possible to ↵Chris Maynard1-3/+7
export packets as plain text in a format that could then have a chance of being imported again (assuming other factors such as packet bytes were printed, etc.) in order to recover the original pcap file. Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1636 svn path=/trunk/; revision=50036
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-19/+39
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-04-13Don't take the shortcut of moving/copying the existing file if we have a nameEvan Huus1-14/+44
resolution block to write (which isn't necessarily in the existing file). Fixes at least part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8317 svn path=/trunk/; revision=48842
2013-04-02Rename cf_not_saved() to cf_has_unsaved_data() to clarify what itGuy Harris1-1/+1
indicates. (Note: "unsaved data" is more than just "unsaved changes"; it could also mean "temporary file that hasn't been saved anywhere".) svn path=/trunk/; revision=48709
2013-04-01Add routines to file.c to indicate whether:Guy Harris1-5/+93
a save can be done ("can" in the sense of "there's something to save" and in the sense of "we can write that something out"); a "save as" can be done (in the sense of "we can write what we have out"); there's unsaved data to save (which might be unsaved changes or might be a temporary file full of packets); and use them as appropriate. This means that the "unsaved data" indicator in the UI will be turned on for temporary files full of packets as well as for files with unsaved changes; that's what we want. svn path=/trunk/; revision=48693
2013-04-01Add a wtap_dump_can_write() routine that indicates whether WiretapGuy Harris1-14/+8
supports writing files with a given set of encapsulations and comment types. Use it, rather than asking for a list of file formats that support the given set of encapsulation and comment types and checking whether we got back such a list, or duplicating its logic. Having file.c use it means that nobody's using wtap_dump_can_write_encaps() any more; get rid of it. Instead, have a private routine that checks whether a given file format supports a given set of encapsulations *and* comment types, and use that internally. svn path=/trunk/; revision=48690
2013-04-01Define a collection of bits for different types of capture file comments.Guy Harris1-4/+10
For each capture file type, have a bitset of comment types supported by that capture file type. Add a Wiretap routine that, for a given file type, returns the bitset of comment types it supports. Have wtap_get_savable_file_types() take a bitset of comment types that need to be supported by the file types it returns. Replace cf_has_comments() with a routine that returns a bitset of capture file comment types in the capture file. Use those routines in the capture file dialogs; don't wire in the notion that pcap-NG supports all comment types and no other file formats support any comment types. (That's currently true, but we don't want to wire that in as being forever true.) svn path=/trunk/; revision=48689
2013-03-27From Hadriel Kaplan via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8223Evan Huus1-12/+1
Add a 2-pass display-filter flag to tshark so that reassembly and other forward- looking dissections can be used with filters. It's a bit of a hack, but this entire area of 2-pass analysis etc. is a giant pile of hacks to begin with and needs cleaning up. For now just having this feature is a big enough win. svn path=/trunk/; revision=48589
2013-03-21Make internal functions static.Anders Broman1-1/+1
svn path=/trunk/; revision=48465
2013-03-20 From beroset:Bill Meier1-4/+4
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397 svn path=/trunk/; revision=48438
2013-03-15Fix the leaking of packet comments, i.e. the rest ofEvan Huus1-4/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7530 The frame_data_cleanup function was ambiguous; it was being used for two different purposes, and did neither of them quite properly. Split it instead into frame_data_reset and frame_data_destroy, and call the correct one depending on why we were originally calling frame_data_cleanup. svn path=/trunk/; revision=48324