The RR’s authority and format identifier. Dnsruby currently supports only AFI 47 (GOSIP Version 2).
The RR’s domain specific part (the DFI, AA, Rsvd, RD, Area, ID, and SEL fields).
# File lib/Dnsruby/resource/NSAP.rb, line 52
52: def dsp
53: ret = [@dfi,@aa,rsvd,@rd,@area,@id,@sel].join('')
54: return ret
55: end
The RR’s initial domain part (the AFI and IDI fields).
# File lib/Dnsruby/resource/NSAP.rb, line 45
45: def idp
46: ret = [@afi, @idi].join('')
47: return ret
48: end
# File lib/Dnsruby/resource/NSAP.rb, line 57
57: def rsvd
58: if (@rsvd==nil)
59: return "0000"
60: else
61: return @rsvd
62: end
63: 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.
——————————————————————————
# File lib/Dnsruby/resource/NSAP.rb, line 72
72: def str2bcd(s, bytes)
73: retval = "";
74:
75: digits = bytes * 2;
76: string = sprintf("%#{digits}s", s);
77: string.tr!(" ","0");
78:
79: i=0;
80: bytes.times do
81: bcd = string[i*2, 2];
82: retval += [bcd.to_i(16)].pack("C");
83: i+=1
84: end
85:
86: return retval;
87: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.