db.h

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C头文件 代码 · 共 159 行

H
159
字号
/*	@(#)db.h	4.1	(ULTRIX)	7/2/90	*//************************************************************************ *									* *			Copyright (c) 1984-1988 by			* *		Digital Equipment Corporation, Maynard, MA		* *			All rights reserved.				* *									* *   This software is furnished under a license and may be used and	* *   copied  only  in accordance with the terms of such license and	* *   with the  inclusion  of  the  above  copyright  notice.   This	* *   software  or  any  other copies thereof may not be provided or	* *   otherwise made available to any other person.  No title to and	* *   ownership of the software is hereby transferred.			* *									* *   This software is  derived  from  software  received  from  the	* *   University    of   California,   Berkeley,   and   from   Bell	* *   Laboratories.  Use, duplication, or disclosure is  subject  to	* *   restrictions  under  license  agreements  with  University  of	* *   California and with AT&T.						* *									* *   The information in this software is subject to change  without	* *   notice  and should not be construed as a commitment by Digital	* *   Equipment Corporation.						* *									* *   Digital assumes no responsibility for the use  or  reliability	* *   of its software on equipment which is not supplied by Digital.	* *									* ************************************************************************//* * Copyright (c) 1985 Regents of the University of California *	All Rights Reserved *//* * Modification History: * * 18-Jan-88	logcher *	Added BIND 4.7.2. * * 26-Jan-88	logcher *	Added BIND 4.7.3. * *//* * Global structures and variables for data base routines. */#define INVBLKSZ	7	/* # of namebuf pointers per block */#define INVHASHSZ	919	/* size of inverse hash table */	/* max length of data in RR data field */#define MAXDATA		1024/* * Hash table structures. */struct databuf {	struct	databuf *d_next;	/* linked list */	u_long	d_ttl;			/* time to live */	short	d_flags;	short	d_zone;			/* zone number */	short	d_class;		/* class number */	short	d_type;			/* type number */#ifdef AUTHEN	int	d_authen_type;		/* type of authentication used to 					   get this entry */	int	d_authen_ver;		/* version num of the authen type */#endif AUTHEN	short	d_mark;			/* place to mark data */	short	d_size;			/* size of data area */	u_long	d_nstime;		/* NS response time, milliseconds */	char	d_data[MAXDATA]; 	/* the data is malloc'ed to size */};#define DATASIZE(n) (sizeof(struct databuf) - MAXDATA + n)/* * d_flags definitions */#define DB_F_HINT       0x01	/* databuf belongs to fcachetab */struct namebuf {	char	*n_dname;		/* domain name */	u_int	n_hashval;		/* hash value of n_dname */	struct	namebuf *n_next;	/* linked list */	struct	databuf *n_data;	/* data records */#ifdef ULTRIXFUNC	int	n_mark;			/* mark if non-zero is equal to the					   index of the zone in zones that					   is currently being loaded and 					   "owns" this name in the name tree */	struct	databuf *n_loaddb;	/* Primary: the list of records					   currently being loaded from the					   database files.					   Secondary: the list of records 					   currently being loaded from a 					   an xfer file. */#endif ULTRIXFUNC	struct	namebuf *n_parent;	/* parent domain */	struct	hashbuf *n_hash;	/* hash table for children */};struct invbuf {	struct	invbuf *i_next;		/* linked list */	struct	namebuf	*i_dname[INVBLKSZ];	/* domain name */};struct hashbuf {	int	h_size;			/* size of hash table */	int	h_cnt;			/* number of entries */	struct	namebuf	*h_tab[1];	/* malloc'ed as needed */};#define HASHSIZE(s) (s*sizeof(struct namebuf *) + 2*sizeof(int))#define HASHSHIFT	3#define HASHMASK	0x1f/* * Flags to updatedb */#define DB_NODATA	0x01	/* data should not exist */#define DB_MEXIST	0x02	/* data must exist */#define DB_DELETE	0x04	/* delete data if it exists */#define DB_NOTAUTH	0x08	/* must not update authoritative data */#define DB_NOHINTS      0x10	/* don't reflect update in fcachetab */#define DB_LOADDB       0x20	/* add the data to the loaddb database */#define DB_Z_CACHE      (0)	/* cache-zone-only db_dump()  */#define DB_Z_ALL        (-1)	/* normal db_dump() *//* * Error return codes */#define OK		0#define NONAME		-1#define NOCLASS		-2#define NOTYPE		-3#define NODATA		-4#define DATAEXISTS	-5#define NODBFILE	-6#define TOOMANYZONES	-7#define GOODDB		-8#define NEWDB		-9#define AUTH		-10extern struct hashbuf *hashtab;		/* root hash table */extern struct invbuf *invtab[];		/* inverse hash table */extern struct hashbuf *fcachetab;	/* hash table for cache read from file*/extern struct namebuf *nlookup();extern struct namebuf *savename();extern struct databuf *savedata();extern struct databuf *rm_datum();extern struct hashbuf *savehash();extern struct invbuf *saveinv();extern char *savestr();extern char *malloc(), *realloc(), *calloc();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?