Annotation of embedaddon/dhcp/includes/omapip/omapip.h, revision 1.1.1.1

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>