Home | History | Annotate | Line # | Download | only in omapip
      1 /*	$NetBSD: omapip.h,v 1.3 2022/04/03 01:10:59 christos Exp $	*/
      2 
      3 /* omapip.h
      4 
      5    Definitions for the object management API and protocol... */
      6 
      7 /*
      8  * Copyright (C) 2004-2022 Internet Systems Consortium, Inc. ("ISC")
      9  * Copyright (c) 1996-2003 by Internet Software Consortium
     10  *
     11  * This Source Code Form is subject to the terms of the Mozilla Public
     12  * License, v. 2.0. If a copy of the MPL was not distributed with this
     13  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     14  *
     15  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
     16  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     17  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
     18  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     20  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     21  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     22  *
     23  *   Internet Systems Consortium, Inc.
     24  *   PO Box 360
     25  *   Newmarket, NH 03857 USA
     26  *   <info (at) isc.org>
     27  *   https://www.isc.org/
     28  *
     29  */
     30 
     31 #ifndef _OMAPIP_H_
     32 #define _OMAPIP_H_
     33 #include "result.h"
     34 #include <stdarg.h>
     35 
     36 #include <dns/tsec.h>
     37 
     38 typedef unsigned int omapi_handle_t;
     39 
     40 struct __omapi_object;
     41 typedef struct __omapi_object omapi_object_t;
     42 
     43 typedef enum {
     44 	omapi_datatype_int,
     45 	omapi_datatype_string,
     46 	omapi_datatype_data,
     47 	omapi_datatype_object
     48 } omapi_datatype_t;
     49 
     50 typedef struct {
     51 	int refcnt;
     52 	omapi_datatype_t type;
     53 	union {
     54 		struct {
     55 			unsigned len;
     56 #define OMAPI_TYPED_DATA_NOBUFFER_LEN (sizeof (int) + \
     57 				       sizeof (omapi_datatype_t) + \
     58 				       sizeof (int))
     59 			unsigned char value [1];
     60 		} buffer;
     61 #define OMAPI_TYPED_DATA_OBJECT_LEN (sizeof (int) + \
     62 				     sizeof (omapi_datatype_t) + \
     63 				     sizeof (omapi_object_t *))
     64 		omapi_object_t *object;
     65 #define OMAPI_TYPED_DATA_REF_LEN (sizeof (int) + \
     66 				  sizeof (omapi_datatype_t) + \
     67 				  3 * sizeof (void *))
     68 		struct {
     69 			void *ptr;
     70 			isc_result_t (*reference) (void *,
     71 						   void *, const char *, int);
     72 			isc_result_t (*dereference) (void *,
     73 						     const char *, int);
     74 		} ref;
     75 #define OMAPI_TYPED_DATA_INT_LEN (sizeof (int) + \
     76 				  sizeof (omapi_datatype_t) + \
     77 				  sizeof (int))
     78 		int integer;
     79 	} u;
     80 } omapi_typed_data_t;
     81 
     82 typedef struct {
     83 	int refcnt;
     84 	unsigned len;
     85 #define OMAPI_DATA_STRING_EMPTY_SIZE (2 * sizeof (int))
     86 	unsigned char value [1];
     87 } omapi_data_string_t;
     88 
     89 typedef struct {
     90 	int refcnt;
     91 	omapi_data_string_t *name;
     92 	omapi_typed_data_t *value;
     93 } omapi_value_t;
     94 
     95 typedef struct __omapi_object_type_t {
     96 	const char *name;
     97 	struct __omapi_object_type_t *next;
     98 
     99 	isc_result_t (*set_value) (omapi_object_t *, omapi_object_t *,
    100 				   omapi_data_string_t *,
    101 				   omapi_typed_data_t *);
    102 	isc_result_t (*get_value) (omapi_object_t *,
    103 				   omapi_object_t *,
    104 				   omapi_data_string_t *, omapi_value_t **);
    105 	isc_result_t (*destroy) (omapi_object_t *, const char *, int);
    106 	isc_result_t (*signal_handler) (omapi_object_t *,
    107 					const char *, va_list);
    108 	isc_result_t (*stuff_values) (omapi_object_t *,
    109 				      omapi_object_t *, omapi_object_t *);
    110 	isc_result_t (*lookup) (omapi_object_t **, omapi_object_t *,
    111 				omapi_object_t *);
    112 	isc_result_t (*create) (omapi_object_t **, omapi_object_t *);
    113 	isc_result_t (*remove) (omapi_object_t *, omapi_object_t *);
    114 	isc_result_t (*freer) (omapi_object_t *, const char *, int);
    115 	isc_result_t (*allocator) (omapi_object_t **, const char *, int);
    116 	isc_result_t (*sizer) (size_t);
    117 	size_t size;
    118 	int rc_flag;
    119 	isc_result_t (*initialize) (omapi_object_t *, const char *, int);
    120 } omapi_object_type_t;
    121 
    122 #define OMAPI_OBJECT_PREAMBLE \
    123 	omapi_object_type_t *type; \
    124 	int refcnt; \
    125 	omapi_handle_t handle; \
    126 	omapi_object_t *outer, *inner
    127 
    128 /* The omapi handle structure. */
    129 struct __omapi_object {
    130 	OMAPI_OBJECT_PREAMBLE;
    131 };
    132 
    133 /* The port on which applications should listen for OMAPI connections. */
    134 #define OMAPI_PROTOCOL_PORT	7911
    135 
    136 typedef struct {
    137 	unsigned addrtype;
    138 	unsigned addrlen;
    139 	unsigned char address [16];
    140 	unsigned port;
    141 } omapi_addr_t;
    142 
    143 typedef struct {
    144 	int refcnt;
    145 	unsigned count;
    146 	omapi_addr_t *addresses;
    147 } omapi_addr_list_t;
    148 
    149 typedef struct auth_key {
    150 	OMAPI_OBJECT_PREAMBLE;
    151 	char *name;
    152 	char *algorithm;
    153 	omapi_data_string_t *key;
    154 	dns_tsec_t *tsec_key;
    155 } omapi_auth_key_t;
    156 
    157 #define OMAPI_CREATE          1
    158 #define OMAPI_UPDATE          2
    159 #define OMAPI_EXCL            4
    160 #define OMAPI_NOTIFY_PROTOCOL 8
    161 
    162 #define OMAPI_OBJECT_ALLOC(name, stype, type) \
    163 isc_result_t name##_allocate (stype **p, const char *file, int line)	      \
    164 {									      \
    165 	return omapi_object_allocate ((omapi_object_t **)p,		      \
    166 				      type, 0, file, line);		      \
    167 }									      \
    168 									      \
    169 isc_result_t name##_reference (stype **pptr, stype *ptr,		      \
    170 			       const char *file, int line)		      \
    171 {									      \
    172 	return omapi_object_reference ((omapi_object_t **)pptr,		      \
    173 				       (omapi_object_t *)ptr, file, line);    \
    174 }									      \
    175 									      \
    176 isc_result_t name##_dereference (stype **ptr, const char *file, int line)     \
    177 {									      \
    178 	return omapi_object_dereference ((omapi_object_t **)ptr, file, line); \
    179 }
    180 
    181 #define OMAPI_OBJECT_ALLOC_DECL(name, stype, type) \
    182 isc_result_t name##_allocate (stype **p, const char *file, int line); \
    183 isc_result_t name##_reference (stype **pptr, stype *ptr, \
    184 			       const char *file, int line); \
    185 isc_result_t name##_dereference (stype **ptr, const char *file, int line);
    186 
    187 typedef isc_result_t (*omapi_array_ref_t) (char **, char *, const char *, int);
    188 typedef isc_result_t (*omapi_array_deref_t) (char **, const char *, int);
    189 
    190 /* An extensible array type. */
    191 typedef struct {
    192 	char **data;
    193 	omapi_array_ref_t ref;
    194 	omapi_array_deref_t deref;
    195 	int count;
    196 	int max;
    197 } omapi_array_t;
    198 
    199 #define OMAPI_ARRAY_TYPE(name, stype)					      \
    200 isc_result_t name##_array_allocate (omapi_array_t **p,			      \
    201 				    const char *file, int line)		      \
    202 {									      \
    203 	return (omapi_array_allocate					      \
    204 		(p,							      \
    205 		 (omapi_array_ref_t)name##_reference,			      \
    206 		 (omapi_array_deref_t)name##_dereference,		      \
    207 		 file, line));						      \
    208 }									      \
    209 									      \
    210 isc_result_t name##_array_free (omapi_array_t **p,			      \
    211 				const char *file, int line)		      \
    212 {									      \
    213 	return omapi_array_free (p, file, line);			      \
    214 }									      \
    215 									      \
    216 isc_result_t name##_array_extend (omapi_array_t *pptr, stype *ptr, int *index,\
    217 				  const char *file, int line)		      \
    218 {									      \
    219 	return omapi_array_extend (pptr, (char *)ptr, index, file, line);     \
    220 }									      \
    221 									      \
    222 isc_result_t name##_array_set (omapi_array_t *pptr, stype *ptr,	int index,    \
    223 			       const char *file, int line)		      \
    224 {									      \
    225 	return omapi_array_set (pptr, (char *)ptr, index, file, line);	      \
    226 }									      \
    227 									      \
    228 isc_result_t name##_array_lookup (stype **ptr, omapi_array_t *pptr,	      \
    229 				  int index, const char *file, int line)      \
    230 {									      \
    231 	return omapi_array_lookup ((char **)ptr, pptr, index, file, line);    \
    232 }
    233 
    234 #define OMAPI_ARRAY_TYPE_DECL(name, stype) \
    235 isc_result_t name##_array_allocate (omapi_array_t **, const char *, int);     \
    236 isc_result_t name##_array_free (omapi_array_t **, const char *, int);	      \
    237 isc_result_t name##_array_extend (omapi_array_t *, stype *, int *,	      \
    238 				  const char *, int);			      \
    239 isc_result_t name##_array_set (omapi_array_t *,				      \
    240 			       stype *, int, const char *, int);	      \
    241 isc_result_t name##_array_lookup (stype **,				      \
    242 				  omapi_array_t *, int, const char *, int)
    243 
    244 #define	omapi_array_foreach_begin(array, stype, var)			      \
    245 	{								      \
    246 		int omapi_array_foreach_index;				      \
    247 		stype *var = (stype *)0;				      \
    248 		for (omapi_array_foreach_index = 0;			      \
    249 			     array &&					      \
    250 			     omapi_array_foreach_index < (array) -> count;    \
    251 		     omapi_array_foreach_index++) {			      \
    252 			if ((array) -> data [omapi_array_foreach_index]) {    \
    253 				((*(array) -> ref)			      \
    254 				 ((char **)&var,			      \
    255 				  (array) -> data [omapi_array_foreach_index],\
    256 				  MDL));
    257 
    258 #define	omapi_array_foreach_end(array, stype, var)			      \
    259 				(*(array) -> deref) ((char **)&var, MDL);     \
    260 			}						      \
    261 		}							      \
    262 	}
    263 
    264 isc_result_t omapi_protocol_connect (omapi_object_t *,
    265 				     const char *, unsigned, omapi_object_t *);
    266 isc_result_t omapi_connect_list (omapi_object_t *, omapi_addr_list_t *,
    267 				 omapi_addr_t *);
    268 isc_result_t omapi_protocol_listen (omapi_object_t *, unsigned, int);
    269 isc_boolean_t omapi_protocol_authenticated (omapi_object_t *);
    270 isc_result_t omapi_protocol_configure_security (omapi_object_t *,
    271 						isc_result_t (*)
    272 						(omapi_object_t *,
    273 						 omapi_addr_t *),
    274 						isc_result_t (*)
    275 						(omapi_object_t *,
    276 						 omapi_auth_key_t *));
    277 isc_result_t omapi_protocol_accept (omapi_object_t *);
    278 isc_result_t omapi_protocol_send_intro (omapi_object_t *, unsigned, unsigned);
    279 isc_result_t omapi_protocol_ready (omapi_object_t *);
    280 isc_result_t omapi_protocol_add_auth (omapi_object_t *, omapi_object_t *,
    281 				      omapi_handle_t);
    282 isc_result_t omapi_protocol_lookup_auth (omapi_object_t **, omapi_object_t *,
    283 					 omapi_handle_t);
    284 isc_result_t omapi_protocol_set_value (omapi_object_t *, omapi_object_t *,
    285 				       omapi_data_string_t *,
    286 				       omapi_typed_data_t *);
    287 isc_result_t omapi_protocol_get_value (omapi_object_t *, omapi_object_t *,
    288 				       omapi_data_string_t *,
    289 				       omapi_value_t **);
    290 isc_result_t omapi_protocol_stuff_values (omapi_object_t *,
    291 					  omapi_object_t *,
    292 					  omapi_object_t *);
    293 
    294 isc_result_t omapi_protocol_destroy (omapi_object_t *, const char *, int);
    295 isc_result_t omapi_protocol_send_message (omapi_object_t *,
    296 					  omapi_object_t *,
    297 					  omapi_object_t *,
    298 					  omapi_object_t *);
    299 isc_result_t omapi_protocol_signal_handler (omapi_object_t *,
    300 					    const char *, va_list);
    301 isc_result_t omapi_protocol_listener_set_value (omapi_object_t *,
    302 						omapi_object_t *,
    303 						omapi_data_string_t *,
    304 						omapi_typed_data_t *);
    305 isc_result_t omapi_protocol_listener_get_value (omapi_object_t *,
    306 						omapi_object_t *,
    307 						omapi_data_string_t *,
    308 						omapi_value_t **);
    309 isc_result_t omapi_protocol_listener_destroy (omapi_object_t *,
    310 					      const char *, int);
    311 isc_result_t omapi_protocol_listener_signal (omapi_object_t *,
    312 					     const char *, va_list);
    313 isc_result_t omapi_protocol_listener_stuff (omapi_object_t *,
    314 					    omapi_object_t *,
    315 					    omapi_object_t *);
    316 isc_result_t omapi_protocol_send_status (omapi_object_t *, omapi_object_t *,
    317 					 isc_result_t, unsigned, const char *);
    318 isc_result_t omapi_protocol_send_open (omapi_object_t *, omapi_object_t *,
    319 				       const char *, omapi_object_t *,
    320 				       unsigned);
    321 isc_result_t omapi_protocol_send_update (omapi_object_t *, omapi_object_t *,
    322 					 unsigned, omapi_object_t *);
    323 
    324 isc_result_t omapi_connect (omapi_object_t *, const char *, unsigned);
    325 isc_result_t omapi_disconnect (omapi_object_t *, int);
    326 int omapi_connection_readfd (omapi_object_t *);
    327 int omapi_connection_writefd (omapi_object_t *);
    328 isc_result_t omapi_connection_connect (omapi_object_t *);
    329 isc_result_t omapi_connection_reader (omapi_object_t *);
    330 isc_result_t omapi_connection_writer (omapi_object_t *);
    331 isc_result_t omapi_connection_reaper (omapi_object_t *);
    332 isc_result_t omapi_connection_output_auth_length (omapi_object_t *,
    333                                                   unsigned *);
    334 isc_result_t omapi_connection_set_value (omapi_object_t *, omapi_object_t *,
    335 					 omapi_data_string_t *,
    336 					 omapi_typed_data_t *);
    337 isc_result_t omapi_connection_get_value (omapi_object_t *, omapi_object_t *,
    338 					 omapi_data_string_t *,
    339 					 omapi_value_t **);
    340 isc_result_t omapi_connection_destroy (omapi_object_t *, const char *, int);
    341 isc_result_t omapi_connection_signal_handler (omapi_object_t *,
    342 					      const char *, va_list);
    343 isc_result_t omapi_connection_stuff_values (omapi_object_t *,
    344 					    omapi_object_t *,
    345 					    omapi_object_t *);
    346 isc_result_t omapi_connection_write_typed_data (omapi_object_t *,
    347 						omapi_typed_data_t *);
    348 isc_result_t omapi_connection_put_name (omapi_object_t *, const char *);
    349 isc_result_t omapi_connection_put_string (omapi_object_t *, const char *);
    350 isc_result_t omapi_connection_put_handle (omapi_object_t *c,
    351 					  omapi_object_t *h);
    352 isc_result_t omapi_connection_put_named_uint32 (omapi_object_t *,
    353 						const char *,
    354 						u_int32_t);
    355 isc_result_t omapi_listen (omapi_object_t *, unsigned, int);
    356 isc_result_t omapi_listen_addr (omapi_object_t *,
    357 				omapi_addr_t *, int);
    358 isc_result_t omapi_listener_accept (omapi_object_t *);
    359 int omapi_listener_readfd (omapi_object_t *);
    360 isc_result_t omapi_accept (omapi_object_t *);
    361 isc_result_t omapi_listener_configure_security (omapi_object_t *,
    362 						isc_result_t (*)
    363 						(omapi_object_t *,
    364 						 omapi_addr_t *));
    365 isc_result_t omapi_listener_set_value (omapi_object_t *, omapi_object_t *,
    366 				       omapi_data_string_t *,
    367 				       omapi_typed_data_t *);
    368 isc_result_t omapi_listener_get_value (omapi_object_t *, omapi_object_t *,
    369 				       omapi_data_string_t *,
    370 				       omapi_value_t **);
    371 isc_result_t omapi_listener_destroy (omapi_object_t *, const char *, int);
    372 isc_result_t omapi_listener_signal_handler (omapi_object_t *,
    373 					    const char *, va_list);
    374 isc_result_t omapi_listener_stuff_values (omapi_object_t *,
    375 					  omapi_object_t *,
    376 					  omapi_object_t *);
    377 
    378 isc_result_t omapi_register_io_object (omapi_object_t *,
    379 				       int (*)(omapi_object_t *),
    380 				       int (*)(omapi_object_t *),
    381 				       isc_result_t (*)(omapi_object_t *),
    382 				       isc_result_t (*)(omapi_object_t *),
    383 				       isc_result_t (*)(omapi_object_t *));
    384 isc_result_t omapi_reregister_io_object (omapi_object_t *,
    385 					 int (*)(omapi_object_t *),
    386 					 int (*)(omapi_object_t *),
    387 					 isc_result_t (*)(omapi_object_t *),
    388 					 isc_result_t (*)(omapi_object_t *),
    389 					 isc_result_t (*)(omapi_object_t *));
    390 isc_result_t omapi_unregister_io_object (omapi_object_t *);
    391 isc_result_t omapi_dispatch (struct timeval *);
    392 isc_result_t omapi_wait_for_completion (omapi_object_t *, struct timeval *);
    393 isc_result_t omapi_one_dispatch (omapi_object_t *, struct timeval *);
    394 isc_result_t omapi_io_set_value (omapi_object_t *, omapi_object_t *,
    395 				 omapi_data_string_t *,
    396 				 omapi_typed_data_t *);
    397 isc_result_t omapi_io_get_value (omapi_object_t *, omapi_object_t *,
    398 				 omapi_data_string_t *, omapi_value_t **);
    399 isc_result_t omapi_io_destroy (omapi_object_t *, const char *, int);
    400 isc_result_t omapi_io_signal_handler (omapi_object_t *, const char *, va_list);
    401 isc_result_t omapi_io_stuff_values (omapi_object_t *,
    402 				    omapi_object_t *,
    403 				    omapi_object_t *);
    404 isc_result_t omapi_waiter_signal_handler (omapi_object_t *,
    405 					  const char *, va_list);
    406 isc_result_t omapi_io_state_foreach (isc_result_t (*func) (omapi_object_t *,
    407 							   void *),
    408 				     void *p);
    409 
    410 isc_result_t omapi_generic_new (omapi_object_t **, const char *, int);
    411 isc_result_t omapi_generic_set_value  (omapi_object_t *, omapi_object_t *,
    412 				       omapi_data_string_t *,
    413 				       omapi_typed_data_t *);
    414 isc_result_t omapi_generic_get_value (omapi_object_t *, omapi_object_t *,
    415 				      omapi_data_string_t *,
    416 				      omapi_value_t **);
    417 isc_result_t omapi_generic_destroy (omapi_object_t *, const char *, int);
    418 isc_result_t omapi_generic_signal_handler (omapi_object_t *,
    419 					   const char *, va_list);
    420 isc_result_t omapi_generic_stuff_values (omapi_object_t *,
    421 					 omapi_object_t *,
    422 					 omapi_object_t *);
    423 isc_result_t omapi_generic_clear_flags (omapi_object_t *);
    424 
    425 isc_result_t omapi_message_new (omapi_object_t **, const char *, int);
    426 isc_result_t omapi_message_set_value  (omapi_object_t *, omapi_object_t *,
    427 				       omapi_data_string_t *,
    428 				       omapi_typed_data_t *);
    429 isc_result_t omapi_message_get_value (omapi_object_t *, omapi_object_t *,
    430 				      omapi_data_string_t *,
    431 				      omapi_value_t **);
    432 isc_result_t omapi_message_destroy (omapi_object_t *, const char *, int);
    433 isc_result_t omapi_message_signal_handler (omapi_object_t *,
    434 					   const char *, va_list);
    435 isc_result_t omapi_message_stuff_values (omapi_object_t *,
    436 					 omapi_object_t *,
    437 					 omapi_object_t *);
    438 isc_result_t omapi_message_register (omapi_object_t *);
    439 isc_result_t omapi_message_unregister (omapi_object_t *);
    440 isc_result_t omapi_message_process (omapi_object_t *, omapi_object_t *);
    441 
    442 OMAPI_OBJECT_ALLOC_DECL (omapi_auth_key,
    443 			 omapi_auth_key_t, omapi_type_auth_key)
    444 isc_result_t omapi_auth_key_new (omapi_auth_key_t **, const char *, int);
    445 isc_result_t omapi_auth_key_destroy (omapi_object_t *, const char *, int);
    446 isc_result_t omapi_auth_key_enter (omapi_auth_key_t *);
    447 isc_result_t omapi_auth_key_lookup_name (omapi_auth_key_t **, const char *);
    448 isc_result_t omapi_auth_key_lookup (omapi_object_t **,
    449 				    omapi_object_t *,
    450 				    omapi_object_t *);
    451 isc_result_t omapi_auth_key_get_value (omapi_object_t *, omapi_object_t *,
    452 				       omapi_data_string_t *,
    453 				       omapi_value_t **);
    454 isc_result_t omapi_auth_key_stuff_values (omapi_object_t *,
    455 					  omapi_object_t *,
    456 					  omapi_object_t *);
    457 
    458 extern omapi_object_type_t *omapi_type_connection;
    459 extern omapi_object_type_t *omapi_type_listener;
    460 extern omapi_object_type_t *omapi_type_io_object;
    461 extern omapi_object_type_t *omapi_type_generic;
    462 extern omapi_object_type_t *omapi_type_protocol;
    463 extern omapi_object_type_t *omapi_type_protocol_listener;
    464 extern omapi_object_type_t *omapi_type_waiter;
    465 extern omapi_object_type_t *omapi_type_remote;
    466 extern omapi_object_type_t *omapi_type_message;
    467 extern omapi_object_type_t *omapi_type_auth_key;
    468 
    469 extern omapi_object_type_t *omapi_object_types;
    470 
    471 void omapi_type_relinquish (void);
    472 isc_result_t omapi_init (void);
    473 isc_result_t omapi_object_type_register (omapi_object_type_t **,
    474 					 const char *,
    475 					 isc_result_t (*)
    476 						(omapi_object_t *,
    477 						 omapi_object_t *,
    478 						 omapi_data_string_t *,
    479 						 omapi_typed_data_t *),
    480 					 isc_result_t (*)
    481 						(omapi_object_t *,
    482 						 omapi_object_t *,
    483 						 omapi_data_string_t *,
    484 						 omapi_value_t **),
    485 					 isc_result_t (*) (omapi_object_t *,
    486 							   const char *, int),
    487 					 isc_result_t (*) (omapi_object_t *,
    488 							   const char *,
    489 							   va_list),
    490 					 isc_result_t (*) (omapi_object_t *,
    491 							   omapi_object_t *,
    492 							   omapi_object_t *),
    493 					 isc_result_t (*) (omapi_object_t **,
    494 							   omapi_object_t *,
    495 							   omapi_object_t *),
    496 					 isc_result_t (*) (omapi_object_t **,
    497 							   omapi_object_t *),
    498 					 isc_result_t (*) (omapi_object_t *,
    499 							   omapi_object_t *),
    500 					 isc_result_t (*) (omapi_object_t *,
    501 							   const char *, int),
    502 					 isc_result_t (*) (omapi_object_t **,
    503 							   const char *, int),
    504 					 isc_result_t (*) (size_t), size_t,
    505 					 isc_result_t (*) (omapi_object_t *,
    506 							   const char *, int),
    507 					 int);
    508 isc_result_t omapi_signal (omapi_object_t *, const char *, ...);
    509 isc_result_t omapi_signal_in (omapi_object_t *, const char *, ...);
    510 isc_result_t omapi_set_value (omapi_object_t *, omapi_object_t *,
    511 			      omapi_data_string_t *,
    512 			      omapi_typed_data_t *);
    513 isc_result_t omapi_set_value_str (omapi_object_t *, omapi_object_t *,
    514 				  const char *, omapi_typed_data_t *);
    515 isc_result_t omapi_set_boolean_value (omapi_object_t *, omapi_object_t *,
    516 				      const char *, int);
    517 isc_result_t omapi_set_int_value (omapi_object_t *, omapi_object_t *,
    518 				  const char *, int);
    519 isc_result_t omapi_set_object_value (omapi_object_t *, omapi_object_t *,
    520 				     const char *, omapi_object_t *);
    521 isc_result_t omapi_set_string_value (omapi_object_t *, omapi_object_t *,
    522 				     const char *, const char *);
    523 isc_result_t omapi_get_value (omapi_object_t *, omapi_object_t *,
    524 			      omapi_data_string_t *,
    525 			      omapi_value_t **);
    526 isc_result_t omapi_get_value_str (omapi_object_t *, omapi_object_t *,
    527 				  const char *, omapi_value_t **);
    528 isc_result_t omapi_stuff_values (omapi_object_t *,
    529 				 omapi_object_t *,
    530 				 omapi_object_t *);
    531 isc_result_t omapi_object_create (omapi_object_t **, omapi_object_t *,
    532 				  omapi_object_type_t *);
    533 isc_result_t omapi_object_update (omapi_object_t *, omapi_object_t *,
    534 				  omapi_object_t *, omapi_handle_t);
    535 int omapi_data_string_cmp (omapi_data_string_t *, omapi_data_string_t *);
    536 int omapi_ds_strcmp (omapi_data_string_t *, const char *);
    537 int omapi_td_strcmp (omapi_typed_data_t *, const char *);
    538 int omapi_td_strcasecmp (omapi_typed_data_t *, const char *);
    539 isc_result_t omapi_make_value (omapi_value_t **, omapi_data_string_t *,
    540 			       omapi_typed_data_t *, const char *, int);
    541 isc_result_t omapi_make_const_value (omapi_value_t **, omapi_data_string_t *,
    542 				     const unsigned char *,
    543 				     unsigned, const char *, int);
    544 isc_result_t omapi_make_int_value (omapi_value_t **, omapi_data_string_t *,
    545 				   int, const char *, int);
    546 isc_result_t omapi_make_uint_value (omapi_value_t **, omapi_data_string_t *,
    547 				    unsigned int, const char *, int);
    548 isc_result_t omapi_make_object_value (omapi_value_t **, omapi_data_string_t *,
    549 				      omapi_object_t *, const char *, int);
    550 isc_result_t omapi_make_handle_value (omapi_value_t **, omapi_data_string_t *,
    551 				      omapi_object_t *, const char *, int);
    552 isc_result_t omapi_make_string_value (omapi_value_t **, omapi_data_string_t *,
    553 				      const char *, const char *, int);
    554 isc_result_t omapi_get_int_value (unsigned long *, omapi_typed_data_t *);
    555 
    556 isc_result_t omapi_object_handle (omapi_handle_t *, omapi_object_t *);
    557 isc_result_t omapi_handle_lookup (omapi_object_t **, omapi_handle_t);
    558 isc_result_t omapi_handle_td_lookup (omapi_object_t **, omapi_typed_data_t *);
    559 
    560 void * dmalloc (size_t, const char *, int);
    561 void dfree (void *, const char *, int);
    562 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
    563 		defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
    564 void dmalloc_reuse (void *, const char *, int, int);
    565 void dmalloc_dump_outstanding (void);
    566 #else
    567 #define dmalloc_reuse(x,y,l,z)
    568 #endif
    569 #define MDL __FILE__, __LINE__
    570 #if defined (DEBUG_RC_HISTORY)
    571 void dump_rc_history (void *);
    572 void rc_history_next (int);
    573 #endif
    574 void omapi_print_dmalloc_usage_by_caller (void);
    575 isc_result_t omapi_object_allocate (omapi_object_t **,
    576 				    omapi_object_type_t *,
    577 				    size_t, const char *, int);
    578 isc_result_t omapi_object_initialize (omapi_object_t *,
    579 				      omapi_object_type_t *,
    580 				      size_t, size_t, const char *, int);
    581 isc_result_t omapi_object_reference (omapi_object_t **,
    582 				     omapi_object_t *, const char *, int);
    583 isc_result_t omapi_object_dereference (omapi_object_t **, const char *, int);
    584 isc_result_t omapi_typed_data_new (const char *, int, omapi_typed_data_t **,
    585 				   omapi_datatype_t, ...);
    586 isc_result_t omapi_typed_data_reference (omapi_typed_data_t **,
    587 					 omapi_typed_data_t *,
    588 					 const char *, int);
    589 isc_result_t omapi_typed_data_dereference (omapi_typed_data_t **,
    590 					   const char *, int);
    591 isc_result_t omapi_data_string_new (omapi_data_string_t **,
    592 				    unsigned, const char *, int);
    593 isc_result_t omapi_data_string_reference (omapi_data_string_t **,
    594 					  omapi_data_string_t *,
    595 					  const char *, int);
    596 isc_result_t omapi_data_string_dereference (omapi_data_string_t **,
    597 					    const char *, int);
    598 isc_result_t omapi_value_new (omapi_value_t **, const char *, int);
    599 isc_result_t omapi_value_reference (omapi_value_t **,
    600 				    omapi_value_t *, const char *, int);
    601 isc_result_t omapi_value_dereference (omapi_value_t **, const char *, int);
    602 isc_result_t omapi_addr_list_new (omapi_addr_list_t **, unsigned,
    603 				  const char *, int);
    604 isc_result_t omapi_addr_list_reference (omapi_addr_list_t **,
    605 					omapi_addr_list_t *,
    606 					const char *, int);
    607 isc_result_t omapi_addr_list_dereference (omapi_addr_list_t **,
    608 					  const char *, int);
    609 
    610 isc_result_t omapi_array_allocate (omapi_array_t **, omapi_array_ref_t,
    611 				   omapi_array_deref_t, const char *, int);
    612 isc_result_t omapi_array_free (omapi_array_t **, const char *, int);
    613 isc_result_t omapi_array_extend (omapi_array_t *, char *, int *,
    614 				 const char *, int);
    615 isc_result_t omapi_array_set (omapi_array_t *, void *, int, const char *, int);
    616 isc_result_t omapi_array_lookup (char **,
    617 				 omapi_array_t *, int, const char *, int);
    618 OMAPI_ARRAY_TYPE_DECL(omapi_object, omapi_object_t);
    619 #endif /* _OMAPIP_H_ */
    620