class Dnsruby::RR::NSAP
Class for DNS
Network Service Access Point (NSAP
) resource records. RFC 1706.
Attributes
The RR’s administrative authority.
currently supports only AFI 47 (GOSIP Version 2).
The RR’s area identifier.
The RR’s DSP format identifier.
The RR’s system identifier.
The RR’s initial domain identifier.
The RR’s routing domain identifier.
The RR’s reserved field.
Public Instance Methods
Source
# File lib/dnsruby/resource/NSAP.rb, line 52 def dsp ret = [@dfi,@aa,rsvd,@rd,@area,@id,@sel].join('') return ret end
The RR’s domain specific part (the DFI, AA, Rsvd, RD, Area, ID, and SEL fields).
Source
# File lib/dnsruby/resource/NSAP.rb, line 45 def idp ret = [@afi, @idi].join('') return ret end
The RR’s initial domain part (the AFI and IDI fields).
Source
# File lib/dnsruby/resource/NSAP.rb, line 57 def rsvd if (@rsvd==nil) return "0000" else return @rsvd end end
Source
# File lib/dnsruby/resource/NSAP.rb, line 72 def str2bcd(s, bytes) retval = ""; digits = bytes * 2; string = sprintf("%#{digits}s", s); string.tr!(" ","0"); i=0; bytes.times do bcd = string[i*2, 2]; retval += [bcd.to_i(16)].pack("C"); i+=1 end return retval; end
Usage: str2bcd(STRING, NUM_BYTES) Takes a string representing a hex number of arbitrary length and returns an equivalent BCD string of NUM_BYTES length (with NUM_BYTES * 2 digits), adding leading zeros if necessary.