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