DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T a

⟦87c941d9d⟧ TextFile

    Length: 3267 (0xcc3)
    Types: TextFile
    Names: »acsapabort2.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z« 
        └─⟦de7628f85⟧ 
            └─⟦this⟧ »isode-6.0/acsap/acsapabort2.c« 

TextFile

/* acsapabort2.c - ACPM: interpret abort */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/acsap/RCS/acsapabort2.c,v 7.0 89/11/23 21:21:45 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/acsap/RCS/acsapabort2.c,v 7.0 89/11/23 21:21:45 mrose Rel $
 *
 *
 * $Log:	acsapabort2.c,v $
 * Revision 7.0  89/11/23  21:21:45  mrose
 * Release 6.0
 * 
 */

/*
 *				  NOTICE
 *
 *    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
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include <stdio.h>
#include <signal.h>
#include "ACS-types.h"
#define	ACSE
#include "acpkt.h"
#ifdef	DEBUG
#include "tailor.h"
#endif

/* \f

   handle P-{U,P}-ABORT.INDICATION */

int	AcABORTser (sd, pa, aci)
int	sd;
register struct PSAPabort *pa;
register struct AcSAPindication *aci;
{
    SBV	    smask;
    int	    result;
    register struct assocblk *acb;

    missingP (pa);
    missingP (aci);

    smask = sigioblock ();

    if ((acb = findacblk (sd)) == NULL) {
	(void) sigiomask (smask);
	return acsaplose (aci, ACS_PARAMETER, NULLCP,
			    "invalid association descriptor");
    }

    result = ps2acsabort (acb, pa, aci);

    (void) sigiomask (smask);

    return result;
}

/* \f

 */

int	ps2acsabort (acb, pa, aci)
register struct assocblk *acb;
register struct PSAPabort *pa;
register struct AcSAPindication *aci;
{
    int	    result;
    PE	    pe;
    register struct AcSAPabort *aca = &aci -> aci_abort;
    struct type_ACS_ACSE__apdu *pdu;
    register struct type_ACS_ABRT__apdu *abrt;

    result = OK;
    pdu = NULL;

    if (!pa -> pa_peer) {
	if (PC_FATAL (pa -> pa_reason))
	    acb -> acb_fd = NOTOK;

	(void) ps2acslose (acb, aci, NULLCP, pa);
	goto out;
    }

    if (pa -> pa_ninfo == 0) {
	    (void) acsaplose (aci, ACS_ABORTED, NULLCP, NULLCP);
	if (acb -> acb_sversion == 1)
	    aca -> aca_source = ACA_PROVIDER;
	goto out;
    }

    bzero ((char *) aci, sizeof *aci);
    aci -> aci_type = ACI_ABORT;

    if (acb -> acb_sversion == 1) {
	register int	i;

	aca -> aca_reason = ACS_ABORTED;
	aca -> aca_source = ACA_USER;
	if ((i = pa -> pa_ninfo) > NACDATA)
	    i = NACDATA;
	while (i-- > 0) {
	    aca -> aca_info[i] = pa -> pa_info[i];
	    pa -> pa_info[i] = NULLPE;
	}
	goto out;
    }
    
    result = decode_ACS_ACSE__apdu (pe = pa -> pa_info[0], 1, NULLIP, NULLVP,
				    &pdu);

#ifdef	DEBUG
    if (result == OK && (acsap_log -> ll_events & LLOG_PDUS))
	vpdu (acsap_log, print_ACS_ACSE__apdu, pe, "ACSE-apdu", 1);
#endif

    pe_free (pe);
    pe = pa -> pa_info[0] = NULLPE;

    if (result == NOTOK) {
	(void) acsaplose (aci, ACS_PROTOCOL, NULLCP, "%s", PY_pepy);
	goto out;
    }

    if (pdu -> offset != type_ACS_ACSE__apdu_abrt) {
	result = acsaplose (aci, ACS_PROTOCOL, NULLCP,
			    "unexpected PDU %d on P-U-ABORT", pdu -> offset);
	goto out;
    }

    abrt = pdu -> un.abrt;
    aca -> aca_reason = ACS_ABORTED;
    aca -> aca_source = abrt -> abort__source;
    (void) apdu2info (acb, aci, abrt -> user__information, aca -> aca_info,
		   &aca -> aca_ninfo);

out: ;
    acb -> acb_fd = NOTOK;
    PAFREE (pa);
    if (pdu)
	free_ACS_ACSE__apdu (pdu);

    return result;
}