您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uint16_tobuffer函数代码示例

51自学网 2021-06-03 09:07:23
  C++
这篇教程C++ uint16_tobuffer函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uint16_tobuffer函数的典型用法代码示例。如果您正苦于以下问题:C++ uint16_tobuffer函数的具体用法?C++ uint16_tobuffer怎么用?C++ uint16_tobuffer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uint16_tobuffer函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fromstruct_naptr

static inline isc_result_tfromstruct_naptr(ARGS_FROMSTRUCT) {	dns_rdata_naptr_t *naptr = source;	isc_region_t region;	REQUIRE(type == dns_rdatatype_naptr);	REQUIRE(source != NULL);	REQUIRE(naptr->common.rdtype == type);	REQUIRE(naptr->common.rdclass == rdclass);	REQUIRE(naptr->flags != NULL || naptr->flags_len == 0);	REQUIRE(naptr->service != NULL || naptr->service_len == 0);	REQUIRE(naptr->regexp != NULL || naptr->regexp_len == 0);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(naptr->order, target));	RETERR(uint16_tobuffer(naptr->preference, target));	RETERR(uint8_tobuffer(naptr->flags_len, target));	RETERR(mem_tobuffer(target, naptr->flags, naptr->flags_len));	RETERR(uint8_tobuffer(naptr->service_len, target));	RETERR(mem_tobuffer(target, naptr->service, naptr->service_len));	RETERR(uint8_tobuffer(naptr->regexp_len, target));	RETERR(mem_tobuffer(target, naptr->regexp, naptr->regexp_len));	dns_name_toregion(&naptr->replacement, &region);	return (isc_buffer_copyregion(target, &region));}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:27,


示例2: fromstruct_uri

static inline isc_result_tfromstruct_uri(ARGS_FROMSTRUCT) {	dns_rdata_uri_t *uri = source;	REQUIRE(type == 256);	REQUIRE(source != NULL);	REQUIRE(uri->common.rdtype == type);	REQUIRE(uri->common.rdclass == rdclass);	REQUIRE(uri->target != NULL && uri->tgt_len != 0);	UNUSED(type);	UNUSED(rdclass);	/*	 * Priority	 */	RETERR(uint16_tobuffer(uri->priority, target));	/*	 * Weight	 */	RETERR(uint16_tobuffer(uri->weight, target));	/*	 * Target URI	 */	return (mem_tobuffer(target, uri->target, uri->tgt_len));}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:28,


示例3: fromtext_in_srv

static inline isc_result_tfromtext_in_srv(ARGS_FROMTEXT) {	isc_token_t token;	dns_name_t name;	isc_buffer_t buffer;	isc_boolean_t ok;	REQUIRE(type == 33);	REQUIRE(rdclass == 1);	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);}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:59,


示例4: fromstruct_sig

static inline isc_result_tfromstruct_sig(ARGS_FROMSTRUCT) {	dns_rdata_sig_t *sig = source;	REQUIRE(type == dns_rdatatype_sig);	REQUIRE(source != NULL);	REQUIRE(sig->common.rdtype == type);	REQUIRE(sig->common.rdclass == rdclass);	REQUIRE(sig->signature != NULL || sig->siglen == 0);	UNUSED(type);	UNUSED(rdclass);	/*	 * Type covered.	 */	RETERR(uint16_tobuffer(sig->covered, target));	/*	 * Algorithm.	 */	RETERR(uint8_tobuffer(sig->algorithm, target));	/*	 * Labels.	 */	RETERR(uint8_tobuffer(sig->labels, target));	/*	 * Original TTL.	 */	RETERR(uint32_tobuffer(sig->originalttl, target));	/*	 * Expire time.	 */	RETERR(uint32_tobuffer(sig->timeexpire, target));	/*	 * Time signed.	 */	RETERR(uint32_tobuffer(sig->timesigned, target));	/*	 * Key ID.	 */	RETERR(uint16_tobuffer(sig->keyid, target));	/*	 * Signer name.	 */	RETERR(name_tobuffer(&sig->signer, target));	/*	 * Signature.	 */	return (mem_tobuffer(target, sig->signature, sig->siglen));}
开发者ID:fatman2021,项目名称:netbsd-src,代码行数:58,


示例5: fromstruct_tkey

static inline isc_result_tfromstruct_tkey(ARGS_FROMSTRUCT) {	dns_rdata_tkey_t *tkey = source;	REQUIRE(type == 249);	REQUIRE(source != NULL);	REQUIRE(tkey->common.rdtype == type);	REQUIRE(tkey->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	/*	 * Algorithm Name.	 */	RETERR(name_tobuffer(&tkey->algorithm, target));	/*	 * Inception: 32 bits.	 */	RETERR(uint32_tobuffer(tkey->inception, target));	/*	 * Expire: 32 bits.	 */	RETERR(uint32_tobuffer(tkey->expire, target));	/*	 * Mode: 16 bits.	 */	RETERR(uint16_tobuffer(tkey->mode, target));	/*	 * Error: 16 bits.	 */	RETERR(uint16_tobuffer(tkey->error, target));	/*	 * Key size: 16 bits.	 */	RETERR(uint16_tobuffer(tkey->keylen, target));	/*	 * Key.	 */	RETERR(mem_tobuffer(target, tkey->key, tkey->keylen));	/*	 * Other size: 16 bits.	 */	RETERR(uint16_tobuffer(tkey->otherlen, target));	/*	 * Other data.	 */	return (mem_tobuffer(target, tkey->other, tkey->otherlen));}
开发者ID:2014-class,项目名称:freerouter,代码行数:57,


示例6: fromtext_l32

static inline isc_result_tfromtext_l32(ARGS_FROMTEXT) {	isc_token_t token;	struct in_addr addr;	isc_region_t region;	REQUIRE(type == 105);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	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));	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)		RETTOK(DNS_R_BADDOTTEDQUAD);	isc_buffer_availableregion(target, &region);	if (region.length < 4)		return (ISC_R_NOSPACE);	memcpy(region.base, &addr, 4);	isc_buffer_add(target, 4);	return (ISC_R_SUCCESS);}
开发者ID:Gradwell,项目名称:bind9,代码行数:32,


示例7: generic_fromstruct_ds

static inline isc_result_tgeneric_fromstruct_ds(ARGS_FROMSTRUCT) {	dns_rdata_ds_t *ds = source;	REQUIRE(source != NULL);	REQUIRE(ds->common.rdtype == type);	REQUIRE(ds->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	switch (ds->digest_type) {	case DNS_DSDIGEST_SHA1:		REQUIRE(ds->length == ISC_SHA1_DIGESTLENGTH);		break;	case DNS_DSDIGEST_SHA256:		REQUIRE(ds->length == ISC_SHA256_DIGESTLENGTH);		break;#ifdef ISC_GOST_DIGESTLENGTH	case DNS_DSDIGEST_GOST:		REQUIRE(ds->length == ISC_GOST_DIGESTLENGTH);		break;#endif	case DNS_DSDIGEST_SHA384:		REQUIRE(ds->length == ISC_SHA384_DIGESTLENGTH);		break;	}	RETERR(uint16_tobuffer(ds->key_tag, target));	RETERR(uint8_tobuffer(ds->algorithm, target));	RETERR(uint8_tobuffer(ds->digest_type, target));	return (mem_tobuffer(target, ds->digest, ds->length));}
开发者ID:NZRS,项目名称:bind9-collab,代码行数:34,


示例8: fromtext_ds

static inline isc_result_tfromtext_ds(ARGS_FROMTEXT) {	isc_token_t token;	unsigned char c;	int length;	REQUIRE(type == 43);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	/*	 * Key tag.	 */	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));	/*	 * Algorithm.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secalg_fromtext(&c, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &c, 1));	/*	 * Digest type.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,				      ISC_FALSE));	if (token.value.as_ulong > 0xffU)		RETTOK(ISC_R_RANGE);	RETERR(uint8_tobuffer(token.value.as_ulong, target));	c = (unsigned char) token.value.as_ulong;	/*	 * Digest.	 */	switch (c) {	case DNS_DSDIGEST_SHA1:		length = ISC_SHA1_DIGESTLENGTH;		break;	case DNS_DSDIGEST_SHA256:		length = ISC_SHA256_DIGESTLENGTH;		break;	case DNS_DSDIGEST_GOST:		length = ISC_GOST_DIGESTLENGTH;		break;	default:		length = -1;		break;	}	return (isc_hex_tobuffer(lexer, target, length));}
开发者ID:2014-class,项目名称:freerouter,代码行数:60,


示例9: fromstruct_hip

static inline isc_result_tfromstruct_hip(ARGS_FROMSTRUCT) {	dns_rdata_hip_t *hip = source;	dns_rdata_hip_t myhip;	isc_result_t result;	REQUIRE(type == dns_rdatatype_hip);	REQUIRE(source != NULL);	REQUIRE(hip->common.rdtype == type);	REQUIRE(hip->common.rdclass == rdclass);	REQUIRE(hip->hit_len > 0 && hip->hit != NULL);	REQUIRE(hip->key_len > 0 && hip->key != NULL);	REQUIRE((hip->servers == NULL && hip->servers_len == 0) ||		 (hip->servers != NULL && hip->servers_len != 0));	UNUSED(type);	UNUSED(rdclass);	RETERR(uint8_tobuffer(hip->hit_len, target));	RETERR(uint8_tobuffer(hip->algorithm, target));	RETERR(uint16_tobuffer(hip->key_len, target));	RETERR(mem_tobuffer(target, hip->hit, hip->hit_len));	RETERR(mem_tobuffer(target, hip->key, hip->key_len));	myhip = *hip;	for (result = dns_rdata_hip_first(&myhip);	     result == ISC_R_SUCCESS;	     result = dns_rdata_hip_next(&myhip))		/* empty */;	return(mem_tobuffer(target, hip->servers, hip->servers_len));}
开发者ID:chris-wood,项目名称:bind-prime,代码行数:32,


示例10: fromtext_l64

static inline isc_result_tfromtext_l64(ARGS_FROMTEXT) {	isc_token_t token;	unsigned char locator[NS_LOCATORSZ];	REQUIRE(type == 106);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	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));	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	if (locator_pton(DNS_AS_STR(token), locator) != 1)		RETTOK(DNS_R_SYNTAX);	return (mem_tobuffer(target, locator, NS_LOCATORSZ));}
开发者ID:Gradwell,项目名称:bind9,代码行数:26,


示例11: fromtext_lp

static inline isc_result_tfromtext_lp(ARGS_FROMTEXT) {	isc_token_t token;	dns_name_t name;	isc_buffer_t buffer;	REQUIRE(type == dns_rdatatype_lp);	UNUSED(type);	UNUSED(rdclass);	UNUSED(callbacks);	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));	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	dns_name_init(&name, NULL);	buffer_fromregion(&buffer, &token.value.as_region);	if (origin == NULL)		origin = dns_rootname;	return (dns_name_fromtext(&name, &buffer, origin, options, target));}
开发者ID:NZRS,项目名称:bind9-collab,代码行数:27,


示例12: fromstruct_dlv

static inline isc_result_tfromstruct_dlv(ARGS_FROMSTRUCT) {	dns_rdata_dlv_t *dlv = source;	REQUIRE(type == 32769);	REQUIRE(source != NULL);	REQUIRE(dlv->common.rdtype == type);	REQUIRE(dlv->common.rdclass == rdclass);	switch (dlv->digest_type) {	case DNS_DSDIGEST_SHA1:		REQUIRE(dlv->length == ISC_SHA1_DIGESTLENGTH);		break;	case DNS_DSDIGEST_SHA256:		REQUIRE(dlv->length == ISC_SHA256_DIGESTLENGTH);		break;	}	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(dlv->key_tag, target));	RETERR(uint8_tobuffer(dlv->algorithm, target));	RETERR(uint8_tobuffer(dlv->digest_type, target));	return (mem_tobuffer(target, dlv->digest, dlv->length));}
开发者ID:DHTNS,项目名称:bind9-9.7.0-P1.dfsg,代码行数:26,


示例13: fromstruct_nsec3

static inline isc_result_tfromstruct_nsec3(ARGS_FROMSTRUCT) {	dns_rdata_nsec3_t *nsec3 = source;	isc_region_t region;	REQUIRE(type == dns_rdatatype_nsec3);	REQUIRE(source != NULL);	REQUIRE(nsec3->common.rdtype == type);	REQUIRE(nsec3->common.rdclass == rdclass);	REQUIRE(nsec3->typebits != NULL || nsec3->len == 0);	REQUIRE(nsec3->hash == dns_hash_sha1);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint8_tobuffer(nsec3->hash, target));	RETERR(uint8_tobuffer(nsec3->flags, target));	RETERR(uint16_tobuffer(nsec3->iterations, target));	RETERR(uint8_tobuffer(nsec3->salt_length, target));	RETERR(mem_tobuffer(target, nsec3->salt, nsec3->salt_length));	RETERR(uint8_tobuffer(nsec3->next_length, target));	RETERR(mem_tobuffer(target, nsec3->next, nsec3->next_length));	region.base = nsec3->typebits;	region.length = nsec3->len;	RETERR(typemap_test(&region, ISC_TRUE));	return (mem_tobuffer(target, nsec3->typebits, nsec3->len));}
开发者ID:NZRS,项目名称:bind9-collab,代码行数:28,


示例14: fromstruct_keydata

static inline isc_result_tfromstruct_keydata(ARGS_FROMSTRUCT) {	dns_rdata_keydata_t *keydata = source;	REQUIRE(type == 65533);	REQUIRE(source != NULL);	REQUIRE(keydata->common.rdtype == type);	REQUIRE(keydata->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	/* Refresh timer */	RETERR(uint32_tobuffer(keydata->refresh, target));	/* Add hold-down */	RETERR(uint32_tobuffer(keydata->addhd, target));	/* Remove hold-down */	RETERR(uint32_tobuffer(keydata->removehd, target));	/* Flags */	RETERR(uint16_tobuffer(keydata->flags, target));	/* Protocol */	RETERR(uint8_tobuffer(keydata->protocol, target));	/* Algorithm */	RETERR(uint8_tobuffer(keydata->algorithm, target));	/* Data */	return (mem_tobuffer(target, keydata->data, keydata->datalen));}
开发者ID:pexip,项目名称:os-bind9,代码行数:33,


示例15: fromtext_keydata

static inline isc_result_tfromtext_keydata(ARGS_FROMTEXT) {	isc_token_t token;	dns_secalg_t alg;	dns_secproto_t proto;	dns_keyflags_t flags;	isc_uint32_t refresh, addhd, removehd;	REQUIRE(type == 65533);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	/* refresh timer */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &refresh));	RETERR(uint32_tobuffer(refresh, target));	/* add hold-down */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &addhd));	RETERR(uint32_tobuffer(addhd, target));	/* remove hold-down */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_time32_fromtext(DNS_AS_STR(token), &removehd));	RETERR(uint32_tobuffer(removehd, target));	/* flags */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion));	RETERR(uint16_tobuffer(flags, target));	/* protocol */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &proto, 1));	/* algorithm */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &alg, 1));	/* No Key? */	if ((flags & 0xc000) == 0xc000)		return (ISC_R_SUCCESS);	return (isc_base64_tobuffer(lexer, target, -1));}
开发者ID:pexip,项目名称:os-bind9,代码行数:58,


示例16: fromstruct_cert

static inline isc_result_tfromstruct_cert(ARGS_FROMSTRUCT) {	dns_rdata_cert_t *cert = source;	REQUIRE(type == 37);	REQUIRE(source != NULL);	REQUIRE(cert->common.rdtype == type);	REQUIRE(cert->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(cert->type, target));	RETERR(uint16_tobuffer(cert->key_tag, target));	RETERR(uint8_tobuffer(cert->algorithm, target));	return (mem_tobuffer(target, cert->certificate, cert->length));}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:18,


示例17: fromstruct_uri

static inline isc_result_tfromstruct_uri(ARGS_FROMSTRUCT) {	dns_rdata_uri_t *uri = source;	isc_region_t region;	isc_uint8_t len;	REQUIRE(type == 256);	REQUIRE(source != NULL);	REQUIRE(uri->common.rdtype == type);	REQUIRE(uri->common.rdclass == rdclass);	REQUIRE(uri->target != NULL && uri->tgt_len != 0);	UNUSED(type);	UNUSED(rdclass);	/*	 * Priority	 */	RETERR(uint16_tobuffer(uri->priority, target));	/*	 * Weight	 */	RETERR(uint16_tobuffer(uri->weight, target));	/*	 * Target URI	 */	len = 255U;	region.base = uri->target;	region.length = uri->tgt_len;	while (region.length > 0) {		REQUIRE(len == 255U);		len = uint8_fromregion(&region);		isc_region_consume(&region, 1);		if (region.length < len)			return (ISC_R_UNEXPECTEDEND);		isc_region_consume(&region, len);	}	return (mem_tobuffer(target, uri->target, uri->tgt_len));}
开发者ID:Distrotech,项目名称:bind,代码行数:42,


示例18: fromstruct_in_srv

static inline isc_result_tfromstruct_in_srv(ARGS_FROMSTRUCT) {	dns_rdata_in_srv_t *srv = source;	isc_region_t region;	REQUIRE(type == 33);	REQUIRE(rdclass == 1);	REQUIRE(source != NULL);	REQUIRE(srv->common.rdtype == type);	REQUIRE(srv->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(srv->priority, target));	RETERR(uint16_tobuffer(srv->weight, target));	RETERR(uint16_tobuffer(srv->port, target));	dns_name_toregion(&srv->target, &region);	return (isc_buffer_copyregion(target, &region));}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:20,


示例19: fromtext_cert

static inline isc_result_tfromtext_cert(ARGS_FROMTEXT) {	isc_token_t token;	dns_secalg_t secalg;	dns_cert_t cert;	REQUIRE(type == 37);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	/*	 * Cert type.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_cert_fromtext(&cert, &token.value.as_textregion));	RETERR(uint16_tobuffer(cert, target));	/*	 * Key tag.	 */	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));	/*	 * Algorithm.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secalg_fromtext(&secalg, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &secalg, 1));	return (isc_base64_tobuffer(lexer, target, -1));}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:41,


示例20: fromtext_dlv

static inline isc_result_tfromtext_dlv(ARGS_FROMTEXT) {	isc_token_t token;	unsigned char c;	int length;	REQUIRE(type == 32769);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	/*	 * Key tag.	 */	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));	/*	 * Algorithm.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,				      ISC_FALSE));	if (token.value.as_ulong > 0xffU)		RETTOK(ISC_R_RANGE);	RETERR(uint8_tobuffer(token.value.as_ulong, target));	/*	 * Digest type.	 */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,				      ISC_FALSE));	if (token.value.as_ulong > 0xffU)		RETTOK(ISC_R_RANGE);	RETERR(uint8_tobuffer(token.value.as_ulong, target));	c = (unsigned char) token.value.as_ulong;	/*	 * Digest.	 */	if (c == DNS_DSDIGEST_SHA1)		length = ISC_SHA1_DIGESTLENGTH;	else if (c == DNS_DSDIGEST_SHA256)		length = ISC_SHA256_DIGESTLENGTH;	else		length = -1;	return (isc_hex_tobuffer(lexer, target, -1));}
开发者ID:DHTNS,项目名称:bind9-9.7.0-P1.dfsg,代码行数:53,


示例21: fromtext_uri

static inline isc_result_tfromtext_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);}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:40,


示例22: fromtext_nsec3param

static inline isc_result_tfromtext_nsec3param(ARGS_FROMTEXT) {	isc_token_t token;	unsigned int flags = 0;	unsigned char hashalg;	REQUIRE(type == dns_rdatatype_nsec3param);	UNUSED(type);	UNUSED(rdclass);	UNUSED(callbacks);	UNUSED(origin);	UNUSED(options);	/* Hash. */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_hashalg_fromtext(&hashalg, &token.value.as_textregion));	RETERR(uint8_tobuffer(hashalg, target));	/* Flags. */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,				      ISC_FALSE));	flags = token.value.as_ulong;	if (flags > 255U)		RETTOK(ISC_R_RANGE);	RETERR(uint8_tobuffer(flags, target));	/* Iterations. */	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));	/* Salt. */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	if (token.value.as_textregion.length > (255*2))		RETTOK(DNS_R_TEXTTOOLONG);	if (strcmp(DNS_AS_STR(token), "-") == 0) {		RETERR(uint8_tobuffer(0, target));	} else {		RETERR(uint8_tobuffer(strlen(DNS_AS_STR(token)) / 2, target));		RETERR(isc_hex_decodestring(DNS_AS_STR(token), target));	}	return (ISC_R_SUCCESS);}
开发者ID:crossbuild,项目名称:bind,代码行数:49,


示例23: fromstruct_l64

static inline isc_result_tfromstruct_l64(ARGS_FROMSTRUCT) {	dns_rdata_l64_t *l64 = source;	REQUIRE(type == 106);	REQUIRE(source != NULL);	REQUIRE(l64->common.rdtype == type);	REQUIRE(l64->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(l64->pref, target));	return (mem_tobuffer(target, l64->l64, sizeof(l64->l64)));}
开发者ID:Gradwell,项目名称:bind9,代码行数:15,


示例24: fromstruct_nid

static inline isc_result_tfromstruct_nid(ARGS_FROMSTRUCT) {	dns_rdata_nid_t *nid = source;	REQUIRE(type == 104);	REQUIRE(source != NULL);	REQUIRE(nid->common.rdtype == type);	REQUIRE(nid->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(nid->pref, target));	return (mem_tobuffer(target, nid->nid, sizeof(nid->nid)));}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:15,


示例25: fromtext_cdnskey

static inline isc_result_tfromtext_cdnskey(ARGS_FROMTEXT) {	isc_result_t result;	isc_token_t token;	dns_secalg_t alg;	dns_secproto_t proto;	dns_keyflags_t flags;	REQUIRE(type == dns_rdatatype_cdnskey);	UNUSED(type);	UNUSED(rdclass);	UNUSED(origin);	UNUSED(options);	UNUSED(callbacks);	/* flags */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_keyflags_fromtext(&flags, &token.value.as_textregion));	RETERR(uint16_tobuffer(flags, target));	/* protocol */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secproto_fromtext(&proto, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &proto, 1));	/* algorithm */	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,				      ISC_FALSE));	RETTOK(dns_secalg_fromtext(&alg, &token.value.as_textregion));	RETERR(mem_tobuffer(target, &alg, 1));	/* No Key? */	if ((flags & 0xc000) == 0xc000)		return (ISC_R_SUCCESS);	result = isc_base64_tobuffer(lexer, target, -1);	if (result != ISC_R_SUCCESS)		return (result);	/* Ensure there's at least enough data to compute a key ID for MD5 */	if (alg == DST_ALG_RSAMD5 && isc_buffer_usedlength(target) < 7)		return (ISC_R_UNEXPECTEDEND);	return (ISC_R_SUCCESS);}
开发者ID:chris-wood,项目名称:bind-prime,代码行数:48,


示例26: fromstruct_rt

static inline isc_result_tfromstruct_rt(ARGS_FROMSTRUCT) {	dns_rdata_rt_t *rt = source;	isc_region_t region;	REQUIRE(type == 21);	REQUIRE(source != NULL);	REQUIRE(rt->common.rdtype == type);	REQUIRE(rt->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(rt->preference, target));	dns_name_toregion(&rt->host, &region);	return (isc_buffer_copyregion(target, &region));}
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:17,


示例27: fromstruct_afsdb

static inline isc_result_tfromstruct_afsdb(ARGS_FROMSTRUCT) {	dns_rdata_afsdb_t *afsdb = source;	isc_region_t region;	REQUIRE(type == 18);	REQUIRE(source != NULL);	REQUIRE(afsdb->common.rdclass == rdclass);	REQUIRE(afsdb->common.rdtype == type);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(afsdb->subtype, target));	dns_name_toregion(&afsdb->server, &region);	return (isc_buffer_copyregion(target, &region));}
开发者ID:miettal,项目名称:armadillo420_standard,代码行数:17,


示例28: fromstruct_l32

static inline isc_result_tfromstruct_l32(ARGS_FROMSTRUCT) {	dns_rdata_l32_t *l32 = source;	isc_uint32_t n;	REQUIRE(type == 105);	REQUIRE(source != NULL);	REQUIRE(l32->common.rdtype == type);	REQUIRE(l32->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(l32->pref, target));	n = ntohl(l32->l32.s_addr);	return (uint32_tobuffer(n, target));}
开发者ID:Gradwell,项目名称:bind9,代码行数:17,


示例29: fromstruct_lp

static inline isc_result_tfromstruct_lp(ARGS_FROMSTRUCT) {	dns_rdata_lp_t *lp = source;	isc_region_t region;	REQUIRE(type == dns_rdatatype_lp);	REQUIRE(source != NULL);	REQUIRE(lp->common.rdtype == type);	REQUIRE(lp->common.rdclass == rdclass);	UNUSED(type);	UNUSED(rdclass);	RETERR(uint16_tobuffer(lp->pref, target));	dns_name_toregion(&lp->lp, &region);	return (isc_buffer_copyregion(target, &region));}
开发者ID:NZRS,项目名称:bind9-collab,代码行数:17,



注:本文中的uint16_tobuffer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uint256函数代码示例
C++ uint16_to_bin函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。