Re-added fixes after cvs tree was changed.
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 17 Sep 1998 03:29:28 +0000 (03:29 +0000)
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 17 Sep 1998 03:29:28 +0000 (03:29 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11 f5534014-38df-0310-8fa8-9805f1628bb7

AUTHORS
packet-bootp.c
packet-tr.c
print.ps

diff --git a/AUTHORS b/AUTHORS
index 17b957c6452cc1222be458a1924fe3c96fb6be72..0e29df3ab5367a65624088e9a2fea5397d65b563 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,7 +6,14 @@ Gerald Combs  <gerald@zing.org>
 Contributors
 ------------
 Gilbert Ramirez Jr.  <gram@verdict.uthscsa.edu> {
-    /* add your info here */
+       http://verdict.uthscsa.edu/gram/
+
+       Printing
+       Token-Ring, TR MAC
+       802.2 LLC
+       IPX, SPX, NCP
+       BOOTP/DHCP
+       LPD
 }
 
 Hannes R. Boehm      <hannes@boehm.org> {
index 6ffb8dff1289c59eaf645221cd1dfed7cbbbbde7..c1bdb642ceaf993f55d5a967a41db051e84269cc 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for BOOTP/DHCP packet disassembly
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
- * $Id: packet-bootp.c,v 1.2 1998/09/16 03:22:01 gerald Exp $
+ * $Id: packet-bootp.c,v 1.3 1998/09/17 03:29:26 gram Exp $
  *
  * The information used comes from:
  * RFC 2132: DHCP Options and BOOTP Vendor Extensions
@@ -307,8 +307,8 @@ bootp_option(const u_char *pd, GtkWidget *bp_tree, int voff, int eoff)
 
                        case opaque:
                                add_item_to_tree(bp_tree, voff, consumed,
-                                               "Option %d: %s = %s (%d bytes)",
-                                               code, text, &pd[voff+2], vlen);
+                                               "Option %d: %s (%d bytes)",
+                                               code, text, vlen);
                                break;
 
                        case val_u_short:
index 9f75ec180be5844143dc3c9eed07406746b61a58..2d9a3dbe9f8a93b3081f90a7131b87159b92124a 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for Token-Ring packet disassembly
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
- * $Id: packet-tr.c,v 1.2 1998/09/16 03:22:11 gerald Exp $
+ * $Id: packet-tr.c,v 1.3 1998/09/17 03:29:27 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -81,6 +81,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
        int                     offset = 14;
        int                     source_routed = 0;
        int                     rif_bytes = 0;
+       int                     true_rif_bytes = 0;     /* because of silly_linux */
        guint8          nonsr_hwaddr[8];
        int                     frame_type = (pd[1] & 192) >> 6; /* I use this value a lot */
        #ifdef linux
@@ -104,13 +105,14 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
        /* sometimes we have a RCF but no RIF... half source-routed? */
        /* I'll check for 2 bytes of RIF and the 0x70 byte */
        if (!source_routed) {
-               if ((pd[14] & 31) == 2 && pd[15] == 0x70) {
+               if ((pd[14] & 31) == 2) {
                        source_routed = 1;
                }
        }
 
        if (source_routed) {
                rif_bytes = pd[14] & 31;
+               true_rif_bytes = rif_bytes;
        }
        /* this is a silly hack for Linux 2.0.x. Read the comment below,
        in front of the other #ifdef linux */
@@ -163,8 +165,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
                        ether_to_str((guint8 *) &pd[8]));
 
                if (source_routed) {
-                       add_item_to_tree(fh_tree, 14, 1, "RIF length: %d bytes",
-                               pd[14] & 31); /* not rif_bytes because of silly_linux */
+                       add_item_to_tree(fh_tree, 14, 1, "RIF length: %d bytes", true_rif_bytes);
 
                        add_item_to_tree(fh_tree, 15, 1,
                                "%s, up to %d bytes in frame (LF=%d)",
@@ -179,7 +180,7 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
 
                        /* if we have more than 2 bytes of RIF, then we have
                                ring/bridge pairs */
-                       if ((pd[14] & 31) > 2) { /* not rif_bytes because of silly_linux */
+                       if (true_rif_bytes > 2) {
                                add_ring_bridge_pairs(rif_bytes, pd, fh_tree);
                        }
                }
@@ -194,8 +195,12 @@ dissect_tr(const u_char *pd, frame_data *fd, GtkTree *tree) {
                tcpdump. W/o that, however, I'm guessing that DSAP == SSAP if the
                frame type is LLC.  It's very much a hack. -- Gilbert Ramirez */
                #ifdef linux
-               if ( (source_routed && ((pd[14] & 31) == 2) && silly_linux) ||
-                       (!source_routed) && silly_linux ) {
+               if (source_routed && (true_rif_bytes == 2) && silly_linux) {
+                       add_item_to_tree(fh_tree, 14 + true_rif_bytes, 18 - true_rif_bytes,
+                               "Empty RIF from Linux 2.0.x driver. The sniffing NIC "
+                               "is also running a protocol stack.");
+               }
+               else if ((!source_routed) && silly_linux ) {
                        add_item_to_tree(fh_tree, 14, 18,
                                "Empty RIF from Linux 2.0.x driver. The sniffing NIC "
                                "is also running a protocol stack.");
index b1277df79fdb1e530b30e8b6f80d54eb84577160..4cf9cbfaf166cc0a7ea96b81460f89385c5c96f5 100644 (file)
--- a/print.ps
+++ b/print.ps
@@ -30,10 +30,16 @@ pop pop             % junk
 /lmargin 72 def
 /tmargin vmax 72 sub def
 /bmargin 72 def
+/pagenumtab hmax 72 sub def
 
 % Counters
-/vpos vmax 70 sub def
+/vpos vmax 40 sub def
+/thispagenum 1 def
 
+% Strings
+/pagenostr 7 string def
+
+% Prints text with possible indenting
 /putline {
        exch 10 mul lmargin add         % X
        vpos                                            % Y
@@ -43,11 +49,14 @@ pop pop             % junk
        /vpos vpos 10 sub def
 
        vpos bmargin le                         % is vpos <= bottom margin?
-       {showpage
-               /vpos tmargin def}
+       {
+               printpagenum showpage
+               /vpos tmargin def
+       }
        if                                                      % then formfeed and start at top
 } def
 
+% A putline with no indenting
 /hexdump {
        lmargin                                         % X
        vpos                                            % Y
@@ -57,16 +66,54 @@ pop pop             % junk
        /vpos vpos 10 sub def
 
        vpos bmargin le                         % is vpos <= bottom margin?
-       {showpage
-               /vpos tmargin def}
+       {
+               printpagenum showpage
+               /vpos tmargin def
+       }
        if                                                      % then formfeed and start at top
 } def
 
+% A put line with smaller spacing and no formfeed
+/titleline {
+       lmargin                                         % X
+       vpos                                            % Y
+       moveto
+       show
+
+       /vpos vpos 8 sub def
+} def
+
+% Prints the page number at the top right
+/printpagenum {
+       gsave
+               % Set the font to 8 point
+               /Helvetica findfont 8 scalefont setfont
+
+               pagenumtab                                      % X
+               vmax 40 sub                                     % Y
+               moveto
+               (Page ) show
+               thispagenum pagenostr cvs show
+
+               % thispagenum++
+               /thispagenum thispagenum 1 add def
+       grestore
+} def
+       
+% Set the font to 8 point
+/Helvetica findfont 8 scalefont setfont
+
+% Create the title
+(Ethereal) titleline
+
+% Reset the vertical position
+/vpos tmargin def
+
 % Set the font to 10 point
 /Helvetica findfont 10 scalefont setfont
+% ---- ethereal preamble end ---- %
 
 % Display our output lines.
-% ---- ethereal preamble end ---- %
 0 (Ethernet II \(98 on wire, 68 captured\)) putline
 1 (Destination: 00:00:0c:36:00:2a) putline
 1 (Source: 00:c0:4f:c7:eb:c0) putline
@@ -96,5 +143,12 @@ pop pop             % junk
 (  b0  0000 0000 0000                            ......           ) hexdump
 
 % ---- ethereal finale start ---- %
+% If this is not the first page, then print the page number
+thispagenum 1 gt                               % is thispagenum > 1 ?
+{
+       printpagenum
+}
+if
+
 showpage
 % ---- ethereal finale end ---- %