Class: Aoandon::Semantic
- Defined in:
- lib/aoandon/analysis/semantic.rb
Instance Method Summary collapse
-
#initialize(logger, options = {}) ⇒ Semantic
constructor
A new instance of Semantic.
- #test(packet) ⇒ Object
Methods inherited from Analysis
Constructor Details
#initialize(logger, options = {}) ⇒ Semantic
Returns a new instance of Semantic.
3 4 5 6 7 |
# File 'lib/aoandon/analysis/semantic.rb', line 3 def initialize(logger, = {}) super(logger, ) puts "Modules: #{DynamicRule.constants.join(', ')}" end |
Instance Method Details
#test(packet) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aoandon/analysis/semantic.rb', line 9 def test(packet) if defined? DynamicRule DynamicRule.constants.each do |rule| if DynamicRule.const_get(rule).control?(packet) dump = DynamicRule.const_get(rule).logging?(packet) ? packet : nil = if DynamicRule.const_get(rule).constants.include?(:MESSAGE) DynamicRule.const_get(rule)::MESSAGE else nil end @logger.(packet.time.iso8601, 'SEMANT', rule.downcase, , dump) end end end end |