Lines Matching +defs:c +defs:label +defs:offset

1 /*	$NetBSD: name.c,v 1.15 2025/01/26 16:25:23 christos Exp $	*/
106 unsigned int offset, count, length, nlabels;
121 offset = 0;
124 while (offset != length) {
129 if (offsets != NULL && offsets[nlabels] != offset) {
134 offset += count + 1;
136 if (offset > length) {
145 if (nlabels != name->labels || offset != name->length) {
170 * Does 'name' end in the root label?
178 #define hyphenchar(c) ((c) == 0x2d)
179 #define asterchar(c) ((c) == 0x2a)
180 #define alphachar(c) \
181 (((c) >= 0x41 && (c) <= 0x5a) || ((c) >= 0x61 && (c) <= 0x7a))
182 #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
183 #define borderchar(c) (alphachar(c) || digitchar(c))
184 #define middlechar(c) (borderchar(c) || hyphenchar(c))
185 #define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
198 * Root label.
253 * Root label.
316 unsigned int label;
326 * Skip first label.
332 label = 1;
336 while (label + 1 < name->labels) {
343 label++;
505 /* label lengths are < 64 so tolower() does not affect them */
551 /* label lengths are < 64 so tolower() does not affect them */
605 dns_name_getlabel(const dns_name_t *name, unsigned int n, dns_label_t *label) {
610 * Make 'label' refer to the 'n'th least significant label of 'name'.
616 REQUIRE(label != NULL);
620 label->base = &name->ndata[offsets[n]];
622 label->length = name->length - offsets[n];
624 label->length = offsets[n + 1] - offsets[n];
773 unsigned char *ndata, *label = NULL;
775 char c;
834 c = *tdata++;
843 if (c == '.') {
854 if (c == '@' && tlen == 0) {
861 label = ndata;
866 if (c == '\\') {
876 if (c == '.') {
880 *label = count;
892 } else if (c == '\\') {
900 c = isc_ascii_tolower(c);
902 *ndata++ = c;
908 if (c == '[') {
910 * This looks like a bitstring label, which
919 if (!isdigit((unsigned char)c)) {
925 c = isc_ascii_tolower(c);
927 *ndata++ = c;
938 if (!isdigit((unsigned char)c)) {
941 value = 10 * value + c - '0';
976 INSIST(label != NULL);
977 *label = count;
986 label = origin->ndata;
991 n2 = *label++;
997 c = *label++;
999 c = isc_ascii_tolower(c);
1001 *ndata++ = c;
1034 unsigned char c;
1084 * Special handling for the root label.
1112 c = *ndata;
1113 switch (c) {
1132 *tdata++ = c;
1139 if (c > 0x20 && c < 0x7f) {
1143 *tdata++ = c;
1153 ((c / 100) % 10);
1155 ((c / 10) % 10);
1156 *tdata++ = 0x30 + (c % 10);
1165 FATAL_ERROR("Unexpected label type %02x", count);
1208 unsigned char c;
1230 * Special handling for the root label.
1256 c = *ndata;
1257 if ((c >= 0x30 && c <= 0x39) || /* digit */
1258 (c >= 0x41 && c <= 0x5A) || /* uppercase */
1259 (c >= 0x61 && c <= 0x7A) || /* lowercase */
1260 c == 0x2D || /* hyphen */
1261 c == 0x5F) /* underscore */
1267 if (c >= 0x41 && c <= 0x5A) {
1268 c += 0x20;
1270 *tdata++ = c;
1278 snprintf(tdata, trem, "%%%02X", c);
1287 FATAL_ERROR("Unexpected label type %02x", count);
1351 /* label lengths are < 64 so tolower() does not affect them */
1373 unsigned int offset, count, length, nlabels;
1379 offset = 0;
1382 while (offset != length) {
1384 offsets[nlabels++] = offset;
1387 offset += count + 1;
1389 INSIST(offset <= length);
1399 set_name->length = offset;
1403 INSIST(offset == name->length);
1438 * a sequence of labels ending with the root label or a compression
1448 * We start at octet 1. There is an ordinary single character label "a",
1450 * Here there is a label of length 4, which weirdly re-uses the octets
1451 * we already examined as the data for the label. It is followed by the
1452 * root label,
1495 * The cursor steps forwards for each label.
1506 * One iteration per label.
1512 * Normal label: record its offset, and check bounds on
1559 * from the marker up to and including the root label.
1599 * a pointer to this name's offset that we saved previously.
1628 * Return this name's compression offset for use next time, provided
2168 static unsigned char ip6fc[] = "\001c\001f\003ip6\004ARPA";
2205 * label length consistent with a trust-anchor-telemetry label.
2258 * Do we have a valid _port label?
2271 * Move to next label.