Flesh out BUF_CMD_FLUSH support.
[dragonfly.git] / contrib / dhcp-3.0 / includes / omapip / omapip.h
1 /* omapip.h
2
3    Definitions for the object management API and protocol... */
4
5 /*
6  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
7  * Copyright (c) 1996-2003 by Internet Software Consortium
8  *
9  * Permission to use, copy, modify, and distribute this software for any
10  * purpose with or without fee is hereby granted, provided that the above
11  * copyright notice and this permission notice appear in all copies.
12  *
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.
20  *
21  *   Internet Systems Consortium, Inc.
22  *   950 Charter Street
23  *   Redwood City, CA 94063
24  *   <info@isc.org>
25  *   http://www.isc.org/
26  *
27  * This software has been written for Internet Systems Consortium
28  * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29  * To learn more about Internet Systems Consortium, see
30  * ``http://www.isc.org/''.  To learn more about Vixie Enterprises,
31  * see ``http://www.vix.com''.   To learn more about Nominum, Inc., see
32  * ``http://www.nominum.com''.
33  */
34
35 #ifndef _OMAPIP_H_
36 #define _OMAPIP_H_
37 #include <isc-dhcp/result.h>
38
39 typedef unsigned int omapi_handle_t;
40
41 struct __omapi_object;
42 typedef struct __omapi_object omapi_object_t;
43
44 typedef enum {
45         omapi_datatype_int,
46         omapi_datatype_string,
47         omapi_datatype_data,
48         omapi_datatype_object
49 } omapi_datatype_t;
50
51 typedef struct {
52         int refcnt;
53         omapi_datatype_t type;
54         union {
55                 struct {
56                         unsigned len;
57 #define OMAPI_TYPED_DATA_NOBUFFER_LEN (sizeof (int) + \
58                                        sizeof (omapi_datatype_t) + \
59                                        sizeof (int))
60                         unsigned char value [1];
61                 } buffer;
62 #define OMAPI_TYPED_DATA_OBJECT_LEN (sizeof (int) + \
63                                      sizeof (omapi_datatype_t) + \
64                                      sizeof (omapi_object_t *))
65                 omapi_object_t *object;
66 #define OMAPI_TYPED_DATA_REF_LEN (sizeof (int) + \
67                                   sizeof (omapi_datatype_t) + \
68                                   3 * sizeof (void *))
69                 struct {
70                         void *ptr;
71                         isc_result_t (*reference) (void *,
72                                                    void *, const char *, int);
73                         isc_result_t (*dereference) (void *,
74                                                      const char *, int);
75                 } ref;
76 #define OMAPI_TYPED_DATA_INT_LEN (sizeof (int) + \
77                                   sizeof (omapi_datatype_t) + \
78                                   sizeof (int))
79                 int integer;
80         } u;
81 } omapi_typed_data_t;
82
83 typedef struct {
84         int refcnt;
85         unsigned len;
86 #define OMAPI_DATA_STRING_EMPTY_SIZE (2 * sizeof (int))
87         unsigned char value [1];
88 } omapi_data_string_t;
89
90 typedef struct {
91         int refcnt;
92         omapi_data_string_t *name;
93         omapi_typed_data_t *value;
94 } omapi_value_t;
95
96 typedef struct __omapi_object_type_t {
97         const char *name;
98         struct __omapi_object_type_t *next;
99         
100         isc_result_t (*set_value) (omapi_object_t *, omapi_object_t *,
101                                    omapi_data_string_t *,
102                                    omapi_typed_data_t *);
103         isc_result_t (*get_value) (omapi_object_t *,
104                                    omapi_object_t *,
105                                    omapi_data_string_t *, omapi_value_t **);
106         isc_result_t (*destroy) (omapi_object_t *, const char *, int);
107         isc_result_t (*signal_handler) (omapi_object_t *,
108                                         const char *, va_list);
109         isc_result_t (*stuff_values) (omapi_object_t *,
110                                       omapi_object_t *, omapi_object_t *);
111         isc_result_t (*lookup) (omapi_object_t **, omapi_object_t *,
112                                 omapi_object_t *);
113         isc_result_t (*create) (omapi_object_t **, omapi_object_t *);
114         isc_result_t (*remove) (omapi_object_t *, omapi_object_t *);
115         isc_result_t (*freer) (omapi_object_t *, const char *, int);
116         isc_result_t (*allocator) (omapi_object_t **, const char *, int);
117         isc_result_t (*sizer) (size_t);
118         size_t size;
119         int rc_flag;
120         isc_result_t (*initialize) (omapi_object_t *, const char *, int);
121 } omapi_object_type_t;
122
123 #define OMAPI_OBJECT_PREAMBLE \
124         omapi_object_type_t *type; \
125         int refcnt; \
126         omapi_handle_t handle; \
127         omapi_object_t *outer, *inner
128
129 /* The omapi handle structure. */
130 struct __omapi_object {
131         OMAPI_OBJECT_PREAMBLE;
132 };
133
134 /* The port on which applications should listen for OMAPI connections. */
135 #define OMAPI_PROTOCOL_PORT     7911
136
137 typedef struct {
138         unsigned addrtype;
139         unsigned addrlen;
140         unsigned char address [16];
141         unsigned port;
142 } omapi_addr_t;
143
144 typedef struct {
145         int refcnt;
146         unsigned count;
147         omapi_addr_t *addresses;
148 } omapi_addr_list_t;
149
150 typedef struct auth_key {
151         OMAPI_OBJECT_PREAMBLE;
152         char *name;
153         char *algorithm;
154         omapi_data_string_t *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
353 isc_result_t omapi_listen (omapi_object_t *, unsigned, int);
354 isc_result_t omapi_listen_addr (omapi_object_t *,
355                                 omapi_addr_t *, int);
356 isc_result_t omapi_listener_accept (omapi_object_t *);
357 int omapi_listener_readfd (omapi_object_t *);
358 isc_result_t omapi_accept (omapi_object_t *);
359 isc_result_t omapi_listener_configure_security (omapi_object_t *,
360                                                 isc_result_t (*)
361                                                 (omapi_object_t *,
362                                                  omapi_addr_t *));
363 isc_result_t omapi_listener_set_value (omapi_object_t *, omapi_object_t *,
364                                        omapi_data_string_t *,
365                                        omapi_typed_data_t *);
366 isc_result_t omapi_listener_get_value (omapi_object_t *, omapi_object_t *,
367                                        omapi_data_string_t *,
368                                        omapi_value_t **); 
369 isc_result_t omapi_listener_destroy (omapi_object_t *, const char *, int);
370 isc_result_t omapi_listener_signal_handler (omapi_object_t *,
371                                             const char *, va_list);
372 isc_result_t omapi_listener_stuff_values (omapi_object_t *,
373                                           omapi_object_t *,
374                                           omapi_object_t *);
375
376 isc_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 *));
382 isc_result_t omapi_unregister_io_object (omapi_object_t *);
383 isc_result_t omapi_dispatch (struct timeval *);
384 isc_result_t omapi_wait_for_completion (omapi_object_t *, struct timeval *);
385 isc_result_t omapi_one_dispatch (omapi_object_t *, struct timeval *);
386 isc_result_t omapi_io_set_value (omapi_object_t *, omapi_object_t *,
387                                  omapi_data_string_t *,
388                                  omapi_typed_data_t *);
389 isc_result_t omapi_io_get_value (omapi_object_t *, omapi_object_t *,
390                                  omapi_data_string_t *, omapi_value_t **); 
391 isc_result_t omapi_io_destroy (omapi_object_t *, const char *, int);
392 isc_result_t omapi_io_signal_handler (omapi_object_t *, const char *, va_list);
393 isc_result_t omapi_io_stuff_values (omapi_object_t *,
394                                     omapi_object_t *,
395                                     omapi_object_t *);
396 isc_result_t omapi_waiter_signal_handler (omapi_object_t *,
397                                           const char *, va_list);
398 isc_result_t omapi_io_state_foreach (isc_result_t (*func) (omapi_object_t *,
399                                                            void *),
400                                      void *p);
401
402 isc_result_t omapi_generic_new (omapi_object_t **, const char *, int);
403 isc_result_t omapi_generic_set_value  (omapi_object_t *, omapi_object_t *,
404                                        omapi_data_string_t *,
405                                        omapi_typed_data_t *);
406 isc_result_t omapi_generic_get_value (omapi_object_t *, omapi_object_t *,
407                                       omapi_data_string_t *,
408                                       omapi_value_t **); 
409 isc_result_t omapi_generic_destroy (omapi_object_t *, const char *, int);
410 isc_result_t omapi_generic_signal_handler (omapi_object_t *,
411                                            const char *, va_list);
412 isc_result_t omapi_generic_stuff_values (omapi_object_t *,
413                                          omapi_object_t *,
414                                          omapi_object_t *);
415 isc_result_t omapi_generic_clear_flags (omapi_object_t *);
416
417 isc_result_t omapi_message_new (omapi_object_t **, const char *, int);
418 isc_result_t omapi_message_set_value  (omapi_object_t *, omapi_object_t *,
419                                        omapi_data_string_t *,
420                                        omapi_typed_data_t *);
421 isc_result_t omapi_message_get_value (omapi_object_t *, omapi_object_t *,
422                                       omapi_data_string_t *,
423                                       omapi_value_t **); 
424 isc_result_t omapi_message_destroy (omapi_object_t *, const char *, int);
425 isc_result_t omapi_message_signal_handler (omapi_object_t *,
426                                            const char *, va_list);
427 isc_result_t omapi_message_stuff_values (omapi_object_t *,
428                                          omapi_object_t *,
429                                          omapi_object_t *);
430 isc_result_t omapi_message_register (omapi_object_t *);
431 isc_result_t omapi_message_unregister (omapi_object_t *);
432 isc_result_t omapi_message_process (omapi_object_t *, omapi_object_t *);
433
434 OMAPI_OBJECT_ALLOC_DECL (omapi_auth_key,
435                          omapi_auth_key_t, omapi_type_auth_key)
436 isc_result_t omapi_auth_key_new (omapi_auth_key_t **, const char *, int);
437 isc_result_t omapi_auth_key_destroy (omapi_object_t *, const char *, int);
438 isc_result_t omapi_auth_key_enter (omapi_auth_key_t *);
439 isc_result_t omapi_auth_key_lookup_name (omapi_auth_key_t **, const char *);
440 isc_result_t omapi_auth_key_lookup (omapi_object_t **,
441                                     omapi_object_t *,
442                                     omapi_object_t *);
443 isc_result_t omapi_auth_key_get_value (omapi_object_t *, omapi_object_t *,
444                                        omapi_data_string_t *,
445                                        omapi_value_t **); 
446 isc_result_t omapi_auth_key_stuff_values (omapi_object_t *,
447                                           omapi_object_t *,
448                                           omapi_object_t *);
449
450 extern omapi_object_type_t *omapi_type_connection;
451 extern omapi_object_type_t *omapi_type_listener;
452 extern omapi_object_type_t *omapi_type_io_object;
453 extern omapi_object_type_t *omapi_type_generic;
454 extern omapi_object_type_t *omapi_type_protocol;
455 extern omapi_object_type_t *omapi_type_protocol_listener;
456 extern omapi_object_type_t *omapi_type_waiter;
457 extern omapi_object_type_t *omapi_type_remote;
458 extern omapi_object_type_t *omapi_type_message;
459 extern omapi_object_type_t *omapi_type_auth_key;
460
461 extern omapi_object_type_t *omapi_object_types;
462
463 void omapi_type_relinquish (void);
464 isc_result_t omapi_init (void);
465 isc_result_t omapi_object_type_register (omapi_object_type_t **,
466                                          const char *,
467                                          isc_result_t (*)
468                                                 (omapi_object_t *,
469                                                  omapi_object_t *,
470                                                  omapi_data_string_t *,
471                                                  omapi_typed_data_t *),
472                                          isc_result_t (*)
473                                                 (omapi_object_t *,
474                                                  omapi_object_t *,
475                                                  omapi_data_string_t *,
476                                                  omapi_value_t **),
477                                          isc_result_t (*) (omapi_object_t *,
478                                                            const char *, int),
479                                          isc_result_t (*) (omapi_object_t *,
480                                                            const char *,
481                                                            va_list),
482                                          isc_result_t (*) (omapi_object_t *,
483                                                            omapi_object_t *,
484                                                            omapi_object_t *),
485                                          isc_result_t (*) (omapi_object_t **,
486                                                            omapi_object_t *,
487                                                            omapi_object_t *),
488                                          isc_result_t (*) (omapi_object_t **,
489                                                            omapi_object_t *),
490                                          isc_result_t (*) (omapi_object_t *,
491                                                            omapi_object_t *),
492                                          isc_result_t (*) (omapi_object_t *,
493                                                            const char *, int),
494                                          isc_result_t (*) (omapi_object_t **,
495                                                            const char *, int),
496                                          isc_result_t (*) (size_t), size_t,
497                                          isc_result_t (*) (omapi_object_t *,
498                                                            const char *, int),
499                                          int);
500 isc_result_t omapi_signal (omapi_object_t *, const char *, ...);
501 isc_result_t omapi_signal_in (omapi_object_t *, const char *, ...);
502 isc_result_t omapi_set_value (omapi_object_t *, omapi_object_t *,
503                               omapi_data_string_t *,
504                               omapi_typed_data_t *);
505 isc_result_t omapi_set_value_str (omapi_object_t *, omapi_object_t *,
506                                   const char *, omapi_typed_data_t *);
507 isc_result_t omapi_set_boolean_value (omapi_object_t *, omapi_object_t *,
508                                       const char *, int);
509 isc_result_t omapi_set_int_value (omapi_object_t *, omapi_object_t *,
510                                   const char *, int);
511 isc_result_t omapi_set_object_value (omapi_object_t *, omapi_object_t *,
512                                      const char *, omapi_object_t *);
513 isc_result_t omapi_set_string_value (omapi_object_t *, omapi_object_t *,
514                                      const char *, const char *);
515 isc_result_t omapi_get_value (omapi_object_t *, omapi_object_t *,
516                               omapi_data_string_t *,
517                               omapi_value_t **); 
518 isc_result_t omapi_get_value_str (omapi_object_t *, omapi_object_t *,
519                                   const char *, omapi_value_t **); 
520 isc_result_t omapi_stuff_values (omapi_object_t *,
521                                  omapi_object_t *,
522                                  omapi_object_t *);
523 isc_result_t omapi_object_create (omapi_object_t **, omapi_object_t *,
524                                   omapi_object_type_t *);
525 isc_result_t omapi_object_update (omapi_object_t *, omapi_object_t *,
526                                   omapi_object_t *, omapi_handle_t);
527 int omapi_data_string_cmp (omapi_data_string_t *, omapi_data_string_t *);
528 int omapi_ds_strcmp (omapi_data_string_t *, const char *);
529 int omapi_td_strcmp (omapi_typed_data_t *, const char *);
530 int omapi_td_strcasecmp (omapi_typed_data_t *, const char *);
531 isc_result_t omapi_make_value (omapi_value_t **, omapi_data_string_t *,
532                                omapi_typed_data_t *, const char *, int);
533 isc_result_t omapi_make_const_value (omapi_value_t **, omapi_data_string_t *,
534                                      const unsigned char *,
535                                      unsigned, const char *, int);
536 isc_result_t omapi_make_int_value (omapi_value_t **, omapi_data_string_t *,
537                                    int, const char *, int);
538 isc_result_t omapi_make_uint_value (omapi_value_t **, omapi_data_string_t *,
539                                     unsigned int, const char *, int);
540 isc_result_t omapi_make_object_value (omapi_value_t **, omapi_data_string_t *,
541                                       omapi_object_t *, const char *, int);
542 isc_result_t omapi_make_handle_value (omapi_value_t **, omapi_data_string_t *,
543                                       omapi_object_t *, const char *, int);
544 isc_result_t omapi_make_string_value (omapi_value_t **, omapi_data_string_t *,
545                                       const char *, const char *, int);
546 isc_result_t omapi_get_int_value (unsigned long *, omapi_typed_data_t *);
547
548 isc_result_t omapi_object_handle (omapi_handle_t *, omapi_object_t *);
549 isc_result_t omapi_handle_lookup (omapi_object_t **, omapi_handle_t);
550 isc_result_t omapi_handle_td_lookup (omapi_object_t **, omapi_typed_data_t *);
551
552 void * dmalloc (unsigned, const char *, int);
553 void dfree (void *, const char *, int);
554 #if defined (DEBUG_MEMORY_LEAKAGE) || defined (DEBUG_MALLOC_POOL) || \
555                 defined (DEBUG_MEMORY_LEAKAGE_ON_EXIT)
556 void dmalloc_reuse (void *, const char *, int, int);
557 void dmalloc_dump_outstanding (void);
558 #else
559 #define dmalloc_reuse(x,y,l,z)
560 #endif
561 #define MDL __FILE__, __LINE__
562 #if defined (DEBUG_RC_HISTORY)
563 void dump_rc_history (void *);
564 void rc_history_next (int);
565 #endif
566 void omapi_print_dmalloc_usage_by_caller (void);
567 isc_result_t omapi_object_allocate (omapi_object_t **,
568                                     omapi_object_type_t *,
569                                     size_t, const char *, int);
570 isc_result_t omapi_object_initialize (omapi_object_t *,
571                                       omapi_object_type_t *,
572                                       size_t, size_t, const char *, int);
573 isc_result_t omapi_object_reference (omapi_object_t **,
574                                      omapi_object_t *, const char *, int);
575 isc_result_t omapi_object_dereference (omapi_object_t **, const char *, int);
576 isc_result_t omapi_typed_data_new (const char *, int, omapi_typed_data_t **,
577                                    omapi_datatype_t, ...);
578 isc_result_t omapi_typed_data_reference (omapi_typed_data_t **,
579                                          omapi_typed_data_t *,
580                                          const char *, int);
581 isc_result_t omapi_typed_data_dereference (omapi_typed_data_t **,
582                                            const char *, int);
583 isc_result_t omapi_data_string_new (omapi_data_string_t **,
584                                     unsigned, const char *, int);
585 isc_result_t omapi_data_string_reference (omapi_data_string_t **,
586                                           omapi_data_string_t *,
587                                           const char *, int);
588 isc_result_t omapi_data_string_dereference (omapi_data_string_t **,
589                                             const char *, int);
590 isc_result_t omapi_value_new (omapi_value_t **, const char *, int);
591 isc_result_t omapi_value_reference (omapi_value_t **,
592                                     omapi_value_t *, const char *, int);
593 isc_result_t omapi_value_dereference (omapi_value_t **, const char *, int);
594 isc_result_t omapi_addr_list_new (omapi_addr_list_t **, unsigned,
595                                   const char *, int);
596 isc_result_t omapi_addr_list_reference (omapi_addr_list_t **,
597                                         omapi_addr_list_t *,
598                                         const char *, int);
599 isc_result_t omapi_addr_list_dereference (omapi_addr_list_t **,
600                                           const char *, int);
601
602 isc_result_t omapi_array_allocate (omapi_array_t **, omapi_array_ref_t,
603                                    omapi_array_deref_t, const char *, int);
604 isc_result_t omapi_array_free (omapi_array_t **, const char *, int);
605 isc_result_t omapi_array_extend (omapi_array_t *, char *, int *,
606                                  const char *, int);
607 isc_result_t omapi_array_set (omapi_array_t *, void *, int, const char *, int);
608 isc_result_t omapi_array_lookup (char **,
609                                  omapi_array_t *, int, const char *, int);
610 OMAPI_ARRAY_TYPE_DECL(omapi_object, omapi_object_t);
611 #endif /* _OMAPIP_H_ */