xref: /netbsd-src/external/mpl/dhcp/bind/dist/lib/isc/include/isc/types.h (revision 4afad4b7fa6d4a0d3dedf41d1587a7250710ae54)
1 /*	$NetBSD: types.h,v 1.1 2024/02/18 20:57:54 christos Exp $	*/
2 
3 /*
4  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5  *
6  * SPDX-License-Identifier: MPL-2.0
7  *
8  * This Source Code Form is subject to the terms of the Mozilla Public
9  * License, v. 2.0. If a copy of the MPL was not distributed with this
10  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11  *
12  * See the COPYRIGHT file distributed with this work for additional
13  * information regarding copyright ownership.
14  */
15 
16 #ifndef ISC_TYPES_H
17 #define ISC_TYPES_H 1
18 
19 #include <isc/bind9.h>
20 
21 /*! \file isc/types.h
22  * \brief
23  * OS-specific types, from the OS-specific include directories.
24  */
25 #include <inttypes.h>
26 #include <stdbool.h>
27 
28 #include <isc/offset.h>
29 
30 /*
31  * XXXDCL This is just for ISC_LIST and ISC_LINK, but gets all of the other
32  * list macros too.
33  */
34 #include <isc/list.h>
35 
36 /* Core Types.  Alphabetized by defined type. */
37 
38 typedef struct isc_astack	    isc_astack_t; /*%< Array-based fast stack */
39 typedef struct isc_appctx	    isc_appctx_t; /*%< Application context */
40 typedef struct isc_backtrace_symmap isc_backtrace_symmap_t; /*%< Symbol Table
41 							     * Entry */
42 typedef struct isc_buffer isc_buffer_t;			    /*%< Buffer */
43 typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t;	    /*%< Buffer List */
44 typedef struct isc_constregion	   isc_constregion_t;	    /*%< Const region */
45 typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region
46 							   */
47 typedef struct isc_counter isc_counter_t;		  /*%< Counter */
48 typedef int16_t		   isc_dscp_t;	       /*%< Diffserv code point */
49 typedef struct isc_event   isc_event_t;	       /*%< Event */
50 typedef ISC_LIST(isc_event_t) isc_eventlist_t; /*%< Event List */
51 typedef unsigned int	 isc_eventtype_t;      /*%< Event Type */
52 typedef uint32_t	 isc_fsaccess_t;       /*%< FS Access */
53 typedef struct isc_hash	 isc_hash_t;	       /*%< Hash */
54 typedef struct isc_httpd isc_httpd_t;	       /*%< HTTP client */
55 typedef void(isc_httpdfree_t)(isc_buffer_t *, void *); /*%< HTTP free function
56 							*/
57 typedef struct isc_httpdmgr isc_httpdmgr_t;	       /*%< HTTP manager */
58 typedef struct isc_httpdurl isc_httpdurl_t;	       /*%< HTTP URL */
59 typedef void(isc_httpdondestroy_t)(void *); /*%< Callback on destroying httpd */
60 typedef struct isc_interface	 isc_interface_t;     /*%< Interface */
61 typedef struct isc_interfaceiter isc_interfaceiter_t; /*%< Interface Iterator */
62 typedef struct isc_interval	 isc_interval_t;      /*%< Interval */
63 typedef struct isc_lex		 isc_lex_t;	      /*%< Lex */
64 typedef struct isc_log		 isc_log_t;	      /*%< Log */
65 typedef struct isc_logcategory	 isc_logcategory_t;   /*%< Log Category */
66 typedef struct isc_logconfig	 isc_logconfig_t;     /*%< Log Configuration */
67 typedef struct isc_logmodule	 isc_logmodule_t;     /*%< Log Module */
68 typedef struct isc_mem		 isc_mem_t;	      /*%< Memory */
69 typedef struct isc_mempool	 isc_mempool_t;	      /*%< Memory Pool */
70 typedef struct isc_netaddr	 isc_netaddr_t;	      /*%< Net Address */
71 typedef struct isc_nm		 isc_nm_t;	      /*%< Network manager */
72 typedef struct isc_nmsocket	 isc_nmsocket_t; /*%< Network manager socket */
73 typedef struct isc_nmhandle	 isc_nmhandle_t; /*%< Network manager handle */
74 typedef struct isc_portset	 isc_portset_t;	 /*%< Port Set */
75 typedef struct isc_quota	 isc_quota_t;	 /*%< Quota */
76 typedef struct isc_ratelimiter	 isc_ratelimiter_t;   /*%< Rate Limiter */
77 typedef struct isc_region	 isc_region_t;	      /*%< Region */
78 typedef uint64_t		 isc_resourcevalue_t; /*%< Resource Value */
79 typedef unsigned int		 isc_result_t;	      /*%< Result */
80 typedef struct isc_rwlock	 isc_rwlock_t;	      /*%< Read Write Lock */
81 typedef struct isc_sockaddr	 isc_sockaddr_t;      /*%< Socket Address */
82 typedef ISC_LIST(isc_sockaddr_t) isc_sockaddrlist_t;  /*%< Socket Address List
83 						       * */
84 typedef struct isc_socket      isc_socket_t;	      /*%< Socket */
85 typedef struct isc_socketevent isc_socketevent_t;     /*%< Socket Event */
86 typedef struct isc_socketmgr   isc_socketmgr_t;	      /*%< Socket Manager */
87 typedef struct isc_stats       isc_stats_t;	      /*%< Statistics */
88 #if defined(_WIN32) && !defined(_WIN64) || !defined(_LP64)
89 typedef int_fast32_t isc_statscounter_t; /*%< Statistics Counter */
90 #else  /* if defined(_WIN32) && !defined(_WIN64) */
91 typedef int_fast64_t isc_statscounter_t;
92 #endif /* if defined(_WIN32) && !defined(_WIN64) */
93 typedef struct isc_symtab isc_symtab_t;		/*%< Symbol Table */
94 typedef struct isc_task	  isc_task_t;		/*%< Task */
95 typedef ISC_LIST(isc_task_t) isc_tasklist_t;	/*%< Task List */
96 typedef struct isc_taskmgr    isc_taskmgr_t;	/*%< Task Manager */
97 typedef struct isc_textregion isc_textregion_t; /*%< Text Region */
98 typedef struct isc_time	      isc_time_t;	/*%< Time */
99 typedef struct isc_timer      isc_timer_t;	/*%< Timer */
100 typedef struct isc_timermgr   isc_timermgr_t;	/*%< Timer Manager */
101 
102 typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *);
103 typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *, int);
104 
105 /* The following cannot be listed alphabetically due to forward reference */
106 typedef isc_result_t(isc_httpdaction_t)(
107 	const char *url, isc_httpdurl_t *urlinfo, const char *querystring,
108 	const char *headers, void *arg, unsigned int *retcode,
109 	const char **retmsg, const char **mimetype, isc_buffer_t *body,
110 	isc_httpdfree_t **freecb, void **freecb_args);
111 typedef bool(isc_httpdclientok_t)(const isc_sockaddr_t *, void *);
112 
113 /*% Resource */
114 typedef enum {
115 	isc_resource_coresize = 1,
116 	isc_resource_cputime,
117 	isc_resource_datasize,
118 	isc_resource_filesize,
119 	isc_resource_lockedmemory,
120 	isc_resource_openfiles,
121 	isc_resource_processes,
122 	isc_resource_residentsize,
123 	isc_resource_stacksize
124 } isc_resource_t;
125 
126 /*% Statistics formats (text file or XML) */
127 typedef enum {
128 	isc_statsformat_file,
129 	isc_statsformat_xml,
130 	isc_statsformat_json
131 } isc_statsformat_t;
132 
133 #endif /* ISC_TYPES_H */
134