45 status = omapi_message_allocate (&m,
file,
line);
71 omapi_message_dereference (&m,
file,
line);
95 if (m -> authenticator)
112 if (m -> notify_object)
122 m -> authid =
value -> u.integer;
129 m -> op =
value -> u.integer;
136 m -> h =
value -> u.integer;
143 m ->
id =
value -> u.integer;
150 m -> rid =
value -> u.integer;
155 if (h -> inner && h -> inner -> type -> set_value) {
156 status = ((*(h -> inner -> type -> set_value))
157 (h -> inner, id, name,
value));
162 return ISC_R_NOTFOUND;
180 if (m -> authenticator)
182 m -> authenticator,
MDL);
184 return ISC_R_NOTFOUND;
187 name, (
int)m -> authid,
MDL);
199 if (h -> inner && h -> inner -> type -> get_value)
200 return (*(h -> inner -> type -> get_value))
201 (h -> inner, id, name,
value);
202 return ISC_R_NOTFOUND;
212 if (m -> authenticator) {
221 if (m -> notify_object)
223 if (m -> protocol_object)
224 omapi_protocol_dereference (&m -> protocol_object,
file,
line);
229 const char *name, va_list ap)
236 if (!strcmp (name,
"status")) {
237 if (m -> notify_object &&
238 m -> notify_object -> type -> signal_handler)
239 return ((m -> notify_object -> type -> signal_handler))
240 (m -> notify_object, name, ap);
241 else if (m ->
object && m ->
object -> type -> signal_handler)
242 return ((m ->
object -> type -> signal_handler))
243 (m -> object, name, ap);
245 if (h -> inner && h -> inner -> type -> signal_handler)
246 return (*(h -> inner -> type -> signal_handler)) (h -> inner,
248 return ISC_R_NOTFOUND;
261 if (m -> inner && m -> inner -> type -> stuff_values)
262 return (*(m -> inner -> type -> stuff_values)) (c, id,
342const char *omapi_message_op_name(
int op) {
350 default:
return "(unknown op)";
361#if defined (DEBUG_MEMORY_LEAKAGE) && 0
362 unsigned long previous_outstanding = dmalloc_outstanding;
365 status = omapi_message_process_internal (mo, po);
367#if defined (DEBUG_MEMORY_LEAKAGE) && 0
368 log_info (
"generation %ld: %ld new, %ld outstanding, %ld long-term",
370 dmalloc_outstanding - previous_outstanding,
371 dmalloc_outstanding, dmalloc_longterm);
373#if defined (DEBUG_MEMORY_LEAKAGE) && 0
374 dmalloc_dump_outstanding ();
376#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) && 0
389 unsigned long create, update, exclusive;
391 isc_result_t status, waitstatus;
400 "op=%s handle=%#x id=%#x rid=%#x",
401 omapi_message_op_name (message -> op),
402 message -> h, message ->
id, message -> rid);
405 if (message -> rid) {
407 if (m ->
id == message -> rid)
413 return ISC_R_NOTFOUND;
416 if (message -> authid != m -> authid)
417 return ISC_R_NOTFOUND;
424 !message->id_object &&
428 message->id,
"No authenticator on message");
432 switch (message -> op) {
437 message->id,
"OPEN can't be a response");
448 type; type = type -> next)
460 !message->id_object &&
464 message->id,
"No authenticator on message");
475 (po, message -> id_object,
476 status, message ->
id,
477 "invalid create flag value");
490 (po, message -> id_object,
491 status, message ->
id,
492 "invalid update flag value");
505 (po, message -> id_object,
506 status, message ->
id,
507 "invalid exclusive flag value");
517 (po, message->id_object,
520 "type required on create");
527 if (!type -> lookup) {
529 (po, message -> id_object,
531 "unsearchable object type");
534 status = (*(type -> lookup)) (&
object, message -> id_object,
538 status != ISC_R_NOTFOUND &&
541 (po, message -> id_object,
542 status, message ->
id,
543 "object lookup failed");
548 if (status == ISC_R_NOTFOUND && !
create) {
550 (po, message -> id_object,
551 ISC_R_NOTFOUND, message ->
id,
552 "no object matches specification");
561 (po, message -> id_object,
562 ISC_R_EXISTS, message ->
id,
563 "specified object already exists");
569 message -> id_object,
573 (po, message -> id_object,
574 status, message ->
id,
575 "can't create new object");
585 (po, message -> id_object,
586 status, message ->
id,
587 "can't update object");
591 message -> id_object,
597 (po, message -> id_object,
598 status, message ->
id,
599 "can't update object");
611 (po, message -> id_object,
612 status, message ->
id,
613 "can't select authenticator");
620 (po, message -> id_object,
621 status, message ->
id,
622 "can't select authenticator");
635 (po, message -> id_object,
636 status, message ->
id,
637 "no matching handle");
641 message ->
id,
object);
646 if (m && m ->
object) {
653 (po, message -> id_object,
654 status, message ->
id,
655 "no matching handle");
665 (po, message -> id_object,
666 status, message ->
id,
667 "cannot update authenticator");
674 message -> id_object,
682 (po, message -> id_object,
683 status, message ->
id,
684 "can't update object");
694 message ->
id, (
char *)0);
709 message ->
id,
"notify not implemented yet");
714 return ISC_R_UNEXPECTED;
724 waitstatus = ISC_R_UNEXPECTED;
726 waitstatus = ISC_R_UNEXPECTED;
742 (po, message -> id_object,
743 status, message ->
id,
744 "no matching handle");
747 if (!
object -> type -> remove)
749 (po, message -> id_object,
751 "no remove method for object");
753 status = (*(
object -> type -> remove)) (
object,
754 message -> id_object);
758 status, message ->
id,
struct element * create(void)
#define ISC_R_NOTIMPLEMENTED
isc_result_t omapi_message_set_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_typed_data_t *value)
isc_result_t omapi_message_get_value(omapi_object_t *h, omapi_object_t *id, omapi_data_string_t *name, omapi_value_t **value)
isc_result_t omapi_message_destroy(omapi_object_t *h, const char *file, int line)
isc_result_t omapi_message_unregister(omapi_object_t *mo)
isc_result_t omapi_message_signal_handler(omapi_object_t *h, const char *name, va_list ap)
isc_result_t omapi_message_register(omapi_object_t *mo)
isc_result_t omapi_message_process(omapi_object_t *mo, omapi_object_t *po)
isc_result_t omapi_message_stuff_values(omapi_object_t *c, omapi_object_t *id, omapi_object_t *m)
isc_result_t omapi_value_dereference(omapi_value_t **, const char *, int)
isc_result_t omapi_generic_new(omapi_object_t **, const char *, int)
isc_result_t omapi_typed_data_reference(omapi_typed_data_t **, omapi_typed_data_t *, const char *, int)
struct __omapi_object_type_t omapi_object_type_t
#define OMAPI_OBJECT_ALLOC(name, stype, type)
isc_result_t omapi_object_dereference(omapi_object_t **, const char *, int)
isc_result_t omapi_make_value(omapi_value_t **, omapi_data_string_t *, omapi_typed_data_t *, const char *, int)
isc_result_t omapi_object_handle(omapi_handle_t *, omapi_object_t *)
isc_boolean_t omapi_protocol_authenticated(omapi_object_t *)
struct __omapi_object omapi_object_t
isc_result_t omapi_protocol_add_auth(omapi_object_t *, omapi_object_t *, omapi_handle_t)
isc_result_t omapi_object_create(omapi_object_t **, omapi_object_t *, omapi_object_type_t *)
omapi_object_type_t * omapi_type_auth_key
int omapi_td_strcmp(omapi_typed_data_t *, const char *)
isc_result_t omapi_protocol_send_status(omapi_object_t *, omapi_object_t *, isc_result_t, unsigned, const char *)
isc_result_t omapi_typed_data_dereference(omapi_typed_data_t **, const char *, int)
isc_result_t omapi_object_reference(omapi_object_t **, omapi_object_t *, const char *, int)
isc_result_t omapi_signal(omapi_object_t *, const char *,...)
isc_result_t omapi_handle_lookup(omapi_object_t **, omapi_handle_t)
isc_result_t omapi_object_update(omapi_object_t *, omapi_object_t *, omapi_object_t *, omapi_handle_t)
unsigned int omapi_handle_t
int omapi_ds_strcmp(omapi_data_string_t *, const char *)
void dfree(void *, const char *, int)
isc_result_t omapi_get_value_str(omapi_object_t *, omapi_object_t *, const char *, omapi_value_t **)
isc_result_t omapi_get_int_value(unsigned long *, omapi_typed_data_t *)
isc_result_t omapi_protocol_send_update(omapi_object_t *, omapi_object_t *, unsigned, omapi_object_t *)
isc_result_t omapi_message_new(omapi_object_t **, const char *, int)
omapi_object_type_t * omapi_type_message
omapi_object_type_t * omapi_object_types
isc_result_t omapi_make_int_value(omapi_value_t **, omapi_data_string_t *, int, const char *, int)
struct __omapi_message_object omapi_message_object_t
int int int log_debug(const char *,...) __attribute__((__format__(__printf__
omapi_message_object_t * omapi_registered_messages
int int log_info(const char *,...) __attribute__((__format__(__printf__
#define DHCP_R_INVALIDARG