|
|
1.1 root 1: /* rt2ssreleas1.c - RTPM: initiate release */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/rtsap/RCS/rt2ssreleas1.c,v 6.0 89/03/18 23:43:21 mrose Rel $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/rtsap/RCS/rt2ssreleas1.c,v 6.0 89/03/18 23:43:21 mrose Rel $
9: *
10: *
11: * $Log: rt2ssreleas1.c,v $
12: * Revision 6.0 89/03/18 23:43:21 mrose
13: * Release 5.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 <stdio.h>
31: #include <signal.h>
32: #include "rtpkt.h"
33:
34: /* RT-END.REQUEST (X.410 CLOSE.REQUEST) */
35:
36: int RtEndRequest (sd, rti)
37: int sd;
38: struct RtSAPindication *rti;
39: {
40: SBV smask;
41: int result;
42: register struct assocblk *acb;
43:
44: missingP (rti);
45:
46: smask = sigioblock ();
47:
48: rtsapPsig (acb, sd);
49:
50: result = RtEndRequestAux (acb, rti);
51:
52: (void) sigiomask (smask);
53:
54: return result;
55: }
56:
57: /* */
58:
59: static int RtEndRequestAux (acb, rti)
60: register struct assocblk *acb;
61: struct RtSAPindication *rti;
62: {
63: int result;
64: struct SSAPindication sis;
65: register struct SSAPindication *si = &sis;
66: register struct SSAPabort *sa = &si -> si_abort;
67: struct SSAPrelease srs;
68: register struct SSAPrelease *sr = &srs;
69:
70: if (acb -> acb_flags & ACB_ACS)
71: return rtsaplose (rti, RTS_OPERATION, NULLCP,
72: "not an association descriptor for RTS");
73: if (!(acb -> acb_flags & ACB_INIT) && (acb -> acb_flags & ACB_TWA))
74: return rtsaplose (rti, RTS_OPERATION, NULLCP, "not initiator");
75: if (!(acb -> acb_flags & ACB_TURN))
76: return rtsaplose (rti, RTS_OPERATION, NULLCP, "turn not owned by you");
77: if (acb -> acb_flags & ACB_ACT)
78: return rtsaplose (rti, RTS_OPERATION, NULLCP, "transfer in progress");
79: if (acb -> acb_flags & ACB_PLEASE)
80: return rtsaplose (rti, RTS_WAITING, NULLCP, NULLCP);
81:
82: if (SRelRequest (acb -> acb_fd, NULLCP, 0, NOTOK, sr, si) == NOTOK) {
83: if (sa -> sa_peer)
84: return ss2rtsabort (acb, sa, rti);
85:
86: result = ss2rtslose (acb, rti, "SRelRequest", sa);
87: }
88: else
89: if (!sr -> sr_affirmative)
90: result = rtpktlose (acb, rti, RTS_PROTOCOL, NULLCP,
91: "other side refused to release connection");
92: else {
93: acb -> acb_fd = NOTOK;
94: result = OK;
95: }
96:
97: acb -> acb_flags &= ~ACB_STICKY;
98: freeacblk (acb);
99:
100: return result;
101: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.