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