aboutsummaryrefslogtreecommitdiff
path: root/contrib/bind/doc/notes/data
blob: e522392a38303050a357e0f8c086d752688da85e (plain) (blame)
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
/*
 * We need a registy of name server addresses.  For each, we retain an RTT
 * and a list of name server names which have used this address.
 */
tree_t	*by_nsaddr;
struct by_nsaddr {
	u_int32_t	rtt;		/* measured. */
	char		**names;	/* NULL terminated array; strdup'd. */
};

/*
 * "struct server" is a name server, which can have many addresses.  There
 * is no central registry of servers, since each creator can have a different
 * idea of what the addresses are.
 */
struct server {
	char		*name;		/* made with strdup. */
	struct sockaddr_in *addrs;	/* counted array. */
	int		n_addrs;	/* array size. */
};

/*
 * "struct zone" is a zone cut.
 */
tree_t	*by_class;	/* zone[class]. */
struct zone {
	enum {master, slave, cache, boot}
			type;

	/* Servers learned from boot cache, a parent zone, or !auth answer. */
	struct server	*servers_notauth;

	/* Servers learned from authoritative answer or local zone. */
	struct server	*servers_auth;

	/* Root node of zone. */
	struct node	*root;
};

struct node {
	char		*label;		/* made with strdup. */
	tree_t		*subs;		/* subdomains (node[label]). */
	/* really this is "data" since for the zone cut tree we have no sets.*/
	tree_t		*rrsets;	/* rr sets (rrset[type]). */
};

struct rrset {
	rrtype		type;
	u_int32_t	ttl;
	u_char		data[1];	/* struct size constrains this. */
};