|
|
1.1 ! root 1: /* rosapinvoke.c - ROPM: invoke */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/rosap/RCS/rosapinvoke.c,v 7.1 90/07/01 21:06:02 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/rosap/RCS/rosapinvoke.c,v 7.1 90/07/01 21:06:02 mrose Exp $ ! 9: * ! 10: * Based on an TCP-based implementation by George Michaelson of University ! 11: * College London. ! 12: * ! 13: * ! 14: * $Log: rosapinvoke.c,v $ ! 15: * Revision 7.1 90/07/01 21:06:02 mrose ! 16: * pepsy ! 17: * ! 18: * Revision 6.0 89/03/18 23:42:26 mrose ! 19: * Release 5.0 ! 20: * ! 21: */ ! 22: ! 23: /* ! 24: * NOTICE ! 25: * ! 26: * Acquisition, use, and distribution of this module and related ! 27: * materials are subject to the restrictions of a license agreement. ! 28: * Consult the Preface in the User's Manual for the full terms of ! 29: * this agreement. ! 30: * ! 31: */ ! 32: ! 33: ! 34: /* LINTLIBRARY */ ! 35: ! 36: #include <stdio.h> ! 37: #include <signal.h> ! 38: #include "ROS-types.h" ! 39: #include "ropkt.h" ! 40: ! 41: /* RO-INVOKE.REQUEST */ ! 42: ! 43: int RoInvokeRequest (sd, op, class, args, invokeID, linkedID, priority, roi) ! 44: int sd; ! 45: int op, ! 46: class, ! 47: invokeID, ! 48: *linkedID, ! 49: priority; ! 50: PE args; ! 51: struct RoSAPindication *roi; ! 52: { ! 53: SBV smask; ! 54: int result; ! 55: register struct assocblk *acb; ! 56: ! 57: switch (class) { ! 58: case ROS_SYNC: ! 59: case ROS_ASYNC: ! 60: break; ! 61: ! 62: default: ! 63: return rosaplose (roi, ROS_PARAMETER, NULLCP, ! 64: "bad value for class parameter"); ! 65: } ! 66: missingP (roi); ! 67: ! 68: smask = sigioblock (); ! 69: ! 70: rosapPsig (acb, sd); ! 71: ! 72: result = RoInvokeRequestAux (acb, op, class, args, invokeID, linkedID, ! 73: priority, roi); ! 74: ! 75: (void) sigiomask (smask); ! 76: ! 77: return result; ! 78: } ! 79: ! 80: /* */ ! 81: ! 82: static int RoInvokeRequestAux (acb, op, class, args, invokeID, linkedID, ! 83: priority, roi) ! 84: register struct assocblk *acb; ! 85: int op, ! 86: class, ! 87: invokeID, ! 88: *linkedID, ! 89: priority; ! 90: PE args; ! 91: struct RoSAPindication *roi; ! 92: { ! 93: PE pe; ! 94: ! 95: struct type_ROS_ROSEapdus papdu; ! 96: struct type_ROS_ROIVapdu piv; ! 97: struct type_ROS_InvokeIDType pidt; ! 98: struct type_ROS_Operation prop; ! 99: ! 100: if (!(acb -> acb_flags & ACB_INIT) && (acb -> acb_flags & ACB_ROS)) ! 101: return rosaplose (roi, ROS_OPERATION, NULLCP, "not initiator"); ! 102: if (!(acb -> acb_flags & ACB_ACS)) { ! 103: missingP (args); ! 104: if (linkedID) ! 105: return rosaplose (roi, ROS_OPERATION, NULLCP, ! 106: "linked operations not permitted"); ! 107: } ! 108: ! 109: if (acb -> acb_ready ! 110: && !(acb -> acb_flags & ACB_TURN) ! 111: && (*acb -> acb_ready) (acb, priority, roi) == NOTOK) ! 112: return NOTOK; ! 113: ! 114: if ((acb -> acb_flags & ACB_ACS) == 0) { /* want OPDU */ ! 115: struct type_ROS_OPDU opdu; ! 116: struct type_ROS_Invoke s_invoke; ! 117: ! 118: s_invoke.invokeID = invokeID; ! 119: s_invoke.element_ROS_2 = ∝ ! 120: prop.parm = op; ! 121: s_invoke.argument = args; ! 122: opdu.offset = type_ROS_OPDU_1; /* ROS-Invoke */ ! 123: opdu.un.choice_ROS_8 = &s_invoke; ! 124: if (encode_ROS_OPDU (&pe, 1, 0, NULLCP, &opdu) == NOTOK) ! 125: return NOTOK; ! 126: ! 127: } ! 128: else { ! 129: if (linkedID) { ! 130: piv.optionals = opt_ROS_ROIVapdu_linked__ID; ! 131: piv.linked__ID = *linkedID; ! 132: } else ! 133: piv.optionals = 0; ! 134: ! 135: piv.invokeID = &pidt; ! 136: pidt.parm = invokeID; ! 137: piv.operation__value = ∝ ! 138: prop.parm = op; ! 139: piv.argument = args; ! 140: papdu.offset = type_ROS_ROSEapdus_roiv__apdu; ! 141: papdu.un.roiv__apdu = ϖ ! 142: ! 143: if (encode_ROS_ROSEapdus (&pe, 1, 0, NULLCP, &papdu) == NOTOK) ! 144: return NOTOK; ! 145: } ! 146: ! 147: if ((*acb -> acb_putosdu) (acb, pe, args, priority, roi) == NOTOK) ! 148: return NOTOK; ! 149: ! 150: return (class == ROS_SYNC ! 151: ? (*acb -> acb_rowaitrequest) (acb, &invokeID, NOTOK, roi) ! 152: : OK); ! 153: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.