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
# 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
# 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
# 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
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.