[Gd-chatter] r10878 - in trunk/libraries: flow gui-sniffer network-flow packetizer

hannes at gwydiondylan.org hannes at gwydiondylan.org
Sat Sep 2 04:35:43 CEST 2006


Author: hannes
Date: Sat Sep  2 04:35:39 2006
New Revision: 10878

Modified:
   trunk/libraries/flow/flow.dylan
   trunk/libraries/gui-sniffer/gui-sniffer.dylan
   trunk/libraries/gui-sniffer/module.dylan
   trunk/libraries/network-flow/module.dylan
   trunk/libraries/network-flow/network-flow.dylan
   trunk/libraries/packetizer/dns.dylan
   trunk/libraries/packetizer/ipv4.dylan
   trunk/libraries/packetizer/leaf-frames.dylan
   trunk/libraries/packetizer/module.dylan
   trunk/libraries/packetizer/pcap.dylan
Log:
Bug: 7299
*code cleanup:
  *remove <big-endian-unsigned-integer> and <little-endian-unsigned-integer>,
   both were 32 bit and high-level an <integer> (which only has 29 bit)
   <big-endian-unsigned-integer> was used in dns, used <big-endian-usigned-integer-4byte> instead,
  which has a byte-vector containing 4 bytes, and no high-level-type
 --> big integers would really be great
  *removed debugging stuff
  *removed unused method get-seconds
  *fixed name clashes in imports
 *delegate frame-root-generator to packet and add itself, the first displayed packet is a real <container-frame>,
   not a <frame-field>. this was implemented correctly for <ethernet-frame>, but failing on <prism2-frame>


Modified: trunk/libraries/flow/flow.dylan
==============================================================================
--- trunk/libraries/flow/flow.dylan	(original)
+++ trunk/libraries/flow/flow.dylan	Sat Sep  2 04:35:39 2006
@@ -109,7 +109,7 @@
   node.the-input := make(<pull-input>, node: node)
 end;
 
-define open abstract class <single-output-node> (<node>)
+define abstract class <single-output-node> (<node>)
   slot the-output :: <push-output>, init-keyword: output:;
 end;
 

Modified: trunk/libraries/gui-sniffer/gui-sniffer.dylan
==============================================================================
--- trunk/libraries/gui-sniffer/gui-sniffer.dylan	(original)
+++ trunk/libraries/gui-sniffer/gui-sniffer.dylan	Sat Sep  2 04:35:39 2006
@@ -94,9 +94,6 @@
   frame-children-generator(ff.frame)
 end;
 
-define method frame-root-generator (frame :: <ethernet-frame>)
-  add!(next-method(), frame);
-end;
 define method frame-root-generator (frame :: <header-frame>)
   add!(frame-root-generator(payload(frame)), get-frame-field(#"payload", frame));
 end;
@@ -273,7 +270,7 @@
 define method show-packet-tree (frame :: <gui-sniffer-frame>, packet)
   frame.packet-tree-view.tree-control-roots
     := if (packet)
-         frame-root-generator(packet);
+         add!(frame-root-generator(packet), packet);
        else
          #[]
        end;

Modified: trunk/libraries/gui-sniffer/module.dylan
==============================================================================
--- trunk/libraries/gui-sniffer/module.dylan	(original)
+++ trunk/libraries/gui-sniffer/module.dylan	Sat Sep  2 04:35:39 2006
@@ -3,9 +3,9 @@
 Copyright: (C) 2005, 2006,  All rights reserved. Free for non-commercial use.
 
 define module gui-sniffer
-  use common-dylan;
+  use common-dylan, exclude: { format-to-string };
   use threads;
-  use duim;
+  use duim, exclude: { <frame>, frame-size };
   use win32-duim;
   use format;
   use format-out;

Modified: trunk/libraries/network-flow/module.dylan
==============================================================================
--- trunk/libraries/network-flow/module.dylan	(original)
+++ trunk/libraries/network-flow/module.dylan	Sat Sep  2 04:35:39 2006
@@ -4,7 +4,7 @@
 Copyright: (C) 2006,  All rights reserved.
 
 define module network-flow
-  use common-dylan;
+  use common-dylan, exclude: { format-to-string };
   use threads;
   use format;
   use streams;

Modified: trunk/libraries/network-flow/network-flow.dylan
==============================================================================
--- trunk/libraries/network-flow/network-flow.dylan	(original)
+++ trunk/libraries/network-flow/network-flow.dylan	Sat Sep  2 04:35:39 2006
@@ -3,6 +3,9 @@
 Author:    Andreas Bogk, Hannes Mehnert
 Copyright: (C) 2006,  All rights reserved.
 
+define class <undefined-field-error> (<error>)
+end;
+
 define class <summary-printer> (<single-push-input-node>)
   slot stream :: <stream>, required-init-keyword: stream:;
 end;
@@ -230,7 +233,6 @@
       if (default-field-value)
         field.setter(default-field-value, frame);
       elseif (~ field.fixup-function)
-        format-out("Field %=\n", field.field-name);
         signal(make(<undefined-field-error>));
       end;
     end;

Modified: trunk/libraries/packetizer/dns.dylan
==============================================================================
--- trunk/libraries/packetizer/dns.dylan	(original)
+++ trunk/libraries/packetizer/dns.dylan	Sat Sep  2 04:35:39 2006
@@ -126,7 +126,7 @@
   field domainname :: <domain-name>;
   field rr-type :: <2byte-big-endian-unsigned-integer>;
   field rr-class :: <2byte-big-endian-unsigned-integer>;
-  field ttl :: <big-endian-unsigned-integer>;
+  field ttl :: <big-endian-unsigned-integer-4byte>;
   field rdlength :: <2byte-big-endian-unsigned-integer>;
   variably-typed-field rdata,
     type-function: select (frame.rr-type)

Modified: trunk/libraries/packetizer/ipv4.dylan
==============================================================================
--- trunk/libraries/packetizer/ipv4.dylan	(original)
+++ trunk/libraries/packetizer/ipv4.dylan	Sat Sep  2 04:35:39 2006
@@ -150,19 +150,6 @@
                    end;
 end;
 
-define constant $ipv4 = as(<byte-vector>, #(6, 5, 4, 3, 2, 2, 4, 4, 5, 6, 7, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 1, 0, 3, 4, 5, 6, 7, 8));
-
-define constant $broken-ipv4
-  = as(<byte-vector>,
-       #[#x00, #x30, #x94, #xCB, #xBA, #x30, #x00, #x90,
-         #x86, #xD6, #x10, #x00, #x08, #x00, #x45, #x00,
-         #x00, #x1D, #x64, #x4F, #x00, #x00, #x7E, #x11,
-         #x45, #x62, #xC1, #x11, #x2B, #xC5, #x3E, #x9F,
-         #x67, #xA9, #x11, #x94, #x11, #x94, #x00, #x09,
-         #x4A, #x94, #xFF, #x00, #x00, #x00, #x00, #x00,
-         #x00, #x00, #x00, #x00, #x00, #x00, #x00, #x00,
-         #x00, #x00, #x00, #x00]);
-
 
 define protocol icmp-frame (header-frame)
   summary "ICMP type %= code %=", type, code;

Modified: trunk/libraries/packetizer/leaf-frames.dylan
==============================================================================
--- trunk/libraries/packetizer/leaf-frames.dylan	(original)
+++ trunk/libraries/packetizer/leaf-frames.dylan	Sat Sep  2 04:35:39 2006
@@ -255,57 +255,9 @@
   //slot data :: <integer>, required-init-keyword: data:;
 end;
 
-define class <big-endian-unsigned-integer> (<big-endian-unsigned-integer-byte-frame>)
-  slot data :: <integer>, required-init-keyword: data:;
-end;
-
 define abstract class <little-endian-unsigned-integer-byte-frame> (<fixed-size-translated-leaf-frame>)
 end;
 
-define class <little-endian-unsigned-integer> (<big-endian-unsigned-integer-byte-frame>)
-  slot data :: <integer>, required-init-keyword: data:;
-end;
-
-define inline method high-level-type (low-level-type == <big-endian-unsigned-integer>)
- => (res :: <type>)
-   <integer>
-end;
-
-define inline method high-level-type (low-level-type == <little-endian-unsigned-integer>)
- => (res :: <type>)
-   <integer>
-end;
-
-define inline method field-size (field == <big-endian-unsigned-integer>)
- => (length :: <integer>)
-   4 * 8;
-end;
-
-define inline method field-size (field == <little-endian-unsigned-integer>)
- => (length :: <integer>)
-   4 * 8;
-end;
-
-define method read-frame (type == <big-endian-unsigned-integer>,
-                          string :: <string>)
- => (res)
-  let res = string-to-integer(string);
-  if (res < 0)
-    signal(make(<out-of-range-error>))
-  end;
-  res;
-end;
-
-define method read-frame (type == <little-endian-unsigned-integer>,
-                          string :: <string>)
- => (res)
-  let res = string-to-integer(string);
-  if (res < 0)
-    signal(make(<out-of-range-error>))
-  end;
-  res;
-end;
-
 define macro n-byte-unsigned-integer-definer
     { define n-byte-unsigned-integer(?:name; ?n:*) end }
      => { define class ?name ## "-big-endian-unsigned-integer>"

Modified: trunk/libraries/packetizer/module.dylan
==============================================================================
--- trunk/libraries/packetizer/module.dylan	(original)
+++ trunk/libraries/packetizer/module.dylan	Sat Sep  2 04:35:39 2006
@@ -42,7 +42,7 @@
 
   export <raw-frame>;
 
-  export $broken-ipv4, hexdump;
+  export hexdump;
 
   export <unsigned-byte>,
     <3byte-big-endian-unsigned-integer>,
@@ -97,6 +97,7 @@
   export <container-frame>,
     <unparsed-container-frame>,
     <decoded-container-frame>,
+    fields-initializer,
     frame-name,
     unparsed-class,
     decoded-class,
@@ -121,7 +122,7 @@
 end module packetizer;
 
 define module packet-filter
-  use common-dylan;
+  use common-dylan, exclude: { format-to-string };
   use format;
   use format-out;
   use print;

Modified: trunk/libraries/packetizer/pcap.dylan
==============================================================================
--- trunk/libraries/packetizer/pcap.dylan	(original)
+++ trunk/libraries/packetizer/pcap.dylan	Sat Sep  2 04:35:39 2006
@@ -24,12 +24,6 @@
   field last-linktype :: <unsigned-byte> = 0;
 end;
 
-define function get-seconds () => (seconds :: <collection>)
-  let (year, month, day, hours, minutes, seconds,
-       day-of-week, time-zone-offset) = decode-date(current-date());
-  int-to-byte-vector(seconds);
-end;
-
 define function int-to-byte-vector (int :: <integer>) => (res :: <byte-vector>)
   let res = make(<byte-vector>, size: 4);
   for (i from 0 below 4)



More information about the chatter mailing list