[Bro-Dev] #608: broctl print times out if the table is too big

Bro Tracker bro at tracker.bro-ids.org
Fri Dec 9 22:12:50 PST 2011


#608: broctl print times out if the table is too big
----------------------+------------------------
  Reporter:  aashish  |      Owner:
      Type:  Problem  |     Status:  new
  Priority:  Normal   |  Milestone:  Bro2.0
 Component:  Bro      |    Version:  git/master
Resolution:           |   Keywords:
----------------------+------------------------

Comment (by seth):

 A table with 5000 addresses didn't work.  Here are the scripts I used, you
 need to run them from the build/ directory (and have the ruby bindings
 built).  I suppose it could be a bug in the python bindings even?  Maybe
 someone should port the ruby script to python to see if it breaks there.

 large-table.bro
 {{{
 @load frameworks/control/controllee

 redef Communication::nodes = {
         # We're waiting for connections from this host for control.
         ["control"] = [$host=127.0.0.1,
 $events=Control::controller_events],
 };

 global large_table: table[count] of addr = set();

 function build_table(i: count)
         {
         large_table[i] = 1.2.3.4;
         if ( i < 5000 )
                 build_table(i+1);
         }

 event bro_init()
         {
         build_table(1);
         print large_table;
         }
 }}}


 large-table.rb
 {{{
 $LOAD_PATH << "aux/broccoli/bindings/broccoli-ruby/"
 $LOAD_PATH << "../aux/broccoli/bindings/broccoli-ruby/lib"
 require 'broccoli'

 bc = Broccoli::Connection.new("127.0.0.1:47757")
 bc.event_handler_for "Control::id_value_response" do |id, val|
         puts val
 end

 puts "Trying to connect..."
 if bc.connect
   puts "connected."
   while true
     ev = Broccoli::Event.new("Control::id_value_request")
     ev.insert("large_table", :string)
     puts "sending event"
     bc.send(ev)
     sleep 1
     puts "processing input"
     bc.process_input
   end
 end

 }}}

-- 
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/608#comment:10>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list