class PacketGen::Header::DNS::QDSection

Define a DNS Question Section @author Sylvain Daubert

Public Instance Methods

read(str) click to toggle source

Read Question section from a string @param [String] str binary string @return [QDSection] self

# File lib/packetgen/header/dns/qdsection.rb, line 30
def read(str)
  clear
  return self if str.nil?

  PacketGen.force_binary str
  while !str.empty? && (self.size < @counter.to_i)
    question = Question.new(@dns).read(str)
    str.slice!(0, question.sz)
    push question
  end
  self
end