本文整理汇总了C++中dns_name_ishostname函数的典型用法代码示例。如果您正苦于以下问题:C++ dns_name_ishostname函数的具体用法?C++ dns_name_ishostname怎么用?C++ dns_name_ishostname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dns_name_ishostname函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkowner_in_a
static inline isc_boolean_t
checkowner_in_a(ARGS_CHECKOWNER) {
dns_name_t prefix, suffix;
REQUIRE(type == dns_rdatatype_a);
REQUIRE(rdclass == dns_rdataclass_in);
UNUSED(type);
UNUSED(rdclass);
/*
* Handle Active Diretory gc._msdcs.<forest> name.
*/
if (dns_name_countlabels(name) > 2U) {
dns_name_init(&prefix, NULL);
dns_name_init(&suffix, NULL);
dns_name_split(name, dns_name_countlabels(name) - 2,
&prefix, &suffix);
if (dns_name_equal(&gc_msdcs, &prefix) &&
dns_name_ishostname(&suffix, ISC_FALSE))
return (ISC_TRUE);
}
return (dns_name_ishostname(name, wildcard));
}
示例2: fromtext_ns
static inline isc_result_t
fromtext_ns(ARGS_FROMTEXT) {
isc_token_t token;
dns_name_t name;
isc_buffer_t buffer;
isc_boolean_t ok;
REQUIRE(type == 2);
UNUSED(type);
UNUSED(rdclass);
UNUSED(callbacks);
RETERR(isc_lex_getmastertoken(lexer, &token,isc_tokentype_string,
ISC_FALSE));
dns_name_init(&name, NULL);
buffer_fromregion(&buffer, &token.value.as_region);
origin = (origin != NULL) ? origin : dns_rootname;
RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
ok = ISC_TRUE;
if ((options & DNS_RDATA_CHECKNAMES) != 0)
ok = dns_name_ishostname(&name, ISC_FALSE);
if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
RETTOK(DNS_R_BADNAME);
if (!ok && callbacks != NULL)
warn_badname(&name, lexer, callbacks);
return (ISC_R_SUCCESS);
}
示例3: checknames_soa
static inline isc_boolean_t
checknames_soa(ARGS_CHECKNAMES) {
isc_region_t region;
dns_name_t name;
REQUIRE(rdata->type == 6);
UNUSED(owner);
dns_rdata_toregion(rdata, ®ion);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, ®ion);
if (!dns_name_ishostname(&name, ISC_FALSE)) {
if (bad != NULL)
dns_name_clone(&name, bad);
return (ISC_FALSE);
}
isc_region_consume(®ion, name_length(&name));
dns_name_fromregion(&name, ®ion);
if (!dns_name_ismailbox(&name)) {
if (bad != NULL)
dns_name_clone(&name, bad);
return (ISC_FALSE);
}
return (ISC_TRUE);
}
示例4: checknames_ptr
static inline isc_boolean_t
checknames_ptr(ARGS_CHECKNAMES) {
isc_region_t region;
dns_name_t name;
REQUIRE(rdata->type == dns_rdatatype_ptr);
if (rdata->rdclass != dns_rdataclass_in)
return (ISC_TRUE);
if (dns_name_isdnssd(owner))
return (ISC_TRUE);
if (dns_name_issubdomain(owner, &in_addr_arpa) ||
dns_name_issubdomain(owner, &ip6_arpa) ||
dns_name_issubdomain(owner, &ip6_int)) {
dns_rdata_toregion(rdata, ®ion);
dns_name_init(&name, NULL);
dns_name_fromregion(&name, ®ion);
if (!dns_name_ishostname(&name, ISC_FALSE)) {
if (bad != NULL)
dns_name_clone(&name, bad);
return (ISC_FALSE);
}
}
return (ISC_TRUE);
}
示例5: fromtext_in_srv
static inline isc_result_t
fromtext_in_srv(ARGS_FROMTEXT) {
isc_token_t token;
dns_name_t name;
isc_buffer_t buffer;
isc_boolean_t ok;
REQUIRE(type == dns_rdatatype_srv);
REQUIRE(rdclass == dns_rdataclass_in);
UNUSED(type);
UNUSED(rdclass);
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));
/*
* Port.
*/
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.
*/
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
dns_name_init(&name, NULL);
buffer_fromregion(&buffer, &token.value.as_region);
origin = (origin != NULL) ? origin : dns_rootname;
RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
ok = ISC_TRUE;
if ((options & DNS_RDATA_CHECKNAMES) != 0)
ok = dns_name_ishostname(&name, ISC_FALSE);
if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
RETTOK(DNS_R_BADNAME);
if (!ok && callbacks != NULL)
warn_badname(&name, lexer, callbacks);
return (ISC_R_SUCCESS);
}
示例6: fromtext_soa
static inline isc_result_t
fromtext_soa(ARGS_FROMTEXT) {
isc_token_t token;
dns_name_t name;
isc_buffer_t buffer;
int i;
isc_uint32_t n;
isc_boolean_t ok;
REQUIRE(type == 6);
UNUSED(type);
UNUSED(rdclass);
UNUSED(callbacks);
origin = (origin != NULL) ? origin : dns_rootname;
for (i = 0; i < 2; i++) {
RETERR(isc_lex_getmastertoken(lexer, &token,
isc_tokentype_string,
ISC_FALSE));
dns_name_init(&name, NULL);
buffer_fromregion(&buffer, &token.value.as_region);
RETTOK(dns_name_fromtext(&name, &buffer, origin,
options, target));
ok = ISC_TRUE;
if ((options & DNS_RDATA_CHECKNAMES) != 0)
switch (i) {
case 0:
ok = dns_name_ishostname(&name, ISC_FALSE);
break;
case 1:
ok = dns_name_ismailbox(&name);
break;
}
if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
RETTOK(DNS_R_BADNAME);
if (!ok && callbacks != NULL)
warn_badname(&name, lexer, callbacks);
}
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
ISC_FALSE));
RETERR(uint32_tobuffer(token.value.as_ulong, target));
for (i = 0; i < 4; i++) {
RETERR(isc_lex_getmastertoken(lexer, &token,
isc_tokentype_string,
ISC_FALSE));
RETTOK(dns_counter_fromtext(&token.value.as_textregion, &n));
RETERR(uint32_tobuffer(n, target));
}
return (ISC_R_SUCCESS);
}
示例7: fromtext_ch_a
static inline isc_result_t fromtext_ch_a (ARGS_FROMTEXT)
{
isc_token_t token;
dns_name_t name;
isc_buffer_t buffer;
REQUIRE (type == 1);
REQUIRE (rdclass == dns_rdataclass_ch); /* 3 */
UNUSED (type);
UNUSED (callbacks);
RETERR (isc_lex_getmastertoken (lexer, &token, isc_tokentype_string, ISC_FALSE));
/* get domain name */
dns_name_init (&name, NULL);
buffer_fromregion (&buffer, &token.value.as_region);
origin = (origin != NULL) ? origin : dns_rootname;
RETTOK (dns_name_fromtext (&name, &buffer, origin, options, target));
if ((options & DNS_RDATA_CHECKNAMES) != 0 && (options & DNS_RDATA_CHECKREVERSE) != 0)
{
isc_boolean_t ok;
ok = dns_name_ishostname (&name, ISC_FALSE);
if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
RETTOK (DNS_R_BADNAME);
if (!ok && callbacks != NULL)
warn_badname (&name, lexer, callbacks);
}
/* 16-bit octal address */
RETERR (isc_lex_getoctaltoken (lexer, &token, ISC_FALSE));
if (token.value.as_ulong > 0xffffU)
RETTOK (ISC_R_RANGE);
return (uint16_tobuffer (token.value.as_ulong, target));
}