|
|
1.1 ! root 1: /* oper_invoke.c - encode argument and invoke operation */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/quipu/RCS/oper_invoke.c,v 7.0 89/11/23 22:17:52 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/quipu/RCS/oper_invoke.c,v 7.0 89/11/23 22:17:52 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: oper_invoke.c,v $ ! 12: * Revision 7.0 89/11/23 22:17:52 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: /* LINTLIBRARY */ ! 29: ! 30: #include "rosap.h" ! 31: #include "quipu/util.h" ! 32: #include "quipu/connection.h" ! 33: ! 34: extern LLog * log_dsap; ! 35: #ifndef NO_STATS ! 36: extern LLog * log_stat; ! 37: #endif ! 38: void ros_log (); ! 39: ! 40: oper_send_invoke(oper) ! 41: register struct oper_act * oper; ! 42: { ! 43: int result; ! 44: struct DSAPindication di_s; ! 45: struct DSAPindication * di = &(di_s); ! 46: ! 47: DLOG(log_dsap, LLOG_TRACE, ("oper_send_invoke")); ! 48: ! 49: if(oper == NULLOPER) ! 50: { ! 51: LLOG(log_dsap, LLOG_FATAL, ("Task memerr 3")); ! 52: return(NOTOK); ! 53: } ! 54: ! 55: if(oper->on_state == ON_ABANDONED) ! 56: return NOTOK; ! 57: ! 58: /* ! 59: * Genrate an id unique over this connection for this operation. ! 60: */ ! 61: oper->on_id = ++(oper->on_conn->cn_op_id); ! 62: ! 63: switch (oper->on_conn->cn_ctx) ! 64: { ! 65: case DS_CTX_X500_DAP: ! 66: LLOG (log_dsap, LLOG_EXCEPTIONS, ("oper_invoke(): DAP context unexpected")); ! 67: break; ! 68: case DS_CTX_X500_DSP: ! 69: watch_dog("DspInvokeRequest"); ! 70: result = DspInvokeRequest (oper->on_conn->cn_ad, oper->on_id, ! 71: oper->on_arg, di); ! 72: watch_dog_reset(); ! 73: break; ! 74: case DS_CTX_QUIPU_DSP: ! 75: watch_dog("QspInvokeRequest"); ! 76: result = QspInvokeRequest (oper->on_conn->cn_ad, oper->on_id, ! 77: oper->on_arg, di); ! 78: watch_dog_reset(); ! 79: break; ! 80: default: ! 81: LLOG (log_dsap, LLOG_EXCEPTIONS, ("oper_invoke(): Unknown context %d", oper->on_conn->cn_ctx)); ! 82: break; ! 83: } ! 84: ! 85: if (result != OK) ! 86: { ! 87: if(di->di_type == DI_ABORT) ! 88: { ! 89: struct connection * cn; ! 90: ! 91: LLOG(log_dsap, LLOG_FATAL, ("D-INVOKE.REQUEST: fatal reject - fail the connection")); ! 92: oper->on_conn->cn_state = CN_FAILED; ! 93: cn = oper->on_conn; ! 94: oper_extract(oper); ! 95: conn_extract(cn); ! 96: return(NOTOK); ! 97: } ! 98: else ! 99: { ! 100: oper->on_state = ON_COMPLETE; ! 101: oper->on_resp.di_type = DI_PREJECT; ! 102: oper_fail_wakeup(oper); ! 103: return(NOTOK); ! 104: } ! 105: } ! 106: else ! 107: { ! 108: DLOG(log_dsap, LLOG_NOTICE, ("D-INVOKE.REQUEST: OK")); ! 109: #ifndef NO_STATS ! 110: LLOG(log_stat, LLOG_TRACE, ("Chain (%d)",oper->on_conn->cn_ad)); ! 111: #endif ! 112: oper->on_state = ON_CHAINED; ! 113: return(OK); ! 114: } ! 115: } ! 116:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.