static inline isc_result_t fromtext_caa(ARGS_FROMTEXT) { isc_token_t token; isc_textregion_t tr; isc_uint8_t flags; unsigned int i; REQUIRE(type == 257); UNUSED(type); UNUSED(rdclass); UNUSED(origin); UNUSED(options); UNUSED(callbacks); /* Flags. */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 255U) RETTOK(ISC_R_RANGE); flags = token.value.as_ulong & 255U; RETERR(uint8_tobuffer(flags, target)); /* * Tag */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string, ISC_FALSE)); tr = token.value.as_textregion; for (i = 0; i < tr.length; i++) if (!alphanumeric[(unsigned char) tr.base[i]]) RETTOK(DNS_R_SYNTAX); RETERR(uint8_tobuffer(tr.length, target)); RETERR(mem_tobuffer(target, tr.base, tr.length)); /* * Value */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); if (token.type != isc_tokentype_qstring && token.type != isc_tokentype_string) RETERR(DNS_R_SYNTAX); RETERR(multitxt_fromtext(&token.value.as_textregion, target)); return (ISC_R_SUCCESS); }
static inline isc_result_t fromtext_uri(ARGS_FROMTEXT) { isc_token_t token; REQUIRE(type == 256); UNUSED(type); UNUSED(rdclass); UNUSED(origin); UNUSED(options); UNUSED(callbacks); /* * Priority */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffffU) RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* * Weight */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, ISC_FALSE)); if (token.value.as_ulong > 0xffffU) RETTOK(ISC_R_RANGE); RETERR(uint16_tobuffer(token.value.as_ulong, target)); /* * Target URI */ RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_qstring, ISC_FALSE)); if (token.type != isc_tokentype_qstring) RETTOK(DNS_R_SYNTAX); RETTOK(multitxt_fromtext(&token.value.as_textregion, target)); return (ISC_R_SUCCESS); }