Module DNSTraverse::MessageUtility
In: lib/dnstraverse/message_utility.rb

Methods

Public Instance methods

def msg_referrals(msg, args)

  r = msg.authority.select { |x|
    x.type.to_s.casecmp('NS') == 0 && x.klass.to_s.casecmp('IN') == 0
  }
  if args[:bailiwick] then
    b = args[:bailiwick]
    r = r.select { |x|
      zonename = x.name.to_s
      if cond = zonename !~ /#{@b}$/i then
        Log.debug { "Excluding lame referral #{b} to #{zonename}" }
        raise "lame"
      end
      cond
    }
  end
  Log.debug { "Referrals: " + r.map {|x| x.domainname.to_s }.join(", ") }
  return r

end

[Validate]