Class: PacketGen::Header::DNS::QDSection
- Inherits:
-
RRSection
- Object
- 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
Constants included from Types::LengthFrom
Types::LengthFrom::MAX_SZ_TO_READ
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
#==, #[], #clear, #clear!, #delete_at, #each, #empty?, #first, #initialize, #initialize_copy, #last, set_of, set_of_klass, #size, #sz, #to_a, #to_human, #to_s
Methods included from Types::LengthFrom
#initialize_length_from, #read_with_length_from, #sz_to_read
Methods included from Types::Fieldable
#format_inspect, #sz, #to_human, #to_s, #type_name
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 15
|
#push(q) ⇒ QDSection
Add a question to this section without incrementing associated counter
|
# File 'lib/packetgen/header/dns/qdsection.rb', line 15
|
#read(str) ⇒ QDSection
Read Question section from a string
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/packetgen/header/dns/qdsection.rb', line 31 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 |