| 134 | } |
| 135 | |
| 136 | void |
| 137 | addRRset(Name name, Message response, RRset rrset, int section, int flags) { |
| 138 | for (int s = 1; s <= section; s++) |
| 139 | if (response.findRRset(name, rrset.getType(), s)) |
| 140 | return; |
| 141 | if ((flags & FLAG_SIGONLY) == 0) { |
| 142 | Iterator it = rrset.rrs(); |
| 143 | while (it.hasNext()) { |
| 144 | Record r = (Record) it.next(); |
| 145 | if (r.getName().isWild() && !name.isWild()) |
| 146 | r = r.withName(name); |
| 147 | response.addRecord(r, section); |
| 148 | } |
| 149 | } |
| 150 | if ((flags & (FLAG_SIGONLY | FLAG_DNSSECOK)) != 0) { |
| 151 | Iterator it = rrset.sigs(); |
| 152 | while (it.hasNext()) { |
| 153 | Record r = (Record) it.next(); |
| 154 | if (r.getName().isWild() && !name.isWild()) |
| 155 | r = r.withName(name); |
| 156 | response.addRecord(r, section); |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | private final void |
| 162 | addSOA(Message response, Zone zone) { |