MCPcopy Create free account
hub / github.com/DeNA/PacketProxy / getSectionRRsets

Method getSectionRRsets

src/main/java/core/org/xbill/DNS/Message.java:364–394  ·  view source on GitHub ↗

Returns an array containing all records in the given section grouped into RRsets. @see RRset @see Section

(int section)

Source from the content-addressed store, hash-verified

362 * @see Section
363 */
364public RRset []
365getSectionRRsets(int section) {
366 if (sections[section] == null)
367 return emptyRRsetArray;
368 List sets = new LinkedList();
369 Record [] recs = getSectionArray(section);
370 Set hash = new HashSet();
371 for (int i = 0; i < recs.length; i++) {
372 Name name = recs[i].getName();
373 boolean newset = true;
374 if (hash.contains(name)) {
375 for (int j = sets.size() - 1; j >= 0; j--) {
376 RRset set = (RRset) sets.get(j);
377 if (set.getType() == recs[i].getRRsetType() &&
378 set.getDClass() == recs[i].getDClass() &&
379 set.getName().equals(name))
380 {
381 set.addRR(recs[i]);
382 newset = false;
383 break;
384 }
385 }
386 }
387 if (newset) {
388 RRset set = new RRset(recs[i]);
389 sets.add(set);
390 hash.add(name);
391 }
392 }
393 return (RRset []) sets.toArray(new RRset[sets.size()]);
394}
395
396void
397toWire(DNSOutput out) {

Callers 1

addMessageMethod · 0.80

Calls 14

getSectionArrayMethod · 0.95
getTypeMethod · 0.95
getDClassMethod · 0.95
getNameMethod · 0.95
addRRMethod · 0.95
getRRsetTypeMethod · 0.80
getNameMethod · 0.65
containsMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
getDClassMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected