diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2017-03-28 11:15:13 +0200 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-03-28 10:32:53 +0000 |
commit | bd486eb9b16640af51fb58995ff59c1434737dc2 (patch) | |
tree | 2b3997fc4f87af777bf9511cbce30fa3080a36c4 /text2pcap.c | |
parent | ed3b5e5764ce368edc6ca10b81411a7b01b29444 (diff) |
text2pcap: define max packet size to WTAP_MAX_PACKET_SIZE
Change-Id: I73ab87032e4a0c0259227622412be36aaf66a9d6
Reviewed-on: https://code.wireshark.org/review/20758
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/text2pcap.c b/text2pcap.c index dd58e722db..848c213c79 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -141,6 +141,8 @@ #include "writecap/pcapio.h" #include "text2pcap.h" +#include "wiretap/wtap.h" + #ifdef _WIN32 #include <wsutil/unicode-utils.h> #endif /* _WIN32 */ @@ -207,12 +209,11 @@ static guint32 direction = 0; /*--- Local date -----------------------------------------------------------------*/ /* This is where we store the packet currently being built */ -#define MAX_PACKET 65535 -static guint8 packet_buf[MAX_PACKET]; +static guint8 packet_buf[WTAP_MAX_PACKET_SIZE]; static guint32 header_length; static guint32 ip_offset; static guint32 curr_offset; -static guint32 max_offset = MAX_PACKET; +static guint32 max_offset = WTAP_MAX_PACKET_SIZE; static guint32 packet_start = 0; static int start_new_packet(gboolean); @@ -459,7 +460,7 @@ write_bytes (const char bytes[], guint32 nbytes) { guint32 i; - if (curr_offset + nbytes < MAX_PACKET) { + if (curr_offset + nbytes < WTAP_MAX_PACKET_SIZE) { for (i = 0; i < nbytes; i++) { packet_buf[curr_offset] = bytes[i]; curr_offset++; @@ -1450,7 +1451,7 @@ print_usage (FILE *output) " -q generate no output at all (automatically disables -d).\n" " -n use PCAP-NG instead of PCAP as output format.\n" "", - MAX_PACKET); + WTAP_MAX_PACKET_SIZE); } /*---------------------------------------------------------------------- |