|
|
1.1 ! root 1: /* ropkt.h - include file for remote operation providers (RoS-PROVIDER) */ ! 2: ! 3: /* ! 4: * $Header: /f/osi/h/RCS/ropkt.h,v 7.1 90/07/01 21:03:53 mrose Exp $ ! 5: * ! 6: * Based on an TCP-based implementation by George Michaelson of University ! 7: * College London. ! 8: * ! 9: * ! 10: * $Log: ropkt.h,v $ ! 11: * Revision 7.1 90/07/01 21:03:53 mrose ! 12: * pepsy ! 13: * ! 14: * Revision 7.0 89/11/23 21:55:55 mrose ! 15: * Release 6.0 ! 16: * ! 17: */ ! 18: ! 19: /* ! 20: * NOTICE ! 21: * ! 22: * Acquisition, use, and distribution of this module and related ! 23: * materials are subject to the restrictions of a license agreement. ! 24: * Consult the Preface in the User's Manual for the full terms of ! 25: * this agreement. ! 26: * ! 27: */ ! 28: ! 29: ! 30: #ifndef _RoSAP_ ! 31: #include "rosap.h" /* definitions for RoS-USERs */ ! 32: #endif ! 33: ! 34: #include "acpkt.h" /* definitions for AcS-PROVIDERs */ ! 35: ! 36: #ifndef _RtSAP_ ! 37: #include "rtsap.h" /* definitions for RtS-USERs */ ! 38: #endif ! 39: ! 40: #ifndef _PSAP2_ ! 41: #include "psap2.h" /* definitions for PS-USERs */ ! 42: #endif ! 43: ! 44: #ifndef _SSAP_ ! 45: #include "ssap.h" /* definitions for SS-USERs */ ! 46: #endif ! 47: ! 48: /* */ ! 49: ! 50: #define rosapPsig(acb, sd) \ ! 51: { \ ! 52: if ((acb = findacblk (sd)) == NULL) { \ ! 53: (void) sigiomask (smask); \ ! 54: return rosaplose (roi, ROS_PARAMETER, NULLCP, \ ! 55: "invalid association descriptor"); \ ! 56: } \ ! 57: if (!(acb -> acb_flags & ACB_CONN)) { \ ! 58: (void) sigiomask (smask); \ ! 59: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 60: "association descriptor not connected"); \ ! 61: } \ ! 62: if (acb -> acb_flags & ACB_CLOSING) { \ ! 63: (void) sigiomask (smask); \ ! 64: return rosaplose (roi, ROS_WAITING, NULLCP, NULLCP); \ ! 65: } \ ! 66: if (acb -> acb_flags & ACB_FINN) { \ ! 67: (void) sigiomask (smask); \ ! 68: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 69: "association descriptor finishing"); \ ! 70: } \ ! 71: if (acb -> acb_putosdu == NULLIFP) { \ ! 72: (void) sigiomask (smask); \ ! 73: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 74: "association descriptor not bound"); \ ! 75: } \ ! 76: } ! 77: ! 78: #define rosapXsig(acb, sd) \ ! 79: { \ ! 80: if ((acb = findacblk (sd)) == NULL) { \ ! 81: (void) sigiomask (smask); \ ! 82: return rosaplose (roi, ROS_PARAMETER, NULLCP, \ ! 83: "invalid association descriptor"); \ ! 84: } \ ! 85: if (!(acb -> acb_flags & ACB_CONN)) { \ ! 86: (void) sigiomask (smask); \ ! 87: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 88: "association descriptor not connected"); \ ! 89: } \ ! 90: if (acb -> acb_flags & ACB_FINN) { \ ! 91: (void) sigiomask (smask); \ ! 92: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 93: "association descriptor finishing"); \ ! 94: } \ ! 95: if (acb -> acb_putosdu == NULLIFP) { \ ! 96: (void) sigiomask (smask); \ ! 97: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 98: "association descriptor not bound"); \ ! 99: } \ ! 100: } ! 101: ! 102: #define rosapFsig(acb, sd) \ ! 103: { \ ! 104: if ((acb = findacblk (sd)) == NULL) { \ ! 105: (void) sigiomask (smask); \ ! 106: return rosaplose (roi, ROS_PARAMETER, NULLCP, \ ! 107: "invalid association descriptor"); \ ! 108: } \ ! 109: if (!(acb -> acb_flags & ACB_ROS)) { \ ! 110: (void) sigiomask (smask); \ ! 111: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 112: "not an association descriptor for ROS"); \ ! 113: } \ ! 114: if (!(acb -> acb_flags & ACB_CONN)) { \ ! 115: (void) sigiomask (smask); \ ! 116: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 117: "association descriptor not connected"); \ ! 118: } \ ! 119: if (!(acb -> acb_flags & ACB_FINN)) { \ ! 120: (void) sigiomask (smask); \ ! 121: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 122: "association descriptor not finishing"); \ ! 123: } \ ! 124: if (acb -> acb_putosdu == NULLIFP) { \ ! 125: (void) sigiomask (smask); \ ! 126: return rosaplose (roi, ROS_OPERATION, NULLCP, \ ! 127: "association descriptor not bound"); \ ! 128: } \ ! 129: } ! 130: ! 131: #define missingP(p) \ ! 132: { \ ! 133: if (p == NULL) \ ! 134: return rosaplose (roi, ROS_PARAMETER, NULLCP, \ ! 135: "mandatory parameter \"%s\" missing", "p"); \ ! 136: } ! 137: ! 138: ! 139: #ifndef lint ! 140: #ifndef __STDC__ ! 141: #define copyRoSAPdata(base,len,d) \ ! 142: { \ ! 143: register int i = len; \ ! 144: if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \ ! 145: bcopy (base, d -> d/* */_data, d -> d/* */_cc); \ ! 146: } ! 147: #else ! 148: #define copyRoSAPdata(base,len,d) \ ! 149: { \ ! 150: register int i = len; \ ! 151: if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \ ! 152: bcopy (base, d -> d##_data, d -> d##_cc); \ ! 153: } ! 154: #endif ! 155: #else ! 156: #define copyRoSAPdata(base,len,d) bcopy (base, (char *) d, len) ! 157: #endif ! 158: ! 159: ! 160: #define pylose() \ ! 161: ropktlose (acb, roi, ROS_PROTOCOL, NULLCP, "%s", PY_pepy) ! 162: ! 163: ! 164: int ropktlose (), rosapreject (), rosaplose (); ! 165: ! 166: /* */ ! 167: ! 168: int acb2osdu (); ! 169: ! 170: ! 171: int ro2rtswrite (), ro2rtswait (), ro2rtsready (), ro2rtsasync (), ! 172: ro2rtsmask (); ! 173: ! 174: ! 175: int ro2pswrite (), ro2pswait (), ro2psasync (), ro2psmask (); ! 176: ! 177: ! 178: int ss2roslose (), ss2rosabort (); ! 179: int ro2sswrite (), ro2sswait (), ro2ssasync (), ro2ssmask (), ro2sslose (), ! 180: ro2ssready (); ! 181: ! 182: /* */ ! 183: ! 184: /* APDU types */ ! 185: #define APDU_INVOKE 1 /* Invoke */ ! 186: #define APDU_RESULT 2 /* Return result */ ! 187: #define APDU_ERROR 3 /* Return error */ ! 188: #define APDU_REJECT 4 /* Reject */ ! 189: ! 190: #define APDU_UNKNOWN (-1) /* anything other than the above */ ! 191: ! 192: ! 193: /* Reject APDU types */ ! 194: #define REJECT_GENERAL 0 /* General Problem */ ! 195: #define REJECT_GENERAL_BASE ROS_GP_UNRECOG ! 196: #define REJECT_INVOKE 1 /* Invoke Problem */ ! 197: #define REJECT_INVOKE_BASE ROS_IP_DUP ! 198: #define REJECT_RESULT 2 /* Return Result Problem */ ! 199: #define REJECT_RESULT_BASE ROS_RRP_UNRECOG ! 200: #define REJECT_ERROR 3 /* Return Error Problem */ ! 201: #define REJECT_ERROR_BASE ROS_REP_UNRECOG ! 202: #define REJECT_COMPLETE 4 /* more Invoke Problem codes */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.