Class: Resolv::DNS::Resource::IN::SRV
- Inherits:
-
Resolv::DNS::Resource
- Object
- Query
- Resolv::DNS::Resource
- Resolv::DNS::Resource::IN::SRV
- Defined in:
- lib/resolv.rb
Overview
SRV resource record defined in RFC 2782
These records identify the hostname and port that a service is available at.
The format is:
_Service._Proto.Name TTL Class SRV Priority Weight Port Target
The fields specific to SRV are defined in RFC 2782 as meaning:
-
priorityThe priority of this target host. A client MUST attempt to contact the target host with the lowest-numbered priority it can reach; target hosts with the same priority SHOULD be tried in an order defined by the weight field. The range is 0-65535. Note that it is not widely implemented and should be set to zero. -
weightA server selection mechanism. The weight field specifies a relative weight for entries with the same priority. Larger weights SHOULD be given a proportionately higher probability of being selected. The range of this number is 0-65535. Domain administrators SHOULD use Weight 0 when there isn't any server selection to do, to make the RR easier to read for humans (less noisy). Note that it is not widely implemented and should be set to zero. -
portThe port on this target host of this service. The range is 0- 65535. -
targetThe domain name of the target host. A target of "." means that the service is decidedly not available at this domain.
Constant Summary
Constants inherited from Resolv::DNS::Resource
ClassHash, ClassInsensitiveTypes, ClassValue
Instance Attribute Summary collapse
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
- #encode_rdata(msg) ⇒ Object
-
#initialize(priority, weight, port, target) ⇒ SRV
constructor
Create a SRV resource record.
Methods inherited from Resolv::DNS::Resource
Constructor Details
Instance Attribute Details
#port ⇒ Object (readonly)
Returns the value of attribute port.
1692 1693 1694 |
# File 'lib/resolv.rb', line 1692 def port @port end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
1692 1693 1694 |
# File 'lib/resolv.rb', line 1692 def priority @priority end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
1692 1693 1694 |
# File 'lib/resolv.rb', line 1692 def target @target end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
1692 1693 1694 |
# File 'lib/resolv.rb', line 1692 def weight @weight end |
Class Method Details
.decode_rdata(msg) ⇒ Object
1701 1702 1703 1704 1705 1706 1707 |
# File 'lib/resolv.rb', line 1701 def self.decode_rdata(msg) priority, = msg.get_unpack("n") weight, = msg.get_unpack("n") port, = msg.get_unpack("n") target = msg.get_name return self.new(priority, weight, port, target) end |
Instance Method Details
#encode_rdata(msg) ⇒ Object
1694 1695 1696 1697 1698 1699 |
# File 'lib/resolv.rb', line 1694 def encode_rdata(msg) msg.put_pack("n", @priority) msg.put_pack("n", @weight) msg.put_pack("n", @port) msg.put_name(@target) end |