X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=editcap.c;h=cc1a0c9d386f87b002ef616468bfd467e049a4e4;hb=692f0145f45f93b67be2a2ee4067de84f78cc6f7;hp=ea9a1656e4e04132132eb764dc8e284dafbde313;hpb=ecb4dc396ef71feb67aeda7603e09b0cea0bc920;p=metze%2Fwireshark%2Fwip.git diff --git a/editcap.c b/editcap.c index ea9a1656e4..cc1a0c9d38 100644 --- a/editcap.c +++ b/editcap.c @@ -1,4 +1,5 @@ -/* Edit capture files. We can delete packets, adjust timestamps, or +/* editcap.c + * Edit capture files. We can delete packets, adjust timestamps, or * simply convert from one format to another format. * * Originally written by Richard Sharpe. @@ -63,7 +64,6 @@ #endif #ifdef _WIN32 -#include #include #include /* getpid */ #ifdef HAVE_WINSOCK2_H @@ -77,13 +77,14 @@ #include #include +#include #include #include #include #include #include #include -#include +#include #include #include #include @@ -283,11 +284,11 @@ add_selection(char *sel, guint* max_selection) selectfrm[max_selected].inclusive = FALSE; selectfrm[max_selected].first = (guint)strtoul(sel, NULL, 10); - if (selectfrm[max_selected].first < *max_selection) + if (selectfrm[max_selected].first > *max_selection) *max_selection = selectfrm[max_selected].first; if (verbose) - fprintf(stderr, " %i\n", selectfrm[max_selected].first); + fprintf(stderr, " %u\n", selectfrm[max_selected].first); } else { if (verbose) fprintf(stderr, "Inclusive ..."); @@ -302,11 +303,11 @@ add_selection(char *sel, guint* max_selection) /* Not a valid number, presume all */ selectfrm[max_selected].second = *max_selection = G_MAXUINT; } - else if (selectfrm[max_selected].second < *max_selection) + else if (selectfrm[max_selected].second > *max_selection) *max_selection = selectfrm[max_selected].second; if (verbose) - fprintf(stderr, " %i, %i\n", selectfrm[max_selected].first, + fprintf(stderr, " %u, %u\n", selectfrm[max_selected].first, selectfrm[max_selected].second); } @@ -736,9 +737,9 @@ print_usage(FILE *output) fprintf(output, " given time (format as YYYY-MM-DD hh:mm:ss).\n"); fprintf(output, "\n"); fprintf(output, "Duplicate packet removal:\n"); - fprintf(output, " --novlan remove vlan info from packets before checking for duplicates.\n"); + fprintf(output, " --novlan remove vlan info from packets before checking for duplicates.\n"); fprintf(output, " -d remove packet if duplicate (window == %d).\n", DEFAULT_DUP_DEPTH); - fprintf(output, " -D remove packet if duplicate; configurable \n"); + fprintf(output, " -D remove packet if duplicate; configurable .\n"); fprintf(output, " Valid values are 0 to %d.\n", MAX_DUP_DEPTH); fprintf(output, " NOTE: A of 0 with -v (verbose option) is\n"); fprintf(output, " useful to print MD5 hashes.\n"); @@ -746,14 +747,14 @@ print_usage(FILE *output) fprintf(output, " LESS THAN prior to current packet.\n"); fprintf(output, " A is specified in relative seconds\n"); fprintf(output, " (e.g. 0.000001).\n"); - fprintf(output, " -a : Add or replace comment for given frame number\n"); + fprintf(output, " -a : Add or replace comment for given frame number\n"); fprintf(output, "\n"); fprintf(output, " -I ignore the specified bytes at the beginning of\n"); - fprintf(output, " the frame during MD5 hash calculation\n"); + fprintf(output, " the frame during MD5 hash calculation.\n"); fprintf(output, " Useful to remove duplicated packets taken on\n"); - fprintf(output, " several routers(differents mac addresses for \n"); - fprintf(output, " example)\n"); - fprintf(output, " e.g. -I 26 in case of Ether/IP/ will ignore \n"); + fprintf(output, " several routers (different mac addresses for\n"); + fprintf(output, " example).\n"); + fprintf(output, " e.g. -I 26 in case of Ether/IP/ will ignore\n"); fprintf(output, " ether(14) and IP header(20 - 4(src ip) - 4(dst ip)).\n"); fprintf(output, "\n"); fprintf(output, " NOTE: The use of the 'Duplicate packet removal' options with\n"); @@ -773,8 +774,8 @@ print_usage(FILE *output) fprintf(output, " regions within a packet provided that at least 1\n"); fprintf(output, " choplen is positive and at least 1 is negative.\n"); fprintf(output, " -L adjust the frame (i.e. reported) length when chopping\n"); - fprintf(output, " and/or snapping\n"); - fprintf(output, " -t