Parent

Methods

Net::DNS::Header::RCode

DNS Header RCode handling class

It should be used internally by Net::DNS::Header class. However, it's still possible to instantiate it directly.

require 'net/dns/header'
rcode = Net::DNS::Header::RCode.new 0

The RCode class represents the RCode field in the Header portion of a DNS packet. This field (called Response Code) is used to get informations about the status of a DNS operation, such as a query or an update. These are the values in the original Mockapetris's standard (RFC1035):

In the next DNS RFCs, codes 6-15 has been assigned to the following errors:

More RCodes has to come for TSIGs and other operations.

Constants

FORMAT

Constant for rcode Response Code Format Error

NAME

Constant for rcode Response Code Name Error

NOERROR

Constant for rcode Response Code No Error

NOTIMPLEMENTED

Constant for rcode Response Code Not Implemented Error

RCodeErrorString
RCodeType
REFUSED

Constant for rcode Response Code Refused Error

SERVER

Constant for rcode Response Code Server Format Error

Attributes

code[R]
explanation[R]
type[R]

Public Class Methods

new(code) click to toggle source
# File lib/net/dns/header.rb, line 139
def initialize(code)
  if (0..10).include? code
    @code         = code
    @type         = RCodeType[code]
    @explanation  = RCodeErrorString[code]
  else
    raise ArgumentError, "RCode `#{code}' out of range"
  end
end

Public Instance Methods

to_s() click to toggle source
# File lib/net/dns/header.rb, line 149
def to_s
  @code.to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.