|
|
1.1 root 1: /* acsapabort1.c - ACPM: user abort */
2:
3: #ifndef lint
4: static char *rcsid = "$Header: /f/osi/acsap/RCS/acsapabort1.c,v 7.1 90/07/01 21:01:49 mrose Exp $";
5: #endif
6:
7: /*
8: * $Header: /f/osi/acsap/RCS/acsapabort1.c,v 7.1 90/07/01 21:01:49 mrose Exp $
9: *
10: *
11: * $Log: acsapabort1.c,v $
12: * Revision 7.1 90/07/01 21:01:49 mrose
13: * pepsy
14: *
15: * Revision 7.0 89/11/23 21:21:44 mrose
16: * Release 6.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 "ACS-types.h"
36: #define ACSE
37: #include "acpkt.h"
38: #include "tailor.h"
39:
40: /* A-ABORT.REQUEST */
41:
42: int AcUAbortRequest (sd, data, ndata, aci)
43: int sd;
44: PE *data;
45: int ndata;
46: struct AcSAPindication *aci;
47: {
48: SBV smask;
49: int result;
50: register struct assocblk *acb;
51: PE pe;
52: struct PSAPindication pis;
53: register struct PSAPindication *pi = &pis;
54: register struct PSAPabort *pa = &pi -> pi_abort;
55: register struct type_ACS_ABRT__apdu *pdu;
56:
57: toomuchP (data, ndata, NACDATA, "release");
58: missingP (aci);
59:
60: smask = sigioblock ();
61:
62: if ((acb = findacblk (sd)) == NULL) {
63: (void) sigiomask (smask);
64: return acsaplose (aci, ACS_PARAMETER, NULLCP,
65: "invalid association descriptor");
66: }
67:
68: pdu = NULL;
69: pe = NULLPE;
70: if (acb -> acb_sversion == 1) {
71: if ((result = PUAbortRequest (acb -> acb_fd, data, ndata, pi))
72: == NOTOK) {
73: (void) ps2acslose (acb, aci, "PUAbortRequest", pa);
74: if (PC_FATAL (pa -> pa_reason))
75: goto out2;
76: else
77: goto out1;
78: }
79:
80: result = OK;
81: acb -> acb_fd = NOTOK;
82: goto out2;
83: }
84:
85: if ((pdu = (struct type_ACS_ABRT__apdu *) calloc (1, sizeof *pdu))
86: == NULL) {
87: result = acsaplose (aci, ACS_CONGEST, NULLCP, "out of memory");
88: goto out2;
89: }
90: pdu -> abort__source = int_ACS_abort__source_acse__service__user;
91: if (data
92: && ndata > 0
93: && (pdu -> user__information = info2apdu (acb, aci, data, ndata))
94: == NULL)
95: goto out2;
96:
97: result = encode_ACS_ABRT__apdu (&pe, 1, 0, NULLCP, pdu);
98:
99: free_ACS_ABRT__apdu (pdu);
100: pdu = NULL;
101:
102: if (result == NOTOK) {
103: (void) acsaplose (aci, ACS_CONGEST, NULLCP, "error encoding PDU: %s",
104: PY_pepy);
105: goto out2;
106: }
107: pe -> pe_context = acb -> acb_id;
108:
109: PLOGP (acsap_log,ACS_ACSE__apdu, pe, "ABRT-apdu", 0);
110:
111: if ((result = PUAbortRequest (acb -> acb_fd, &pe, 1, pi)) == NOTOK) {
112: (void) ps2acslose (acb, aci, "PUAbortRequest", pa);
113: if (PC_FATAL (pa -> pa_reason))
114: goto out2;
115: else
116: goto out1;
117: }
118:
119: result = OK;
120: acb -> acb_fd = NOTOK;
121:
122: out2: ;
123: freeacblk (acb);
124:
125: out1: ;
126: if (pe)
127: pe_free (pe);
128: if (pdu)
129: free_ACS_ABRT__apdu (pdu);
130:
131: (void) sigiomask (smask);
132:
133: return result;
134: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.