"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/rdata/generic/smimea_53.c" (4 Sep 2020, 3332 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


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 "smimea_53.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_SMIMEA_53_C
   13 #define RDATA_GENERIC_SMIMEA_53_C
   14 
   15 #define RRTYPE_SMIMEA_ATTRIBUTES 0
   16 
   17 static inline isc_result_t
   18 fromtext_smimea(ARGS_FROMTEXT) {
   19     REQUIRE(type == dns_rdatatype_smimea);
   20 
   21     return (generic_fromtext_tlsa(rdclass, type, lexer, origin, options,
   22                       target, callbacks));
   23 }
   24 
   25 static inline isc_result_t
   26 totext_smimea(ARGS_TOTEXT) {
   27     REQUIRE(rdata->type == dns_rdatatype_smimea);
   28 
   29     return (generic_totext_tlsa(rdata, tctx, target));
   30 }
   31 
   32 static inline isc_result_t
   33 fromwire_smimea(ARGS_FROMWIRE) {
   34     REQUIRE(type == dns_rdatatype_smimea);
   35 
   36     return (generic_fromwire_tlsa(rdclass, type, source, dctx, options,
   37                       target));
   38 }
   39 
   40 static inline isc_result_t
   41 towire_smimea(ARGS_TOWIRE) {
   42     isc_region_t sr;
   43 
   44     REQUIRE(rdata->type == dns_rdatatype_smimea);
   45     REQUIRE(rdata->length != 0);
   46 
   47     UNUSED(cctx);
   48 
   49     dns_rdata_toregion(rdata, &sr);
   50     return (mem_tobuffer(target, sr.base, sr.length));
   51 }
   52 
   53 static inline int
   54 compare_smimea(ARGS_COMPARE) {
   55     isc_region_t r1;
   56     isc_region_t r2;
   57 
   58     REQUIRE(rdata1->type == rdata2->type);
   59     REQUIRE(rdata1->rdclass == rdata2->rdclass);
   60     REQUIRE(rdata1->type == dns_rdatatype_smimea);
   61     REQUIRE(rdata1->length != 0);
   62     REQUIRE(rdata2->length != 0);
   63 
   64     dns_rdata_toregion(rdata1, &r1);
   65     dns_rdata_toregion(rdata2, &r2);
   66     return (isc_region_compare(&r1, &r2));
   67 }
   68 
   69 static inline isc_result_t
   70 fromstruct_smimea(ARGS_FROMSTRUCT) {
   71     REQUIRE(type == dns_rdatatype_smimea);
   72 
   73     return (generic_fromstruct_tlsa(rdclass, type, source, target));
   74 }
   75 
   76 static inline isc_result_t
   77 tostruct_smimea(ARGS_TOSTRUCT) {
   78     dns_rdata_smimea_t *smimea = target;
   79 
   80     REQUIRE(rdata != NULL);
   81     REQUIRE(rdata->type == dns_rdatatype_smimea);
   82     REQUIRE(smimea != NULL);
   83 
   84     smimea->common.rdclass = rdata->rdclass;
   85     smimea->common.rdtype = rdata->type;
   86     ISC_LINK_INIT(&smimea->common, link);
   87 
   88     return (generic_tostruct_tlsa(rdata, target, mctx));
   89 }
   90 
   91 static inline void
   92 freestruct_smimea(ARGS_FREESTRUCT) {
   93     dns_rdata_smimea_t *smimea = source;
   94 
   95     REQUIRE(smimea != NULL);
   96     REQUIRE(smimea->common.rdtype == dns_rdatatype_smimea);
   97 
   98     generic_freestruct_tlsa(source);
   99 }
  100 
  101 static inline isc_result_t
  102 additionaldata_smimea(ARGS_ADDLDATA) {
  103     REQUIRE(rdata->type == dns_rdatatype_smimea);
  104 
  105     UNUSED(rdata);
  106     UNUSED(add);
  107     UNUSED(arg);
  108 
  109     return (ISC_R_SUCCESS);
  110 }
  111 
  112 static inline isc_result_t
  113 digest_smimea(ARGS_DIGEST) {
  114     isc_region_t r;
  115 
  116     REQUIRE(rdata->type == dns_rdatatype_smimea);
  117 
  118     dns_rdata_toregion(rdata, &r);
  119 
  120     return ((digest)(arg, &r));
  121 }
  122 
  123 static inline bool
  124 checkowner_smimea(ARGS_CHECKOWNER) {
  125     REQUIRE(type == dns_rdatatype_smimea);
  126 
  127     UNUSED(name);
  128     UNUSED(type);
  129     UNUSED(rdclass);
  130     UNUSED(wildcard);
  131 
  132     return (true);
  133 }
  134 
  135 static inline bool
  136 checknames_smimea(ARGS_CHECKNAMES) {
  137     REQUIRE(rdata->type == dns_rdatatype_smimea);
  138 
  139     UNUSED(rdata);
  140     UNUSED(owner);
  141     UNUSED(bad);
  142 
  143     return (true);
  144 }
  145 
  146 static inline int
  147 casecompare_smimea(ARGS_COMPARE) {
  148     return (compare_smimea(rdata1, rdata2));
  149 }
  150 
  151 #endif /* RDATA_GENERIC_SMIMEA_53_C */