Parent

Class Index [+]

Quicksearch

Dnsruby::RR::NSAP

Class for DNS Network Service Access Point (NSAP) resource records. RFC 1706.

Constants

TypeValue

Attributes

afi[RW]

The RR’s authority and format identifier. Dnsruby currently supports only AFI 47 (GOSIP Version 2).

idi[RW]

The RR’s initial domain identifier.

dfi[RW]

The RR’s DSP format identifier.

aa[RW]

The RR’s administrative authority.

rd[RW]

The RR’s routing domain identifier.

area[RW]

The RR’s area identifier.

id[RW]

The RR’s system identifier.

sel[RW]

The RR’s NSAP selector.

rsvd[W]

The RR’s reserved field.

Public Instance Methods

dsp() click to toggle source

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
idp() click to toggle source

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
rsvd() click to toggle source
    # 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
str2bcd(s, bytes) click to toggle source

——————————————————————————

 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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.