diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-06-22 14:41:16 -0700 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-06-23 03:03:51 +0000 |
commit | bcae998048190ce70ae9d0cbc05dc61e9e66c3b4 (patch) | |
tree | 5346794d02b6f3f7976b7e01ee18a65440e66f1e /wireshark-qt.cpp | |
parent | 18a900f19126dead1f039c699b5e48b1c5fd2efd (diff) |
Qt: Support the -j, -J, and -l command line flags
Add support for -j, -J, and -l. Mark the -m flag deprecated.
Bug: 12546
Change-Id: Ic44b3997840018e5d571aa1813a1646bce11d4a6
Reviewed-on: https://code.wireshark.org/review/16083
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'wireshark-qt.cpp')
-rw-r--r-- | wireshark-qt.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 16fc62dc2e..cf73e5deb9 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -796,6 +796,22 @@ int main(int argc, char *argv[]) /* Jump to the specified frame number, kept for backward compatibility. */ cf_goto_frame(CaptureFile::globalCapFile(), commandline_info.go_to_packet); + } else if (commandline_info.jfilter != NULL) { + dfilter_t *jump_to_filter = NULL; + /* try to compile given filter */ + if (!dfilter_compile(commandline_info.jfilter, &jump_to_filter, &err_msg)) { + // Similar code in MainWindow::mergeCaptureFile(). + QMessageBox::warning(main_w, QObject::tr("Invalid Display Filter"), + QObject::tr("The filter expression %1 isn't a valid display filter. (%2).") + .arg(commandline_info.jfilter, err_msg), + QMessageBox::Ok); + g_free(err_msg); + } else { + /* Filter ok, jump to the first packet matching the filter + conditions. Default search direction is forward, but if + option d was given, search backwards */ + cf_find_packet_dfilter(CaptureFile::globalCapFile(), jump_to_filter, commandline_info.jump_backwards); + } } } } |