# 2.11BSD#431 - /usr/src/usr.sbin/named/named/db.h

##### Macros

    AUTH              X
    DATAEXISTS        X
    DATASIZE          X
    DB_DELETE         X
    DB_F_HINT         X
    DB_MEXIST         X
    DB_NODATA         X
    DB_NOHINTS        X
    DB_NOTAUTH        X
    DB_Z_ALL          X
    DB_Z_CACHE        X
    GOODDB            X
    HASHMASK          X
    HASHSHIFT         X
    HASHSIZE          X
    INVBLKSZ          X
    INVHASHSZ         X
    MAXDATA           X
    NEWDB             X
    NOCLASS           X
    NODATA            X
    NODBFILE          X
    NONAME            X
    NOTYPE            X
    OK                X
    TOOMANYZONES      X

##### struct's

    databuf           X
    hashbuf           X
    invbuf            X
    namebuf           X

       1: /*
       2:  * Copyright (c) 1985 Regents of the University of California.
       3:  * All rights reserved.
       4:  *
       5:  * Redistribution and use in source and binary forms are permitted
       6:  * provided that this notice is preserved and that due credit is given
       7:  * to the University of California at Berkeley. The name of the University
       8:  * may not be used to endorse or promote products derived from this
       9:  * software without specific prior written permission. This software
      10:  * is provided ``as is'' without express or implied warranty.
      11:  *
      12:  *	@(#)db.h	4.13 (Berkeley) 2/17/88
      13:  */
      14:
      15: /*
      16:  * Global structures and variables for data base routines.
      17:  */
      18:
      19: #define INVBLKSZ    7   /* # of namebuf pointers per block */
      20: #define INVHASHSZ   919 /* size of inverse hash table */
      21:
      22:     /* max length of data in RR data field */
      23: #define MAXDATA     256
      24:
      25: /*
      26:  * Hash table structures.
      27:  */
      28: struct databuf {
      29:     struct  databuf *d_next;    /* linked list */
      30:     u_long  d_ttl;          /* time to live */
      31:     short   d_flags;
      32:     short   d_zone;         /* zone number */
      33:     short   d_class;        /* class number */
      34:     short   d_type;         /* type number */
      35:     short   d_mark;         /* place to mark data */
      36:     short   d_size;         /* size of data area */
      37:     u_long  d_nstime;       /* NS response time, milliseconds */
      38:     char    d_data[MAXDATA];    /* the data is malloc'ed to size */
      39: };
      40: #define DATASIZE(n) (sizeof(struct databuf) - MAXDATA + n)
      41:
      42: /*
      43:  * d_flags definitions
      44:  */
      45: #define DB_F_HINT       0x01    /* databuf belongs to fcachetab */
      46:
      47: struct namebuf {
      48:     char    *n_dname;       /* domain name */
      49:     u_int   n_hashval;      /* hash value of n_dname */
      50:     struct  namebuf *n_next;    /* linked list */
      51:     struct  databuf *n_data;    /* data records */
      52:     struct  namebuf *n_parent;  /* parent domain */
      53:     struct  hashbuf *n_hash;    /* hash table for children */
      54: };
      55:
      56: struct invbuf {
      57:     struct  invbuf *i_next;     /* linked list */
      58:     struct  namebuf *i_dname[INVBLKSZ]; /* domain name */
      59: };
      60:
      61: struct hashbuf {
      62:     int h_size;         /* size of hash table */
      63:     int h_cnt;          /* number of entries */
      64:     struct  namebuf *h_tab[1];  /* malloc'ed as needed */
      65: };
      66: #define HASHSIZE(s) (s*sizeof(struct namebuf *) + 2*sizeof(int))
      67:
      68: #define HASHSHIFT   3
      69: #define HASHMASK    0x1f
      70:
      71: /*
      72:  * Flags to updatedb
      73:  */
      74: #define DB_NODATA   0x01    /* data should not exist */
      75: #define DB_MEXIST   0x02    /* data must exist */
      76: #define DB_DELETE   0x04    /* delete data if it exists */
      77: #define DB_NOTAUTH  0x08    /* must not update authoritative data */
      78: #define DB_NOHINTS      0x10    /* don't reflect update in fcachetab */
      79:
      80: #define DB_Z_CACHE      (0) /* cache-zone-only db_dump()  */
      81: #define DB_Z_ALL        (-1)    /* normal db_dump() */
      82:
      83: /*
      84:  * Error return codes
      85:  */
      86: #define OK      0
      87: #define NONAME      -1
      88: #define NOCLASS     -2
      89: #define NOTYPE      -3
      90: #define NODATA      -4
      91: #define DATAEXISTS  -5
      92: #define NODBFILE    -6
      93: #define TOOMANYZONES    -7
      94: #define GOODDB      -8
      95: #define NEWDB       -9
      96: #define AUTH        -10
      97:
      98: extern struct hashbuf *hashtab;     /* root hash table */
      99: extern struct invbuf *invtab[];     /* inverse hash table */
     100: extern struct hashbuf *fcachetab;   /* hash table for cache read from file*/
     101:
     102: extern struct namebuf *nlookup();
     103: extern struct namebuf *savename();
     104: extern struct databuf *savedata();
     105: extern struct databuf *rm_datum();
     106: extern struct hashbuf *savehash();
     107: extern struct invbuf *saveinv();
     108: extern char *savestr();
     109: extern char *malloc(), *realloc(), *calloc();

#### Defined struct's

databuf defined in line 28; used 130 times

- in line 29(2), 51(2), 104-105(4)
- in /usr/src/usr.sbin/named/named/db_dump.c line 138(2), 176(2), 287(2)
- in /usr/src/usr.sbin/named/named/db_load.c line 120(2)
- in /usr/src/usr.sbin/named/named/db_lookup.c line 152(2)
- in /usr/src/usr.sbin/named/named/db_reload.c line 60(2)
- in /usr/src/usr.sbin/named/named/db_save.c line 58(2), 65-71(6)
- in /usr/src/usr.sbin/named/named/db_update.c line 42-47(4), 68(2), 190(2), 210(2), 242-245(4), 300(2)
- in /usr/src/usr.sbin/named/named/ns_forw.c line 47(2), 153-157(4)
- in /usr/src/usr.sbin/named/named/ns_maint.c line 377(2), 488(2), 578(2), 606(2)
- in /usr/src/usr.sbin/named/named/ns_req.c line 63(2), 72(2), 621(2), 653(2), 814(2), 886(2), 943-946(4), 1038(2), 1050-1051(4), 1201(2), 1219(2), 1235-1240(6)
- in /usr/src/usr.sbin/named/named/ns_resp.c line 47-49(4), 126(2), 365(2), 719(2), 726(2), 908(2), 924(2), 1116(2), 1223(2), 1273(2), 1346-1351(6), 1461(2), 1539(2), 1587-1591(4), 1618(2)
- in /usr/src/usr.sbin/named/named/ns_sort.c line 140(2)

hashbuf defined in line 61; used 65 times

- in line 53, 98-100(4), 106(2)
- in /usr/src/usr.sbin/named/named/db_dump.c line 136(2), 173(2), 247(2), 283(2)
- in /usr/src/usr.sbin/named/named/db_lookup.c line 26-27(4), 42(2), 50(2), 70(2)
- in /usr/src/usr.sbin/named/named/db_reload.c line 58(2)
- in /usr/src/usr.sbin/named/named/db_save.c line 104-108(6), 128(2), 134(2)
- in /usr/src/usr.sbin/named/named/db_update.c line 44(2)
- in /usr/src/usr.sbin/named/named/ns_forw.c line 160(2)
- in /usr/src/usr.sbin/named/named/ns_init.c line 67-70(4)
- in /usr/src/usr.sbin/named/named/ns_maint.c line 574(2), 602(2)
- in /usr/src/usr.sbin/named/named/ns_req.c line 64(2), 817(2), 945(2), 1048(2)
- in /usr/src/usr.sbin/named/named/ns_resp.c line 62(2), 1117(2), 1275(2), 1352(2)

invbuf defined in line 56; used 24 times

- in line 57(2), 99(2), 107(2)
- in /usr/src/usr.sbin/named/named/db_reload.c line 85(2)
- in /usr/src/usr.sbin/named/named/db_save.c line 160-165(8)
- in /usr/src/usr.sbin/named/named/db_update.c line 203(2), 212(2), 244(2)
- in /usr/src/usr.sbin/named/named/ns_req.c line 361(2)

namebuf defined in line 47; used 104 times

- in line 50-52(4), 58(2), 64(2), 102-103(4)
- in /usr/src/usr.sbin/named/named/db_dump.c line 139(2), 177-178(4), 288-289(4)
- in /usr/src/usr.sbin/named/named/db_lookup.c line 39(2), 46-51(4)
- in /usr/src/usr.sbin/named/named/db_reload.c line 61-62(4)
- in /usr/src/usr.sbin/named/named/db_save.c line 37-43(8), 109(2)
- in /usr/src/usr.sbin/named/named/db_update.c line 46(2), 209(2), 246(2)
- in /usr/src/usr.sbin/named/named/ns_forw.c line 156(2)
- in /usr/src/usr.sbin/named/named/ns_maint.c line 485-490(6), 579-580(4), 607-608(4)
- in /usr/src/usr.sbin/named/named/ns_req.c line 62(2), 813(2), 885(2), 910(2), 939(2), 947-948(4), 1049(2), 1238(2), 1258(2)
- in /usr/src/usr.sbin/named/named/ns_resp.c line 63(2), 1115(2), 1224(2), 1274(2), 1345-1349(4), 1455(2), 1586(2), 1615(2)
- in /usr/src/usr.sbin/named/named/ns_sort.c line 138(2)

#### Defined macros

AUTH defined in line 96; used 1 times

- in /usr/src/usr.sbin/named/named/db_update.c line 120

DATAEXISTS defined in line 91; used 5 times

- in /usr/src/usr.sbin/named/named/db_load.c line 465
- in /usr/src/usr.sbin/named/named/db_update.c line 134, 180-184(2)
- in /usr/src/usr.sbin/named/named/ns_resp.c line 1002

DATASIZE defined in line 40; used 2 times

- in /usr/src/usr.sbin/named/named/db_save.c line 69-71(2)

DB_DELETE defined in line 76; used 5 times

- in /usr/src/usr.sbin/named/named/db_update.c line 146, 154
- in /usr/src/usr.sbin/named/named/ns_req.c line 1189
- in /usr/src/usr.sbin/named/named/ns_resp.c line 901, 918

DB_F_HINT defined in line 45; used 16 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 317, 340
- in /usr/src/usr.sbin/named/named/db_load.c line 144
- in /usr/src/usr.sbin/named/named/db_update.c line 55, 64, 77, 166-168(2), 192
- in /usr/src/usr.sbin/named/named/ns_forw.c line 191, 213
- in /usr/src/usr.sbin/named/named/ns_req.c line 639, 675, 852
- in /usr/src/usr.sbin/named/named/ns_resp.c line 1405, 1628

DB_MEXIST defined in line 75; used 2 times

- in /usr/src/usr.sbin/named/named/db_update.c line 156
- in /usr/src/usr.sbin/named/named/ns_resp.c line 901

DB_NODATA defined in line 74; used 10 times

- in /usr/src/usr.sbin/named/named/db_load.c line 143-146(2)
- in /usr/src/usr.sbin/named/named/db_update.c line 122, 179-183(2)
- in /usr/src/usr.sbin/named/named/ns_maint.c line 377
- in /usr/src/usr.sbin/named/named/ns_req.c line 1201
- in /usr/src/usr.sbin/named/named/ns_resp.c line 361-363(2), 982

DB_NOHINTS defined in line 78; used 4 times

- in /usr/src/usr.sbin/named/named/db_load.c line 143
- in /usr/src/usr.sbin/named/named/db_update.c line 63, 78
- in /usr/src/usr.sbin/named/named/ns_resp.c line 363

DB_NOTAUTH defined in line 77; used 3 times

- in /usr/src/usr.sbin/named/named/db_update.c line 112
- in /usr/src/usr.sbin/named/named/ns_resp.c line 361-363(2)

DB_Z_ALL defined in line 81; used 3 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 233-236(2), 313

DB_Z_CACHE defined in line 80; used 5 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 92, 98, 315, 339
- in /usr/src/usr.sbin/named/named/db_update.c line 76

GOODDB defined in line 94; never used
HASHMASK defined in line 69; used 2 times

- in /usr/src/usr.sbin/named/named/db_lookup.c line 77, 113

HASHSHIFT defined in line 68; used 1 times

- in /usr/src/usr.sbin/named/named/db_lookup.c line 76

HASHSIZE defined in line 66; used 1 times

- in /usr/src/usr.sbin/named/named/db_save.c line 128

INVBLKSZ defined in line 19; used 6 times

- in line 58
- in /usr/src/usr.sbin/named/named/db_reload.c line 90
- in /usr/src/usr.sbin/named/named/db_update.c line 227, 251, 259
- in /usr/src/usr.sbin/named/named/ns_req.c line 432

INVHASHSZ defined in line 20; used 3 times

- in /usr/src/usr.sbin/named/named/db_reload.c line 88
- in /usr/src/usr.sbin/named/named/db_update.c line 203, 289

MAXDATA defined in line 23; used 6 times

- in line 38-40(2)
- in /usr/src/usr.sbin/named/named/db_load.c line 115, 431
- in /usr/src/usr.sbin/named/named/ns_resp.c line 841, 960

NEWDB defined in line 95; never used
NOCLASS defined in line 88; never used
NODATA defined in line 90; used 2 times

- in /usr/src/usr.sbin/named/named/db_update.c line 155-157(2)

NODBFILE defined in line 92; used 4 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 98, 504, 513-514(2)

NONAME defined in line 87; used 1 times

- in /usr/src/usr.sbin/named/named/db_update.c line 59

NOTYPE defined in line 89; never used
OK defined in line 86; used 9 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 517
- in /usr/src/usr.sbin/named/named/db_update.c line 78, 161, 175, 186
- in /usr/src/usr.sbin/named/named/ns_resp.c line 903, 920, 983, 1429

TOOMANYZONES defined in line 93; never used

#### Usage of this include

db.h used 13 times

- in /usr/src/usr.sbin/named/named/db_dump.c line 26
- in /usr/src/usr.sbin/named/named/db_load.c line 31
- in /usr/src/usr.sbin/named/named/db_lookup.c line 24
- in /usr/src/usr.sbin/named/named/db_reload.c line 24
- in /usr/src/usr.sbin/named/named/db_save.c line 25
- in /usr/src/usr.sbin/named/named/db_update.c line 25
- in /usr/src/usr.sbin/named/named/ns_forw.c line 25
- in /usr/src/usr.sbin/named/named/ns_init.c line 28
- in /usr/src/usr.sbin/named/named/ns_main.c line 49
- in /usr/src/usr.sbin/named/named/ns_maint.c line 30
- in /usr/src/usr.sbin/named/named/ns_req.c line 27
- in /usr/src/usr.sbin/named/named/ns_resp.c line 26
- in /usr/src/usr.sbin/named/named/ns_sort.c line 26

Last modified: 1988-02-18 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1551 |