Class: Racket::L5::DNS
- Inherits:
-
RacketPart
- Object
- BitStruct
- RacketPart
- Racket::L5::DNS
- Defined in:
- lib/racket/l5/dns.rb
Overview
Domain Name System
Instance Attribute Summary
Attributes inherited from RacketPart
Instance Method Summary collapse
-
#add_additional(name, type, klass) ⇒ Object
Add an additional record.
-
#add_answer(name, type, klass) ⇒ Object
Add an answer record.
-
#add_authority(name, type, klass) ⇒ Object
Add an authority record.
-
#add_question(name, type, klass) ⇒ Object
Add a question record.
-
#initialize(*args) ⇒ DNS
constructor
A new instance of DNS.
Methods inherited from RacketPart
Constructor Details
#initialize(*args) ⇒ DNS
Returns a new instance of DNS.
64 65 66 |
# File 'lib/racket/l5/dns.rb', line 64 def initialize(*args) super end |
Instance Method Details
#add_additional(name, type, klass) ⇒ Object
Add an additional record. Automatically increases additional_rr
69 70 71 72 |
# File 'lib/racket/l5/dns.rb', line 69 def add_additional(name, type, klass) self.payload += self.add_record(name, type, klass).encode self.additional_rr += 1 end |
#add_answer(name, type, klass) ⇒ Object
Add an answer record. Automatically increases answer_rr
75 76 77 78 |
# File 'lib/racket/l5/dns.rb', line 75 def add_answer(name, type, klass) self.payload += self.add_record(name, type, klass).encode self.answer_rr += 1 end |
#add_authority(name, type, klass) ⇒ Object
Add an authority record. Automatically increases authority_rr
XXX: broken. authns records are much more complicated than this.
82 83 84 85 |
# File 'lib/racket/l5/dns.rb', line 82 def (name, type, klass) self.payload += self.add_record(name, type, klass).encode self. += 1 end |
#add_question(name, type, klass) ⇒ Object
Add a question record. Automatically increases question_rr
88 89 90 91 |
# File 'lib/racket/l5/dns.rb', line 88 def add_question(name, type, klass) self.payload += add_record(name, type, klass).encode self.question_rr += 1 end |