Class | Dnsruby::RR::NSAP |
In: |
lib/Dnsruby/resource/NSAP.rb
|
Parent: | RR |
TypeValue | = | Types::NSAP #:nodoc: all |
aa | [RW] | The RR‘s administrative authority. |
afi | [RW] | The RR‘s authority and format identifier. Dnsruby currently supports only AFI 47 (GOSIP Version 2). |
area | [RW] | The RR‘s area identifier. |
dfi | [RW] | The RR‘s DSP format identifier. |
id | [RW] | The RR‘s system identifier. |
idi | [RW] | The RR‘s initial domain identifier. |
rd | [RW] | The RR‘s routing domain identifier. |
rsvd | [W] | The RR‘s reserved field. |
sel | [RW] | The RR‘s NSAP selector. |
# 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
# 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