[Gd-chatter] r10846 - trunk/libraries/pcap

hannes at gwydiondylan.org hannes at gwydiondylan.org
Thu Aug 10 17:44:54 CEST 2006


Author: hannes
Date: Thu Aug 10 17:44:53 2006
New Revision: 10846

Modified:
   trunk/libraries/pcap/library.dylan
   trunk/libraries/pcap/pcap.dylan
Log:
Bug: 7299
*support for stop capturing packets

Modified: trunk/libraries/pcap/library.dylan
==============================================================================
--- trunk/libraries/pcap/library.dylan	(original)
+++ trunk/libraries/pcap/library.dylan	Thu Aug 10 17:44:53 2006
@@ -25,6 +25,6 @@
   use byte-vector;
   use flow;
   use packetizer, import: { unparsed-class, <ethernet-frame>, <frame>, assemble-frame };
-  export <ethernet-interface>, interface-name;
+  export <ethernet-interface>, interface-name, running?-setter, running?;
 end;
 

Modified: trunk/libraries/pcap/pcap.dylan
==============================================================================
--- trunk/libraries/pcap/pcap.dylan	(original)
+++ trunk/libraries/pcap/pcap.dylan	Thu Aug 10 17:44:53 2006
@@ -38,10 +38,13 @@
 define generic promiscious? (object :: <ethernet-interface>) => (res :: <boolean>);
 define generic pcap-t (object :: <ethernet-interface>) => (res :: <object>);
 define generic pcap-t-setter (value :: <object>, object :: <ethernet-interface>) => (res :: <object>);
+define generic running? (object :: <ethernet-interface>) => (res :: <boolean>);
+define generic running?-setter (value :: <boolean>, object :: <ethernet-interface>) => (res :: <boolean>);
 
 define open class <ethernet-interface> (<filter>)
   constant slot interface-name :: <string> = "ath0", init-keyword: name:;
   constant slot promiscious? :: <boolean> = #t, init-keyword: promiscious?:;
+  slot running? :: <boolean> = #t;
   slot pcap-t;
 end;
 
@@ -150,7 +153,7 @@
 
 define method toplevel (interface :: <ethernet-interface>)
   register-c-dylan-object(interface);
-  while(#t)
+  while(interface.running?)
     pcap-dispatch(interface.pcap-t,
                   1,
                   receive-callback,



More information about the chatter mailing list