45 status = omapi_message_allocate (&m,
file,
line);
46 if (status != ISC_R_SUCCESS)
51 if (status != ISC_R_SUCCESS) {
56 if (status != ISC_R_SUCCESS) {
64 if (status != ISC_R_SUCCESS) {
71 omapi_message_dereference (&m,
file,
line);
73 if (status != ISC_R_SUCCESS)
95 if (m -> authenticator)
107 return ISC_R_SUCCESS;
112 if (m -> notify_object)
116 return ISC_R_SUCCESS;
122 m -> authid = value -> u.
integer;
123 return ISC_R_SUCCESS;
130 return ISC_R_SUCCESS;
137 return ISC_R_SUCCESS;
144 return ISC_R_SUCCESS;
151 return ISC_R_SUCCESS;
155 if (h -> inner && h -> inner -> type -> set_value) {
156 status = ((*(h -> inner -> type -> set_value))
157 (h -> inner, id, name, value));
158 if (status == ISC_R_SUCCESS)
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);
225 return ISC_R_SUCCESS;
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,
264 return ISC_R_SUCCESS;
292 return ISC_R_SUCCESS;;
338 return ISC_R_SUCCESS;
341 #ifdef DEBUG_PROTOCOL
342 static const 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;
398 #ifdef DEBUG_PROTOCOL
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;
428 message->
id,
"No authenticator on message");
432 switch (message -> op) {
437 message->
id,
"OPEN can't be a response");
444 if (status == ISC_R_SUCCESS &&
448 type; type = type -> next)
464 message->
id,
"No authenticator on message");
470 if (status == ISC_R_SUCCESS) {
473 if (status != ISC_R_SUCCESS) {
475 (po, message -> id_object,
476 status, message ->
id,
477 "invalid create flag value");
485 if (status == ISC_R_SUCCESS) {
488 if (status != ISC_R_SUCCESS) {
490 (po, message -> id_object,
491 status, message ->
id,
492 "invalid update flag value");
500 if (status == ISC_R_SUCCESS) {
503 if (status != ISC_R_SUCCESS) {
505 (po, message -> id_object,
506 status, message ->
id,
507 "invalid exclusive flag value");
520 "type required on create");
527 if (!type -> lookup) {
529 (po, message -> id_object,
530 ISC_R_NOTIMPLEMENTED, message ->
id,
531 "unsearchable object type");
534 status = (*(type -> lookup)) (&object, message -> id_object,
537 if (status != ISC_R_SUCCESS &&
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");
558 if (status == ISC_R_SUCCESS && create && exclusive) {
561 (po, message -> id_object,
562 ISC_R_EXISTS, message ->
id,
563 "specified object already exists");
569 message -> id_object,
571 if (status != ISC_R_SUCCESS) {
573 (po, message -> id_object,
574 status, message ->
id,
575 "can't create new object");
580 if (create || update) {
585 (po, message -> id_object,
586 status, message ->
id,
587 "can't update object");
591 message -> id_object,
594 if (status != ISC_R_SUCCESS) {
597 (po, message -> id_object,
598 status, message ->
id,
599 "can't update object");
608 if (status != ISC_R_SUCCESS) {
611 (po, message -> id_object,
612 status, message ->
id,
613 "can't select authenticator");
617 if (status != ISC_R_SUCCESS) {
620 (po, message -> id_object,
621 status, message ->
id,
622 "can't select authenticator");
633 if (status != ISC_R_SUCCESS) {
635 (po, message -> id_object,
636 status, message ->
id,
637 "no matching handle");
641 message ->
id,
object);
646 if (m && m ->
object) {
651 if (status != ISC_R_SUCCESS) {
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,
678 if (status != ISC_R_SUCCESS) {
682 (po, message -> id_object,
683 status, message ->
id,
684 "can't update object");
689 return ISC_R_SUCCESS;
693 (po, message -> id_object, ISC_R_SUCCESS,
694 message ->
id, (
char *)0);
697 "status", ISC_R_SUCCESS,
708 (po, message -> id_object, ISC_R_NOTIMPLEMENTED,
709 message ->
id,
"notify not implemented yet");
714 return ISC_R_UNEXPECTED;
719 if (status == ISC_R_SUCCESS) {
723 if (status != ISC_R_SUCCESS)
724 waitstatus = ISC_R_UNEXPECTED;
726 waitstatus = ISC_R_UNEXPECTED;
731 if (status == ISC_R_SUCCESS)
736 return ISC_R_SUCCESS;
740 if (status != ISC_R_SUCCESS) {
742 (po, message -> id_object,
743 status, message ->
id,
744 "no matching handle");
747 if (!
object -> type -> remove)
749 (po, message -> id_object,
750 ISC_R_NOTIMPLEMENTED, message ->
id,
751 "no remove method for object");
753 status = (*(
object -> type -> remove)) (object,
754 message -> id_object);
758 status, message ->
id,
761 return ISC_R_NOTIMPLEMENTED;