lib/nesser/packets/packet.rb
##
# Convert a query packet to the corresponding answer - the trn_id is copied,
# the qr is changed to QR_RESPONSE, the opcode and flags are updated, and
# the question from the query is added.
##
Convert a query packet to the corresponding answer - the trn_id is copied,
the qr is changed to QR_RESPONSE, the opcode and flags are updated, and
the question from the query is added.
Convert a query packet to the corresponding answer - the trn_id is copied the qr is changed to QR_RESPONSE the opcode and flags are updated and the question from the query is added .
def answer(answers:[], question:nil)
      question = question || @questions[0]
      return Packet.new(
        trn_id: @trn_id,
        qr: QR_RESPONSE,
        opcode: OPCODE_QUERY,
        flags: FLAG_RD | FLAG_RA,
        rcode: RCODE_SUCCESS,
        questions: [question],
        answers: answers,
      )
    end
def answer ( answers : [ ] , question : nil ) question = question || @questions [ 0 ] return Packet . new ( trn_id : @trn_id , qr : QR_RESPONSE , opcode : OPCODE_QUERY , flags : FLAG_RD | FLAG_RA , rcode : RCODE_SUCCESS , questions : [ question ] , answers : answers , ) end
Convert a query packet to the corresponding answer - the trn_id is copied,
the qr is changed to QR_RESPONSE, the opcode and flags are updated, and
the question from the query is added.
Convert a query packet to the corresponding answer - the trn_id is copied the qr is changed to QR_RESPONSE the opcode and flags are updated and the question from the query is added .
answers
<not_specific>
question
<not_specific>