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 p

⟦86aa7e723⟧ TextFile

    Length: 2852 (0xb24)
    Types: TextFile
    Names: »psapabort.c«

Derivation

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

TextFile

/* psapabort.c - PPM: user abort */

#ifndef	lint
static char *rcsid = "$Header: /f/osi/psap2/RCS/psapabort.c,v 7.0 89/11/23 22:14:17 mrose Rel $";
#endif

/* 
 * $Header: /f/osi/psap2/RCS/psapabort.c,v 7.0 89/11/23 22:14:17 mrose Rel $
 *
 *
 * $Log:	psapabort.c,v $
 * Revision 7.0  89/11/23  22:14:17  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 "PS-types.h"
#include "ppkt.h"
#include "tailor.h"

/* \f

   P-U-ABORT.REQUEST */

int	PUAbortRequest (sd, data, ndata, pi)
int	sd;
PE     *data;
int	ndata;
struct PSAPindication *pi;
{
    SBV	    smask;
    int	    len,
	    result;
    char   *base;
    PE	    pe;
    register struct psapblk *pb;
    struct SSAPindication   sis;
    register struct SSAPabort  *sa = &sis.si_abort;
    register struct type_PS_ARU__PPDU *pdu;

    toomuchP (data, ndata, NPDATA, "abort");
    missingP (pi);

    smask = sigioblock ();

    if ((pb = findpblk (sd)) == NULL) {
	(void) sigiomask (smask);
	return psaplose (pi, PC_PARAMETER, NULLCP,
		"invalid presentation descriptor");
    }

    pe = NULLPE;
    base = NULLCP;
    result = NOTOK;
    if ((pdu = (struct type_PS_ARU__PPDU *) calloc (1, sizeof *pdu)) == NULL) {
no_mem: ;
	(void) psaplose (pi, PC_CONGEST, NULLCP, "out of memory");
	goto out2;
    }
    pdu -> offset = type_PS_ARU__PPDU_normal__mode;
    if ((pdu -> un.normal__mode = (struct element_PS_4 *)
				calloc (1, sizeof (struct element_PS_4)))
	    == NULL)
	goto no_mem;
    if (data && ndata > 0) {
	if (pb -> pb_ncontext > 0
	        && (pdu -> un.normal__mode -> context__list =
		    		silly_list (pb, pi)) == NULL)
	    goto out2;

	if ((pdu -> un.normal__mode -> user__data = info2ppdu (pb, pi,
							       data, ndata,
							       PPDU_NONE))
	    == NULL)
	goto out2;
    }

    if (encode_PS_ARU__PPDU (&pe, 1, 0, NULLCP, pdu) == NOTOK) {
	(void) psaplose (pi, PC_CONGEST, NULLCP, "error encoding PDU: %s",
			 PY_pepy);
	goto out2;
    }

    PLOG (psap2_log, print_PS_ARU__PPDU, pe, "ARU-PPDU", 0);

    if (pe2ssdu (pe, &base, &len) == NOTOK)
	goto no_mem;

    if ((result = SUAbortRequest (pb -> pb_fd, base, len, &sis)) == NOTOK)
	if (SC_FATAL (sa -> sa_reason)) {
	    (void) ss2pslose (pb, pi, "SUAbortRequest", sa);
	    goto out2;
	}
	else {
	    (void) ss2pslose (NULLPB, pi, "SUAbortRequest", sa);	    
	    goto out1;
	}

    result = OK;
    pb -> pb_fd = NOTOK;

out2: ;
    freepblk (pb);

out1: ;
    if (pdu)
	free_PS_ARU__PPDU (pdu);
    if (pe)
	pe_free (pe);
    if (base)
	free (base);

    (void) sigiomask (smask);

    return result;
}