Class: Racket::L5::DNS

Inherits:
RacketPart show all
Defined in:
lib/racket/l5/dns.rb

Overview

Domain Name System

Instance Attribute Summary

Attributes inherited from RacketPart

#autofix

Instance Method Summary collapse

Methods inherited from RacketPart

#autofix?, #fix!, #pretty

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 add_authority(name, type, klass)
  self.payload += self.add_record(name, type, klass).encode
  self.authority_rr += 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