aboutsummaryrefslogtreecommitdiffstats
path: root/text2pcap.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-05-11 22:13:42 -0400
committerGerald Combs <gerald@wireshark.org>2022-05-12 16:20:40 +0000
commit2e5a78dc6438d456bd92c54103432cdcf8d3a9ea (patch)
tree2d5f15c474b6802392062c5a71383f66cb2cf939 /text2pcap.c
parentb602911b31dc98a2b2c835f116396a7beb5fabbc (diff)
text2pcap: Switch default file format to pcapng
For the upcoming 4.0 release, switch the default file format for text2pcap to pcapng from pcap, to match other tools and the GUI behavior. Update the documentation and release notes appropriately. Deprecate the old -n flag; since pcapng is the default this has no effect. Changing the output capture file format is supported with the -F option, consistent with the other command line tools. Related to #18009.
Diffstat (limited to 'text2pcap.c')
-rw-r--r--text2pcap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/text2pcap.c b/text2pcap.c
index aeadbaf4ea..d774b0c9bb 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -210,7 +210,7 @@ print_usage (FILE *output)
" (def: 16: hexadecimal) No effect in hexdump mode.\n"
"\n"
"Output:\n"
- " -F <capture type> set the output file type; default is pcap.\n"
+ " -F <capture type> set the output file type; default is pcapng.\n"
" an empty \"-F\" option will list the file types.\n"
" -E <encap type> set the output file encapsulation type; default is\n"
" ether (Ethernet). An empty \"-E\" option will list\n"
@@ -221,7 +221,6 @@ print_usage (FILE *output)
" numbers.\n"
" Example: -l 7 for ARCNet packets.\n"
" -m <max-packet> max packet length in output; default is %d\n"
- " -n use pcapng instead of pcap as output format.\n"
" -N <intf-name> assign name to the interface in the pcapng file.\n"
"\n"
"Prepend dummy header:\n"
@@ -395,7 +394,7 @@ parse_options(int argc, char *argv[], text_import_info_t * const info, wtap_dump
wtap_encap_type = wtap_pcap_encap_to_wtap_encap(pcap_link_type);
break;
case 'm': max_offset = (guint32)strtol(ws_optarg, NULL, 0); break;
- case 'n': file_type_subtype = wtap_pcapng_file_type_subtype(); break;
+ case 'n': cmdarg_err("'-n' is deprecated; the output format already defaults to pcapng."); break;
case 'N': interface_name = ws_optarg; break;
case 'b':
{
@@ -858,7 +857,7 @@ parse_options(int argc, char *argv[], text_import_info_t * const info, wtap_dump
params->encap = wtap_encap_type;
params->snaplen = max_offset;
if (file_type_subtype == WTAP_FILE_TYPE_SUBTYPE_UNKNOWN) {
- file_type_subtype = wtap_pcap_file_type_subtype();
+ file_type_subtype = wtap_pcapng_file_type_subtype();
}
/* Request nanosecond precision. Most file formats only support one time
* precision and ignore this parameter (and the related options in the