[BACK]Return to ninfo_56.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / external / mpl / bind / dist / lib / dns / rdata / generic

Annotation of src/external/mpl/bind/dist/lib/dns/rdata/generic/ninfo_56.c, Revision 1.1

1.1     ! christos    1: /*     $NetBSD$        */
        !             2:
        !             3: /*
        !             4:  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
        !             5:  *
        !             6:  * This Source Code Form is subject to the terms of the Mozilla Public
        !             7:  * License, v. 2.0. If a copy of the MPL was not distributed with this
        !             8:  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
        !             9:  *
        !            10:  * See the COPYRIGHT file distributed with this work for additional
        !            11:  * information regarding copyright ownership.
        !            12:  */
        !            13:
        !            14: #ifndef RDATA_GENERIC_NINFO_56_C
        !            15: #define RDATA_GENERIC_NINFO_56_C
        !            16:
        !            17: #define RRTYPE_NINFO_ATTRIBUTES (0)
        !            18:
        !            19: static inline isc_result_t
        !            20: fromtext_ninfo(ARGS_FROMTEXT) {
        !            21:
        !            22:        REQUIRE(type == dns_rdatatype_ninfo);
        !            23:
        !            24:        UNUSED(type);
        !            25:        UNUSED(rdclass);
        !            26:        UNUSED(origin);
        !            27:        UNUSED(options);
        !            28:        UNUSED(callbacks);
        !            29:
        !            30:        return (generic_fromtext_txt(rdclass, type, lexer, origin, options,
        !            31:                                     target, callbacks));
        !            32: }
        !            33:
        !            34: static inline isc_result_t
        !            35: totext_ninfo(ARGS_TOTEXT) {
        !            36:
        !            37:        UNUSED(tctx);
        !            38:
        !            39:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !            40:
        !            41:        return (generic_totext_txt(rdata, tctx, target));
        !            42: }
        !            43:
        !            44: static inline isc_result_t
        !            45: fromwire_ninfo(ARGS_FROMWIRE) {
        !            46:
        !            47:        REQUIRE(type == dns_rdatatype_ninfo);
        !            48:
        !            49:        UNUSED(type);
        !            50:        UNUSED(dctx);
        !            51:        UNUSED(rdclass);
        !            52:        UNUSED(options);
        !            53:
        !            54:        return (generic_fromwire_txt(rdclass, type, source, dctx, options,
        !            55:                                     target));
        !            56: }
        !            57:
        !            58: static inline isc_result_t
        !            59: towire_ninfo(ARGS_TOWIRE) {
        !            60:
        !            61:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !            62:
        !            63:        UNUSED(cctx);
        !            64:
        !            65:        return (mem_tobuffer(target, rdata->data, rdata->length));
        !            66: }
        !            67:
        !            68: static inline int
        !            69: compare_ninfo(ARGS_COMPARE) {
        !            70:        isc_region_t r1;
        !            71:        isc_region_t r2;
        !            72:
        !            73:        REQUIRE(rdata1->type == rdata2->type);
        !            74:        REQUIRE(rdata1->rdclass == rdata2->rdclass);
        !            75:        REQUIRE(rdata1->type == dns_rdatatype_ninfo);
        !            76:
        !            77:        dns_rdata_toregion(rdata1, &r1);
        !            78:        dns_rdata_toregion(rdata2, &r2);
        !            79:        return (isc_region_compare(&r1, &r2));
        !            80: }
        !            81:
        !            82: static inline isc_result_t
        !            83: fromstruct_ninfo(ARGS_FROMSTRUCT) {
        !            84:
        !            85:        REQUIRE(type == dns_rdatatype_ninfo);
        !            86:
        !            87:        return (generic_fromstruct_txt(rdclass, type, source, target));
        !            88: }
        !            89:
        !            90: static inline isc_result_t
        !            91: tostruct_ninfo(ARGS_TOSTRUCT) {
        !            92:        dns_rdata_ninfo_t *txt = target;
        !            93:
        !            94:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !            95:
        !            96:        txt->common.rdclass = rdata->rdclass;
        !            97:        txt->common.rdtype = rdata->type;
        !            98:        ISC_LINK_INIT(&txt->common, link);
        !            99:
        !           100:        return (generic_tostruct_txt(rdata, target, mctx));
        !           101: }
        !           102:
        !           103: static inline void
        !           104: freestruct_ninfo(ARGS_FREESTRUCT) {
        !           105:        dns_rdata_ninfo_t *ninfo = source;
        !           106:
        !           107:        REQUIRE(source != NULL);
        !           108:        REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
        !           109:
        !           110:        generic_freestruct_txt(source);
        !           111: }
        !           112:
        !           113: static inline isc_result_t
        !           114: additionaldata_ninfo(ARGS_ADDLDATA) {
        !           115:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !           116:
        !           117:        UNUSED(rdata);
        !           118:        UNUSED(add);
        !           119:        UNUSED(arg);
        !           120:
        !           121:        return (ISC_R_SUCCESS);
        !           122: }
        !           123:
        !           124: static inline isc_result_t
        !           125: digest_ninfo(ARGS_DIGEST) {
        !           126:        isc_region_t r;
        !           127:
        !           128:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !           129:
        !           130:        dns_rdata_toregion(rdata, &r);
        !           131:
        !           132:        return ((digest)(arg, &r));
        !           133: }
        !           134:
        !           135: static inline isc_boolean_t
        !           136: checkowner_ninfo(ARGS_CHECKOWNER) {
        !           137:
        !           138:        REQUIRE(type == dns_rdatatype_ninfo);
        !           139:
        !           140:        UNUSED(name);
        !           141:        UNUSED(type);
        !           142:        UNUSED(rdclass);
        !           143:        UNUSED(wildcard);
        !           144:
        !           145:        return (ISC_TRUE);
        !           146: }
        !           147:
        !           148: static inline isc_boolean_t
        !           149: checknames_ninfo(ARGS_CHECKNAMES) {
        !           150:
        !           151:        REQUIRE(rdata->type == dns_rdatatype_ninfo);
        !           152:
        !           153:        UNUSED(rdata);
        !           154:        UNUSED(owner);
        !           155:        UNUSED(bad);
        !           156:
        !           157:        return (ISC_TRUE);
        !           158: }
        !           159:
        !           160: static inline int
        !           161: casecompare_ninfo(ARGS_COMPARE) {
        !           162:        return (compare_ninfo(rdata1, rdata2));
        !           163: }
        !           164:
        !           165: isc_result_t
        !           166: dns_rdata_ninfo_first(dns_rdata_ninfo_t *ninfo) {
        !           167:
        !           168:        REQUIRE(ninfo != NULL);
        !           169:        REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
        !           170:
        !           171:        return (generic_txt_first(ninfo));
        !           172: }
        !           173:
        !           174: isc_result_t
        !           175: dns_rdata_ninfo_next(dns_rdata_ninfo_t *ninfo) {
        !           176:
        !           177:        REQUIRE(ninfo != NULL);
        !           178:        REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
        !           179:
        !           180:        return (generic_txt_next(ninfo));
        !           181: }
        !           182:
        !           183: isc_result_t
        !           184: dns_rdata_ninfo_current(dns_rdata_ninfo_t *ninfo,
        !           185:                        dns_rdata_ninfo_string_t *string)
        !           186: {
        !           187:
        !           188:        REQUIRE(ninfo != NULL);
        !           189:        REQUIRE(ninfo->common.rdtype == dns_rdatatype_ninfo);
        !           190:
        !           191:        return (generic_txt_current(ninfo, string));
        !           192: }
        !           193: #endif /* RDATA_GENERIC_NINFO_56_C */

CVSweb <webmaster@jp.NetBSD.org>