Class: Dnsruby::RR::NSAP

### Home Classes Methods

### In Files

- lib/Dnsruby/resource/NSAP.rb

### Parent

Dnsruby::RR

### Methods

- #dsp
- #idp
- #rsvd
- #str2bcd

### Files

- DNSSEC
- EVENTMACHINE
- EXAMPLES
- README

### Class/Module Index

Quicksearch

- Dnsruby
- Dnsruby::Algorithms
- Dnsruby::Classes
- Dnsruby::CodeMapper
- Dnsruby::Config
- Dnsruby::DNS
- Dnsruby::DecodeError
- Dnsruby::Dnssec
- Dnsruby::Dnssec::ValidationPolicy
- Dnsruby::EncodeError
- Dnsruby::ExtendedRCode
- Dnsruby::FormErr
- Dnsruby::Header
- Dnsruby::Hosts
- Dnsruby::IPv4
- Dnsruby::IPv6
- Dnsruby::Message
- Dnsruby::Message::Section
- Dnsruby::Message::SecurityLevel
- Dnsruby::MetaTypes
- Dnsruby::Modes
- Dnsruby::NXDomain
- Dnsruby::NXRRSet
- Dnsruby::Name
- Dnsruby::Name::Label
- Dnsruby::NotAuth
- Dnsruby::NotImp
- Dnsruby::NotZone
- Dnsruby::Nsec3HashAlgorithms
- Dnsruby::OpCode
- Dnsruby::OtherResolvError
- Dnsruby::QTypes
- Dnsruby::Question
- Dnsruby::RCode
- Dnsruby::RR
- Dnsruby::RR::ANY
- Dnsruby::RR::CERT
- Dnsruby::RR::CERT::CertificateTypes
- Dnsruby::RR::CNAME
- Dnsruby::RR::DHCID
- Dnsruby::RR::DLV
- Dnsruby::RR::DNAME
- Dnsruby::RR::DNSKEY
- Dnsruby::RR::DS
- Dnsruby::RR::DS::DigestTypes
- Dnsruby::RR::DomainName
- Dnsruby::RR::Generic
- Dnsruby::RR::HINFO
- Dnsruby::RR::HIP
- Dnsruby::RR::IN
- Dnsruby::RR::IN::A
- Dnsruby::RR::IN::AAAA
- Dnsruby::RR::IN::AFSDB
- Dnsruby::RR::IN::PX
- Dnsruby::RR::IN::SRV
- Dnsruby::RR::IN::WKS
- Dnsruby::RR::IPSECKEY
- Dnsruby::RR::ISDN
- Dnsruby::RR::KX
- Dnsruby::RR::LOC
- Dnsruby::RR::MB
- Dnsruby::RR::MG
- Dnsruby::RR::MINFO
- Dnsruby::RR::MR
- Dnsruby::RR::MX
- Dnsruby::RR::NAPTR
- Dnsruby::RR::NS
- Dnsruby::RR::NSAP
- Dnsruby::RR::NSEC
- Dnsruby::RR::NSEC3
- Dnsruby::RR::NSEC3PARAM
- Dnsruby::RR::OPT
- Dnsruby::RR::PTR
- Dnsruby::RR::RP
- Dnsruby::RR::RRSIG
- Dnsruby::RR::RT
- Dnsruby::RR::SOA
- Dnsruby::RR::SPF
- Dnsruby::RR::SSHFP
- Dnsruby::RR::SSHFP::Algorithms
- Dnsruby::RR::SSHFP::FpTypes
- Dnsruby::RR::TKEY
- Dnsruby::RR::TSIG
- Dnsruby::RR::TXT
- Dnsruby::RR::X25
- Dnsruby::RRSet
- Dnsruby::Recursor
- Dnsruby::Refused
- Dnsruby::Resolv
- Dnsruby::ResolvError
- Dnsruby::ResolvTimeout
- Dnsruby::Resolver
- Dnsruby::Resolver::EventType
- Dnsruby::SelectThread
- Dnsruby::ServFail
- Dnsruby::SingleResolver
- Dnsruby::TheLog
- Dnsruby::TsigError
- Dnsruby::TsigNotSignedResponseError
- Dnsruby::Types
- Dnsruby::Update
- Dnsruby::VerifyError
- Dnsruby::YXDomain
- Dnsruby::YXRRSet
- Dnsruby::ZoneReader
- Dnsruby::ZoneReader::ParseException
- Dnsruby::ZoneSerialError
- Dnsruby::ZoneTransfer
- Dnsruby::ZoneTransfer::Delta
- Base32

No matching classes.

# Dnsruby::RR::NSAP

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

### Attributes

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.

### 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
    def dsp
      ret = [@dfi,@aa,rsvd,@rd,@area,@id,@sel].join('')
      return ret
    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
    def idp
      ret = [@afi, @idi].join('')
      return ret
    end

rsvd() click to toggle source

    # File lib/Dnsruby/resource/NSAP.rb, line 57
    def rsvd
      if (@rsvd==nil)
        return "0000"
      else
        return @rsvd
      end
    end

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.