mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
_OMAPI_OMAPIP_H_ changed to _OMAPI_OMAPI_H_ to match file name.
include isc/region.h and new omapi/types.h typedefs moved to omapi/types.h define protocol port to 7912 so as not to conflict with dhcp server; this clearly needs more thought. the default omapi port will need to be server specific rather than library specific. new public functions, omapi_listener_shutdown, omapi_data_getint. changed API, omapi_string_totext, omapi_value_getint
This commit is contained in:
@@ -19,16 +19,19 @@
|
|||||||
* Definitions for the object management API and protocol.
|
* Definitions for the object management API and protocol.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _OMAPI_OMAPIP_H_
|
#ifndef _OMAPI_OMAPI_H_
|
||||||
#define _OMAPI_OMAPIP_H_
|
#define _OMAPI_OMAPI_H_
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <isc/boolean.h>
|
#include <isc/boolean.h>
|
||||||
#include <isc/lang.h>
|
#include <isc/lang.h>
|
||||||
#include <isc/time.h>
|
#include <isc/time.h>
|
||||||
|
#include <isc/region.h>
|
||||||
#include <isc/result.h>
|
#include <isc/result.h>
|
||||||
|
|
||||||
|
#include <omapi/types.h>
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
#define OMAPI_PROTOCOL_VERSION 100
|
#define OMAPI_PROTOCOL_VERSION 100
|
||||||
@@ -43,29 +46,6 @@ ISC_LANG_BEGINDECLS
|
|||||||
#define OMAPI_OP_STATUS 5
|
#define OMAPI_OP_STATUS 5
|
||||||
#define OMAPI_OP_DELETE 6
|
#define OMAPI_OP_DELETE 6
|
||||||
|
|
||||||
/*****
|
|
||||||
***** Type definitions.
|
|
||||||
*****/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These structures are all opaque; they are fully defined in private.h
|
|
||||||
* for use only by the internal library. If there is a need to get
|
|
||||||
* at their internal data for some purpose, new APIs can be added for that.
|
|
||||||
*/
|
|
||||||
typedef unsigned int omapi_handle_t;
|
|
||||||
typedef struct omapi_object omapi_object_t;
|
|
||||||
typedef struct omapi_objecttype omapi_objecttype_t;
|
|
||||||
typedef struct omapi_data omapi_data_t;
|
|
||||||
typedef struct omapi_string omapi_string_t;
|
|
||||||
typedef struct omapi_value omapi_value_t;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
omapi_datatype_int,
|
|
||||||
omapi_datatype_string,
|
|
||||||
omapi_datatype_data,
|
|
||||||
omapi_datatype_object
|
|
||||||
} omapi_datatype_t;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This preamble is common to all objects manipulated by libomapi.a,
|
* This preamble is common to all objects manipulated by libomapi.a,
|
||||||
* including specials objects created by external users of the library.
|
* including specials objects created by external users of the library.
|
||||||
@@ -88,8 +68,11 @@ struct omapi_object {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The port on which applications should listen for OMAPI connections.
|
* The port on which applications should listen for OMAPI connections.
|
||||||
|
* XXXDCL 7911 is being used by DHCP; putting this in general library header
|
||||||
|
* file seems to be a bit of a mistake if the API is to be used for more
|
||||||
|
* than one server.
|
||||||
*/
|
*/
|
||||||
#define OMAPI_PROTOCOL_PORT 7911
|
#define OMAPI_PROTOCOL_PORT 7912
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For use with omapi_connection_disconnect().
|
* For use with omapi_connection_disconnect().
|
||||||
@@ -149,6 +132,9 @@ omapi_connection_puthandle(omapi_object_t *connection, omapi_object_t *object);
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
omapi_listener_listen(omapi_object_t *listener, int port, int backlog);
|
omapi_listener_listen(omapi_object_t *listener, int port, int backlog);
|
||||||
|
|
||||||
|
void
|
||||||
|
omapi_listener_shutdown(omapi_object_t *listener);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public functions defined in message.c.
|
* Public functions defined in message.c.
|
||||||
*/
|
*/
|
||||||
@@ -259,7 +245,6 @@ omapi_object_passstuffvalues(omapi_object_t *connection,
|
|||||||
/*
|
/*
|
||||||
* Public functions defined in data.c.
|
* Public functions defined in data.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
omapi_data_create(omapi_data_t **data, omapi_datatype_t type, ...);
|
omapi_data_create(omapi_data_t **data, omapi_datatype_t type, ...);
|
||||||
|
|
||||||
@@ -272,6 +257,9 @@ omapi_data_dereference(omapi_data_t **reference);
|
|||||||
int
|
int
|
||||||
omapi_data_strcmp(omapi_data_t *string_type, const char *string);
|
omapi_data_strcmp(omapi_data_t *string_type, const char *string);
|
||||||
|
|
||||||
|
int
|
||||||
|
omapi_data_getint(omapi_data_t *data);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public functions defined in string.c.
|
* Public functions defined in string.c.
|
||||||
*/
|
*/
|
||||||
@@ -279,14 +267,16 @@ isc_result_t
|
|||||||
omapi_string_create(omapi_string_t **string, unsigned int length);
|
omapi_string_create(omapi_string_t **string, unsigned int length);
|
||||||
|
|
||||||
void
|
void
|
||||||
omapi_string_reference(omapi_string_t **reference,
|
omapi_string_reference(omapi_string_t **reference, omapi_string_t *string);
|
||||||
omapi_string_t *string);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
omapi_string_dereference(omapi_string_t **);
|
omapi_string_dereference(omapi_string_t **);
|
||||||
|
|
||||||
char *
|
/*
|
||||||
omapi_string_totext(omapi_string_t *string);
|
* XXXDCL consider better API
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
omapi_string_totext(omapi_string_t *string, isc_region_t *region);
|
||||||
|
|
||||||
int
|
int
|
||||||
omapi_string_stringcmp(omapi_string_t *string1, omapi_string_t *string2);
|
omapi_string_stringcmp(omapi_string_t *string1, omapi_string_t *string2);
|
||||||
@@ -332,8 +322,20 @@ omapi_value_storestr(omapi_value_t **valuep, omapi_string_t *name,
|
|||||||
* is more used to working with.
|
* is more used to working with.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
omapi_value_asint(omapi_data_t *data_object);
|
omapi_value_getint(omapi_value_t *value);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WARNING: The region returned is (currently) only valid for as long
|
||||||
|
* as the value pointer is valid, which means "until it is completely
|
||||||
|
* dereferenced". If you want to ensure it hangs around, you should
|
||||||
|
* use omapi_value_reference to add another reference to the value pointer,
|
||||||
|
* and then remember to use omapi_value_dereference to free it.
|
||||||
|
* XXXDCL yes, kind of lame. the interface to the omapi_value_get* functions
|
||||||
|
* will probably change.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
omapi_value_getregion(omapi_value_t *value, isc_region_t *region);
|
||||||
|
|
||||||
ISC_LANG_ENDDECLS
|
ISC_LANG_ENDDECLS
|
||||||
|
|
||||||
#endif /* _OMAPI_OMAPIP_H_ */
|
#endif /* _OMAPI_OMAPI_H_ */
|
||||||
|
Reference in New Issue
Block a user