"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/dns/rdata/generic/spf_99.c" (4 Sep 2020, 3241 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.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 "spf_99.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_SPF_99_C
   13 #define RDATA_GENERIC_SPF_99_C
   14 
   15 #define RRTYPE_SPF_ATTRIBUTES (0)
   16 
   17 static inline isc_result_t
   18 fromtext_spf(ARGS_FROMTEXT) {
   19     REQUIRE(type == dns_rdatatype_spf);
   20 
   21     UNUSED(type);
   22     UNUSED(rdclass);
   23     UNUSED(origin);
   24     UNUSED(options);
   25     UNUSED(callbacks);
   26 
   27     return (generic_fromtext_txt(rdclass, type, lexer, origin, options,
   28                      target, callbacks));
   29 }
   30 
   31 static inline isc_result_t
   32 totext_spf(ARGS_TOTEXT) {
   33     UNUSED(tctx);
   34 
   35     REQUIRE(rdata->type == dns_rdatatype_spf);
   36 
   37     return (generic_totext_txt(rdata, tctx, target));
   38 }
   39 
   40 static inline isc_result_t
   41 fromwire_spf(ARGS_FROMWIRE) {
   42     REQUIRE(type == dns_rdatatype_spf);
   43 
   44     UNUSED(type);
   45     UNUSED(dctx);
   46     UNUSED(rdclass);
   47     UNUSED(options);
   48 
   49     return (generic_fromwire_txt(rdclass, type, source, dctx, options,
   50                      target));
   51 }
   52 
   53 static inline isc_result_t
   54 towire_spf(ARGS_TOWIRE) {
   55     REQUIRE(rdata->type == dns_rdatatype_spf);
   56 
   57     UNUSED(cctx);
   58 
   59     return (mem_tobuffer(target, rdata->data, rdata->length));
   60 }
   61 
   62 static inline int
   63 compare_spf(ARGS_COMPARE) {
   64     isc_region_t r1;
   65     isc_region_t r2;
   66 
   67     REQUIRE(rdata1->type == rdata2->type);
   68     REQUIRE(rdata1->rdclass == rdata2->rdclass);
   69     REQUIRE(rdata1->type == dns_rdatatype_spf);
   70 
   71     dns_rdata_toregion(rdata1, &r1);
   72     dns_rdata_toregion(rdata2, &r2);
   73     return (isc_region_compare(&r1, &r2));
   74 }
   75 
   76 static inline isc_result_t
   77 fromstruct_spf(ARGS_FROMSTRUCT) {
   78     REQUIRE(type == dns_rdatatype_spf);
   79 
   80     return (generic_fromstruct_txt(rdclass, type, source, target));
   81 }
   82 
   83 static inline isc_result_t
   84 tostruct_spf(ARGS_TOSTRUCT) {
   85     dns_rdata_spf_t *spf = target;
   86 
   87     REQUIRE(spf != NULL);
   88     REQUIRE(rdata != NULL);
   89     REQUIRE(rdata->type == dns_rdatatype_spf);
   90 
   91     spf->common.rdclass = rdata->rdclass;
   92     spf->common.rdtype = rdata->type;
   93     ISC_LINK_INIT(&spf->common, link);
   94 
   95     return (generic_tostruct_txt(rdata, target, mctx));
   96 }
   97 
   98 static inline void
   99 freestruct_spf(ARGS_FREESTRUCT) {
  100     dns_rdata_spf_t *spf = source;
  101 
  102     REQUIRE(spf != NULL);
  103     REQUIRE(spf->common.rdtype == dns_rdatatype_spf);
  104 
  105     generic_freestruct_txt(source);
  106 }
  107 
  108 static inline isc_result_t
  109 additionaldata_spf(ARGS_ADDLDATA) {
  110     REQUIRE(rdata->type == dns_rdatatype_spf);
  111 
  112     UNUSED(rdata);
  113     UNUSED(add);
  114     UNUSED(arg);
  115 
  116     return (ISC_R_SUCCESS);
  117 }
  118 
  119 static inline isc_result_t
  120 digest_spf(ARGS_DIGEST) {
  121     isc_region_t r;
  122 
  123     REQUIRE(rdata->type == dns_rdatatype_spf);
  124 
  125     dns_rdata_toregion(rdata, &r);
  126 
  127     return ((digest)(arg, &r));
  128 }
  129 
  130 static inline bool
  131 checkowner_spf(ARGS_CHECKOWNER) {
  132     REQUIRE(type == dns_rdatatype_spf);
  133 
  134     UNUSED(name);
  135     UNUSED(type);
  136     UNUSED(rdclass);
  137     UNUSED(wildcard);
  138 
  139     return (true);
  140 }
  141 
  142 static inline bool
  143 checknames_spf(ARGS_CHECKNAMES) {
  144     REQUIRE(rdata->type == dns_rdatatype_spf);
  145 
  146     UNUSED(rdata);
  147     UNUSED(owner);
  148     UNUSED(bad);
  149 
  150     return (true);
  151 }
  152 
  153 static inline int
  154 casecompare_spf(ARGS_COMPARE) {
  155     return (compare_spf(rdata1, rdata2));
  156 }
  157 #endif /* RDATA_GENERIC_SPF_99_C */