diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-02-11 06:17:30 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-02-11 06:17:30 +0000 |
commit | 22990ed08fa4cab9f8c2b771bee62013e8b591c6 (patch) | |
tree | 706de8a41c29f3d17ddda8d3d483b75c474922ee | |
parent | 75305346b532da113629c21311817099305762f3 (diff) | |
download | wireshark-22990ed08fa4cab9f8c2b771bee62013e8b591c6.tar.gz wireshark-22990ed08fa4cab9f8c2b771bee62013e8b591c6.tar.bz2 wireshark-22990ed08fa4cab9f8c2b771bee62013e8b591c6.zip |
Make the minimum and maximum packet sizes #defines.
Crank the maximum packet size up to 65535 bytes.
svn path=/trunk/; revision=185
-rw-r--r-- | capture.c | 12 | ||||
-rw-r--r-- | ethereal.c | 10 | ||||
-rw-r--r-- | ethereal.h | 5 | ||||
-rw-r--r-- | file.h | 4 |
4 files changed, 17 insertions, 14 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.18 1999/02/09 00:35:35 guy Exp $ + * $Id: capture.c,v 1.19 1999/02/11 06:17:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -257,8 +257,8 @@ capture_prep_cb(GtkWidget *w, gpointer d) { gtk_box_pack_start(GTK_BOX(caplen_hb), snap_lb, FALSE, FALSE, 6); gtk_widget_show(snap_lb); - adj = (GtkAdjustment *) gtk_adjustment_new((float) cf.snap, 1.0, 4096.0, - 1.0, 10.0, 0.0); + adj = (GtkAdjustment *) gtk_adjustment_new((float) cf.snap, 1.0, + MAX_PACKET_SIZE, 1.0, 10.0, 0.0); snap_sb = gtk_spin_button_new (adj, 0, 0); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (snap_sb), TRUE); gtk_widget_set_usize (snap_sb, 80, 0); @@ -365,9 +365,9 @@ capture_prep_ok_cb(GtkWidget *w, gpointer data) { open = GTK_TOGGLE_BUTTON(open_ck)->active; cf.snap = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(snap_sb)); if (cf.snap < 1) - cf.snap = 4096; - else if (cf.snap < 68) - cf.snap = 68; + cf.snap = MAX_PACKET_SIZE; + else if (cf.snap < MIN_PACKET_SIZE) + cf.snap = MIN_PACKET_SIZE; gtk_widget_destroy(GTK_WIDGET(data)); diff --git a/ethereal.c b/ethereal.c index 16c9ffb229..02a81d830b 100644 --- a/ethereal.c +++ b/ethereal.c @@ -1,6 +1,6 @@ /* ethereal.c * - * $Id: ethereal.c,v 1.21 1999/02/09 00:35:35 guy Exp $ + * $Id: ethereal.c,v 1.22 1999/02/11 06:17:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -442,7 +442,7 @@ main(int argc, char *argv[]) cf.cfilter = NULL; cf.iface = NULL; cf.save_file = NULL; - cf.snap = 68; + cf.snap = MIN_PACKET_SIZE; cf.count = 0; cf.cinfo.num_cols = prefs->num_cols; cf.cinfo.fmt_matx = (gboolean **) g_malloc(sizeof(gboolean *) * @@ -543,9 +543,9 @@ main(int argc, char *argv[]) } if (cf.snap < 1) - cf.snap = 4096; - else if (cf.snap < 68) - cf.snap = 68; + cf.snap = MAX_PACKET_SIZE; + else if (cf.snap < MIN_PACKET_SIZE) + cf.snap = MIN_PACKET_SIZE; rc_file = (gchar *) g_malloc(strlen(getenv("HOME")) + strlen(RC_FILE) + 4); sprintf(rc_file, "%s/%s", getenv("HOME"), RC_FILE); diff --git a/ethereal.h b/ethereal.h index 4f5a74e41a..58e8553b67 100644 --- a/ethereal.h +++ b/ethereal.h @@ -1,7 +1,7 @@ /* ethereal.h * Global defines, etc. * - * $Id: ethereal.h,v 1.10 1998/12/29 04:05:35 gerald Exp $ + * $Id: ethereal.h,v 1.11 1999/02/11 06:17:30 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -37,6 +37,9 @@ #define DEF_READY_MESSAGE " Ready to load or capture" #define EXTERNAL_FILTER "/usr/local/bin/ethereal_tcp_filter -f" +#define MIN_PACKET_SIZE 68 /* minimum amount of packet data we can read */ +#define MAX_PACKET_SIZE 65535 /* maximum amount of packet data we can read */ + /* Byte swapping routines */ #define SWAP16(x) \ ( (((x) & 0x00ff) << 8) | \ @@ -1,7 +1,7 @@ /* file.h * Definitions for file structures and routines * - * $Id: file.h,v 1.9 1999/01/07 16:15:35 gram Exp $ + * $Id: file.h,v 1.10 1999/02/11 06:17:30 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -82,7 +82,7 @@ typedef struct _capture_file { gchar *dfilter; /* Display filter string */ gchar *cfilter; /* Capture filter string */ bpf_prog fcode; /* Compiled filter program */ - guint8 pd[4096]; /* Packet data */ + guint8 pd[MAX_PACKET_SIZE]; /* Packet data */ GList *plist; /* Packet list */ frame_data *cur; /* Current list item */ column_info cinfo; /* Column formatting information */ |