class Aoandon::Semantic

Public Class Methods

new(logger, options = {}) click to toggle source
Calls superclass method Aoandon::Analysis::new
# File lib/aoandon/analysis/semantic.rb, line 5
def initialize(logger, options = {})
  super(logger, options)

  puts "Modules:  #{DynamicRule.constants.join(', ')}"
end

Public Instance Methods

test(packet) click to toggle source
# File lib/aoandon/analysis/semantic.rb, line 11
def test(packet)
  if defined? DynamicRule
    DynamicRule.constants.each do |rule|
      next unless DynamicRule.const_get(rule).control?(packet)

      dump = DynamicRule.const_get(rule).logging?(packet) ? packet : nil
      message = (DynamicRule.const_get(rule)::MESSAGE if DynamicRule.const_get(rule).constants.include?(:MESSAGE))

      @logger.message(packet.time.iso8601, "SEMANT", rule.downcase, message, dump)
    end
  end
end