Class: Bro::Event

Inherits:
Object
  • Object
show all
Includes:
Broccoli
Defined in:
lib/Bro/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Event

Returns a new instance of Event.



7
8
9
10
11
# File 'lib/Bro/event.rb', line 7

def initialize(name)
  @ev = bro_event_new(name)
  # Kill the BroEvent when the ruby object is garbage collected
  ObjectSpace.define_finalizer(self, Event.create_finalizer(@ev))
end

Instance Attribute Details

#evObject (readonly)

Returns the value of attribute ev.



5
6
7
# File 'lib/Bro/event.rb', line 5

def ev
  @ev
end

Instance Method Details

#insert(value, type, type_name = nil) ⇒ Object

Insert a value into an event.



14
15
16
17
# File 'lib/Bro/event.rb', line 14

def insert(value, type, type_name=nil)
  value = value.rec if type == :record
  bro_event_add_val(@ev, [Bro::TYPES[type], type_name, value])
end