diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-12-06 08:36:43 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-12-06 16:39:17 +0000 |
commit | 0946518780bc260d0668485b3f6f7e1d14325a7b (patch) | |
tree | 86b1941bb952fe1bf796a3b5a0919a7b14332734 | |
parent | 9df987d2a4270822da070449c1513698012490f1 (diff) |
Update comments, get rid of IMPORT_MAX_PACKET.
Get rid of the IMPORT_MAX_PACKET #define; just directly use
WTAP_MAX_PACKET_SIZE_STANDARD, to match what text2pcap.c does.
Update comments in text2pcap.c and ui/text_import.c to say the maximum
packet size is WTAP_MAX_PACKET_SIZE_STANDARD.
Change-Id: I34118f76426d1416fccf43b2a356ad8d200de19b
Ping-Bug: 15292
Reviewed-on: https://code.wireshark.org/review/30945
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | text2pcap.c | 5 | ||||
-rw-r--r-- | ui/qt/import_text_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/text_import.c | 9 | ||||
-rw-r--r-- | ui/text_import.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/text2pcap.c b/text2pcap.c index 62c3d28834..0eaf1588f1 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -59,8 +59,9 @@ * hexdump line is dropped (including mail forwarding '>'). The offset * can be any hex number of four digits or greater. * - * This converter cannot read a single packet greater than 64KiB-1. Packet - * snaplength is automatically set to 64KiB-1. + * This converter cannot read a single packet greater than + * WTAP_MAX_PACKET_SIZE_STANDARD. The snapshot length is automatically + * set to WTAP_MAX_PACKET_SIZE_STANDARD. */ #include <config.h> diff --git a/ui/qt/import_text_dialog.cpp b/ui/qt/import_text_dialog.cpp index e9b239cd2a..d55010fdc3 100644 --- a/ui/qt/import_text_dialog.cpp +++ b/ui/qt/import_text_dialog.cpp @@ -267,7 +267,7 @@ int ImportTextDialog::exec() { } } if (import_info_.max_frame_length == 0) { - import_info_.max_frame_length = IMPORT_MAX_PACKET; + import_info_.max_frame_length = WTAP_MAX_PACKET_SIZE_STANDARD; } convertTextFile(); @@ -513,7 +513,7 @@ void ImportTextDialog::on_payloadLineEdit_textChanged(const QString &payload) void ImportTextDialog::on_maxLengthLineEdit_textChanged(const QString &max_frame_len_str) { - check_line_edit(ti_ui_->maxLengthLineEdit, max_len_ok_, max_frame_len_str, 10, IMPORT_MAX_PACKET, true, &import_info_.max_frame_length); + check_line_edit(ti_ui_->maxLengthLineEdit, max_len_ok_, max_frame_len_str, 10, WTAP_MAX_PACKET_SIZE_STANDARD, true, &import_info_.max_frame_length); } void ImportTextDialog::on_buttonBox_helpRequested() diff --git a/ui/text_import.c b/ui/text_import.c index 4f55aadde5..6658d27e8c 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -56,8 +56,9 @@ * hexdump line is dropped (including mail forwarding '>'). The offset * can be any hex number of four digits or greater. * - * This converter cannot read a single packet greater than 64KiB-1. Packet - * snaplength is automatically set to 64KiB-1. + * This converter cannot read a single packet greater than + * WTAP_MAX_PACKET_SIZE_STANDARD. The snapshot length is automatically + * set to WTAP_MAX_PACKET_SIZE_STANDARD. */ #include "config.h" @@ -163,7 +164,7 @@ static guint32 direction = 0; /* This is where we store the packet currently being built */ static guint8 *packet_buf; static guint32 curr_offset = 0; -static guint32 max_offset = IMPORT_MAX_PACKET; +static guint32 max_offset = WTAP_MAX_PACKET_SIZE_STANDARD; static guint32 packet_start = 0; static void start_new_packet (void); @@ -941,7 +942,7 @@ text_import(text_import_info_t *info) packet_buf = (guint8 *)g_malloc(sizeof(HDR_ETHERNET) + sizeof(HDR_IP) + sizeof(HDR_SCTP) + sizeof(HDR_DATA_CHUNK) + - sizeof(HDR_EXPORT_PDU) + IMPORT_MAX_PACKET); + sizeof(HDR_EXPORT_PDU) + WTAP_MAX_PACKET_SIZE_STANDARD); if (!packet_buf) { diff --git a/ui/text_import.h b/ui/text_import.h index 334c99c02c..e7384ac957 100644 --- a/ui/text_import.h +++ b/ui/text_import.h @@ -24,8 +24,6 @@ extern "C" { #endif /* __cplusplus */ -#define IMPORT_MAX_PACKET WTAP_MAX_PACKET_SIZE_STANDARD - /* The parameter interface */ enum offset_type |