aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-05-31 21:30:40 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-05-31 21:30:40 +0000
commit87bcb9f8e58a69465531c5493fd520aa20184ebe (patch)
treeb2b9a302bd11e35e4732cb1e33ff001150bf7a9a /gtk/main.c
parentbd1442f452e3b24434df878713fd075bd9044203 (diff)
add new command line flag "-g", will go to a given packet, after loading a capture file with -r
svn path=/trunk/; revision=14511
Diffstat (limited to 'gtk/main.c')
-rw-r--r--gtk/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/main.c b/gtk/main.c
index a923e876fe..571373186d 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1604,8 +1604,9 @@ main(int argc, char *argv[])
GtkWidget *splash_win = NULL;
gboolean capture_child; /* True if this is the child for "-S" */
GLogLevelFlags log_flags;
+ guint go_to_packet = 0;
-#define OPTSTRING_INIT "a:b:c:f:Hhi:klLm:nN:o:pQr:R:Ss:t:w:vy:z:"
+#define OPTSTRING_INIT "a:b:c:f:g:Hhi:klLm:nN:o:pQr:R:Ss:t:w:vy:z:"
#ifdef HAVE_LIBPCAP
#ifdef _WIN32
@@ -1970,6 +1971,9 @@ main(int argc, char *argv[])
#endif
/*** all non capture option specific ***/
+ case 'g': /* Go to packet */
+ go_to_packet = get_positive_int("Ethereal", optarg, "go to packet");
+ break;
case 'h': /* Print help and exit */
print_usage(TRUE);
exit(0);
@@ -2444,6 +2448,10 @@ main(int argc, char *argv[])
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
+ /* if the user told us to jump to a specific packet, do it now */
+ if(go_to_packet != 0) {
+ cf_goto_frame(&cfile, go_to_packet);
+ }
break;
case CF_READ_ABORTED: