Sha256: d600872aa89bec0bcd95792c041f6180c7cb3e17db8ead00f6f728b274cee4a5

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

module Net # :nodoc:
  module DNS
    class RR
      
      #------------------------------------------------------------
      # RR type SRV
      #------------------------------------------------------------
      class SRV < RR
        
        attr_reader :priority, :weight, :port, :host
        
        private
        
        def build_pack
          str = ""
        end
        
        def subclass_new_from_binary(data,offset)
          off_end = offset + @rdlength
          @priority, @weight, @port = data.unpack("@#{offset} n n n")
          offset+=6

          @host=[]
          while offset < off_end
            len = data.unpack("@#{offset} C")[0]
            offset += 1
            str = data[offset..offset+len-1]
            offset += len
            @host << str
          end
          @host=@host.join(".")
          offset
        end
        
        private
        
          def set_type
            @type = Net::DNS::RR::Types.new("SRV")
          end
        
      end
    end
        
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
net-dns2-0.8.6 lib/net/dns/rr/srv.rb
net-dns2-0.8.5 lib/net/dns/rr/srv.rb
net-dns2-0.8.4 lib/net/dns/rr/srv.rb
net-dns2-0.8.3 lib/net/dns/rr/srv.rb
net-dns2-0.8.2 lib/net/dns/rr/srv.rb
net-dns2-0.8.1 lib/net/dns/rr/srv.rb
net-dns-0.8.0 lib/net/dns/rr/srv.rb
net-dns-0.7.1 lib/net/dns/rr/srv.rb
net-dns-0.7.0 lib/net/dns/rr/srv.rb