aboutsummaryrefslogtreecommitdiffstats
path: root/ui/failure_message.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-01Move some command-line-oriented routines from wsutil to ui.Guy Harris1-1/+1
cmdarg_err() is for reporting errors for command-line programs and command-line errors in GUI programs; it's not something for any of the Wireshark libraries to use. The various routines for parsing numerical command-line arguments are not for general use, they're just for use when parsing arguments. Change-Id: I100bd4a55ab8ee4497f41d9651b0c5670e6c1e7f Reviewed-on: https://code.wireshark.org/review/31281 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-14Catch attempts to write multiple encapsulation types if unsupported.Guy Harris1-0/+11
If, in the process of opening the input file, we determine that it has packets of more than one link-layer type, we can catch attempts to write that file to a file of a format that doesn't support more than one link-layer type at the time we try to open the output file. If, however, we don't discover that the file has more than one link-layer type until we've already created the output file - for example, if we have a pcapng file with a new IDB, with a different link-layer type from previous IDBs, after packet blocks for the earlier interfces - we can't catch that until we try to write the packet. Currently, that causes the packet's data to be written out as is, so the output file claims it's of the file's link-layer type, causing programs reading the file to misdissect the packet. Report WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on the write attempt instead, and have a nicer error message for WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED on a write. Change-Id: Ic41f2e4367cfe5667eb30c88cc6d3bfe422462f6 Reviewed-on: https://code.wireshark.org/review/30617 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-01Fix comment end after SPDX identifierStig Bjørlykke1-1/+2
Move */ to a separate line below the SPDX identifier. Change-Id: Id1032215449cfccae0933147b45e04b65e0b727f Reviewed-on: https://code.wireshark.org/review/27211 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07Plug another leak for Wiretap errors.Guy Harris1-8/+10
Clean up comments while we're at it. Change-Id: I7e218ba3f998804045e3d7fab08d85d09a293d69 Reviewed-on: https://code.wireshark.org/review/26320 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-07failure_message.c: fix a memory leak if err is not negativePascal Quantin1-5/+3
Bug: 14489 Change-Id: I958cfae824c50263913ba9df8128e34e9466cb67 Reviewed-on: https://code.wireshark.org/review/26294 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: ronnie sahlberg <ronniesahlberg@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-02ui: use SPDX identifiers.Dario Lombardo1-14/+1
Change-Id: I6b05399395bcc35e59b73b4030ba4a05711a7b1a Reviewed-on: https://code.wireshark.org/review/25565 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-14Check for gzipped files even if we don't have libz.Guy Harris1-0/+16
If we aren't built with libz, report a new "decompression not supported" error if the file is gzipped; the problem isn't that it's a new capture file format we don't support, it's that a *compressed* capture file, in some format, but we don't support the *compression* format used. This can be extended if we add support for other compression formats. Change-Id: I19239525d4e02357e3ca7189996556839af8fce2 Reviewed-on: https://code.wireshark.org/review/25315 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Use cfile_write_failure_message() in the randpkt code.Guy Harris1-10/+18
Change-Id: I32ef7ff85f854782e5dd02c3e7f12436a120bc13 Reviewed-on: https://code.wireshark.org/review/21259 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Have separate routines for open-for-reading and open-for-writing errors.Guy Harris1-71/+97
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-20Make the command-line and alert-box failure messages more similar.Guy Harris1-15/+19
Change-Id: I94af221a0ce8b6b3ff8e0e1b94d5379351ac0962 Reviewed-on: https://code.wireshark.org/review/21251 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Fix a comment.Guy Harris1-1/+1
Change-Id: Ic99602ec405533dcf436463ee26bf312f9dd78f1 Reviewed-on: https://code.wireshark.org/review/21240 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Add common routines for command-line libwiretap error reporting.Guy Harris1-0/+413
These are similar to the routines added to ui/alert_box.c for dialog-box libwiretap error reporting. This centralizes the knowledge about what to say for various libwiretap errors, removing some duplicate code, and giving more details in some programs. Change-Id: I737405c4edaa0e6c27840f78a8c587a8b3ee120b Reviewed-on: https://code.wireshark.org/review/21234 Reviewed-by: Guy Harris <guy@alum.mit.edu>