summaryrefslogtreecommitdiff
path: root/capinfos.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-29Eliminate some double-frees.Guy Harris1-5/+0
The cfile_ error-reporting routines free err_info; the caller doesn't have to and, in fact, mustn't do so themselves. While we're at it, make sure wtap_seek_read() always zeroes out *err and nulls out *err_info, so the latter either points to a freshly-allocated string or is null. Change-Id: Idfe05a3ba2fbf2647ba14e483187617ee53e3c69 Reviewed-on: https://code.wireshark.org/review/21407 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Have separate routines for open-for-reading and open-for-writing errors.Guy Harris1-2/+1
Expand comments while we're at it. Change-Id: I6dcc791eab1c9e323a9572f3d54720d223bdd64b Reviewed-on: https://code.wireshark.org/review/21252 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Use the new cfile_XXX_failure_message() routines more broadly.Guy Harris1-10/+20
Change-Id: I7814b3fd0353f4836ae61cbdbd4e13f659cbcb59 Reviewed-on: https://code.wireshark.org/review/21239 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-4/+6
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-23capinfos: Add -K option and report capture comments lastJim Young1-40/+47
This patch adds a capinfos -K option to suppess printing of capture comments. This patch also changes when capture comments are printed relative to the other enabled infos. Because capture comments are freeform we will now defer their printing until all but the interface detail infos are printed. Change-Id: Ibb3df040c09e4c67d714c561869c00e08b83d6ed Reviewed-on: https://code.wireshark.org/review/20643 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-20capinfos: Remove obsolete message from print_usage() report.Jim Young1-1/+0
Commit 6b84ddee83e70aff944da084129624226b7a32fa made libcrypt a mandatory dependency. Remove overlooked help message claiming that hashing support is not present. Change-Id: I908dbbf4d37253fe01513988a42f074322344c0f Reviewed-on: https://code.wireshark.org/review/20644 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-19capinfos: Ensure empty columns are written in -T reports.Jim Young1-10/+25
When using capinfo's -T report insure that proper placeholders are written to the records if any of the optional pcapng SHB block values are missing so as to maintain column alignment with the header record. Augment the comments about the potential silliness regarding the dumping of pcapng comments in capinfos -T reports. Change-Id: I43df4aeed2235f7ed9c67519c249361ab00680f1 Reviewed-on: https://code.wireshark.org/review/20613 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-26capinfos: use single exit point.Dario Lombardo1-5/+10
Change-Id: Ib1b556c07ec3e1f788c48038ed6bb0ae6af5cb7d Reviewed-on: https://code.wireshark.org/review/20196 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-18wsutil: remove leaks from filesystem and plugins code.Dario Lombardo1-0/+4
Change-Id: Iac2805c0130bd2ba6cdb3c9dd997050274d58d99 Reviewed-on: https://code.wireshark.org/review/20020 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-14wiretap: add cleanup routine.Dario Lombardo1-0/+1
The cleanup routine has been added to exit section of the applications. Those which required a exit restyle have been patched as well. Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1 Reviewed-on: https://code.wireshark.org/review/19949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-13Make Libgcrypt a mandatory dependencyPeter Wu1-34/+1
Removed all guards for HAVE_LIBGCRYPT, change autotools and CMake to error out if it is not available. Update release notes, developer documentation and README with the new status. Clarify relation with GnuTLS in macosx-setup.sh. Install Libgcrypt via brew script. Motivation for this change is that many dissectors depend on Libgcrypt and having it optional increases the maintenance burden (there have been several compile issues in the past due to the optional status). Furthermore, wsutil has crypto code that can be replaced by Libgcrypt. Change-Id: Idf0021b8c4cd5db70b8766f7dcc2a8b3acbf042f Link: https://www.wireshark.org/lists/wireshark-dev/201702/msg00011.html Reviewed-on: https://code.wireshark.org/review/20030 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-01-08Fix exit code for non-existent file.Dario Lombardo1-1/+1
The patched command line utilities have been aligned to tshark behavior. Change-Id: I0cb764b37792e882e182681124341893b3958c59 Reviewed-on: https://code.wireshark.org/review/19580 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-05Clean up initialization code for programs.Guy Harris1-17/+22
Make the init_progfile_dir() call unconditionally, even if plugins aren't supported, as that doesn't necessarily mean nobody uses the directory containing the executable. Report the error the same way in all programs, and free the error string after we're finished with it. Make the error - and the comment before the code - reflect what init_progfile_dir() is actually doing (the goal is to get the full pathname of the directory *containing* the executable; that's generally done by getting the pathname of the executable and stripping off the name of the executable, but that's won't necessarily always be the case). Also note for TShark that we won't be able to capture traffic, just as we do for Wireshark (if we don't have the pathname of the program file, we don't have a pathname to use to find dumpcap). Have the plugin scanner just fail silently if we weren't able to get the plugin directory path, so we don't have to worry about calling it if init_progfile_dir() fails. Clean up white space while we're at it. Change-Id: I8e580c719aab6fbf74a764bf6629962394fff7c8 Reviewed-on: https://code.wireshark.org/review/19076 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-04Have a routine to do all the work of initializing libwiretap.Guy Harris1-4/+2
Have programs that use libwiretap call that routine rather than separately calling some or all of init_open_routines(), wtap_register_plugin_types(), and wtap_opttypes_initialize(). Also don't have routines internal to libwiretap call those. Yes, this means doing some initialization work when it isn't necessary, but scattering on-demand calls throughout the code is a great way to forget to make those calls. Change-Id: I5828e1c5591c9d94fbb3eb0a0e54591e8fc61710 Reviewed-on: https://code.wireshark.org/review/19069 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-25Do GArray bounds checking.Guy Harris1-1/+4
Make sure we aren't going past the end of the array of per-interface packet counts. Change-Id: I6e19a5d375ebcc2193c37dc42c8f49836a5fd2c7 Reviewed-on: https://code.wireshark.org/review/17924 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-10capinfos: fix memleaksPeter Wu1-3/+13
Change-Id: Ib3145bb13d2a72c16f9c219fa19321e44958a30e Reviewed-on: https://code.wireshark.org/review/17622 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-09-05Have scan_plugins() take an argument specify what to do on load failures.Guy Harris1-7/+11
That's a less gross hack to suppress load failures due to not having libwiretap than providing a no-op failure-message routine, as it at least allows other code using a failure-message routine, such as cmdarg_err() and routines that call it, to be used. We really should put libwiretap and libwireshark plugins into separate subdirectories of the plugin directories, and avoid even looking at libwireshark plugins in programs that don't use libwireshark. Change-Id: I0a6ec01ecb4e718ed36233cfaf638a317f839a73 Reviewed-on: https://code.wireshark.org/review/17506 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-21No need to check for string option values being null.Guy Harris1-12/+7
A string option, if present, always has a value; it might be a null *string*, but you won't get a null pointer (if the option isn't present, it simply isn't present). Fix some comments while we're at it. Change-Id: I9c1420f56998a7d04de5c5cc2e92631b181f303a Reviewed-on: https://code.wireshark.org/review/16564 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-14Redo the block options APIs.Guy Harris1-25/+19
A block can have zero or more instances of a given option. We distinguish between "one instance only" options, where a block can have zero or one instance, and "multiple instances allowed" options, where a block can have zero or more instances. For "one instance only" options: "add" routines add an instance if there isn't one already and fail if there is; "set" routines add an instance if there isn't one already and change the value of the existing instance if there is one; "set nth" routines fail; "get" routines return the value of the instance if there is one and fail if there isn't; "get nth" routines fail. For "multiple instances allowed" options: "add" routines add an instance; "set" routines fail; "set nth" routines set the value of the nth instance if there is one and fail otherwise; "get" routines fail; "get nth" routines get the value if the nth instance if there is one and fail otherwise. Rename "optionblock" to just "block"; it describes the contents of a block, including both mandatory items and options. Add some support for NRB options, including IPv4 and IPv6 option types. Change-Id: Iad184f668626c3d1498b2ed00c7f1672e4abf52e Reviewed-on: https://code.wireshark.org/review/16444 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-10Always count packets per encapsulation.Guy Harris1-8/+5
Currently, for pcapng files, if all of the IDBs we've seen *so far* are the same, we report it as the file's encapsulation type; however, we may see IDBs of a different type in the future, so don't check for per-packet encapsulation before counting packets of the encapsulation type. Change-Id: I617ddcf2963aa16e7ba58855b3e5bf326ab7dc32 Reviewed-on: https://code.wireshark.org/review/15808 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-10Set the size of the packet counts array when we create it.Guy Harris1-0/+1
g_array_sized_new() sets the amount of *space allocated for* the array, but doesn't actually set its *length*. Change-Id: Ia7deab34c758c88910dfb0e246a6903301e68029 Reviewed-on: https://code.wireshark.org/review/15806 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-10Set cf_info.num_interfaces before using it.Guy Harris1-0/+1
Change-Id: I6ba5932f339ea6296dd91a6800721b11bcd4956a Reviewed-on: https://code.wireshark.org/review/15804 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-10Don't assume all IDBs are available aftre we open the file.Guy Harris1-18/+41
IDBs can occur anywhere in the file, so if we see an interface ID bigger than the number of IDBs we've see, re-fetch the interface information, update the IDB count, and grow the packet count array as necessary. Get the information strings for interfaces after reading the entire file; we don't need them until then. Change-Id: Ib6096e481e321de485710d14eadf7b5232bf0be7 Reviewed-on: https://code.wireshark.org/review/15797 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-09Use the locale's decimal separator for times as seconds and fraction.Guy Harris1-15/+34
We use it when printing *other* seconds-and-fraction values, as we're just using %f, so we should use it consistently. If you don't want commas as decimal separators, you presumably don't want them anywhere; if you want to standardize the way numbers are shown, set the locale to the C locale. This addresses one of the two problems mentioned in bug 12500; there may be other places in the Wireshark suite where we should use the locale's decimal separator in times. Change-Id: I41f1c44d12ebf0f46ff678c977a955d09831b0cf Ping-Bug: 12500 Reviewed-on: https://code.wireshark.org/review/15787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-08Check whether cf_info->shb is null before using it.Guy Harris1-68/+72
Fixes CID 1362571. Change-Id: I8cb930bade47653d172f8c2057e3bfc446f4e9af Reviewed-on: https://code.wireshark.org/review/15781 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-06Add a routine to get an array of all instances of a string option.Guy Harris1-163/+60
Use it for OPT_COMMENT in the SHB, as there may be ore than one instance of OPT_COMMENT in an SHB. Also, use wtap_optionblock_get_option_string for OPT_SHB_HARDWARE, OPT_SHB_OS, and OPT_SHB_USERAPPL; they're specified as "only one instance allowed". Change-Id: I23ad87e41e40b7ae1155e96c0523a6f8caad5204 Reviewed-on: https://code.wireshark.org/review/15750 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-06Directly use wtap_opttypes calls to fetch SHB options.Guy Harris1-1/+0
Don't put them in the summary structure; the summary routines should calculate summary statistics, not dig up every bit of information that *could* appear in a summary. Instead, have the GUI code call wtap_file_get_shb() to get the SHB information and call wtap_optionblock_get_option_string() to fetch the option values. Move the option code definitions into wtap_opttypes.h, as they're used by the API. Change-Id: Icef11f5fb30fdc3df1bb0208aae9ed0aebaf0182 Reviewed-on: https://code.wireshark.org/review/15748 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-28More use of wtap_optionblock_foreach_option().Guy Harris1-23/+86
Change-Id: I5c0eb9f399e00580d8fc25c5e164b7b67353655f Reviewed-on: https://code.wireshark.org/review/15602 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-28Use wtap_optionblock_foreach_option() to get the SHB options.Guy Harris1-66/+109
That way, we're not assuming that there's one, and only one, of each of those options. That also lets us not have to modify the options to replace linefeeds with spaces - we just make a copy of the option string, do the replacement, print the modified copy, and free the copy. Change-Id: I6c51a0a5e70ac01b03b3657a8e2aef39fefcafa6 Reviewed-on: https://code.wireshark.org/review/15601 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-22Add wtap_optionblock_set_option_string_formatMichael Mann1-4/+4
Also add a length parameter to wtap_optionblock_set_option_string Change-Id: I8c7bbc48aa96b5c2a91ab9a17980928d6894f1ee Reviewed-on: https://code.wireshark.org/review/15505 Reviewed-by: Anthony Coddington <anthony.coddington@endace.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-16Use a native Section Header block for capinfo.Michael Mann1-42/+47
This is intended to aid possible future efforts with generic block handling. Change-Id: Iff915a8d0d8ed20ef89c20e0cf7967a3416318c3 Reviewed-on: https://code.wireshark.org/review/15451 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-10capinfos: wsgcrypt.h checks internally if we HAVE_LIBGCRYPTMartin Kaiser1-2/+0
we can #include <wsutils/wsgcrypt.h> without doing the check ourselves Change-Id: Id0cee25e10c150105636574e683c39b81eb07ebf Reviewed-on: https://code.wireshark.org/review/15328 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-04-21Link version code statically againJoão Valverde1-1/+1
This allows keeping the code-sharing with the static linking. This "fixes" a hypothetical ABI mismatch with wsutil and avoids pulling more external dependencies to wsutil than strictly necessary. A nice side-effect is that libwsutil no longer depends on version.h. Follow up to f95976eefcbeb5d24df383c29d29ef888b503945. Change-Id: I8f0d6a557ab3f7ce6f0e2c269124c89f29d6ad23 Reviewed-on: https://code.wireshark.org/review/15002 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-04-04Include ws_diag_control.h in config.hJoão Valverde1-1/+0
Change-Id: Ia394071710ecda3b0e6686a51fbca45a8ff20317 Reviewed-on: https://code.wireshark.org/review/14749 Petri-Dish: João Valverde <j@v6e.pt> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-04-03Move zlib version check to wsutilJoão Valverde1-37/+2
Change-Id: I0950f61e90af5bb21c0017204de0c0b509616e5c Reviewed-on: https://code.wireshark.org/review/14747 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-28Fix some warnings/errors of typeJoerg Mayer1-1/+6
git/epan/dissectors/packet-a21.c:478:25: error: 'item' was marked unused but was used [-Werror,-Wused-but-marked-unused] proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown")); ^ Added manual change id because file-jpeg.c forced the use of commit -n Change-Id: Iffff53d6253758c8454d9583f0a11f317c8390cb Reviewed-on: https://code.wireshark.org/review/14666 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-26Fix compile errors when compiling w/o zlibDaniël van Eeden1-1/+1
Change-Id: I443cd0d4a143e456e11b5939891312a0501770a0 Reviewed-on: https://code.wireshark.org/review/14636 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-23Making wiretap option blocks more generic.Michael Mann1-6/+13
This was inspired by https://code.wireshark.org/review/9729/, but takes it in a different direction where all options are put into an array, regardless of whether they are "standard" or "custom". It should be easier to add "custom" options in this design. Some, but not all blocks have been converted. Descriptions of some of the block options have been moved from wtap.h to pcapng.h as it seems to be the one that implements the description of the blocks. Also what could be added/refactored is registering block behavior. Change-Id: I3dffa38f0bb088f98749a4f97a3b7655baa4aa6a Reviewed-on: https://code.wireshark.org/review/13667 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-06Clean up more includes of wtap.h.Guy Harris1-1/+2
Change-Id: Ie53b64f7e5b39a50dffb62fc0b886da71e0a3bd2 Reviewed-on: https://code.wireshark.org/review/13066 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-14Make init_progfile_dir() take a function pointer [-Wpedantic]João Valverde1-1/+1
Change-Id: I45f8ea5ee6ccc5a484c60ad6e686aaf30f6b0c98 Reviewed-on: https://code.wireshark.org/review/12557 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-12Remove -Wwrite-strings compiler flagJoão Valverde1-4/+2
The "-Wwrite-strings" flag produces nuisance warnings. These warnings are not useful, they're impossible to fix in a sane way and therefore are being handled with casts of static strings to (char *). This just moves the warning to [-Wcast-qual] and a compiler pragma is in turn required (and used) to squelch that warning. Remove the Wwrite-strings warning. Let that responsibility fall on the programmer (as is done by casting). Change-Id: I5a44dfd9decd6d80797a521a3373593074962fb5 Reviewed-on: https://code.wireshark.org/review/12162 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-11Update user guide for development releasePascal Quantin1-1/+1
Change-Id: I9b4c5ab2e98ad6daa618bcda20b53a23467e16e0 Reviewed-on: https://code.wireshark.org/review/11734 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-07Clean up includes of unistd.h, fcntl.h, and sys/stat.h.Guy Harris1-4/+0
Have wsutil/file_util.h include them on UN*X, just as it includes io.h on Windows, so we can have a rule of "if you do file operations, include <wsutil/file_util.h> and use the routines in it". Remove includes of unistd.h, fcntl.h, and sys/stat.h that aren't necessary (whether because of the addition of them to wsutil/file_util.h or because they weren't needed in the first place). Change-Id: Ie241dd74deff284e39a5f690a297dbb6e1dc485f Reviewed-on: https://code.wireshark.org/review/11619 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-23Don't assume we have interface information.Guy Harris1-4/+7
Not all capture file formats provide interface information. Check whether we have it, and don't fail if we don't have any. (Note that the current version of the pcapng specification in the Git repository does not require that there be at least one IDB in a file, only that there must be an IDB for each interface to which other blocks in a file refers.) Change-Id: Ia796f639ed3a8cb21e1dbe9b2bc6b4b66c7be479 Reviewed-on: https://code.wireshark.org/review/10220 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-19capinfos: add more info about file and interfacesHadriel Kaplan1-183/+212
Add more information about the capture file, and about the interface descriptions in it. Also remove long-unused g_options code. Change-Id: I93cbd70fc7b09ec1b8b2fd6c85bb885c7f749543 Reviewed-on: https://code.wireshark.org/review/10073 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-18Pcapng: clean up Section Header Block handlingHadriel Kaplan1-8/+7
Change-Id: I8516d0c561ed0b63e49a3594027c9c15bb789258 Reviewed-on: https://code.wireshark.org/review/9726 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-31Print times with the resolution from the capture file.Guy Harris1-56/+261
Print the first packet and last packet time stamps with the resolution supplied for them, and print the difference between them with the higher of those two resolutions. Change-Id: I111fbbf91b5957e63dca650b85f182c5f103c5fd Reviewed-on: https://code.wireshark.org/review/9840 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-28Don't use ctime().Guy Harris1-15/+16
The API checks warn about it being deprecated - that doesn't seem to cause a problem with the buildbot, but does result in failures from the Petri dish. Format the first and last packet time in an ISO 8601-style format. Call them "First packet time" and "Last packet time", rather than "Start time" and "End time", as they're not necessarily the times when the capture started or ended. (Both make the output a bit more like the Statistics -> Summary window.) Change-Id: Ibf02999851f49c7951c6f6152c70efa271414bd9 Reviewed-on: https://code.wireshark.org/review/7442 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-28Remove some unneeded includes of <sys/time.h>.Guy Harris1-4/+0
Change-Id: I9e4e6efa9f8c7dbff7627f8d5fc3278ab383618d Reviewed-on: https://code.wireshark.org/review/7441 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-20Suppress a bunch of cast-qual warnings.Gerald Combs1-2/+5
Squelch warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual] similar to g630f54f. Change strtod to g_ascii_strtod to squelch a checkAPIs error. Change-Id: Ib2d26ef89f08827a5adc07e35eaf876cd7b8d14e Reviewed-on: https://code.wireshark.org/review/7269 Reviewed-by: Gerald Combs <gerald@wireshark.org>