File: zonec.h

package info (click to toggle)
nsd 4.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,188 kB
  • sloc: ansic: 64,639; sh: 4,523; python: 2,085; yacc: 1,344; makefile: 688
file content (67 lines) | stat: -rw-r--r-- 1,863 bytes parent folder | download
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
/*
 * zonec.h -- zone compiler.
 *
 * Copyright (c) 2001-2006, NLnet Labs. All rights reserved.
 *
 * See LICENSE for the license.
 *
 */

#ifndef ZONEC_H
#define ZONEC_H

#include "namedb.h"

#define NSEC_WINDOW_COUNT     256
#define NSEC_WINDOW_BITS_COUNT 256
#define NSEC_WINDOW_BITS_SIZE  (NSEC_WINDOW_BITS_COUNT / 8)

#define IPSECKEY_NOGATEWAY      0       /* RFC 4025 */
#define IPSECKEY_IP4            1
#define IPSECKEY_IP6            2
#define IPSECKEY_DNAME          3

#define AMTRELAY_NOGATEWAY      0       /* RFC 8777 */
#define AMTRELAY_IP4            1
#define AMTRELAY_IP6            2
#define AMTRELAY_DNAME          3

#define LINEBUFSZ 1024

#define DEFAULT_TTL 3600

/* Some zones, such as DNS-SD zones, have RRsets with many RRs in them.
 * By minimizing the need to reallocate the list of RRs in an RRset,
 * we reduce memory fragmentation significantly for such zones.
 * To this end, `domain`, `type`, `rrset`, `rrset_prev`, `rr_count` and
 * `rrs` are used to commit the RRs within an RRset, that are grouped
 * together in a zone file, to the database in batches. 
 */
struct collect_rrs {
	struct domain *domain;
	int type;
	struct rrset *rrset;
#ifdef PACKED_STRUCTS
	struct rrset *rrset_prev;
#endif
	int rr_count;
	/* When the RRset is more than 256 RRs, the set will be committed in
	 * batches of 256 RRs (and resized if needed) */
	struct rr* rrs[256];
};

/* parse a zone into memory. name is origin. zonefile is file to read.
 * returns number of errors; failure may have read a partial zone */
unsigned int zonec_read(
	struct namedb *database,
	struct domain_table *domains,
	const char *name,
	const char *zonefile,
	struct zone *zone);

/** check SSHFP type for failures and emit warnings */
void check_sshfp(void);
void apex_rrset_checks(struct namedb* db, rrset_type* rrset,
	domain_type* domain);

#endif /* ZONEC_H */