"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/dns/rdata/generic/ninfo_56.c" (7 Sep 2020, 3948 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ninfo_56.c" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef RDATA_GENERIC_NINFO_56_C
   13 #define RDATA_GENERIC_NINFO_56_C
   14 
   15 #define RRTYPE_NINFO_ATTRIBUTES (0)
   16 
   17 static inline isc_result_t
   18 fromtext_ninfo(ARGS_FROMTEXT) {
   19 
   20     REQUIRE(type == dns_rdatatype_ninfo);
   21 
   22     UNUSED(type);
   23     UNUSED(rdclass);
   24     UNUSED(origin);
   25     UNUSED(options);
   26     UNUSED(callbacks);
   27 
   28     return (generic_fromtext_txt(rdclass, type, lexer, origin, options,
   29                      target, callbacks));
   30 }
   31 
   32 static inline isc_result_t
   33 totext_ninfo(ARGS_TOTEXT) {
   34 
   35     UNUSED(tctx);
   36 
   37     REQUIRE(rdata->type == dns_rdatatype_ninfo);
   38 
   39     return (generic_totext_txt(rdata, tctx, target));
   40 }
   41 
   42 static inline isc_result_t
   43 fromwire_ninfo(ARGS_FROMWIRE) {
   44 
   45     REQUIRE(type == dns_rdatatype_ninfo);
   46 
   47     UNUSED(type);
   48     UNUSED(dctx);
   49     UNUSED(rdclass);
   50     UNUSED(options);
   51 
   52     return (generic_fromwire_txt(rdclass, type, source, dctx, options,
   53                      target));
   54 }
   55 
   56 static inline isc_result_t
   57 towire_ninfo(ARGS_TOWIRE) {
   58 
   59     REQUIRE(rdata->type == dns_rdatatype_ninfo);
   60 
   61     UNUSED(cctx);
   62 
   63     return (mem_tobuffer(target, rdata->data, rdata->length));
   64 }
   65 
   66 static inline int
   67 compare_ninfo(ARGS_COMPARE) {
   68     isc_region_t r1;
   69     isc_region_t r2;
   70 
   71     REQUIRE(rdata1->type == rdata2->type);
   72     REQUIRE(rdata1->rdclass == rdata2->rdclass);
   73     REQUIRE(rdata1->type == dns_rdatatype_ninfo);
   74 
   75     dns_rdata_toregion(rdata1, &r1);
   76     dns_rdata_toregion(rdata2, &r2);
   77     return (isc_region_compare(&r1, &r2));
   78 }
   79 
   80 static inline isc_result_t
   81 fromstruct_ninfo(ARGS_FROMSTRUCT) {
   82 
   83     REQUIRE(type == dns_rdatatype_ninfo);
   84 
   85     return (generic_fromstruct_txt(rdclass, type, source, target));
   86 }
   87 
   88 static inline isc_result_t
   89 tostruct_ninfo(ARGS_TOSTRUCT) {
   90     dns_rdata_ninfo_t *ninfo;
   91 
   92     REQUIRE(rdata->type == dns_rdatatype_ninfo);
   93     REQUIRE(((dns_rdata_ninfo_t *)target) != NULL);
   94 
   95     ninfo = target;
   96 
   97     ninfo->common.rdclass = rdata->rdclass;
   98     ninfo->common.rdtype = rdata->type;
   99     ISC_LINK_INIT(&ninfo->common, link);
  100 
  101     return (generic_tostruct_txt(rdata, target, mctx));
  102 }
  103 
  104 static inline void
  105 freestruct_ninfo(ARGS_FREESTRUCT) {
  106     REQUIRE(((dns_rdata_ninfo_t *)source) != NULL);
  107     REQUIRE(((dns_rdata_ninfo_t *)source)->common.rdtype ==
  108         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 bool
  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 (true);
  146 }
  147 
  148 static inline bool
  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 (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 */