aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rw-r--r--doc/ethereal.pod.template22
-rw-r--r--doc/tethereal.pod.template6
-rw-r--r--globals.h3
-rw-r--r--gtk/display_opts.c18
-rw-r--r--gtk/main.c7
-rw-r--r--packet-ip.c108
-rw-r--r--tethereal.c11
8 files changed, 152 insertions, 25 deletions
diff --git a/AUTHORS b/AUTHORS
index c82f579225..ad2c58ee8a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -183,6 +183,8 @@ Heikki Vatiainen <hessu@cs.tut.fi> {
SAP (Session Announcement Protocol) support
VRRP (Virtual Router Redundancy)
HSRP (Hot Standby Router Protocol)
+ option to control whether to interpret the IPv4 TOS field as
+ such or as the DiffServ field
}
Greg Hankins <gregh@twoguys.org> {
diff --git a/doc/ethereal.pod.template b/doc/ethereal.pod.template
index be8622ba8f..98b9704e24 100644
--- a/doc/ethereal.pod.template
+++ b/doc/ethereal.pod.template
@@ -9,6 +9,7 @@ B<ethereal>
S<[ B<-B> byte view height ]>
S<[ B<-b> bold font ]>
S<[ B<-c> count ]>
+S<[ B<-D> ]>
S<[ B<-f> filter expression ]>
S<[ B<-h> ]>
S<[ B<-i> interface ]>
@@ -84,6 +85,11 @@ pane that corresponds to the field selected in the protocol tree pane.
Sets the default number of packets to read when capturing live
data.
+=item -D
+
+Turns off treating the original IPv4 TOS field as the Differentiated
+Services Field. The structure of the DS Field is defined in RFC 2474.
+
=item -f
Sets the capture filter expression.
@@ -245,10 +251,12 @@ system-dependent, but is likely either /var/tmp or /tmp.
=item Display:Options
-Sets the format of the packet timestamp displayed in the packet list
-window to relative, absolute, or delta.
-Allows you to enable the automatic scrolling of the packet list while a
-live capture is in progress.
+Allows you to sets the format of the packet timestamp displayed in the
+packet list window to relative, absolute, or delta, to enable or disable
+the automatic scrolling of the packet list while a live capture is in
+progress, to enable or disable translation of addresses to names in the
+display, or to enable or disable interpretation of the IPv4 TOS field as
+the Differentiated Services field.
=item Display:Match Selected
@@ -500,7 +508,9 @@ in the packet list. You can select "Time of day" for absolute time stamps,
"Seconds since previous frame" for delta time stamps. You can also
specify whether, when the display is updated as packets are captured,
the list should automatically scroll to show the most recently captured
-packets or not.
+packets or not, whether addresses should be translated to names in the
+display, and whether IPv4 TOS field should be treated as the
+Differentiated Services field.
=item Plugins
@@ -509,7 +519,7 @@ on your system.
The I<Plugins List> shows the name, description, version and state
(enabled or not) of each plugin found on your system. The plugins are
-searched in the following directories : B</usr/share/ethereal/plugins>,
+searched in the following directories: B</usr/share/ethereal/plugins>,
B</usr/local/share/ethereal/plugins> and B<~/.ethereal/plugins>
A plugin must be activated using the I<Enable> button in order to use it
diff --git a/doc/tethereal.pod.template b/doc/tethereal.pod.template
index 57c2c63eb5..537cab3c20 100644
--- a/doc/tethereal.pod.template
+++ b/doc/tethereal.pod.template
@@ -7,6 +7,7 @@ Tethereal - Dump and analyze network traffic
B<tethereal>
S<[ B<-c> count ]>
+S<[ B<-D> ]>
S<[ B<-f> filter expression ]>
S<[ B<-F> file format ]>
S<[ B<-h> ]>
@@ -91,6 +92,11 @@ be unable to read compressed files.
Sets the default number of packets to read when capturing live
data.
+=item -D
+
+Turns off treating the original IPv4 TOS field as the Differentiated
+Services Field. The structure of the DS Field is defined in RFC 2474.
+
=item -f
Sets the capture filter expression.
diff --git a/globals.h b/globals.h
index 3b628f41b8..0c0f4e7edb 100644
--- a/globals.h
+++ b/globals.h
@@ -1,7 +1,7 @@
/* globals.h
* Global defines, etc.
*
- * $Id: globals.h,v 1.14 2000/01/06 06:28:54 guy Exp $
+ * $Id: globals.h,v 1.15 2000/01/24 04:44:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -85,6 +85,7 @@ extern gchar *bold_font;
extern gchar *last_open_dir;
extern gboolean auto_scroll_live;
extern int g_resolving_actif;
+extern gboolean g_ip_dscp_actif;
extern field_info *finfo_selected;
extern ts_type timestamp_type;
diff --git a/gtk/display_opts.c b/gtk/display_opts.c
index d4f2d120b4..c5377164db 100644
--- a/gtk/display_opts.c
+++ b/gtk/display_opts.c
@@ -1,7 +1,7 @@
/* display_opts.c
* Routines for packet display windows
*
- * $Id: display_opts.c,v 1.1 1999/10/18 12:48:13 gram Exp $
+ * $Id: display_opts.c,v 1.2 2000/01/24 04:44:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -92,6 +92,7 @@ extern GtkWidget *packet_list;
#define E_DISPLAY_TIME_DELTA_KEY "display_time_delta"
#define E_DISPLAY_AUTO_SCROLL_KEY "display_auto_scroll"
#define E_DISPLAY_NAME_RESOLUTION_KEY "display_name_resolution"
+#define E_DISPLAY_IP_DSCP_KEY "display_ip_dscp"
static void display_opt_ok_cb(GtkWidget *, gpointer);
static void display_opt_apply_cb(GtkWidget *, gpointer);
@@ -172,6 +173,13 @@ display_opt_cb(GtkWidget *w, gpointer d) {
gtk_box_pack_start(GTK_BOX(main_vb), button, TRUE, TRUE, 0);
gtk_widget_show(button);
+ button = gtk_check_button_new_with_label("Decode IPv4 TOS field as DiffServ Field");
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button), g_ip_dscp_actif);
+ gtk_object_set_data(GTK_OBJECT(display_opt_w), E_DISPLAY_IP_DSCP_KEY,
+ button);
+ gtk_box_pack_start(GTK_BOX(main_vb), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
/* Button row: OK, Apply, and Cancel buttons */
bbox = gtk_hbutton_box_new();
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
@@ -232,6 +240,10 @@ display_opt_ok_cb(GtkWidget *ok_bt, gpointer parent_w) {
E_DISPLAY_NAME_RESOLUTION_KEY);
g_resolving_actif = (GTK_TOGGLE_BUTTON (button)->active);
+ button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
+ E_DISPLAY_IP_DSCP_KEY);
+ g_ip_dscp_actif = (GTK_TOGGLE_BUTTON (button)->active);
+
gtk_widget_destroy(GTK_WIDGET(parent_w));
display_opt_window_active = FALSE;
@@ -265,6 +277,10 @@ display_opt_apply_cb(GtkWidget *ok_bt, gpointer parent_w) {
E_DISPLAY_NAME_RESOLUTION_KEY);
g_resolving_actif = (GTK_TOGGLE_BUTTON (button)->active);
+ button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
+ E_DISPLAY_IP_DSCP_KEY);
+ g_ip_dscp_actif = (GTK_TOGGLE_BUTTON (button)->active);
+
change_time_formats(&cf);
}
diff --git a/gtk/main.c b/gtk/main.c
index 9d40c96789..dde9be8195 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1,6 +1,6 @@
/* main.c
*
- * $Id: main.c,v 1.92 2000/01/18 08:38:16 guy Exp $
+ * $Id: main.c,v 1.93 2000/01/24 04:44:58 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1157,7 +1157,7 @@ main(int argc, char *argv[])
#ifndef WIN32
/* Now get our args */
- while ((opt = getopt(argc, argv, "b:B:c:f:hi:km:nP:Qr:R:Ss:t:T:w:W:v")) != EOF) {
+ while ((opt = getopt(argc, argv, "b:B:c:Df:hi:km:nP:Qr:R:Ss:t:T:w:W:v")) != EOF) {
switch (opt) {
case 'b': /* Bold font */
bold_font = g_strdup(optarg);
@@ -1173,6 +1173,9 @@ main(int argc, char *argv[])
arg_error = TRUE;
#endif
break;
+ case 'D': /* Turn off DSCP printing */
+ g_ip_dscp_actif = FALSE;
+ break;
case 'f':
#ifdef HAVE_LIBPCAP
if (cf.cfilter)
diff --git a/packet-ip.c b/packet-ip.c
index c1bb7e69a2..df68f17871 100644
--- a/packet-ip.c
+++ b/packet-ip.c
@@ -1,7 +1,7 @@
/* packet-ip.c
* Routines for IP and miscellaneous IP protocol packet disassembly
*
- * $Id: packet-ip.c,v 1.70 2000/01/23 08:55:32 guy Exp $
+ * $Id: packet-ip.c,v 1.71 2000/01/24 04:44:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -54,9 +54,15 @@
#include "packet-ip.h"
#endif
+/* Decode the old IPv4 TOS field as the DiffServ DS Field */
+gboolean g_ip_dscp_actif = TRUE;
+
static int proto_ip = -1;
static int hf_ip_version = -1;
static int hf_ip_hdr_len = -1;
+static int hf_ip_dsfield = -1;
+static int hf_ip_dsfield_dscp = -1;
+static int hf_ip_dsfield_cu = -1;
static int hf_ip_tos = -1;
static int hf_ip_tos_precedence = -1;
static int hf_ip_tos_delay = -1;
@@ -77,6 +83,7 @@ static int hf_ip_proto = -1;
static int hf_ip_checksum = -1;
static gint ett_ip = -1;
+static gint ett_ip_dsfield = -1;
static gint ett_ip_tos = -1;
static gint ett_ip_off = -1;
static gint ett_ip_options = -1;
@@ -242,6 +249,34 @@ typedef struct _e_ip
#define IP_MF 0x2000 /* Flag: "More Fragments" */
#define IP_OFFSET 0x1FFF /* "Fragment Offset" part */
+/* Differentiated Services Field. See RFCs 2474, 2597 and 2598. */
+#define IPDSFIELD_DSCP_MASK 0xFC
+#define IPDSFIELD_DSCP_SHIFT 2
+#define IPDSFIELD_DSCP(dsfield) (((dsfield)&IPDSFIELD_DSCP_MASK)>>IPDSFIELD_DSCP_SHIFT)
+#define IPDSFIELD_DSCP_DEFAULT 0x00
+#define IPDSFIELD_DSCP_CS1 0x08
+#define IPDSFIELD_DSCP_CS2 0x10
+#define IPDSFIELD_DSCP_CS3 0x18
+#define IPDSFIELD_DSCP_CS4 0x20
+#define IPDSFIELD_DSCP_CS5 0x28
+#define IPDSFIELD_DSCP_CS6 0x30
+#define IPDSFIELD_DSCP_CS7 0x38
+#define IPDSFIELD_DSCP_AF11 0x0A
+#define IPDSFIELD_DSCP_AF12 0x0C
+#define IPDSFIELD_DSCP_AF13 0x0E
+#define IPDSFIELD_DSCP_AF21 0x12
+#define IPDSFIELD_DSCP_AF22 0x14
+#define IPDSFIELD_DSCP_AF23 0x16
+#define IPDSFIELD_DSCP_AF31 0x1A
+#define IPDSFIELD_DSCP_AF32 0x1C
+#define IPDSFIELD_DSCP_AF33 0x1E
+#define IPDSFIELD_DSCP_AF41 0x22
+#define IPDSFIELD_DSCP_AF42 0x24
+#define IPDSFIELD_DSCP_AF43 0x26
+#define IPDSFIELD_DSCP_EF 0x2E
+#define IPDSFIELD_CU_MASK 0x03
+
+/* IP TOS, superseded by the DS Field, RFC 2474. */
#define IPTOS_TOS_MASK 0x1E
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
#define IPTOS_NONE 0x00
@@ -720,6 +755,30 @@ static const value_string proto_vals[] = { {IP_PROTO_ICMP, "ICMP"},
{IP_PROTO_VINES,"VINES"},
{0, NULL } };
+static const value_string dscp_vals[] = {
+ { IPDSFIELD_DSCP_DEFAULT, "Default" },
+ { IPDSFIELD_DSCP_CS1, "Class Selector 1" },
+ { IPDSFIELD_DSCP_CS2, "Class Selector 2" },
+ { IPDSFIELD_DSCP_CS3, "Class Selector 3" },
+ { IPDSFIELD_DSCP_CS4, "Class Selector 4" },
+ { IPDSFIELD_DSCP_CS5, "Class Selector 5" },
+ { IPDSFIELD_DSCP_CS6, "Class Selector 6" },
+ { IPDSFIELD_DSCP_CS7, "Class Selector 7" },
+ { IPDSFIELD_DSCP_AF11, "Assured Forwarding 11" },
+ { IPDSFIELD_DSCP_AF12, "Assured Forwarding 12" },
+ { IPDSFIELD_DSCP_AF13, "Assured Forwarding 13" },
+ { IPDSFIELD_DSCP_AF21, "Assured Forwarding 21" },
+ { IPDSFIELD_DSCP_AF22, "Assured Forwarding 22" },
+ { IPDSFIELD_DSCP_AF23, "Assured Forwarding 23" },
+ { IPDSFIELD_DSCP_AF31, "Assured Forwarding 31" },
+ { IPDSFIELD_DSCP_AF32, "Assured Forwarding 32" },
+ { IPDSFIELD_DSCP_AF33, "Assured Forwarding 33" },
+ { IPDSFIELD_DSCP_AF41, "Assured Forwarding 41" },
+ { IPDSFIELD_DSCP_AF42, "Assured Forwarding 42" },
+ { IPDSFIELD_DSCP_AF43, "Assured Forwarding 43" },
+ { IPDSFIELD_DSCP_EF, "Expedited Forwarding" },
+ { 0, NULL } };
+
static const value_string precedence_vals[] = {
{ IPTOS_PREC_ROUTINE, "routine" },
{ IPTOS_PREC_PRIORITY, "priority" },
@@ -870,16 +929,28 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
proto_tree_add_item(ip_tree, hf_ip_version, offset, 1, hi_nibble(iph.ip_v_hl));
proto_tree_add_item_format(ip_tree, hf_ip_hdr_len, offset, 1, hlen,
"Header length: %u bytes", hlen);
- tf = proto_tree_add_item_format(ip_tree, hf_ip_tos, offset + 1, 1, iph.ip_tos,
- "Type of service: 0x%02x (%s)", iph.ip_tos,
- val_to_str( IPTOS_TOS(iph.ip_tos), iptos_vals, "Unknown") );
-
- field_tree = proto_item_add_subtree(tf, ett_ip_tos);
- proto_tree_add_item(field_tree, hf_ip_tos_precedence, offset + 1, 1, iph.ip_tos);
- proto_tree_add_item(field_tree, hf_ip_tos_delay, offset + 1, 1, iph.ip_tos);
- proto_tree_add_item(field_tree, hf_ip_tos_throughput, offset + 1, 1, iph.ip_tos);
- proto_tree_add_item(field_tree, hf_ip_tos_reliability, offset + 1, 1, iph.ip_tos);
- proto_tree_add_item(field_tree, hf_ip_tos_cost, offset + 1, 1, iph.ip_tos);
+
+ if (g_ip_dscp_actif) {
+ tf = proto_tree_add_item_format(ip_tree, hf_ip_dsfield, offset + 1, 1, iph.ip_tos,
+ "Differentiated Services Field: 0x%02x (DSCP 0x%02x: %s)", iph.ip_tos,
+ IPDSFIELD_DSCP(iph.ip_tos), val_to_str(IPDSFIELD_DSCP(iph.ip_tos), dscp_vals,
+ "Unknown DSCP"));
+
+ field_tree = proto_item_add_subtree(tf, ett_ip_dsfield);
+ proto_tree_add_item(field_tree, hf_ip_dsfield_dscp, offset + 1, 1, iph.ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_dsfield_cu, offset + 1, 1, iph.ip_tos);
+ } else {
+ tf = proto_tree_add_item_format(ip_tree, hf_ip_tos, offset + 1, 1, iph.ip_tos,
+ "Type of service: 0x%02x (%s)", iph.ip_tos,
+ val_to_str( IPTOS_TOS(iph.ip_tos), iptos_vals, "Unknown") );
+
+ field_tree = proto_item_add_subtree(tf, ett_ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_tos_precedence, offset + 1, 1, iph.ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_tos_delay, offset + 1, 1, iph.ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_tos_throughput, offset + 1, 1, iph.ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_tos_reliability, offset + 1, 1, iph.ip_tos);
+ proto_tree_add_item(field_tree, hf_ip_tos_cost, offset + 1, 1, iph.ip_tos);
+ }
proto_tree_add_item(ip_tree, hf_ip_len, offset + 2, 2, iph.ip_len);
proto_tree_add_item(ip_tree, hf_ip_id, offset + 4, 2, iph.ip_id);
@@ -1344,6 +1415,20 @@ proto_register_ip(void)
{ "Header Length", "ip.hdr_len", FT_UINT8, BASE_DEC, NULL, 0x0,
"" }},
+ { &hf_ip_dsfield,
+ { "Differentiated Services field", "ip.dsfield", FT_UINT8, BASE_DEC, NULL, 0x0,
+ "" }},
+
+ { &hf_ip_dsfield_dscp,
+ { "Differentiated Services Codepoint", "ip.dsfield.dscp", FT_UINT8, BASE_HEX,
+ VALS(dscp_vals), IPDSFIELD_DSCP_MASK,
+ "" }},
+
+ { &hf_ip_dsfield_cu,
+ { "Currently Unused", "ip.dsfield.cu", FT_UINT8, BASE_DEC, NULL,
+ IPDSFIELD_CU_MASK,
+ "" }},
+
{ &hf_ip_tos,
{ "Type of Service", "ip.tos", FT_UINT8, BASE_DEC, NULL, 0x0,
"" }},
@@ -1423,6 +1508,7 @@ proto_register_ip(void)
};
static gint *ett[] = {
&ett_ip,
+ &ett_ip_dsfield,
&ett_ip_tos,
&ett_ip_off,
&ett_ip_options,
diff --git a/tethereal.c b/tethereal.c
index f6bc85d8cc..e524c9acec 100644
--- a/tethereal.c
+++ b/tethereal.c
@@ -1,6 +1,6 @@
/* tethereal.c
*
- * $Id: tethereal.c,v 1.12 2000/01/22 07:19:26 guy Exp $
+ * $Id: tethereal.c,v 1.13 2000/01/24 04:44:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -144,8 +144,8 @@ print_usage(void)
fprintf(stderr, "This is GNU t%s %s, compiled with %s\n", PACKAGE,
VERSION, comp_info_str);
- fprintf(stderr, "t%s [ -vVh ] [ -c count ] [ -f <filter expression> ] [ -F <capture type> ]\n", PACKAGE);
- fprintf(stderr, "\t[ -i iface ] [ -r infile ] [ -R <filter expression> ]\n");
+ fprintf(stderr, "t%s [ -vVh ] [ -c count ] [ -D ] [ -f <filter expression> ] [ -F <capture type> ]\n", PACKAGE);
+ fprintf(stderr, "\t[ -i iface ] [ -n ] [ -r infile ] [ -R <filter expression> ]\n");
fprintf(stderr, "\t[ -s snaplen ] [ -t <time stamp format> ] [ -w savefile ] [ -x ]\n");
fprintf(stderr, "Valid file type arguments to the \"-F\" flag:\n");
for (i = 0; i < WTAP_NUM_FILE_TYPES; i++) {
@@ -266,7 +266,7 @@ main(int argc, char *argv[])
);
/* Now get our args */
- while ((opt = getopt(argc, argv, "c:f:F:hi:nr:R:s:t:vw:Vx")) != EOF) {
+ while ((opt = getopt(argc, argv, "c:Df:F:hi:nr:R:s:t:vw:Vx")) != EOF) {
switch (opt) {
case 'c': /* Capture xxx packets */
#ifdef HAVE_LIBPCAP
@@ -276,6 +276,9 @@ main(int argc, char *argv[])
arg_error = TRUE;
#endif
break;
+ case 'D': /* Turn off DSCP printing */
+ g_ip_dscp_actif = FALSE;
+ break;
case 'f':
#ifdef HAVE_LIBPCAP
cf.cfilter = g_strdup(optarg);