/* acsapreleas2.c - ACPM: respond to release */
static char *rcsid
= "$Header: /f/osi/acsap/RCS/acsapreleas2.c,v 7.2 91/02/22 09:14:13 mrose Interim $";
* $Header: /f/osi/acsap/RCS/acsapreleas2.c,v 7.2 91/02/22 09:14:13 mrose Interim $
* $Log: acsapreleas2.c,v $
* Revision 7.2 91/02/22 09:14:13 mrose
* Revision 7.1 90/07/01 21:02:04 mrose
* Revision 7.0 89/11/23 21:21:55 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
/* \f A-RELEASE.RESPONSE */
int AcRelResponse (sd
, status
, reason
, data
, ndata
, aci
)
struct AcSAPindication
*aci
;
register struct assocblk
*acb
;
struct PSAPindication pis
;
register struct PSAPabort
*pa
= &pis
.pi_abort
;
register struct type_ACS_RLRE__apdu
*pdu
;
return acsaplose (aci
, ACS_PARAMETER
, NULLCP
,
"invalid value for status parameter");
return acsaplose (aci
, ACS_PARAMETER
, NULLCP
,
"invalid value for reason parameter");
toomuchP (data
, ndata
, NACDATA
, "release");
if (data
) { /* XXX: probably should have a more intensive check... */
for (pep
= data
, i
= ndata
; i
> 0; pep
++, i
--)
if ((*pep
) -> pe_context
== PE_DFLT_CTX
)
return acsaplose (aci
, ACS_PARAMETER
, NULLCP
,
"default context not allowed for user-data at slot %d",
if ((pdu
= (struct type_ACS_RLRE__apdu
*) calloc (1, sizeof *pdu
))
(void) acsaplose (aci
, ACS_CONGEST
, NULLCP
, "out of memory");
pdu
-> optionals
|= opt_ACS_RLRE__apdu_reason
;
&& (pdu
-> user__information
= info2apdu (acb
, aci
, data
, ndata
))
result
= encode_ACS_RLRE__apdu (&pe
, 1, 0, NULLCP
, pdu
);
free_ACS_RLRE__apdu (pdu
);
(void) acsaplose (aci
, ACS_CONGEST
, NULLCP
, "error encoding PDU: %s",
pe
-> pe_context
= acb
-> acb_id
;
PLOGP (acsap_log
,ACS_ACSE__apdu
, pe
, "RLRE-apdu", 0);
if ((result
= PRelResponse (acb
-> acb_fd
, code
, &pe
, 1, &pis
)) == NOTOK
) {
(void) ps2acslose (acb
, aci
, "PRelResponse", pa
);
if (PC_FATAL (pa
-> pa_reason
))
if (status
== ACS_ACCEPT
)
acb
-> acb_flags
&= ~ACB_FINN
;
if (result
== NOTOK
|| status
== ACS_ACCEPT
)
free_ACS_RLRE__apdu (pdu
);
(void) sigiomask (smask
);