Class: PacketGen::Header::DNS::QDSection
- Inherits:
-
RRSection
- Object
- Array
- Types::Array
- RRSection
- PacketGen::Header::DNS::QDSection
- Defined in:
- lib/packetgen/header/dns/qdsection.rb
Overview
Define a DNS Question Section
Constant Summary
Constants inherited from Types::Array
Instance Method Summary collapse
-
#<<(q) ⇒ QDSection
Add a question to this section.
-
#delete(q) ⇒ Question
Delete a question.
-
#push(q) ⇒ QDSection
Add a question to this section without incrementing associated counter.
-
#read(str) ⇒ QDSection
Read Question section from a string.
Methods inherited from RRSection
Methods inherited from Types::Array
#force_binary, #initialize, set_of, #sz, #to_human, #to_s
Constructor Details
This class inherits a constructor from PacketGen::Header::DNS::RRSection
Instance Method Details
#<<(q) ⇒ QDSection
Add a question to this section. Increment associated counter
|
|
# File 'lib/packetgen/header/dns/qdsection.rb', line 8
|
#push(q) ⇒ QDSection
Add a question to this section without incrementing associated counter
|
|
# File 'lib/packetgen/header/dns/qdsection.rb', line 8
|
#read(str) ⇒ QDSection
Read Question section from a string
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/packetgen/header/dns/qdsection.rb', line 24 def read(str) clear return self if str.nil? force_binary str while str.length > 0 and self.size < @counter.to_i question = Question.new(@dns).read(str) str.slice!(0, question.sz) self.push question end self end |