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