Parent

Class Index [+]

Quicksearch

Dnsruby::RR::IPSECKEY

Constants

TypeValue

Attributes

precedence[RW]

An 8-bit precedence for this field. Lower values are preferred.

gateway_type[RW]

Specifies the type of gateway :

 0 - no gateway present
 1 - 4 byte IPv4 address present
 2 - 16 byte IPv6 address present
 3 - wire-encoded domain name present
algorithm[RW]

The algorithm used by this key :

 0 - no key present
 1 - DSA key present
 2 - RSA key present
gateway[RW]

The gateway. May either be a 32-bit network order IPv4 address, or a 128-bit IPv6 address, or a domain name, or may not be present.

Public Instance Methods

from_hash(hash) click to toggle source
    # File lib/Dnsruby/resource/IPSECKEY.rb, line 53
53:       def from_hash(hash)
54:         @precedence = hash[:precedence]
55:         @gateway_type = hash[:gateway_type]
56:         @algorithm = hash[:algorithm]
57:         @gateway = load_gateway_from_string(@gateway_type, hash[:gateway])
58:         @public_key = hash[:public_key]
59:       end
from_string(input) click to toggle source
     # File lib/Dnsruby/resource/IPSECKEY.rb, line 88
 88:       def from_string(input)
 89:         if (input.length > 0)
 90:           split = input.split(" ")
 91: 
 92:           @precedence = split[0].to_i
 93:           @gateway_type = split[1].to_i
 94:           @algorithm = split[2].to_i
 95: 
 96:           @gateway = load_gateway_from_string(@gateway_type, split[3])
 97: 
 98:           @public_key = public_key_from_string(split[4])
 99:         end
100:       end
load_gateway_from_string(gateway_type, s) click to toggle source
    # File lib/Dnsruby/resource/IPSECKEY.rb, line 61
61:       def load_gateway_from_string(gateway_type, s)
62:         gateway = nil
63:         if (gateway_type == 0)
64:           gateway = nil
65:         elsif (gateway_type == 1)
66:           # Load IPv4 gateway
67:           gateway = IPv4.create(s)
68:         elsif (gateway_type == 2)
69:           # Load IPv6 gateway
70:           gateway = IPv6.create(s)
71:         else
72:           # Load gateway domain name
73:           gateway = Name.create(s)
74:         end
75:         return gateway        
76:       end
public_key_from_string(key_text) click to toggle source
    # File lib/Dnsruby/resource/IPSECKEY.rb, line 82
82:       def public_key_from_string(key_text)
83:         key_text.gsub!(/\n/, "")
84:         key_text.gsub!(/ /, "")
85:         return key_text.unpack("m*")[0]
86:       end
public_key_string() click to toggle source
    # File lib/Dnsruby/resource/IPSECKEY.rb, line 78
78:       def public_key_string
79:         [@public_key.to_s].pack("m*").gsub("\n", "")
80:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.