Java Code Examples for org.xbill.DNS.RRset#rrs()

The following examples show how to use org.xbill.DNS.RRset#rrs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DNSSECVerifier.java    From androdns with Apache License 2.0 6 votes vote down vote up
public void learnDNSSECKeysFromRRSETs(RRset[] rrsets){
    Iterator it;
    int i;

    for (i = 0; i < rrsets.length; i++) {
        RRset rrset = rrsets[i];
        if (rrset.getType()!=Type.DNSKEY){
            continue;
        }
        it = rrset.rrs();

        while (it.hasNext()) {
            DNSKEYRecord r = (DNSKEYRecord) it.next();
            addDNSKEY(r);
        }


    }

}
 
Example 2
Source File: DNSFormActivity.java    From androdns with Apache License 2.0 5 votes vote down vote up
public String rrSetsToString(RRset[] rrsets) {
    StringBuffer ansBuffer = new StringBuffer();
    Iterator it;
    int i;

    for (i = 0; i < rrsets.length; i++) {
        RRset rrset = rrsets[i];
        it = rrset.rrs();

        while (it.hasNext()) {
            Record r = (Record) it.next();
            //Log.i(TAG, "rrsetstostring: type=" + r.getType());
            ansBuffer.append(r.toString());
            ansBuffer.append("\n");
        }

        //RRSIGs
        final Iterator<Record> sigIter = rrset.sigs();
        while (sigIter.hasNext()) {
            final Record sigRec = sigIter.next();

            ansBuffer.append(sigRec.toString());
            ansBuffer.append("\n");
        }
    }
    //replace tabs
    String ret = ansBuffer.toString().replace('\t', ' ');
    return ret;
}
 
Example 3
Source File: jnamed.java    From dnsjava with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void addCacheNS(Message response, Cache cache, Name name) {
  SetResponse sr = cache.lookupRecords(name, Type.NS, Credibility.HINT);
  if (!sr.isDelegation()) {
    return;
  }
  RRset nsRecords = sr.getNS();
  for (Record r : nsRecords.rrs()) {
    response.addRecord(r, Section.AUTHORITY);
  }
}