types.h revision 290001
1/*
2 * Copyright (C) 2004-2009, 2012  Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2003  Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
16 */
17
18/* $Id$ */
19
20#ifndef ISC_TYPES_H
21#define ISC_TYPES_H 1
22
23#include <isc/bind9.h>
24#include <isc/namespace.h>
25
26/*! \file isc/types.h
27 * \brief
28 * OS-specific types, from the OS-specific include directories.
29 */
30#include <isc/int.h>
31#include <isc/offset.h>
32
33/*
34 * XXXDCL should isc_boolean_t be moved here, requiring an explicit include
35 * of <isc/boolean.h> when ISC_TRUE/ISC_FALSE/ISC_TF() are desired?
36 */
37#include <isc/boolean.h>
38/*
39 * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
40 * list macros too.
41 */
42#include <isc/list.h>
43
44/* Core Types.  Alphabetized by defined type. */
45
46typedef struct isc_appctx		isc_appctx_t;	 	/*%< Application context */
47typedef struct isc_backtrace_symmap	isc_backtrace_symmap_t; /*%< Symbol Table Entry */
48typedef struct isc_bitstring		isc_bitstring_t; 	/*%< Bitstring */
49typedef struct isc_buffer		isc_buffer_t;		/*%< Buffer */
50typedef ISC_LIST(isc_buffer_t)		isc_bufferlist_t;	/*%< Buffer List */
51typedef struct isc_constregion		isc_constregion_t;	/*%< Const region */
52typedef struct isc_consttextregion	isc_consttextregion_t;	/*%< Const Text Region */
53typedef struct isc_entropy		isc_entropy_t;		/*%< Entropy */
54typedef struct isc_entropysource	isc_entropysource_t;	/*%< Entropy Source */
55typedef struct isc_event		isc_event_t;		/*%< Event */
56typedef ISC_LIST(isc_event_t)		isc_eventlist_t;	/*%< Event List */
57typedef unsigned int			isc_eventtype_t;	/*%< Event Type */
58typedef isc_uint32_t			isc_fsaccess_t;		/*%< FS Access */
59typedef struct isc_hash			isc_hash_t;		/*%< Hash */
60typedef struct isc_httpd		isc_httpd_t;		/*%< HTTP client */
61typedef void (isc_httpdfree_t)(isc_buffer_t *, void *);		/*%< HTTP free function */
62typedef struct isc_httpdmgr		isc_httpdmgr_t;		/*%< HTTP manager */
63typedef struct isc_httpdurl		isc_httpdurl_t;		/*%< HTTP URL */
64typedef void (isc_httpdondestroy_t)(void *);			/*%< Callback on destroying httpd */
65typedef struct isc_interface		isc_interface_t;	/*%< Interface */
66typedef struct isc_interfaceiter	isc_interfaceiter_t;	/*%< Interface Iterator */
67typedef struct isc_interval		isc_interval_t;		/*%< Interval */
68typedef struct isc_lex			isc_lex_t;		/*%< Lex */
69typedef struct isc_log 			isc_log_t;		/*%< Log */
70typedef struct isc_logcategory		isc_logcategory_t;	/*%< Log Category */
71typedef struct isc_logconfig		isc_logconfig_t;	/*%< Log Configuration */
72typedef struct isc_logmodule		isc_logmodule_t;	/*%< Log Module */
73typedef struct isc_mem			isc_mem_t;		/*%< Memory */
74typedef struct isc_mempool		isc_mempool_t;		/*%< Memory Pool */
75typedef struct isc_msgcat		isc_msgcat_t;		/*%< Message Catalog */
76typedef struct isc_ondestroy		isc_ondestroy_t;	/*%< On Destroy */
77typedef struct isc_netaddr		isc_netaddr_t;		/*%< Net Address */
78typedef struct isc_portset		isc_portset_t;		/*%< Port Set */
79typedef struct isc_quota		isc_quota_t;		/*%< Quota */
80typedef struct isc_random		isc_random_t;		/*%< Random */
81typedef struct isc_ratelimiter		isc_ratelimiter_t;	/*%< Rate Limiter */
82typedef struct isc_region		isc_region_t;		/*%< Region */
83typedef isc_uint64_t			isc_resourcevalue_t;	/*%< Resource Value */
84typedef unsigned int			isc_result_t;		/*%< Result */
85typedef struct isc_rwlock		isc_rwlock_t;		/*%< Read Write Lock */
86typedef struct isc_sockaddr		isc_sockaddr_t;		/*%< Socket Address */
87typedef struct isc_socket		isc_socket_t;		/*%< Socket */
88typedef struct isc_socketevent		isc_socketevent_t;	/*%< Socket Event */
89typedef struct isc_socketmgr		isc_socketmgr_t;	/*%< Socket Manager */
90typedef struct isc_stats		isc_stats_t;		/*%< Statistics */
91typedef int				isc_statscounter_t;	/*%< Statistics Counter */
92typedef struct isc_symtab		isc_symtab_t;		/*%< Symbol Table */
93typedef struct isc_task			isc_task_t;		/*%< Task */
94typedef ISC_LIST(isc_task_t)		isc_tasklist_t;		/*%< Task List */
95typedef struct isc_taskmgr		isc_taskmgr_t;		/*%< Task Manager */
96typedef struct isc_textregion		isc_textregion_t;	/*%< Text Region */
97typedef struct isc_time			isc_time_t;		/*%< Time */
98typedef struct isc_timer		isc_timer_t;		/*%< Timer */
99typedef struct isc_timermgr		isc_timermgr_t;		/*%< Timer Manager */
100
101typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *);
102typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *, int);
103
104/* The following cannot be listed alphabetically due to forward reference */
105typedef isc_result_t (isc_httpdaction_t)(const char *url,
106					 const char *querystring,
107					 void *arg,
108					 unsigned int *retcode,
109					 const char **retmsg,
110					 const char **mimetype,
111					 isc_buffer_t *body,
112					 isc_httpdfree_t **freecb,
113					 void **freecb_args);
114typedef isc_boolean_t (isc_httpdclientok_t)(const isc_sockaddr_t *, void *);
115
116/*% Resource */
117typedef enum {
118	isc_resource_coresize = 1,
119	isc_resource_cputime,
120	isc_resource_datasize,
121	isc_resource_filesize,
122	isc_resource_lockedmemory,
123	isc_resource_openfiles,
124	isc_resource_processes,
125	isc_resource_residentsize,
126	isc_resource_stacksize
127} isc_resource_t;
128
129#endif /* ISC_TYPES_H */
130