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

Method rrFromWire

src/main/java/core/org/xbill/DNS/APLRecord.java:144–171  ·  view source on GitHub ↗
(DNSInput in)

Source from the content-addressed store, hash-verified

142}
143
144void
145rrFromWire(DNSInput in) throws IOException {
146 elements = new ArrayList(1);
147 while (in.remaining() != 0) {
148 int family = in.readU16();
149 int prefix = in.readU8();
150 int length = in.readU8();
151 boolean negative = (length & 0x80) != 0;
152 length &= ~0x80;
153
154 byte [] data = in.readByteArray(length);
155 Element element;
156 if (!validatePrefixLength(family, prefix)) {
157 throw new WireParseException("invalid prefix length");
158 }
159
160 if (family == Address.IPv4 || family == Address.IPv6) {
161 data = parseAddress(data,
162 Address.addressLength(family));
163 InetAddress addr = InetAddress.getByAddress(data);
164 element = new Element(negative, addr, prefix);
165 } else {
166 element = new Element(family, negative, data, prefix);
167 }
168 elements.add(element);
169
170 }
171}
172
173void
174rdataFromString(Tokenizer st, Name origin) throws IOException {

Callers

nothing calls this directly

Calls 9

validatePrefixLengthMethod · 0.95
parseAddressMethod · 0.95
addressLengthMethod · 0.95
remainingMethod · 0.80
readU16Method · 0.80
readU8Method · 0.80
readByteArrayMethod · 0.80
getByAddressMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected