/usr/include/dnsdb/nsec.h is in libyadifa-dev 2.1.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | /*------------------------------------------------------------------------------
*
* Copyright (c) 2011-2016, EURid. All rights reserved.
* The YADIFA TM software product is provided under the BSD 3-clause license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of EURid nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*------------------------------------------------------------------------------
*
*/
/** @defgroup nsec NSEC functions
* @ingroup dnsdbdnssec
* @brief
*
*
*
* @{
*
*----------------------------------------------------------------------------*/
#ifndef _NSEC_H
#define _NSEC_H
#include <dnsdb/zdb_types.h>
#if ZDB_HAS_NSEC_SUPPORT == 0
#error "Please do not include nsec.h if ZDB_HAS_NSEC_SUPPORT is 0"
#endif
#include <dnsdb/nsec_collection.h>
#include <dnscore/ptr_set.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define ZDB_NSECLABEL_TAG 0x4c42414c4345534e
#define NSEC_NEXT_DOMAIN_NAME(x__) (&(x__).rdata_start[0])
/*
struct nsec_label_extension
{
nsec_node* node;
};
*/
struct nsec_zone
{
nsec_label* last_nsec_label;
};
/**
* Reverses the labels of the fqdn
*
* @param inverse_name
* @param name
* @return
*/
u32 nsec_inverse_name(u8 *inverse_name,const u8 *name);
/**
*
* Updates/Verifies the NSEC structures of the zone.
*
* @param zone the zone
* @param read_only a slave would not change the records.
*
* @return an error code (only fails if a slave got a zone with errors)
*/
ya_result nsec_update_zone(zdb_zone* zone, bool read_only); /* read_only a.k.a slave */
/**
* Creates the NSEC node, creates or update the NSEC record
*
* @param zone
* @param label
* @param labels
* @param labels_top
*/
void nsec_update_label(zdb_zone* zone, zdb_rr_label* label, dnslabel_vector_reference labels, s32 labels_top);
/**
* Verifies and, if needed, update the NSEC record.
* There WILL be an NSEC record in the label at the end of the call.
* It does NOT create the NSEC node (needs it created already).
* It does NOT check for the relevancy of the NSEC record.
*
* @param label
* @param node
* @param next_node
* @param name
* @param ttl
* @return
*/
bool nsec_update_label_record(zdb_zone *zone, zdb_rr_label *label, nsec_node *node, nsec_node *next_node, u8 *name);
/**
* Creates the NSEC node, link it to the label.
*
* @param zone
* @param label
* @param labels
* @param labels_top
* @return
*/
nsec_node *nsec_update_label_node(zdb_zone* zone, zdb_rr_label* label, dnslabel_vector_reference labels, s32 labels_top);
/**
*
* Unlink the NSEC node from the label, then deletes said node from the chain.
*
* @param zone
* @param label
* @param labels
* @param labels_top
* @return
*/
bool nsec_delete_label_node(zdb_zone* zone, zdb_rr_label* label, dnslabel_vector_reference labels, s32 labels_top);
/**
*
* Find the label that has got the right NSEC interval for "nextname"
*
* @param zone
* @param name_vector
* @param dname_out
* @return
*/
zdb_rr_label *nsec_find_interval(const zdb_zone *zone, const dnsname_vector *name_vector, u8 **out_dname_p, u8 * restrict * pool);
void nsec_name_error(const zdb_zone* zone, const dnsname_vector *qname_not_const, s32 closest_index,
u8 * restrict * pool,
u8 **out_encloser_nsec_name_p,
zdb_rr_label** out_encloser_nsec_label,
u8 **out_wild_encloser_nsec_name_p,
zdb_rr_label** out_wildencloser_nsec_label
);
void nsec_destroy_zone(zdb_zone* zone);
struct nsec_icmtl_replay
{
ptr_set nsec_del;
ptr_set nsec_add;
zdb_zone *zone;
};
typedef struct nsec_icmtl_replay nsec_icmtl_replay;
/**
* Initialises the replay structure
*
* @param replay
* @param zone
*/
void nsec_icmtl_replay_init(nsec_icmtl_replay *replay, zdb_zone *zone);
void nsec_icmtl_replay_destroy(nsec_icmtl_replay *replay);
/**
* Appends a NSEC del to the replay structure
*
* @param replay
* @param fqdn
* @param ttlrdata
*/
void nsec_icmtl_replay_nsec_del(nsec_icmtl_replay *replay, const u8* fqdn);
/**
* Appends a NSEC add to the replay structure
*
* @param replay
* @param fqdn
* @param ttlrdata
*/
void nsec_icmtl_replay_nsec_add(nsec_icmtl_replay *replay, const u8* fqdn);
void nsec_icmtl_replay_execute(nsec_icmtl_replay *replay);
void nsec_logdump_tree(zdb_zone *zone);
#define ZONE_NSEC_AVAILABLE(zone_) ( ((zone_)->apex->flags & (ZDB_RR_LABEL_DNSSEC_EDIT|ZDB_RR_LABEL_NSEC)) == ZDB_RR_LABEL_NSEC)
#ifdef __cplusplus
}
#endif
#endif /* _NSEC_H */
/** @} */
/*----------------------------------------------------------------------------*/
|