omapi.c revision 94b50bce2b5deeac93734457d5474736d7b76af1
/*
* Copyright (C) 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: omapi.c,v 1.20 2000/10/12 21:51:43 mws Exp $ */
/*
* Principal Author: DCL
*/
#include <config.h>
/*
* The control_object structure is used for receiving commands that
* request the server to perform some action, but that do not set or
* get any state.
*/
typedef struct control_object {
static control_object_t control;
static omapi_objecttype_t *control_type;
/*
* Ok, kind of gross. Sorry. A little.
*/
/*
* This is the function that is called when an incoming OMAPI_OP_OPEN
* message is received with either the create or update option set.
* value list.
*/
static isc_result_t
{
char *args;
"control_setvalue: '%.*s' control command received",
REGION_FMT(®ion));
/*
* Compare the 'name' parameter against all known control commands.
*/
/* XXX Can the previous case ever happen??? */
else
args);
} else {
}
args);
}
} else if (omapi_string_strcmp(name,
NS_OMAPI_COMMAND_RELOADCONFIG) == 0 ||
NS_OMAPI_COMMAND_RELOADZONES) == 0) {
"control_setvalue: '%.*s' not yet implemented",
REGION_FMT(®ion));
} else {
"control_setvalue: unknown name: '%.*s'",
REGION_FMT(®ion));
}
return (result);
}
/*
* This is the function that is called by the library's internal
* message_process function when an incoming OMAPI_OP_OPEN message is received.
* It is supposed to look up the object in the server that corresponds to the
*/
static isc_result_t
/*
* There is only one control object so no key is needed to look it up.
*/
return (ISC_R_SUCCESS);
}
/*
* This function is called when the server is sending a reply to a client
* that opened an object of its type. It needs to output all published
* for any inner objects (but in this program, there will be no inner
* objects). The handle parameter is an object of the type registered
* in ns_omapi_listen.
*/
static isc_result_t
/*
* Currently the server has no values to publish, but it needs
* to publish something for its OMAPI_OP_UPDATE function to work
* when received by the client.
*/
}
ns_omapi_init(void) {
if (result == ISC_R_SUCCESS)
/*
* Register the control_object. NS_OMAPI_CONTROL is
* what a client would need to specify as a value for
* the value of "type" in a message when contacting
* the server to perform a control function.
*/
NULL, /* getvalue */
NULL, /* destroy */
NULL, /* signalhandler */
NULL, /* create */
NULL); /* remove */
if (result == ISC_R_SUCCESS) {
/*
* Initialize the static control object.
*/
}
return (result);
}