Lines Matching refs:length

44 	isc_uint16_t length;
54 while (r.length > 0) {
57 length = uint16_fromregion(&r);
59 snprintf(buf, sizeof(buf), "%u %u", option, length);
61 INSIST(r.length >= length);
62 if (length > 0) {
67 or.length = length;
74 isc_region_consume(&r, length);
78 if (r.length > 0)
90 isc_uint16_t length;
101 if (sregion.length == 0)
104 while (sregion.length != 0) {
105 if (sregion.length < 4)
109 length = uint16_fromregion(&sregion);
112 if (sregion.length < length)
121 if (length < 4)
156 if (addrbytes + 4 != length)
170 * Request has zero length. Response is 32 bits.
172 if (length != 0 && length != 4)
174 isc_region_consume(&sregion, length);
177 if (length != 8 && (length < 16 || length > 40))
179 isc_region_consume(&sregion, length);
182 if (length == 0 || (length % 2) != 0)
184 isc_region_consume(&sregion, length);
187 isc_region_consume(&sregion, length);
190 total += length;
195 if (tregion.length < total)
211 return (mem_tobuffer(target, rdata->data, rdata->length));
232 isc_uint16_t length;
238 REQUIRE(opt->options != NULL || opt->length == 0);
244 region.length = opt->length;
245 while (region.length >= 4) {
247 length = uint16_fromregion(&region);
249 if (region.length < length)
251 isc_region_consume(&region, length);
253 if (region.length != 0)
256 return (mem_tobuffer(target, opt->options, opt->length));
272 opt->length = r.length;
273 opt->options = mem_maybedup(mctx, r.base, r.length);
358 REQUIRE(opt->options != NULL || opt->length == 0);
360 if (opt->length == 0)
370 isc_uint16_t length;
374 REQUIRE(opt->options != NULL && opt->length != 0);
375 REQUIRE(opt->offset < opt->length);
377 INSIST(opt->offset + 4 <= opt->length);
379 r.length = opt->length - opt->offset - 2;
380 length = uint16_fromregion(&r);
381 INSIST(opt->offset + 4 + length <= opt->length);
382 opt->offset = opt->offset + 4 + length;
383 if (opt->offset == opt->length)
396 REQUIRE(opt->offset < opt->length);
398 INSIST(opt->offset + 4 <= opt->length);
400 r.length = opt->length - opt->offset;
404 opcode->length = uint16_fromregion(&r);
407 INSIST(opt->offset + 4 + opcode->length <= opt->length);