|
|
1.1 ! root 1: /* rt2psreleas1.c - RTPM: initiate release */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/rtsap/RCS/rt2psreleas1.c,v 7.1 90/07/01 21:06:55 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/rtsap/RCS/rt2psreleas1.c,v 7.1 90/07/01 21:06:55 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: rt2psreleas1.c,v $ ! 12: * Revision 7.1 90/07/01 21:06:55 mrose ! 13: * pepsy ! 14: * ! 15: * Revision 6.0 89/03/18 23:43:11 mrose ! 16: * Release 5.0 ! 17: * ! 18: */ ! 19: ! 20: /* ! 21: * NOTICE ! 22: * ! 23: * Acquisition, use, and distribution of this module and related ! 24: * materials are subject to the restrictions of a license agreement. ! 25: * Consult the Preface in the User's Manual for the full terms of ! 26: * this agreement. ! 27: * ! 28: */ ! 29: ! 30: ! 31: /* LINTLIBRARY */ ! 32: ! 33: #include <stdio.h> ! 34: #include <signal.h> ! 35: #include "rtpkt.h" ! 36: ! 37: /* RT-CLOSE.REQUEST */ ! 38: ! 39: int RtCloseRequest (sd, reason, data, acr, rti) ! 40: int sd, ! 41: reason; ! 42: PE data; ! 43: struct AcSAPrelease *acr; ! 44: struct RtSAPindication *rti; ! 45: { ! 46: SBV smask; ! 47: int result; ! 48: register struct assocblk *acb; ! 49: ! 50: missingP (acr); ! 51: missingP (rti); ! 52: ! 53: smask = sigioblock (); ! 54: ! 55: rtsapPsig (acb, sd); ! 56: ! 57: result = RtCloseRequestAux (acb, reason, data, acr, rti); ! 58: ! 59: (void) sigiomask (smask); ! 60: ! 61: return result; ! 62: } ! 63: ! 64: /* */ ! 65: ! 66: static int RtCloseRequestAux (acb, reason, data, acr, rti) ! 67: register struct assocblk *acb; ! 68: int reason; ! 69: PE data; ! 70: struct AcSAPrelease *acr; ! 71: register struct RtSAPindication *rti; ! 72: { ! 73: int result; ! 74: struct AcSAPindication acis; ! 75: register struct AcSAPindication *aci = &acis; ! 76: register struct AcSAPabort *aca = &aci -> aci_abort; ! 77: ! 78: if (!(acb -> acb_flags & ACB_ACS)) ! 79: return rtsaplose (rti, RTS_OPERATION, NULLCP, ! 80: "not an association descriptor for RTS"); ! 81: if (!(acb -> acb_flags & ACB_INIT) && (acb -> acb_flags & ACB_TWA)) ! 82: return rtsaplose (rti, RTS_OPERATION, NULLCP, "not initiator"); ! 83: if (!(acb -> acb_flags & ACB_TURN)) ! 84: return rtsaplose (rti, RTS_OPERATION, NULLCP, "turn not owned by you"); ! 85: if (acb -> acb_flags & ACB_ACT) ! 86: return rtsaplose (rti, RTS_OPERATION, NULLCP, "transfer in progress"); ! 87: if (acb -> acb_flags & ACB_PLEASE) ! 88: return rtsaplose (rti, RTS_WAITING, NULLCP, NULLCP); ! 89: ! 90: if (data) ! 91: data -> pe_context = acb -> acb_rtsid; ! 92: ! 93: acb -> acb_flags &= ~ACB_STICKY; ! 94: if (AcRelRequest (acb -> acb_fd, reason, &data, data ? 1 : 0, NOTOK, acr, aci) ! 95: == NOTOK) { ! 96: if (aca -> aca_source == ACA_USER) ! 97: result = acs2rtsabort (acb, aca, rti); ! 98: else ! 99: result = acs2rtslose (acb, rti, "AcRelRequest", aca); ! 100: } ! 101: else ! 102: if (!acr -> acr_affirmative) ! 103: result = rtpktlose (acb, rti, RTS_PROTOCOL, NULLCP, ! 104: "other side refused to release association"); ! 105: else ! 106: result = OK; ! 107: ! 108: return result; ! 109: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.