1: /* db.h 4.3 86/06/04 */
2:
3: /*
4: * Copyright (c) 1985 Regents of the University of California
5: * All Rights Reserved
6: */
7:
8: /*
9: * Global structures and variables for data base routines.
10: */
11:
12: #define INVBLKSZ 7 /* # of namebuf pointers per block */
13: #define INVHASHSZ 919 /* size of inverse hash table */
14:
15: /* max length of data in RR data field */
16: #define MAXDATA 256
17:
18: /*
19: * Hash table structures.
20: */
21: struct databuf {
22: struct databuf *d_next; /* linked list */
23: short d_refcount; /* reference count */
24: short d_zone; /* zone number */
25: short d_class; /* class number */
26: short d_type; /* type number */
27: u_long d_ttl; /* time to live */
28: int d_size; /* size of data area */
29: char d_data[MAXDATA]; /* malloc'ed as needed */
30: };
31: #define DATASIZE(n) (sizeof(struct databuf) - MAXDATA + n)
32:
33: struct namebuf {
34: char *n_dname; /* domain name */
35: struct namebuf *n_next; /* linked list */
36: struct databuf *n_data; /* data records */
37: struct namebuf *n_parent; /* parent domain */
38: struct hashbuf *n_hash; /* hash table for children */
39: };
40:
41: struct invbuf {
42: struct invbuf *i_next; /* linked list */
43: struct namebuf *i_dname[INVBLKSZ]; /* domain name */
44: };
45:
46: struct hashbuf {
47: int h_size; /* size of hash table */
48: int h_cnt; /* number of entries */
49: struct namebuf *h_tab[1]; /* malloc'ed as needed */
50: };
51: #define HASHSIZE(s) (s*sizeof(struct namebuf *) + 2*sizeof(int))
52:
53: #define HASHSHIFT 3
54: #define HASHMASK 0x1f
55:
56: /*
57: * Flags to updatedb
58: */
59: #define DB_NODATA 0x1 /* data should not exist */
60: #define DB_MEXIST 0x2 /* data must exist */
61: #define DB_DELETE 0x4 /* delete data if it exists */
62:
63: /*
64: * Error return codes
65: */
66: #define OK 0
67: #define NONAME -1
68: #define NOCLASS -2
69: #define NOTYPE -3
70: #define NODATA -4
71: #define DATAEXISTS -5
72: #define NODBFILE -6
73: #define TOOMANYZONES -7
74: #define GOODDB -8
75: #define NEWDB -9
76:
77: extern struct hashbuf *hashtab; /* root hash table */
78: extern struct invbuf *invtab[]; /* inverse hash table */
79:
80: extern struct namebuf *nlookup();
81: extern struct namebuf *savename();
82: extern struct databuf *savedata();
83: extern struct hashbuf *savehash();
84: extern struct invbuf *saveinv();
85: extern char *savestr();
Defined struct's
databuf
defined in line
21; used 70 times
- in line 22(2),
36(2),
82(2)
- in /usr/src/etc/named/db_dump.c line
53(2)
- in /usr/src/etc/named/db_load.c line
90(2)
- in /usr/src/etc/named/db_lookup.c line
120(2)
- in /usr/src/etc/named/db_reload.c line
40(2)
- in /usr/src/etc/named/db_save.c line
51(2),
58-60(4)
- in /usr/src/etc/named/db_update.c line
26-30(4),
104(2),
136-139(4),
194(2)
- in /usr/src/etc/named/ns_forw.c line
30(2),
106-112(6)
- in /usr/src/etc/named/ns_maint.c line
102(2),
115(2)
- in /usr/src/etc/named/ns_req.c line
47-49(6),
60(2),
836(2),
973-976(6),
1048(2),
1117(2)
- in /usr/src/etc/named/ns_resp.c line
23(2),
47(2),
477(2)
invbuf
defined in line
41; used 24 times
namebuf
defined in line
33; used 62 times
- in line 35-37(4),
43(2),
49(2),
80-81(4)
- in /usr/src/etc/named/db_dump.c line
54-55(4)
- in /usr/src/etc/named/db_lookup.c line
31(2),
38-43(4)
- in /usr/src/etc/named/db_reload.c line
41-42(4)
- in /usr/src/etc/named/db_save.c line
30-36(8),
123-124(4)
- in /usr/src/etc/named/db_update.c line
29(2),
103(2),
140(2)
- in /usr/src/etc/named/ns_forw.c line
109(2)
- in /usr/src/etc/named/ns_maint.c line
116(2)
- in /usr/src/etc/named/ns_req.c line
46(2),
972(2),
1092(2),
1113(2),
1119(2)
- in /usr/src/etc/named/ns_resp.c line
48(2),
208(2)
Defined macros
NEWDB
defined in line
75;
never used
OK
defined in line
66; used 5 times
Usage of this include