"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/rdata/generic/avc_258.c" (4 Sep 2020, 3219 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 "avc_258.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_AVC_258_C
   13 #define RDATA_GENERIC_AVC_258_C
   14 
   15 #define RRTYPE_AVC_ATTRIBUTES (0)
   16 
   17 static inline isc_result_t
   18 fromtext_avc(ARGS_FROMTEXT) {
   19     REQUIRE(type == dns_rdatatype_avc);
   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_avc(ARGS_TOTEXT) {
   33     UNUSED(tctx);
   34 
   35     REQUIRE(rdata->type == dns_rdatatype_avc);
   36 
   37     return (generic_totext_txt(rdata, tctx, target));
   38 }
   39 
   40 static inline isc_result_t
   41 fromwire_avc(ARGS_FROMWIRE) {
   42     REQUIRE(type == dns_rdatatype_avc);
   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_avc(ARGS_TOWIRE) {
   55     REQUIRE(rdata->type == dns_rdatatype_avc);
   56 
   57     UNUSED(cctx);
   58 
   59     return (mem_tobuffer(target, rdata->data, rdata->length));
   60 }
   61 
   62 static inline int
   63 compare_avc(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_avc);
   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_avc(ARGS_FROMSTRUCT) {
   78     REQUIRE(type == dns_rdatatype_avc);
   79 
   80     return (generic_fromstruct_txt(rdclass, type, source, target));
   81 }
   82 
   83 static inline isc_result_t
   84 tostruct_avc(ARGS_TOSTRUCT) {
   85     dns_rdata_avc_t *avc = target;
   86 
   87     REQUIRE(rdata->type == dns_rdatatype_avc);
   88     REQUIRE(avc != NULL);
   89 
   90     avc->common.rdclass = rdata->rdclass;
   91     avc->common.rdtype = rdata->type;
   92     ISC_LINK_INIT(&avc->common, link);
   93 
   94     return (generic_tostruct_txt(rdata, target, mctx));
   95 }
   96 
   97 static inline void
   98 freestruct_avc(ARGS_FREESTRUCT) {
   99     dns_rdata_avc_t *avc = source;
  100 
  101     REQUIRE(avc != NULL);
  102     REQUIRE(avc->common.rdtype == dns_rdatatype_avc);
  103 
  104     generic_freestruct_txt(source);
  105 }
  106 
  107 static inline isc_result_t
  108 additionaldata_avc(ARGS_ADDLDATA) {
  109     REQUIRE(rdata->type == dns_rdatatype_avc);
  110 
  111     UNUSED(rdata);
  112     UNUSED(add);
  113     UNUSED(arg);
  114 
  115     return (ISC_R_SUCCESS);
  116 }
  117 
  118 static inline isc_result_t
  119 digest_avc(ARGS_DIGEST) {
  120     isc_region_t r;
  121 
  122     REQUIRE(rdata->type == dns_rdatatype_avc);
  123 
  124     dns_rdata_toregion(rdata, &r);
  125 
  126     return ((digest)(arg, &r));
  127 }
  128 
  129 static inline bool
  130 checkowner_avc(ARGS_CHECKOWNER) {
  131     REQUIRE(type == dns_rdatatype_avc);
  132 
  133     UNUSED(name);
  134     UNUSED(type);
  135     UNUSED(rdclass);
  136     UNUSED(wildcard);
  137 
  138     return (true);
  139 }
  140 
  141 static inline bool
  142 checknames_avc(ARGS_CHECKNAMES) {
  143     REQUIRE(rdata->type == dns_rdatatype_avc);
  144 
  145     UNUSED(rdata);
  146     UNUSED(owner);
  147     UNUSED(bad);
  148 
  149     return (true);
  150 }
  151 
  152 static inline int
  153 casecompare_avc(ARGS_COMPARE) {
  154     return (compare_avc(rdata1, rdata2));
  155 }
  156 #endif /* RDATA_GENERIC_AVC_258_C */